diff --git a/.github/workflows/cronet.yml b/.github/workflows/cronet.yml index c6ca3e47be..9b2a4cfcf6 100644 --- a/.github/workflows/cronet.yml +++ b/.github/workflows/cronet.yml @@ -24,13 +24,19 @@ jobs: verify: name: Format & Analyze & Test runs-on: ubuntu-latest + timeout-minutes: 20 strategy: + fail-fast: false matrix: cronetHttpNoPlay: ['false', 'true'] defaults: run: working-directory: pkgs/cronet_http steps: + - name: Delete unnecessary tools 🔧 + uses: jlumbroso/free-disk-space@v1.3.1 + with: + android: false # Don't remove Android tools - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 with: diff --git a/.github/workflows/cupertino.yml b/.github/workflows/cupertino.yml index e701c73395..68213aa069 100644 --- a/.github/workflows/cupertino.yml +++ b/.github/workflows/cupertino.yml @@ -28,10 +28,11 @@ jobs: run: working-directory: pkgs/cupertino_http strategy: + fail-fast: false matrix: # Test on the minimum supported flutter version and the latest # version. - flutter-version: ["3.22.0", "any"] + flutter-version: ["3.24.0", "any"] steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - uses: subosito/flutter-action@44ac965b96f18d999802d4b807e3256d5a3f9fa1 @@ -50,9 +51,9 @@ jobs: - uses: futureware-tech/simulator-action@bfa03d93ec9de6dacb0c5553bbf8da8afc6c2ee9 with: os: iOS - os_version: '>=12.0' + os_version: '>=13.0' - name: Run tests run: | cd example flutter pub get - flutter test integration_test/main.dart + flutter test integration_test/main.dart --test-randomize-ordering-seed=random diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 00a651ede0..038e0cdfdc 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.6.1 +# Created with package:mono_repo v6.6.2 name: Dart CI on: push: @@ -36,30 +36,39 @@ jobs: name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: mono_repo self validate - run: dart pub global activate mono_repo 6.6.1 + run: dart pub global activate mono_repo 6.6.2 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: - name: "analyze_and_format; linux; Dart 3.2.0; PKG: pkgs/http_client_conformance_tests; `dart analyze --fatal-infos`" + name: "analyze_and_format; linux; Dart 3.4.0; PKGS: pkgs/http, pkgs/http_client_conformance_tests, pkgs/http_profile, pkgs/web_socket, pkgs/web_socket_conformance_tests; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkgs/http_client_conformance_tests;commands:analyze_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http-pkgs/http_client_conformance_tests-pkgs/http_profile-pkgs/web_socket-pkgs/web_socket_conformance_tests;commands:analyze_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0;packages:pkgs/http_client_conformance_tests - os:ubuntu-latest;pub-cache-hosted;sdk:3.2.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http-pkgs/http_client_conformance_tests-pkgs/http_profile-pkgs/web_socket-pkgs/web_socket_conformance_tests + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.2.0" + sdk: "3.4.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: pkgs_http_pub_upgrade + name: pkgs/http; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/http + - name: "pkgs/http; dart analyze --fatal-infos" + run: dart analyze --fatal-infos + if: "always() && steps.pkgs_http_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/http - id: pkgs_http_client_conformance_tests_pub_upgrade name: pkgs/http_client_conformance_tests; dart pub upgrade run: dart pub upgrade @@ -69,36 +78,15 @@ jobs: run: dart analyze --fatal-infos if: "always() && steps.pkgs_http_client_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http_client_conformance_tests - job_003: - name: "analyze_and_format; linux; Dart 3.3.0; PKGS: pkgs/http, pkgs/web_socket, pkgs/web_socket_conformance_tests; `dart analyze --fatal-infos`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http-pkgs/web_socket-pkgs/web_socket_conformance_tests;commands:analyze_1" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http-pkgs/web_socket-pkgs/web_socket_conformance_tests - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: "3.3.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - id: pkgs_http_pub_upgrade - name: pkgs/http; dart pub upgrade + - id: pkgs_http_profile_pub_upgrade + name: pkgs/http_profile; dart pub upgrade run: dart pub upgrade if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/http - - name: "pkgs/http; dart analyze --fatal-infos" + working-directory: pkgs/http_profile + - name: "pkgs/http_profile; dart analyze --fatal-infos" run: dart analyze --fatal-infos - if: "always() && steps.pkgs_http_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/http + if: "always() && steps.pkgs_http_profile_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/http_profile - id: pkgs_web_socket_pub_upgrade name: pkgs/web_socket; dart pub upgrade run: dart pub upgrade @@ -117,37 +105,7 @@ jobs: run: dart analyze --fatal-infos if: "always() && steps.pkgs_web_socket_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/web_socket_conformance_tests - job_004: - name: "analyze_and_format; linux; Dart 3.4.0; PKG: pkgs/http_profile; `dart analyze --fatal-infos`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http_profile;commands:analyze_1" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http_profile - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: "3.4.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - id: pkgs_http_profile_pub_upgrade - name: pkgs/http_profile; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/http_profile - - name: "pkgs/http_profile; dart analyze --fatal-infos" - run: dart analyze --fatal-infos - if: "always() && steps.pkgs_http_profile_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/http_profile - job_005: + job_003: name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests, pkgs/http_profile, pkgs/web_socket, pkgs/web_socket_conformance_tests; `dart analyze --fatal-infos`" runs-on: ubuntu-latest steps: @@ -213,7 +171,7 @@ jobs: run: dart analyze --fatal-infos if: "always() && steps.pkgs_web_socket_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/web_socket_conformance_tests - job_006: + job_004: name: "analyze_and_format; linux; Dart dev; PKGS: pkgs/http, pkgs/http_client_conformance_tests, pkgs/http_profile, pkgs/web_socket, pkgs/web_socket_conformance_tests; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: @@ -279,7 +237,7 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.pkgs_web_socket_conformance_tests_pub_upgrade.conclusion == 'success'" working-directory: pkgs/web_socket_conformance_tests - job_007: + job_005: name: "analyze_and_format; linux; Flutter stable; PKG: pkgs/flutter_http_example; `dart format --output=none --set-exit-if-changed .`" runs-on: ubuntu-latest steps: @@ -309,7 +267,7 @@ jobs: run: "dart format --output=none --set-exit-if-changed ." if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" working-directory: pkgs/flutter_http_example - job_008: + job_006: name: "analyze_and_format; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter analyze --fatal-infos`" runs-on: ubuntu-latest steps: @@ -339,24 +297,24 @@ jobs: run: flutter analyze --fatal-infos if: "always() && steps.pkgs_flutter_http_example_pub_upgrade.conclusion == 'success'" working-directory: pkgs/flutter_http_example - job_009: - name: "unit_test; linux; Dart 3.3.0; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" + job_007: + name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http;commands:command_1" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http;commands:command_1" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.3.0" + sdk: "3.4.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -376,26 +334,24 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_010: - name: "unit_test; linux; Dart 3.3.0; PKG: pkgs/http; `dart test --platform chrome`" + job_008: + name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/http; `dart test --platform chrome`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http;commands:test_3" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http;commands:test_3" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.3.0" + sdk: "3.4.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -415,26 +371,24 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_011: - name: "unit_test; linux; Dart 3.3.0; PKG: pkgs/http; `dart test --platform vm`" + job_009: + name: "unit_test; linux; Dart 3.4.0; PKGS: pkgs/http, pkgs/http_profile; `dart test --platform vm`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http;commands:test_2" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http-pkgs/http_profile;commands:test_2" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/http - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http-pkgs/http_profile + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.3.0" + sdk: "3.4.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -447,6 +401,15 @@ jobs: run: dart test --platform vm if: "always() && steps.pkgs_http_pub_upgrade.conclusion == 'success'" working-directory: pkgs/http + - id: pkgs_http_profile_pub_upgrade + name: pkgs/http_profile; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: pkgs/http_profile + - name: "pkgs/http_profile; dart test --platform vm" + run: dart test --platform vm + if: "always() && steps.pkgs_http_profile_pub_upgrade.conclusion == 'success'" + working-directory: pkgs/http_profile needs: - job_001 - job_002 @@ -454,26 +417,24 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_012: - name: "unit_test; linux; Dart 3.3.0; PKG: pkgs/web_socket; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2js`" + job_010: + name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/web_socket; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2js`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/web_socket;commands:test_6" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/web_socket;commands:test_6" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/web_socket - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/web_socket + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.3.0" + sdk: "3.4.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -493,26 +454,24 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_013: - name: "unit_test; linux; Dart 3.3.0; PKG: pkgs/web_socket; `dart test --test-randomize-ordering-seed=random -p vm`" + job_011: + name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/web_socket; `dart test --test-randomize-ordering-seed=random -p vm`" runs-on: ubuntu-latest steps: - name: Cache Pub hosted dependencies uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 with: path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/web_socket;commands:test_5" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/web_socket;commands:test_5" restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0;packages:pkgs/web_socket - os:ubuntu-latest;pub-cache-hosted;sdk:3.3.0 + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/web_socket + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 os:ubuntu-latest;pub-cache-hosted os:ubuntu-latest - name: Setup Dart SDK uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 with: - sdk: "3.3.0" + sdk: "3.4.0" - id: checkout name: Checkout repository uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 @@ -532,48 +491,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_014: - name: "unit_test; linux; Dart 3.4.0; PKG: pkgs/http_profile; `dart test --platform vm`" - runs-on: ubuntu-latest - steps: - - name: Cache Pub hosted dependencies - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 - with: - path: "~/.pub-cache/hosted" - key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http_profile;commands:test_2" - restore-keys: | - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:pkgs/http_profile - os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 - os:ubuntu-latest;pub-cache-hosted - os:ubuntu-latest - - name: Setup Dart SDK - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: "3.4.0" - - id: checkout - name: Checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - id: pkgs_http_profile_pub_upgrade - name: pkgs/http_profile; dart pub upgrade - run: dart pub upgrade - if: "always() && steps.checkout.conclusion == 'success'" - working-directory: pkgs/http_profile - - name: "pkgs/http_profile; dart test --platform vm" - run: dart test --platform vm - if: "always() && steps.pkgs_http_profile_pub_upgrade.conclusion == 'success'" - working-directory: pkgs/http_profile - needs: - - job_001 - - job_002 - - job_003 - - job_004 - - job_005 - - job_006 - - job_007 - - job_008 - job_015: + job_012: name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart run --define=no_default_http_client=true test/no_default_http_client_test.dart`" runs-on: ubuntu-latest steps: @@ -610,9 +528,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_016: + job_013: name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart test --platform chrome`" runs-on: ubuntu-latest steps: @@ -649,9 +565,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_017: + job_014: name: "unit_test; linux; Dart dev; PKGS: pkgs/http, pkgs/http_profile; `dart test --platform vm`" runs-on: ubuntu-latest steps: @@ -697,9 +611,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_018: + job_015: name: "unit_test; linux; Dart dev; PKG: pkgs/http; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm`" runs-on: ubuntu-latest steps: @@ -736,9 +648,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_019: + job_016: name: "unit_test; linux; Dart dev; PKG: pkgs/web_socket; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2js`" runs-on: ubuntu-latest steps: @@ -775,9 +685,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_020: + job_017: name: "unit_test; linux; Dart dev; PKG: pkgs/web_socket; `dart test --test-randomize-ordering-seed=random -p vm`" runs-on: ubuntu-latest steps: @@ -814,9 +722,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_021: + job_018: name: "unit_test; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test --platform chrome`" runs-on: ubuntu-latest steps: @@ -853,9 +759,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_022: + job_019: name: "unit_test; linux; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" runs-on: ubuntu-latest steps: @@ -892,9 +796,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_023: + job_020: name: "unit_test; macos; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" runs-on: macos-latest steps: @@ -931,9 +833,7 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 - job_024: + job_021: name: "unit_test; windows; Flutter stable; PKG: pkgs/flutter_http_example; `flutter test`" runs-on: windows-latest steps: @@ -960,5 +860,3 @@ jobs: - job_004 - job_005 - job_006 - - job_007 - - job_008 diff --git a/.gitignore b/.gitignore index b1696ff164..828cb6ca3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,119 @@ +# Adapted from https://github.com/flutter/flutter/blob/master/.gitignore + +# Miscellaneous +*.class +*.lock +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws .idea/ + +# Visual Studio Code related .vscode/ +.classpath +.project +.settings/ +.vscode/* -# Don’t commit the following directories created by pub. -.dart_tool +# Flutter/Dart/Pub related +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +**/generated_plugin_registrant.dart .packages +.pub-preload-cache/ +.pub-cache/ +.pub/ +build/ +flutter_*.png +linked_*.ds +unlinked.ds +unlinked_spec.ds pubspec.lock pubspec_overrides.yaml + +# Android related +**/android/**/gradle-wrapper.jar +.gradle/ +**/android/captures/ +**/android/gradlew +**/android/gradlew.bat +**/android/local.properties +**/android/**/GeneratedPluginRegistrant.java +**/android/key.properties +*.jks + +# iOS/XCode related +**/ios/**/*.mode1v3 +**/ios/**/*.mode2v3 +**/ios/**/*.moved-aside +**/ios/**/*.pbxuser +**/ios/**/*.perspectivev3 +**/ios/**/*sync/ +**/ios/**/.sconsign.dblite +**/ios/**/.tags* +**/ios/**/.vagrant/ +**/ios/**/DerivedData/ +**/ios/**/Icon? +**/ios/**/Pods/ +**/ios/**/.symlinks/ +**/ios/**/profile +**/ios/**/xcuserdata +**/ios/.generated/ +**/ios/Flutter/.last_build_id +**/ios/Flutter/App.framework +**/ios/Flutter/Flutter.framework +**/ios/Flutter/Flutter.podspec +**/ios/Flutter/Generated.xcconfig +**/ios/Flutter/ephemeral +**/ios/Flutter/app.flx +**/ios/Flutter/app.zip +**/ios/Flutter/flutter_assets/ +**/ios/Flutter/flutter_export_environment.sh +**/ios/ServiceDefinitions.json +**/ios/Runner/GeneratedPluginRegistrant.* + +# macOS +**/Flutter/ephemeral/ +**/Pods/ +**/macos/Flutter/GeneratedPluginRegistrant.swift +**/macos/Flutter/ephemeral +**/xcuserdata/ + +# Windows +**/windows/flutter/ephemeral/ +**/windows/flutter/generated_plugin_registrant.cc +**/windows/flutter/generated_plugin_registrant.h +**/windows/flutter/generated_plugins.cmake + +# Linux +**/linux/flutter/ephemeral/ +**/linux/flutter/generated_plugin_registrant.cc +**/linux/flutter/generated_plugin_registrant.h +**/linux/flutter/generated_plugins.cmake + +# Coverage +coverage/ + +# Symbols +app.*.symbols + +# Exceptions to above rules. +!**/ios/**/default.mode1v3 +!**/ios/**/default.mode2v3 +!**/ios/**/default.pbxuser +!**/ios/**/default.perspectivev3 +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +!/dev/ci/**/Gemfile.lock +!.vscode/settings.json \ No newline at end of file diff --git a/pkgs/cupertino_http/.gitattributes b/pkgs/cupertino_http/.gitattributes index d1c5cc3aee..472b1abfbd 100644 --- a/pkgs/cupertino_http/.gitattributes +++ b/pkgs/cupertino_http/.gitattributes @@ -1,5 +1,3 @@ # ffigen generated code lib/src/native_cupertino_bindings.dart linguist-generated - -# vendored Dart API code -src/dart-sdk/** linguist-vendored +darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m linguist-generated diff --git a/pkgs/cupertino_http/CHANGELOG.md b/pkgs/cupertino_http/CHANGELOG.md index 4667f6ab1f..04b2ed6a65 100644 --- a/pkgs/cupertino_http/CHANGELOG.md +++ b/pkgs/cupertino_http/CHANGELOG.md @@ -1,4 +1,23 @@ -## 1.5.2-wip +## 2.0.0-wip + +* The behavior of `CupertinoClient` and `CupertinoWebSocket` has not changed. +* **Breaking:** `MutableURLRequest.httpBodyStream` now takes a `NSInputStream` + instead of a `Stream>`. +* **Breaking:** The following enums/classes previous defined by + `package:cupertino_http` are now imported from `package:objective_c`: + * `NSData` + * `NSError` + * `NSHTTPCookieAcceptPolicy` + * `NSMutableData` + * `NSURLRequestCachePolicy` + * `NSURLRequestNetworkServiceType` + * `NSURLSessionMultipathServiceType` + * `NSURLSessionResponseDisposition` + * `NSURLSessionTaskState` + * `NSURLSessionWebSocketCloseCode` + * `NSURLSessionWebSocketMessageType` +* **Breaking:** `URLSession.dataTaskWithCompletionHandler` is no longer + supported for background sessions. ## 1.5.1 diff --git a/pkgs/cupertino_http/darwin/Classes/CUPHTTPClientDelegate.m b/pkgs/cupertino_http/darwin/Classes/CUPHTTPClientDelegate.m deleted file mode 100644 index 5b375ca3b4..0000000000 --- a/pkgs/cupertino_http/darwin/Classes/CUPHTTPClientDelegate.m +++ /dev/null @@ -1 +0,0 @@ -#include "../../src/CUPHTTPClientDelegate.m" diff --git a/pkgs/cupertino_http/darwin/Classes/CUPHTTPCompletionHelper.m b/pkgs/cupertino_http/darwin/Classes/CUPHTTPCompletionHelper.m deleted file mode 100644 index b05d1fc717..0000000000 --- a/pkgs/cupertino_http/darwin/Classes/CUPHTTPCompletionHelper.m +++ /dev/null @@ -1 +0,0 @@ -#include "../../src/CUPHTTPCompletionHelper.m" diff --git a/pkgs/cupertino_http/darwin/Classes/CUPHTTPForwardedDelegate.m b/pkgs/cupertino_http/darwin/Classes/CUPHTTPForwardedDelegate.m deleted file mode 100644 index 39c9e02729..0000000000 --- a/pkgs/cupertino_http/darwin/Classes/CUPHTTPForwardedDelegate.m +++ /dev/null @@ -1 +0,0 @@ -#include "../../src/CUPHTTPForwardedDelegate.m" diff --git a/pkgs/cupertino_http/darwin/Classes/CUPHTTPStreamToNSInputStreamAdapter.m b/pkgs/cupertino_http/darwin/Classes/CUPHTTPStreamToNSInputStreamAdapter.m deleted file mode 100644 index 46eb84ba89..0000000000 --- a/pkgs/cupertino_http/darwin/Classes/CUPHTTPStreamToNSInputStreamAdapter.m +++ /dev/null @@ -1 +0,0 @@ -#include "../../src/CUPHTTPStreamToNSInputStreamAdapter.m" diff --git a/pkgs/cupertino_http/darwin/Classes/dart_api_dl.c b/pkgs/cupertino_http/darwin/Classes/dart_api_dl.c deleted file mode 100644 index 023f80ab06..0000000000 --- a/pkgs/cupertino_http/darwin/Classes/dart_api_dl.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../src/dart-sdk/include/dart_api_dl.c" diff --git a/pkgs/cupertino_http/darwin/cupertino_http.podspec b/pkgs/cupertino_http/darwin/cupertino_http.podspec index c3e47bac03..0b44154cb6 100644 --- a/pkgs/cupertino_http/darwin/cupertino_http.podspec +++ b/pkgs/cupertino_http/darwin/cupertino_http.podspec @@ -12,18 +12,13 @@ Pod::Spec.new do |s| s.homepage = 'https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http' s.license = { :type => 'BSD', :file => '../LICENSE' } s.author = { 'TODO' => 'use-valid-author' } + s.source = { :http => 'https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http' } - # This will ensure the source files in Classes/ are included in the native - # builds of apps using this FFI plugin. Podspec does not support relative - # paths, so Classes contains a forwarder C file that relatively imports - # `../src/*` so that the C sources can be shared among all target platforms. - s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'cupertino_http/Sources/cupertino_http/**/*' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' - s.ios.deployment_target = '12.0' - s.osx.deployment_target = '10.14' - s.requires_arc = [] + s.ios.deployment_target = '13.0' # Required for NSURLSessionWebSocketDelegate. + s.osx.deployment_target = '10.15' # Required for NSURLSessionWebSocketDelegate. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m new file mode 100644 index 0000000000..20bed4c2b7 --- /dev/null +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m @@ -0,0 +1,284 @@ +#include +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import "utils.h" + +#if !__has_feature(objc_arc) +#error "This file must be compiled with ARC enabled" +#endif + +id objc_retain(id); +id objc_retainBlock(id); + +typedef void (^_ListenerTrampoline)(); +_ListenerTrampoline _wrapListenerBlock_ksby9f(_ListenerTrampoline block) NS_RETURNS_RETAINED { + return ^void() { + objc_retainBlock(block); + block(); + }; +} + +typedef void (^_ListenerTrampoline1)(void * arg0); +_ListenerTrampoline1 _wrapListenerBlock_hepzs(_ListenerTrampoline1 block) NS_RETURNS_RETAINED { + return ^void(void * arg0) { + objc_retainBlock(block); + block(arg0); + }; +} + +typedef void (^_ListenerTrampoline2)(void * arg0, id arg1); +_ListenerTrampoline2 _wrapListenerBlock_sjfpmz(_ListenerTrampoline2 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1)); + }; +} + +typedef void (^_ListenerTrampoline3)(id arg0); +_ListenerTrampoline3 _wrapListenerBlock_ukcdfq(_ListenerTrampoline3 block) NS_RETURNS_RETAINED { + return ^void(id arg0) { + objc_retainBlock(block); + block(objc_retain(arg0)); + }; +} + +typedef void (^_ListenerTrampoline4)(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1); +_ListenerTrampoline4 _wrapListenerBlock_ttt6u1(_ListenerTrampoline4 block) NS_RETURNS_RETAINED { + return ^void(struct __CFRunLoopObserver * arg0, CFRunLoopActivity arg1) { + objc_retainBlock(block); + block(arg0, arg1); + }; +} + +typedef void (^_ListenerTrampoline5)(struct __CFRunLoopTimer * arg0); +_ListenerTrampoline5 _wrapListenerBlock_1txhfzs(_ListenerTrampoline5 block) NS_RETURNS_RETAINED { + return ^void(struct __CFRunLoopTimer * arg0) { + objc_retainBlock(block); + block(arg0); + }; +} + +typedef void (^_ListenerTrampoline6)(size_t arg0); +_ListenerTrampoline6 _wrapListenerBlock_1hmngv6(_ListenerTrampoline6 block) NS_RETURNS_RETAINED { + return ^void(size_t arg0) { + objc_retainBlock(block); + block(arg0); + }; +} + +typedef void (^_ListenerTrampoline7)(id arg0, int arg1); +_ListenerTrampoline7 _wrapListenerBlock_108ugvk(_ListenerTrampoline7 block) NS_RETURNS_RETAINED { + return ^void(id arg0, int arg1) { + objc_retainBlock(block); + block(objc_retain(arg0), arg1); + }; +} + +typedef void (^_ListenerTrampoline8)(int arg0); +_ListenerTrampoline8 _wrapListenerBlock_1afulej(_ListenerTrampoline8 block) NS_RETURNS_RETAINED { + return ^void(int arg0) { + objc_retainBlock(block); + block(arg0); + }; +} + +typedef void (^_ListenerTrampoline9)(BOOL arg0, id arg1, int arg2); +_ListenerTrampoline9 _wrapListenerBlock_elldw5(_ListenerTrampoline9 block) NS_RETURNS_RETAINED { + return ^void(BOOL arg0, id arg1, int arg2) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), arg2); + }; +} + +typedef void (^_ListenerTrampoline10)(struct __SecTrust * arg0, SecTrustResultType arg1); +_ListenerTrampoline10 _wrapListenerBlock_129ffij(_ListenerTrampoline10 block) NS_RETURNS_RETAINED { + return ^void(struct __SecTrust * arg0, SecTrustResultType arg1) { + objc_retainBlock(block); + block(arg0, arg1); + }; +} + +typedef void (^_ListenerTrampoline11)(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2); +_ListenerTrampoline11 _wrapListenerBlock_1458n52(_ListenerTrampoline11 block) NS_RETURNS_RETAINED { + return ^void(struct __SecTrust * arg0, BOOL arg1, struct __CFError * arg2) { + objc_retainBlock(block); + block(arg0, arg1, arg2); + }; +} + +typedef void (^_ListenerTrampoline12)(uint16_t arg0); +_ListenerTrampoline12 _wrapListenerBlock_yo3tv0(_ListenerTrampoline12 block) NS_RETURNS_RETAINED { + return ^void(uint16_t arg0) { + objc_retainBlock(block); + block(arg0); + }; +} + +typedef void (^_ListenerTrampoline13)(id arg0, id arg1); +_ListenerTrampoline13 _wrapListenerBlock_1tjlcwl(_ListenerTrampoline13 block) NS_RETURNS_RETAINED { + return ^void(id arg0, id arg1) { + objc_retainBlock(block); + block(objc_retain(arg0), objc_retain(arg1)); + }; +} + +typedef void (^_ListenerTrampoline14)(id arg0, id arg1, id arg2); +_ListenerTrampoline14 _wrapListenerBlock_10t0qpd(_ListenerTrampoline14 block) NS_RETURNS_RETAINED { + return ^void(id arg0, id arg1, id arg2) { + objc_retainBlock(block); + block(objc_retain(arg0), objc_retain(arg1), objc_retainBlock(arg2)); + }; +} + +typedef void (^_ListenerTrampoline15)(id arg0, id arg1); +_ListenerTrampoline15 _wrapListenerBlock_cmbt6k(_ListenerTrampoline15 block) NS_RETURNS_RETAINED { + return ^void(id arg0, id arg1) { + objc_retainBlock(block); + block(objc_retain(arg0), objc_retainBlock(arg1)); + }; +} + +typedef void (^_ListenerTrampoline16)(BOOL arg0); +_ListenerTrampoline16 _wrapListenerBlock_117qins(_ListenerTrampoline16 block) NS_RETURNS_RETAINED { + return ^void(BOOL arg0) { + objc_retainBlock(block); + block(arg0); + }; +} + +typedef void (^_ListenerTrampoline17)(id arg0, id arg1, id arg2); +_ListenerTrampoline17 _wrapListenerBlock_tenbla(_ListenerTrampoline17 block) NS_RETURNS_RETAINED { + return ^void(id arg0, id arg1, id arg2) { + objc_retainBlock(block); + block(objc_retain(arg0), objc_retain(arg1), objc_retain(arg2)); + }; +} + +typedef void (^_ListenerTrampoline18)(id arg0, BOOL arg1, id arg2); +_ListenerTrampoline18 _wrapListenerBlock_hfhq9m(_ListenerTrampoline18 block) NS_RETURNS_RETAINED { + return ^void(id arg0, BOOL arg1, id arg2) { + objc_retainBlock(block); + block(objc_retain(arg0), arg1, objc_retain(arg2)); + }; +} + +typedef void (^_ListenerTrampoline19)(void * arg0, id arg1, id arg2); +_ListenerTrampoline19 _wrapListenerBlock_tm2na8(_ListenerTrampoline19 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2)); + }; +} + +typedef void (^_ListenerTrampoline20)(NSURLSessionAuthChallengeDisposition arg0, id arg1); +_ListenerTrampoline20 _wrapListenerBlock_1najo2h(_ListenerTrampoline20 block) NS_RETURNS_RETAINED { + return ^void(NSURLSessionAuthChallengeDisposition arg0, id arg1) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1)); + }; +} + +typedef void (^_ListenerTrampoline21)(void * arg0, id arg1, id arg2, id arg3); +_ListenerTrampoline21 _wrapListenerBlock_1wmulza(_ListenerTrampoline21 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, id arg3) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retainBlock(arg3)); + }; +} + +typedef void (^_ListenerTrampoline22)(NSURLSessionDelayedRequestDisposition arg0, id arg1); +_ListenerTrampoline22 _wrapListenerBlock_wnmjgj(_ListenerTrampoline22 block) NS_RETURNS_RETAINED { + return ^void(NSURLSessionDelayedRequestDisposition arg0, id arg1) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1)); + }; +} + +typedef void (^_ListenerTrampoline23)(void * arg0, id arg1, id arg2, id arg3, id arg4); +_ListenerTrampoline23 _wrapListenerBlock_1nnj9ov(_ListenerTrampoline23 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retainBlock(arg4)); + }; +} + +typedef void (^_ListenerTrampoline24)(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5); +_ListenerTrampoline24 _wrapListenerBlock_dmve6(_ListenerTrampoline24 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4, id arg5) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retain(arg4), objc_retainBlock(arg5)); + }; +} + +typedef void (^_ListenerTrampoline25)(void * arg0, id arg1, id arg2, int64_t arg3, id arg4); +_ListenerTrampoline25 _wrapListenerBlock_qxeqyf(_ListenerTrampoline25 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, int64_t arg3, id arg4) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, objc_retainBlock(arg4)); + }; +} + +typedef void (^_ListenerTrampoline26)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5); +_ListenerTrampoline26 _wrapListenerBlock_jzggzf(_ListenerTrampoline26 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4, int64_t arg5) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, arg4, arg5); + }; +} + +typedef void (^_ListenerTrampoline27)(void * arg0, id arg1, id arg2, id arg3); +_ListenerTrampoline27 _wrapListenerBlock_1a6kixf(_ListenerTrampoline27 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, id arg3) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3)); + }; +} + +typedef void (^_ListenerTrampoline28)(NSURLSessionResponseDisposition arg0); +_ListenerTrampoline28 _wrapListenerBlock_ci81hw(_ListenerTrampoline28 block) NS_RETURNS_RETAINED { + return ^void(NSURLSessionResponseDisposition arg0) { + objc_retainBlock(block); + block(arg0); + }; +} + +typedef void (^_ListenerTrampoline29)(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4); +_ListenerTrampoline29 _wrapListenerBlock_1wl7fts(_ListenerTrampoline29 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, int64_t arg3, int64_t arg4) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, arg4); + }; +} + +typedef void (^_ListenerTrampoline30)(void * arg0, id arg1, id arg2, id arg3, id arg4); +_ListenerTrampoline30 _wrapListenerBlock_no6pyg(_ListenerTrampoline30 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, id arg3, id arg4) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), objc_retain(arg3), objc_retain(arg4)); + }; +} + +typedef void (^_ListenerTrampoline31)(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4); +_ListenerTrampoline31 _wrapListenerBlock_10hgvcc(_ListenerTrampoline31 block) NS_RETURNS_RETAINED { + return ^void(void * arg0, id arg1, id arg2, NSURLSessionWebSocketCloseCode arg3, id arg4) { + objc_retainBlock(block); + block(arg0, objc_retain(arg1), objc_retain(arg2), arg3, objc_retain(arg4)); + }; +} + +typedef void (^_ListenerTrampoline32)(id arg0, id arg1, id arg2, id arg3); +_ListenerTrampoline32 _wrapListenerBlock_19b8ge5(_ListenerTrampoline32 block) NS_RETURNS_RETAINED { + return ^void(id arg0, id arg1, id arg2, id arg3) { + objc_retainBlock(block); + block(objc_retain(arg0), objc_retain(arg1), objc_retain(arg2), objc_retain(arg3)); + }; +} diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h new file mode 100644 index 0000000000..3dd8b2ae02 --- /dev/null +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.h @@ -0,0 +1,19 @@ +#import +#import +#import +#include + +#if !__has_feature(objc_arc) +#error "This file must be compiled with ARC enabled" +#endif + +typedef void (^_DidFinish)(void *, NSURLSession *session, + NSURLSessionDownloadTask *downloadTask, + NSURL *location); +typedef void (^_DidFinishWithLock)(NSCondition *lock, NSURLSession *session, + NSURLSessionDownloadTask *downloadTask, + NSURL *location); +/// Create a block useable as a +/// `URLSession:downloadTask:didFinishDownloadingToURL:` that can be used to +/// make an async Dart callback behave synchronously. +_DidFinish adaptFinishWithLock(_DidFinishWithLock block); diff --git a/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m new file mode 100644 index 0000000000..ff5f771f5d --- /dev/null +++ b/pkgs/cupertino_http/darwin/cupertino_http/Sources/cupertino_http/utils.m @@ -0,0 +1,21 @@ +#import "utils.h" + +_DidFinish adaptFinishWithLock(_DidFinishWithLock block) { + return ^void(void *, NSURLSession *session, + NSURLSessionDownloadTask *downloadTask, NSURL *location) { + NSCondition *lock = [[NSCondition alloc] init]; + [lock lock]; + block(lock, session, downloadTask, location); + [lock lock]; + [lock unlock]; + }; +} + +void doNotCall() { + // TODO(https://github.com/dart-lang/native/issues/1672): Remove + // when fixed. + // Force the protocol information to be available at runtime. + @protocol (NSURLSessionDataDelegate); + @protocol (NSURLSessionDownloadDelegate); + @protocol (NSURLSessionWebSocketDelegate); +} diff --git a/pkgs/cupertino_http/example/.gitignore b/pkgs/cupertino_http/example/.gitignore index a8e938c083..221b42254f 100644 --- a/pkgs/cupertino_http/example/.gitignore +++ b/pkgs/cupertino_http/example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/pkgs/cupertino_http/example/integration_test/data_test.dart b/pkgs/cupertino_http/example/integration_test/data_test.dart deleted file mode 100644 index 981bcef614..0000000000 --- a/pkgs/cupertino_http/example/integration_test/data_test.dart +++ /dev/null @@ -1,41 +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 'dart:typed_data'; - -import 'package:cupertino_http/cupertino_http.dart'; -import 'package:integration_test/integration_test.dart'; -import 'package:test/test.dart'; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - group('empty data', () { - final data = Data.fromList([]); - - test('length', () => expect(data.length, 0)); - test('bytes', () => expect(data.bytes, Uint8List(0))); - test('toString', data.toString); // Just verify that there is no crash. - }); - - group('non-empty data', () { - final data = Data.fromList([1, 2, 3, 4, 5]); - test('length', () => expect(data.length, 5)); - test( - 'bytes', () => expect(data.bytes, Uint8List.fromList([1, 2, 3, 4, 5]))); - test('toString', data.toString); // Just verify that there is no crash. - }); - - group('Data.fromData', () { - test('from empty', () { - final from = Data.fromList([]); - expect(Data.fromData(from).bytes, Uint8List(0)); - }); - - test('from non-empty', () { - final from = Data.fromList([1, 2, 3, 4, 5]); - expect(Data.fromData(from).bytes, Uint8List.fromList([1, 2, 3, 4, 5])); - }); - }); -} diff --git a/pkgs/cupertino_http/example/integration_test/error_test.dart b/pkgs/cupertino_http/example/integration_test/error_test.dart deleted file mode 100644 index 06216519c8..0000000000 --- a/pkgs/cupertino_http/example/integration_test/error_test.dart +++ /dev/null @@ -1,38 +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 'package:cupertino_http/cupertino_http.dart'; -import 'package:integration_test/integration_test.dart'; -import 'package:test/test.dart'; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - group('error', () { - test('simple', () { - final e = Error.fromCustomDomain('test domain', 123); - expect(e.code, 123); - expect(e.domain, 'test domain'); - expect(e.localizedDescription, - allOf(contains('test domain'), contains('123'))); - expect(e.localizedFailureReason, null); - expect(e.localizedRecoverySuggestion, null); - expect(e.toString(), allOf(contains('test domain'), contains('123'))); - }); - - test('localized description', () { - final e = Error.fromCustomDomain('test domain', 123, - localizedDescription: 'This is a description'); - expect(e.code, 123); - expect(e.domain, 'test domain'); - expect(e.localizedDescription, 'This is a description'); - expect(e.localizedFailureReason, null); - expect(e.localizedRecoverySuggestion, null); - expect( - e.toString(), - allOf(contains('test domain'), contains('123'), - contains('This is a description'))); - }); - }); -} diff --git a/pkgs/cupertino_http/example/integration_test/http_url_response_test.dart b/pkgs/cupertino_http/example/integration_test/http_url_response_test.dart index ae3f5f883e..5e29620a4b 100644 --- a/pkgs/cupertino_http/example/integration_test/http_url_response_test.dart +++ b/pkgs/cupertino_http/example/integration_test/http_url_response_test.dart @@ -28,7 +28,8 @@ void main() { final task = session.dataTaskWithRequest( URLRequest.fromUrl(Uri.parse('http://localhost:${server.port}'))) ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future(() {}); } diff --git a/pkgs/cupertino_http/example/integration_test/main.dart b/pkgs/cupertino_http/example/integration_test/main.dart index a632b0c40a..14a7ba9bcf 100644 --- a/pkgs/cupertino_http/example/integration_test/main.dart +++ b/pkgs/cupertino_http/example/integration_test/main.dart @@ -7,10 +7,7 @@ import 'package:integration_test/integration_test.dart'; import 'client_conformance_test.dart' as client_conformance_test; import 'client_profile_test.dart' as profile_test; import 'client_test.dart' as client_test; -import 'data_test.dart' as data_test; -import 'error_test.dart' as error_test; import 'http_url_response_test.dart' as http_url_response_test; -import 'mutable_data_test.dart' as mutable_data_test; import 'mutable_url_request_test.dart' as mutable_url_request_test; import 'url_cache_test.dart' as url_cache_test; import 'url_request_test.dart' as url_request_test; @@ -33,10 +30,7 @@ void main() { client_conformance_test.main(); profile_test.main(); client_test.main(); - data_test.main(); - error_test.main(); http_url_response_test.main(); - mutable_data_test.main(); mutable_url_request_test.main(); url_cache_test.main(); url_request_test.main(); diff --git a/pkgs/cupertino_http/example/integration_test/mutable_data_test.dart b/pkgs/cupertino_http/example/integration_test/mutable_data_test.dart deleted file mode 100644 index f323574c5d..0000000000 --- a/pkgs/cupertino_http/example/integration_test/mutable_data_test.dart +++ /dev/null @@ -1,37 +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 'dart:typed_data'; - -import 'package:cupertino_http/cupertino_http.dart'; -import 'package:integration_test/integration_test.dart'; -import 'package:test/test.dart'; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - group('empty data', () { - final data = MutableData.empty(); - - test('length', () => expect(data.length, 0)); - test('bytes', () => expect(data.bytes, Uint8List(0))); - test('toString', data.toString); // Just verify that there is no crash. - }); - - group('appendBytes', () { - test('append no bytes', () { - final data = MutableData.empty()..appendBytes([]); - expect(data.bytes, Uint8List(0)); - data.toString(); // Just verify that there is no crash. - }); - - test('append some bytes', () { - final data = MutableData.empty()..appendBytes([1, 2, 3, 4, 5]); - expect(data.bytes, Uint8List.fromList([1, 2, 3, 4, 5])); - data.appendBytes([6, 7, 8, 9, 10]); - expect(data.bytes, Uint8List.fromList([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])); - data.toString(); // Just verify that there is no crash. - }); - }); -} diff --git a/pkgs/cupertino_http/example/integration_test/mutable_url_request_test.dart b/pkgs/cupertino_http/example/integration_test/mutable_url_request_test.dart index 9239d07511..446b1ee95f 100644 --- a/pkgs/cupertino_http/example/integration_test/mutable_url_request_test.dart +++ b/pkgs/cupertino_http/example/integration_test/mutable_url_request_test.dart @@ -6,6 +6,7 @@ import 'dart:typed_data'; import 'package:cupertino_http/cupertino_http.dart'; import 'package:integration_test/integration_test.dart'; +import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; void main() { @@ -18,9 +19,10 @@ void main() { setUp(() => request = MutableURLRequest.fromUrl(uri)); test('set', () { - request.cachePolicy = URLRequestCachePolicy.returnCacheDataDontLoad; - expect( - request.cachePolicy, URLRequestCachePolicy.returnCacheDataDontLoad); + request.cachePolicy = + NSURLRequestCachePolicy.NSURLRequestReturnCacheDataDontLoad; + expect(request.cachePolicy, + NSURLRequestCachePolicy.NSURLRequestReturnCacheDataDontLoad); request.toString(); // Just verify that there is no crash. }); }); @@ -47,13 +49,13 @@ void main() { test('empty', () => expect(request.httpBody, null)); test('set', () { - request.httpBody = Data.fromList([1, 2, 3]); - expect(request.httpBody!.bytes, Uint8List.fromList([1, 2, 3])); + request.httpBody = [1, 2, 3].toNSData(); + expect(request.httpBody!.toList(), Uint8List.fromList([1, 2, 3])); request.toString(); // Just verify that there is no crash. }); test('set to null', () { request - ..httpBody = Data.fromList([1, 2, 3]) + ..httpBody = [1, 2, 3].toNSData() ..httpBody = null; expect(request.httpBody, null); }); diff --git a/pkgs/cupertino_http/example/integration_test/url_cache_test.dart b/pkgs/cupertino_http/example/integration_test/url_cache_test.dart index 4b55b1a3c9..133a5d9695 100644 --- a/pkgs/cupertino_http/example/integration_test/url_cache_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_cache_test.dart @@ -56,6 +56,7 @@ void main() { await doRequest(session); expect(uncachedRequestCount, 2); + session.finishTasksAndInvalidate(); }); test('with cache', () async { @@ -67,6 +68,7 @@ void main() { await doRequest(session); expect(uncachedRequestCount, 1); + session.finishTasksAndInvalidate(); }); }); } diff --git a/pkgs/cupertino_http/example/integration_test/url_request_test.dart b/pkgs/cupertino_http/example/integration_test/url_request_test.dart index 86ce7e8007..266d578c41 100644 --- a/pkgs/cupertino_http/example/integration_test/url_request_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_request_test.dart @@ -19,7 +19,8 @@ void main() { expect(request.httpBody, null); expect(request.timeoutInterval, const Duration(minutes: 1)); - expect(request.cachePolicy, URLRequestCachePolicy.useProtocolCachePolicy); + expect(request.cachePolicy, + NSURLRequestCachePolicy.NSURLRequestUseProtocolCachePolicy); request.toString(); // Just verify that there is no crash. }); @@ -33,7 +34,8 @@ void main() { expect(request.httpBody, null); expect(request.timeoutInterval, const Duration(minutes: 1)); - expect(request.cachePolicy, URLRequestCachePolicy.useProtocolCachePolicy); + expect(request.cachePolicy, + NSURLRequestCachePolicy.NSURLRequestUseProtocolCachePolicy); request.toString(); // Just verify that there is no crash. }); @@ -47,7 +49,8 @@ void main() { expect(request.httpBody, null); expect(request.timeoutInterval, const Duration(minutes: 1)); - expect(request.cachePolicy, URLRequestCachePolicy.useProtocolCachePolicy); + expect(request.cachePolicy, + NSURLRequestCachePolicy.NSURLRequestUseProtocolCachePolicy); request.toString(); // Just verify that there is no crash. }); diff --git a/pkgs/cupertino_http/example/integration_test/url_response_test.dart b/pkgs/cupertino_http/example/integration_test/url_response_test.dart index 777ec68e6a..908996d9e7 100644 --- a/pkgs/cupertino_http/example/integration_test/url_response_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_response_test.dart @@ -16,7 +16,8 @@ void main() { final task = session.dataTaskWithRequest(URLRequest.fromUrl( Uri.parse('data:text/fancy;charset=utf-8,Hello%20World'))) ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future.delayed(const Duration()); } diff --git a/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart b/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart index ab117c37d0..e316e80bb3 100644 --- a/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_session_configuration_test.dart @@ -26,7 +26,7 @@ Future>> sentHeaders( final task = session.dataTaskWithRequest(URLRequest.fromUrl( Uri(scheme: 'http', host: 'localhost', port: server.port))) ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while (task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { await pumpEventQueue(); } @@ -78,13 +78,13 @@ void testProperties(URLSessionConfiguration config) { }); test('httpCookieAcceptPolicy', () { config.httpCookieAcceptPolicy = - HTTPCookieAcceptPolicy.httpCookieAcceptPolicyAlways; + NSHTTPCookieAcceptPolicy.NSHTTPCookieAcceptPolicyAlways; expect(config.httpCookieAcceptPolicy, - HTTPCookieAcceptPolicy.httpCookieAcceptPolicyAlways); + NSHTTPCookieAcceptPolicy.NSHTTPCookieAcceptPolicyAlways); config.httpCookieAcceptPolicy = - HTTPCookieAcceptPolicy.httpCookieAcceptPolicyNever; + NSHTTPCookieAcceptPolicy.NSHTTPCookieAcceptPolicyNever; expect(config.httpCookieAcceptPolicy, - HTTPCookieAcceptPolicy.httpCookieAcceptPolicyNever); + NSHTTPCookieAcceptPolicy.NSHTTPCookieAcceptPolicyNever); }); test('httpMaximumConnectionsPerHost', () { config.httpMaximumConnectionsPerHost = 6; @@ -105,37 +105,44 @@ void testProperties(URLSessionConfiguration config) { expect(config.httpShouldUsePipelining, false); }); test('multipathServiceType', () { - expect(config.multipathServiceType, - URLSessionMultipathServiceType.multipathServiceTypeNone); + expect( + config.multipathServiceType, + NSURLSessionMultipathServiceType + .NSURLSessionMultipathServiceTypeNone); + config.multipathServiceType = NSURLSessionMultipathServiceType + .NSURLSessionMultipathServiceTypeAggregate; + expect( + config.multipathServiceType, + NSURLSessionMultipathServiceType + .NSURLSessionMultipathServiceTypeAggregate); config.multipathServiceType = - URLSessionMultipathServiceType.multipathServiceTypeAggregate; - expect(config.multipathServiceType, - URLSessionMultipathServiceType.multipathServiceTypeAggregate); - config.multipathServiceType = - URLSessionMultipathServiceType.multipathServiceTypeNone; - expect(config.multipathServiceType, - URLSessionMultipathServiceType.multipathServiceTypeNone); + NSURLSessionMultipathServiceType.NSURLSessionMultipathServiceTypeNone; + expect( + config.multipathServiceType, + NSURLSessionMultipathServiceType + .NSURLSessionMultipathServiceTypeNone); }); test('networkServiceType', () { expect(config.networkServiceType, - URLRequestNetworkService.networkServiceTypeDefault); + NSURLRequestNetworkServiceType.NSURLNetworkServiceTypeDefault); config.networkServiceType = - URLRequestNetworkService.networkServiceTypeResponsiveData; + NSURLRequestNetworkServiceType.NSURLNetworkServiceTypeResponsiveAV; expect(config.networkServiceType, - URLRequestNetworkService.networkServiceTypeResponsiveData); + NSURLRequestNetworkServiceType.NSURLNetworkServiceTypeResponsiveAV); config.networkServiceType = - URLRequestNetworkService.networkServiceTypeDefault; + NSURLRequestNetworkServiceType.NSURLNetworkServiceTypeDefault; expect(config.networkServiceType, - URLRequestNetworkService.networkServiceTypeDefault); + NSURLRequestNetworkServiceType.NSURLNetworkServiceTypeDefault); }); test('requestCachePolicy', () { - config.requestCachePolicy = URLRequestCachePolicy.returnCacheDataDontLoad; + config.requestCachePolicy = + NSURLRequestCachePolicy.NSURLRequestReturnCacheDataDontLoad; expect(config.requestCachePolicy, - URLRequestCachePolicy.returnCacheDataDontLoad); + NSURLRequestCachePolicy.NSURLRequestReturnCacheDataDontLoad); config.requestCachePolicy = - URLRequestCachePolicy.reloadIgnoringLocalCacheData; + NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData; expect(config.requestCachePolicy, - URLRequestCachePolicy.reloadIgnoringLocalCacheData); + NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData); }); test('sessionSendsLaunchEvents', () { config.sessionSendsLaunchEvents = true; diff --git a/pkgs/cupertino_http/example/integration_test/url_session_delegate_test.dart b/pkgs/cupertino_http/example/integration_test/url_session_delegate_test.dart index 0d86694c09..6baa5e6ca9 100644 --- a/pkgs/cupertino_http/example/integration_test/url_session_delegate_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_session_delegate_test.dart @@ -8,9 +8,10 @@ import 'dart:io'; import 'package:cupertino_http/cupertino_http.dart'; import 'package:integration_test/integration_test.dart'; +import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; -void testOnComplete(URLSessionConfiguration config) { +void testOnComplete(URLSessionConfiguration Function() config) { group('onComplete', () { late HttpServer server; @@ -29,12 +30,12 @@ void testOnComplete(URLSessionConfiguration config) { test('success', () async { final c = Completer(); - Error? actualError; + NSError? actualError; late URLSession actualSession; late URLSessionTask actualTask; final session = - URLSession.sessionWithConfiguration(config, onComplete: (s, t, e) { + URLSession.sessionWithConfiguration(config(), onComplete: (s, t, e) { actualSession = s; actualTask = t; actualError = e; @@ -49,16 +50,17 @@ void testOnComplete(URLSessionConfiguration config) { expect(actualSession, session); expect(actualTask, task); expect(actualError, null); + session.finishTasksAndInvalidate(); }); test('bad host', () async { final c = Completer(); - Error? actualError; + NSError? actualError; late URLSession actualSession; late URLSessionTask actualTask; final session = - URLSession.sessionWithConfiguration(config, onComplete: (s, t, e) { + URLSession.sessionWithConfiguration(config(), onComplete: (s, t, e) { actualSession = s; actualTask = t; actualError = e; @@ -77,11 +79,12 @@ void testOnComplete(URLSessionConfiguration config) { -1001, // kCFURLErrorTimedOut -1003, // kCFURLErrorCannotFindHost )); + session.finishTasksAndInvalidate(); }); }); } -void testOnResponse(URLSessionConfiguration config) { +void testOnResponse(URLSessionConfiguration Function() config) { group('onResponse', () { late HttpServer server; @@ -105,12 +108,12 @@ void testOnResponse(URLSessionConfiguration config) { late URLSessionTask actualTask; final session = - URLSession.sessionWithConfiguration(config, onResponse: (s, t, r) { + URLSession.sessionWithConfiguration(config(), onResponse: (s, t, r) { actualSession = s; actualTask = t; actualResponse = r as HTTPURLResponse; c.complete(); - return URLSessionResponseDisposition.urlSessionResponseAllow; + return NSURLSessionResponseDisposition.NSURLSessionResponseAllow; }); final task = session.dataTaskWithRequest( @@ -120,6 +123,7 @@ void testOnResponse(URLSessionConfiguration config) { expect(actualSession, session); expect(actualTask, task); expect(actualResponse.statusCode, 200); + session.finishTasksAndInvalidate(); }); test('bad host', () async { @@ -127,11 +131,11 @@ void testOnResponse(URLSessionConfiguration config) { final c = Completer(); var called = false; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onComplete: (session, task, error) => c.complete(), onResponse: (s, t, r) { called = true; - return URLSessionResponseDisposition.urlSessionResponseAllow; + return NSURLSessionResponseDisposition.NSURLSessionResponseAllow; }); session @@ -140,11 +144,12 @@ void testOnResponse(URLSessionConfiguration config) { .resume(); await c.future; expect(called, false); + session.finishTasksAndInvalidate(); }); }); } -void testOnData(URLSessionConfiguration config) { +void testOnData(URLSessionConfiguration Function() config) { group('onData', () { late HttpServer server; @@ -163,16 +168,16 @@ void testOnData(URLSessionConfiguration config) { test('success', () async { final c = Completer(); - final actualData = MutableData.empty(); + final actualData = NSMutableData.data(); late URLSession actualSession; late URLSessionTask actualTask; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onComplete: (s, t, r) => c.complete(), onData: (s, t, d) { actualSession = s; actualTask = t; - actualData.appendBytes(d.bytes); + actualData.appendData_(d); }); final task = session.dataTaskWithRequest( @@ -181,12 +186,13 @@ void testOnData(URLSessionConfiguration config) { await c.future; expect(actualSession, session); expect(actualTask, task); - expect(actualData.bytes, 'Hello World'.codeUnits); + expect(actualData.toList(), 'Hello World'.codeUnits); + session.finishTasksAndInvalidate(); }); }); } -void testOnFinishedDownloading(URLSessionConfiguration config) { +void testOnFinishedDownloading(URLSessionConfiguration Function() config) { group('onFinishedDownloading', () { late HttpServer server; @@ -209,7 +215,7 @@ void testOnFinishedDownloading(URLSessionConfiguration config) { late URLSessionDownloadTask actualTask; late String actualContent; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onComplete: (s, t, r) => c.complete(), onFinishedDownloading: (s, t, uri) { actualSession = s; @@ -224,11 +230,12 @@ void testOnFinishedDownloading(URLSessionConfiguration config) { expect(actualSession, session); expect(actualTask, task); expect(actualContent, 'Hello World'); + session.finishTasksAndInvalidate(); }); }); } -void testOnRedirect(URLSessionConfiguration config) { +void testOnRedirect(URLSessionConfiguration Function() config) { group('onRedirect', () { late HttpServer redirectServer; @@ -257,13 +264,13 @@ void testOnRedirect(URLSessionConfiguration config) { }); test('disallow redirect', () async { - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onRedirect: (redirectSession, redirectTask, redirectResponse, newRequest) => null); final c = Completer(); - HTTPURLResponse? response; - Error? error; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -275,20 +282,26 @@ void testOnRedirect(URLSessionConfiguration config) { }).resume(); await c.future; - expect(response!.statusCode, 302); - expect(response!.allHeaderFields['Location'], - 'http://localhost:${redirectServer.port}/99'); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 302) + .having( + (r) => r.allHeaderFields['Location'], + "allHeaderFields['Location']", + 'http://localhost:${redirectServer.port}/99')); expect(error, null); + session.finishTasksAndInvalidate(); }); - test('use preposed redirect request', () async { - final session = URLSession.sessionWithConfiguration(config, + test('use proposed redirect request', () async { + final session = URLSession.sessionWithConfiguration(config(), onRedirect: (redirectSession, redirectTask, redirectResponse, newRequest) => newRequest); final c = Completer(); - HTTPURLResponse? response; - Error? error; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -300,21 +313,25 @@ void testOnRedirect(URLSessionConfiguration config) { }).resume(); await c.future; - expect(response!.statusCode, 200); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 200)); expect(error, null); + session.finishTasksAndInvalidate(); }); test('use custom redirect request', () async { final session = URLSession.sessionWithConfiguration( - config, + config(), onRedirect: (redirectSession, redirectTask, redirectResponse, newRequest) => URLRequest.fromUrl( Uri.parse('http://localhost:${redirectServer.port}/')), ); final c = Completer(); - HTTPURLResponse? response; - Error? error; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -326,22 +343,26 @@ void testOnRedirect(URLSessionConfiguration config) { }).resume(); await c.future; - expect(response!.statusCode, 200); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 200)); expect(error, null); + session.finishTasksAndInvalidate(); }); test('exception in http redirection', () async { final session = URLSession.sessionWithConfiguration( - config, + config(), onRedirect: (redirectSession, redirectTask, redirectResponse, newRequest) { throw UnimplementedError(); }, ); final c = Completer(); - HTTPURLResponse? response; + URLResponse? response; // ignore: unused_local_variable - Error? error; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -353,45 +374,28 @@ void testOnRedirect(URLSessionConfiguration config) { }).resume(); await c.future; - expect(response!.statusCode, 302); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 302)); // TODO(https://github.com/dart-lang/ffigen/issues/386): Check that the // error is set. + session.finishTasksAndInvalidate(); }, skip: 'Error not set for redirect exceptions.'); test('3 redirects', () async { var redirectCounter = 0; final session = URLSession.sessionWithConfiguration( - config, + config(), onRedirect: (redirectSession, redirectTask, redirectResponse, newRequest) { - expect(redirectResponse.statusCode, 302); - switch (redirectCounter) { - case 0: - expect(redirectResponse.allHeaderFields['Location'], - 'http://localhost:${redirectServer.port}/2'); - expect(newRequest.url, - Uri.parse('http://localhost:${redirectServer.port}/2')); - break; - case 1: - expect(redirectResponse.allHeaderFields['Location'], - 'http://localhost:${redirectServer.port}/1'); - expect(newRequest.url, - Uri.parse('http://localhost:${redirectServer.port}/1')); - break; - case 2: - expect(redirectResponse.allHeaderFields['Location'], - 'http://localhost:${redirectServer.port}/'); - expect(newRequest.url, - Uri.parse('http://localhost:${redirectServer.port}/')); - break; - } ++redirectCounter; return newRequest; }, ); final c = Completer(); - HTTPURLResponse? response; - Error? error; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -403,22 +407,27 @@ void testOnRedirect(URLSessionConfiguration config) { }).resume(); await c.future; - expect(response!.statusCode, 200); + expect(redirectCounter, 3); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 200)); expect(error, null); + session.finishTasksAndInvalidate(); }); test('allow too many redirects', () async { // The Foundation URL Loading System limits the number of redirects // even when a redirect delegate is present and allows the redirect. final session = URLSession.sessionWithConfiguration( - config, + config(), onRedirect: (redirectSession, redirectTask, redirectResponse, newRequest) => newRequest, ); final c = Completer(); - HTTPURLResponse? response; - Error? error; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -430,13 +439,24 @@ void testOnRedirect(URLSessionConfiguration config) { }).resume(); await c.future; - expect(response, null); + expect( + response, + anyOf( + isNull, + isA() + .having((r) => r.statusCode, 'statusCode', 302) + .having( + (r) => r.allHeaderFields['Location'], + "r.allHeaderFields['Location']", + matches('http://localhost:${redirectServer.port}/' + r'\d+')))); expect(error!.code, -1007); // kCFURLErrorHTTPTooManyRedirects + session.finishTasksAndInvalidate(); }); }); } -void testOnWebSocketTaskOpened(URLSessionConfiguration config) { +void testOnWebSocketTaskOpened(URLSessionConfiguration Function() config) { group('onWebSocketTaskOpened', () { late HttpServer server; @@ -465,7 +485,7 @@ void testOnWebSocketTaskOpened(URLSessionConfiguration config) { late URLSession actualSession; late URLSessionWebSocketTask actualTask; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onWebSocketTaskOpened: (s, t, p) { actualSession = s; actualTask = t; @@ -482,6 +502,7 @@ void testOnWebSocketTaskOpened(URLSessionConfiguration config) { expect(actualSession, session); expect(actualTask, task); expect(actualProtocol, 'myprotocol'); + session.finishTasksAndInvalidate(); }); test('without protocol', () async { @@ -490,7 +511,7 @@ void testOnWebSocketTaskOpened(URLSessionConfiguration config) { late URLSession actualSession; late URLSessionWebSocketTask actualTask; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onWebSocketTaskOpened: (s, t, p) { actualSession = s; actualTask = t; @@ -505,17 +526,19 @@ void testOnWebSocketTaskOpened(URLSessionConfiguration config) { expect(actualSession, session); expect(actualTask, task); expect(actualProtocol, null); + session.finishTasksAndInvalidate(); }); test('server failure', () async { final c = Completer(); var onWebSocketTaskOpenedCalled = false; + NSError? actualError; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onWebSocketTaskOpened: (s, t, p) { onWebSocketTaskOpenedCalled = true; }, onComplete: (s, t, e) { - expect(e, isNotNull); + actualError = e; c.complete(); }); @@ -523,12 +546,14 @@ void testOnWebSocketTaskOpened(URLSessionConfiguration config) { Uri.parse('http://localhost:${server.port}?error=1')); session.webSocketTaskWithRequest(request).resume(); await c.future; + expect(actualError, isNotNull); expect(onWebSocketTaskOpenedCalled, false); + session.finishTasksAndInvalidate(); }); }); } -void testOnWebSocketTaskClosed(URLSessionConfiguration config) { +void testOnWebSocketTaskClosed(URLSessionConfiguration Function() config) { group('testOnWebSocketTaskClosed', () { late HttpServer server; late int? serverCode; @@ -562,13 +587,13 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { serverCode = null; serverReason = null; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onWebSocketTaskOpened: (session, task, protocol) {}, onWebSocketTaskClosed: (session, task, closeCode, reason) { actualSession = session; actualTask = task; actualCloseCode = closeCode!; - actualReason = utf8.decode(reason!.bytes); + actualReason = utf8.decode(reason!.toList()); c.complete(); }); @@ -579,7 +604,7 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { expect( task.receiveMessage(), - throwsA(isA() + throwsA(isA() .having((e) => e.code, 'code', 57 // Socket is not connected. ))); await c.future; @@ -587,6 +612,7 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { expect(actualTask, task); expect(actualCloseCode, 1005); expect(actualReason, ''); + session.finishTasksAndInvalidate(); }); test('close code', () async { @@ -599,13 +625,13 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { serverCode = 4000; serverReason = null; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onWebSocketTaskOpened: (session, task, protocol) {}, onWebSocketTaskClosed: (session, task, closeCode, reason) { actualSession = session; actualTask = task; actualCloseCode = closeCode!; - actualReason = utf8.decode(reason!.bytes); + actualReason = utf8.decode(reason!.toList()); c.complete(); }); @@ -616,7 +642,7 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { expect( task.receiveMessage(), - throwsA(isA() + throwsA(isA() .having((e) => e.code, 'code', 57 // Socket is not connected. ))); await c.future; @@ -624,6 +650,7 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { expect(actualTask, task); expect(actualCloseCode, serverCode); expect(actualReason, ''); + session.finishTasksAndInvalidate(); }); test('close code and reason', () async { @@ -636,13 +663,13 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { serverCode = 4000; serverReason = 'no real reason'; - final session = URLSession.sessionWithConfiguration(config, + final session = URLSession.sessionWithConfiguration(config(), onWebSocketTaskOpened: (session, task, protocol) {}, onWebSocketTaskClosed: (session, task, closeCode, reason) { actualSession = session; actualTask = task; actualCloseCode = closeCode!; - actualReason = utf8.decode(reason!.bytes); + actualReason = utf8.decode(reason!.toList()); c.complete(); }); @@ -653,7 +680,7 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { expect( task.receiveMessage(), - throwsA(isA() + throwsA(isA() .having((e) => e.code, 'code', 57 // Socket is not connected. ))); await c.future; @@ -661,6 +688,7 @@ void testOnWebSocketTaskClosed(URLSessionConfiguration config) { expect(actualTask, task); expect(actualCloseCode, serverCode); expect(actualReason, serverReason); + session.finishTasksAndInvalidate(); }); }); } @@ -669,10 +697,15 @@ void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); group('backgroundSession', () { - final config = - URLSessionConfiguration.backgroundSession('backgroundSession'); + var count = 0; + URLSessionConfiguration config() { + ++count; + return URLSessionConfiguration.backgroundSession( + 'backgroundSession{$count}'); + } + testOnComplete(config); - testOnResponse(config); + // onResponse is not called for background sessions. testOnData(config); // onRedirect is not called for background sessions. testOnFinishedDownloading(config); @@ -680,7 +713,8 @@ void main() { }); group('defaultSessionConfiguration', () { - final config = URLSessionConfiguration.defaultSessionConfiguration(); + URLSessionConfiguration config() => + URLSessionConfiguration.defaultSessionConfiguration(); testOnComplete(config); testOnResponse(config); testOnData(config); @@ -691,7 +725,8 @@ void main() { }); group('ephemeralSessionConfiguration', () { - final config = URLSessionConfiguration.ephemeralSessionConfiguration(); + URLSessionConfiguration config() => + URLSessionConfiguration.ephemeralSessionConfiguration(); testOnComplete(config); testOnResponse(config); testOnData(config); diff --git a/pkgs/cupertino_http/example/integration_test/url_session_task_test.dart b/pkgs/cupertino_http/example/integration_test/url_session_task_test.dart index c00de9c142..a85b317a10 100644 --- a/pkgs/cupertino_http/example/integration_test/url_session_task_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_session_task_test.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:cupertino_http/cupertino_http.dart'; import 'package:integration_test/integration_test.dart'; +import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; void testWebSocketTask() { @@ -52,6 +53,7 @@ void testWebSocketTask() { () => session.webSocketTaskWithRequest(URLRequest.fromUrl( Uri.parse('ws://localhost:${server.port}/?noclose'))), throwsUnsupportedError); + session.finishTasksAndInvalidate(); }); test('client code and reason', () async { @@ -62,7 +64,7 @@ void testWebSocketTask() { await task .sendMessage(URLSessionWebSocketMessage.fromString('Hello World!')); await task.receiveMessage(); - task.cancelWithCloseCode(4998, Data.fromList('Bye'.codeUnits)); + task.cancelWithCloseCode(4998, 'Bye'.codeUnits.toNSData()); // Allow the server to run and save the close code. while (lastCloseCode == null) { @@ -80,13 +82,16 @@ void testWebSocketTask() { await task .sendMessage(URLSessionWebSocketMessage.fromString('Hello World!')); await task.receiveMessage(); - await expectLater(task.receiveMessage(), - throwsA(isA().having((e) => e.code, 'code', 57 // NOT_CONNECTED - ))); + await expectLater( + task.receiveMessage(), + throwsA( + isA().having((e) => e.code, 'code', 57 // NOT_CONNECTED + ))); expect(task.closeCode, 4999); - expect(task.closeReason!.bytes, 'fun'.codeUnits); + expect(task.closeReason!.toList(), 'fun'.codeUnits); task.cancel(); + session.finishTasksAndInvalidate(); }); test('data message', () async { @@ -95,11 +100,13 @@ void testWebSocketTask() { URLRequest.fromUrl(Uri.parse('ws://localhost:${server.port}'))) ..resume(); await task.sendMessage( - URLSessionWebSocketMessage.fromData(Data.fromList([1, 2, 3]))); + URLSessionWebSocketMessage.fromData([1, 2, 3].toNSData())); final receivedMessage = await task.receiveMessage(); - expect(receivedMessage.type, - URLSessionWebSocketMessageType.urlSessionWebSocketMessageTypeData); - expect(receivedMessage.data!.bytes, [1, 2, 3]); + expect( + receivedMessage.type, + NSURLSessionWebSocketMessageType + .NSURLSessionWebSocketMessageTypeData); + expect(receivedMessage.data!.toList(), [1, 2, 3]); expect(receivedMessage.string, null); task.cancel(); }); @@ -112,8 +119,10 @@ void testWebSocketTask() { await task .sendMessage(URLSessionWebSocketMessage.fromString('Hello World!')); final receivedMessage = await task.receiveMessage(); - expect(receivedMessage.type, - URLSessionWebSocketMessageType.urlSessionWebSocketMessageTypeString); + expect( + receivedMessage.type, + NSURLSessionWebSocketMessageType + .NSURLSessionWebSocketMessageTypeString); expect(receivedMessage.data, null); expect(receivedMessage.string, 'Hello World!'); task.cancel(); @@ -127,7 +136,7 @@ void testWebSocketTask() { await expectLater( task.sendMessage( URLSessionWebSocketMessage.fromString('Hello World!')), - throwsA(isA().having( + throwsA(isA().having( (e) => e.code, 'code', -1011 // NSURLErrorBadServerResponse ))); task.cancel(); @@ -141,9 +150,11 @@ void testWebSocketTask() { await task .sendMessage(URLSessionWebSocketMessage.fromString('Hello World!')); await task.receiveMessage(); - await expectLater(task.receiveMessage(), - throwsA(isA().having((e) => e.code, 'code', 57 // NOT_CONNECTED - ))); + await expectLater( + task.receiveMessage(), + throwsA( + isA().having((e) => e.code, 'code', 57 // NOT_CONNECTED + ))); task.cancel(); }); }); @@ -171,14 +182,14 @@ void testURLSessionTaskCommon( server.close(); }); test('starts suspended', () { - expect(task.state, URLSessionTaskState.urlSessionTaskStateSuspended); + expect(task.state, NSURLSessionTaskState.NSURLSessionTaskStateSuspended); expect(task.response, null); task.toString(); // Just verify that there is no crash. }); test('resume to running', () { task.resume(); - expect(task.state, URLSessionTaskState.urlSessionTaskStateRunning); + expect(task.state, NSURLSessionTaskState.NSURLSessionTaskStateRunning); expect(task.response, null); task.toString(); // Just verify that there is no crash. }); @@ -186,9 +197,11 @@ void testURLSessionTaskCommon( test('cancel', () { task.cancel(); if (suspendedAfterCancel) { - expect(task.state, URLSessionTaskState.urlSessionTaskStateSuspended); + expect( + task.state, NSURLSessionTaskState.NSURLSessionTaskStateSuspended); } else { - expect(task.state, URLSessionTaskState.urlSessionTaskStateCanceling); + expect( + task.state, NSURLSessionTaskState.NSURLSessionTaskStateCanceling); } expect(task.response, null); task.toString(); // Just verify that there is no crash. @@ -196,7 +209,8 @@ void testURLSessionTaskCommon( test('completed', () async { task.resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future(() {}); } @@ -219,13 +233,14 @@ void testURLSessionTaskCommon( MutableURLRequest.fromUrl( Uri.parse('http://localhost:${server.port}/mypath')) ..httpMethod = 'POST' - ..httpBody = Data.fromList([1, 2, 3])) + ..httpBody = [1, 2, 3].toNSData()) ..prefersIncrementalDelivery = false ..priority = 0.2 ..taskDescription = 'my task description' ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future(() {}); } @@ -296,7 +311,8 @@ void testURLSessionTaskCommon( MutableURLRequest.fromUrl(Uri.parse('http://notarealserver'))) ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future(() {}); } @@ -340,7 +356,8 @@ void testURLSessionTaskCommon( Uri.parse('http://localhost:${server.port}/launch'))) ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future(() {}); } diff --git a/pkgs/cupertino_http/example/integration_test/url_session_test.dart b/pkgs/cupertino_http/example/integration_test/url_session_test.dart index 3bed931e95..96e09789f8 100644 --- a/pkgs/cupertino_http/example/integration_test/url_session_test.dart +++ b/pkgs/cupertino_http/example/integration_test/url_session_test.dart @@ -7,6 +7,7 @@ import 'dart:io'; import 'package:cupertino_http/cupertino_http.dart'; import 'package:integration_test/integration_test.dart'; +import 'package:objective_c/objective_c.dart'; import 'package:test/test.dart'; void testDataTaskWithCompletionHandler(URLSession session) { @@ -58,9 +59,9 @@ void testDataTaskWithCompletionHandler(URLSession session) { test('success', () async { final c = Completer(); - Data? data; - HTTPURLResponse? response; - Error? error; + NSData? data; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -72,16 +73,19 @@ void testDataTaskWithCompletionHandler(URLSession session) { }).resume(); await c.future; - expect(data!.bytes, 'Hello World'.codeUnits); - expect(response!.statusCode, 200); + expect(data!.toList(), 'Hello World'.codeUnits); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 200)); expect(error, null); }); test('success no data', () async { final c = Completer(); - Data? data; - HTTPURLResponse? response; - Error? error; + NSData? data; + URLResponse? response; + NSError? error; final request = MutableURLRequest.fromUrl( Uri.parse('http://localhost:${successServer.port}')) @@ -95,16 +99,19 @@ void testDataTaskWithCompletionHandler(URLSession session) { }).resume(); await c.future; - expect(data, null); - expect(response!.statusCode, 200); + expect(data!.length, 0); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 200)); expect(error, null); }); test('500 response', () async { final c = Completer(); - Data? data; - HTTPURLResponse? response; - Error? error; + NSData? data; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -116,8 +123,11 @@ void testDataTaskWithCompletionHandler(URLSession session) { }).resume(); await c.future; - expect(data!.bytes, 'Hello World'.codeUnits); - expect(response!.statusCode, 500); + expect(data!.toList(), 'Hello World'.codeUnits); + expect( + response, + isA() + .having((r) => r.statusCode, 'statusCode', 500)); expect(error, null); }); @@ -125,9 +135,9 @@ void testDataTaskWithCompletionHandler(URLSession session) { // Ensures that the delegate used to implement the completion handler // does not interfere with the default redirect behavior. final c = Completer(); - Data? data; - HTTPURLResponse? response; - Error? error; + NSData? data; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl( @@ -140,16 +150,26 @@ void testDataTaskWithCompletionHandler(URLSession session) { }).resume(); await c.future; - expect(response, null); expect(data, null); + expect( + response, + anyOf( + isNull, + isA() + .having((r) => r.statusCode, 'statusCode', 302) + .having( + (r) => r.allHeaderFields['Location'], + "r.allHeaderFields['Location']", + matches('http://localhost:${redirectServer.port}/' + r'\d+')))); expect(error!.code, -1007); // kCFURLErrorHTTPTooManyRedirects }); test('unable to connect', () async { final c = Completer(); - Data? data; - HTTPURLResponse? response; - Error? error; + NSData? data; + URLResponse? response; + NSError? error; session.dataTaskWithCompletionHandler( URLRequest.fromUrl(Uri.parse('http://this is not a valid URL')), @@ -196,7 +216,8 @@ void testURLSession(URLSession session) { final task = session.dataTaskWithRequest( URLRequest.fromUrl(Uri.parse('http://localhost:${server.port}'))) ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future.delayed(const Duration()); } @@ -208,15 +229,14 @@ void testURLSession(URLSession session) { final task = session.downloadTaskWithRequest( URLRequest.fromUrl(Uri.parse('http://localhost:${server.port}'))) ..resume(); - while (task.state != URLSessionTaskState.urlSessionTaskStateCompleted) { + while ( + task.state != NSURLSessionTaskState.NSURLSessionTaskStateCompleted) { // Let the event loop run. await Future.delayed(const Duration()); } final response = task.response as HTTPURLResponse; expect(response.statusCode, 200); }); - - testDataTaskWithCompletionHandler(session); }); } @@ -231,6 +251,7 @@ void main() { }); testURLSession(session); + testDataTaskWithCompletionHandler(session); }); group('defaultSessionConfiguration', () { @@ -243,6 +264,7 @@ void main() { }); testURLSession(session); + testDataTaskWithCompletionHandler(session); }); group('backgroundSession', () { @@ -256,5 +278,6 @@ void main() { }); testURLSession(session); + // dataTaskWithCompletionHandler is not supported in background sessions. }); } diff --git a/pkgs/cupertino_http/example/integration_test/utils_test.dart b/pkgs/cupertino_http/example/integration_test/utils_test.dart index 315282a6be..d075927863 100644 --- a/pkgs/cupertino_http/example/integration_test/utils_test.dart +++ b/pkgs/cupertino_http/example/integration_test/utils_test.dart @@ -2,50 +2,50 @@ // for 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:cupertino_http/src/native_cupertino_bindings.dart' as ncb; import 'package:cupertino_http/src/utils.dart'; import 'package:integration_test/integration_test.dart'; +import 'package:objective_c/objective_c.dart' as objc; import 'package:test/test.dart'; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - group('toStringOrNull', () { - test('null input', () { - expect(toStringOrNull(null), null); - }); - - test('string input', () { - expect(toStringOrNull('Test'.toNSString(linkedLibs)), 'Test'); - }); - }); - group('stringNSDictionaryToMap', () { test('empty input', () { - final d = ncb.NSMutableDictionary.new1(linkedLibs); + final d = objc.NSMutableDictionary.new1(); expect(stringNSDictionaryToMap(d), {}); }); test('single string input', () { - final d = ncb.NSMutableDictionary.new1(linkedLibs) - ..setObject_forKey_( - 'value'.toNSString(linkedLibs), 'key'.toNSString(linkedLibs)); + final d = objc.NSMutableDictionary.new1() + ..setObject_forKey_('value'.toNSString(), 'key'.toNSString()); expect(stringNSDictionaryToMap(d), {'key': 'value'}); }); test('multiple string input', () { - final d = ncb.NSMutableDictionary.new1(linkedLibs) - ..setObject_forKey_( - 'value1'.toNSString(linkedLibs), 'key1'.toNSString(linkedLibs)) - ..setObject_forKey_( - 'value2'.toNSString(linkedLibs), 'key2'.toNSString(linkedLibs)) - ..setObject_forKey_( - 'value3'.toNSString(linkedLibs), 'key3'.toNSString(linkedLibs)); + final d = objc.NSMutableDictionary.new1() + ..setObject_forKey_('value1'.toNSString(), 'key1'.toNSString()) + ..setObject_forKey_('value2'.toNSString(), 'key2'.toNSString()) + ..setObject_forKey_('value3'.toNSString(), 'key3'.toNSString()); expect(stringNSDictionaryToMap(d), {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'}); }); + + test('non-string value', () { + final d = objc.NSMutableDictionary.new1() + ..setObject_forKey_( + objc.NSNumber.numberWithInteger_(5), 'key'.toNSString()); + expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError); + }); + + test('non-string key', () { + final d = objc.NSMutableDictionary.new1() + ..setObject_forKey_( + 'value'.toNSString(), objc.NSNumber.numberWithInteger_(5)); + expect(() => stringNSDictionaryToMap(d), throwsUnsupportedError); + }); }); group('stringIterableToNSArray', () { @@ -58,16 +58,16 @@ void main() { final array = stringIterableToNSArray(['apple']); expect(array.count, 1); expect( - ncb.NSString.castFrom(array.objectAtIndex_(0)).toString(), 'apple'); + objc.NSString.castFrom(array.objectAtIndex_(0)).toString(), 'apple'); }); test('multiple string input', () { final array = stringIterableToNSArray(['apple', 'banana']); expect(array.count, 2); expect( - ncb.NSString.castFrom(array.objectAtIndex_(0)).toString(), 'apple'); + objc.NSString.castFrom(array.objectAtIndex_(0)).toString(), 'apple'); expect( - ncb.NSString.castFrom(array.objectAtIndex_(1)).toString(), 'banana'); + objc.NSString.castFrom(array.objectAtIndex_(1)).toString(), 'banana'); }); }); } diff --git a/pkgs/cupertino_http/example/ios/Flutter/AppFrameworkInfo.plist b/pkgs/cupertino_http/example/ios/Flutter/AppFrameworkInfo.plist index 9625e105df..1dc6cf7652 100644 --- a/pkgs/cupertino_http/example/ios/Flutter/AppFrameworkInfo.plist +++ b/pkgs/cupertino_http/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 11.0 + 13.0 diff --git a/pkgs/cupertino_http/example/ios/Podfile b/pkgs/cupertino_http/example/ios/Podfile index 88359b225f..6be20bc436 100644 --- a/pkgs/cupertino_http/example/ios/Podfile +++ b/pkgs/cupertino_http/example/ios/Podfile @@ -1,5 +1,4 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '11.0' +platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/pkgs/cupertino_http/example/ios/Podfile.lock b/pkgs/cupertino_http/example/ios/Podfile.lock index 709672b9d7..7201c0f962 100644 --- a/pkgs/cupertino_http/example/ios/Podfile.lock +++ b/pkgs/cupertino_http/example/ios/Podfile.lock @@ -1,28 +1,35 @@ PODS: - cupertino_http (0.0.1): - Flutter + - FlutterMacOS - Flutter (1.0.0) - integration_test (0.0.1): - Flutter + - objective_c (0.0.1): + - Flutter DEPENDENCIES: - - cupertino_http (from `.symlinks/plugins/cupertino_http/ios`) + - cupertino_http (from `.symlinks/plugins/cupertino_http/darwin`) - Flutter (from `Flutter`) - integration_test (from `.symlinks/plugins/integration_test/ios`) + - objective_c (from `.symlinks/plugins/objective_c/ios`) EXTERNAL SOURCES: cupertino_http: - :path: ".symlinks/plugins/cupertino_http/ios" + :path: ".symlinks/plugins/cupertino_http/darwin" Flutter: :path: Flutter integration_test: :path: ".symlinks/plugins/integration_test/ios" + objective_c: + :path: ".symlinks/plugins/objective_c/ios" SPEC CHECKSUMS: - cupertino_http: 5f8b1161107fe6c8d94a0c618735a033d93fa7db - Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 - integration_test: a1e7d09bd98eca2fc37aefd79d4f41ad37bdbbe5 + cupertino_http: 947a233f40cfea55167a49f2facc18434ea117ba + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 + objective_c: 77e887b5ba1827970907e10e832eec1683f3431d -PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 +PODFILE CHECKSUM: d2243213672c3c48aae53c36642ba411a6be7309 -COCOAPODS: 1.11.2 +COCOAPODS: 1.15.2 diff --git a/pkgs/cupertino_http/example/ios/Runner.xcodeproj/project.pbxproj b/pkgs/cupertino_http/example/ios/Runner.xcodeproj/project.pbxproj index 3f233bb8b9..64fe2b898d 100644 --- a/pkgs/cupertino_http/example/ios/Runner.xcodeproj/project.pbxproj +++ b/pkgs/cupertino_http/example/ios/Runner.xcodeproj/project.pbxproj @@ -156,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -205,6 +205,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -342,7 +343,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -420,7 +421,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -469,7 +470,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/pkgs/cupertino_http/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/pkgs/cupertino_http/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a335..5e31d3d342 100644 --- a/pkgs/cupertino_http/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/pkgs/cupertino_http/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/pkgs/cupertino_http/example/pubspec.yaml b/pkgs/cupertino_http/example/pubspec.yaml index b074234bff..5d15cf4a47 100644 --- a/pkgs/cupertino_http/example/pubspec.yaml +++ b/pkgs/cupertino_http/example/pubspec.yaml @@ -31,6 +31,7 @@ dev_dependencies: http_profile: ^0.1.0 integration_test: sdk: flutter + objective_c: ^3.0.0 test: ^1.21.1 web_socket_conformance_tests: path: ../../web_socket_conformance_tests/ diff --git a/pkgs/cupertino_http/ffigen.yaml b/pkgs/cupertino_http/ffigen.yaml index 3e535933a9..9ec658d8bc 100644 --- a/pkgs/cupertino_http/ffigen.yaml +++ b/pkgs/cupertino_http/ffigen.yaml @@ -5,26 +5,23 @@ description: | Regenerate bindings with `flutter packages pub run ffigen --config ffigen.yaml`. language: 'objc' -output: 'lib/src/native_cupertino_bindings.dart' +output: + bindings: 'lib/src/native_cupertino_bindings.dart' + objc-bindings: 'darwin/cupertino_http/Sources/cupertino_http/native_cupertino_bindings.m' headers: entry-points: - - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSArray.h' - - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSData.h' - - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSDictionary.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLCache.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLRequest.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLSession.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURL.h' + - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSLock.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSProgress.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSURLResponse.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSHTTPCookieStorage.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSOperation.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSError.h' - '/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Versions/C/Headers/NSDictionary.h' - - 'src/CUPHTTPClientDelegate.h' - - 'src/CUPHTTPForwardedDelegate.h' - - 'src/CUPHTTPCompletionHelper.h' - - 'src/CUPHTTPStreamToNSInputStreamAdapter.h' + - 'darwin/cupertino_http/Sources/cupertino_http/utils.h' preamble: | // ignore_for_file: always_specify_types // ignore_for_file: camel_case_types @@ -32,6 +29,32 @@ preamble: | // ignore_for_file: unused_element // ignore_for_file: unused_field // ignore_for_file: return_of_invalid_type +objc-interfaces: + include: + - 'NSHTTPURLResponse' + - 'NSMutableURLRequest' + - 'NSOperationQueue' + - 'NSURLCache' + - 'NSURLRequest' + - 'NSURLResponse' + - 'NSURLSession' + - 'NSURLSessionConfiguration' + - 'NSURLSessionDownloadTask' + - 'NSURLSessionTask' + - 'NSURLSessionWebSocketMessage' + - 'NSURLSessionWebSocketTask' comments: style: any length: full +enums: + include: + - 'NSHTTPCookieAcceptPolicy' + - 'NSURLRequestCachePolicy' + - 'NSURLRequestNetworkServiceType' + - 'NSURLSessionMultipathServiceType' + - 'NSURLSessionResponseDisposition' + - 'NSURLSessionTaskState' + - 'NSURLSessionWebSocketMessageType' + as-int: + include: + - 'NSURLSessionWebSocketCloseCode' diff --git a/pkgs/cupertino_http/lib/src/cupertino_api.dart b/pkgs/cupertino_http/lib/src/cupertino_api.dart index 00bf1d0d22..99fb2ee041 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_api.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_api.dart @@ -27,18 +27,34 @@ library; import 'dart:async'; -import 'dart:ffi'; import 'dart:isolate'; -import 'dart:math'; -import 'dart:typed_data'; -import 'package:async/async.dart'; -import 'package:ffi/ffi.dart'; +import 'package:objective_c/objective_c.dart' as objc; import 'native_cupertino_bindings.dart' as ncb; +import 'native_cupertino_bindings.dart' + show + NSHTTPCookieAcceptPolicy, + NSURLRequestCachePolicy, + NSURLRequestNetworkServiceType, + NSURLSessionMultipathServiceType, + NSURLSessionResponseDisposition, + NSURLSessionTaskState, + NSURLSessionWebSocketMessageType; import 'utils.dart'; -abstract class _ObjectHolder { +export 'native_cupertino_bindings.dart' + show + NSHTTPCookieAcceptPolicy, + NSURLRequestCachePolicy, + NSURLRequestNetworkServiceType, + NSURLSessionMultipathServiceType, + NSURLSessionResponseDisposition, + NSURLSessionTaskState, + NSURLSessionWebSocketCloseCode, + NSURLSessionWebSocketMessageType; + +abstract class _ObjectHolder { final T _nsObject; _ObjectHolder(this._nsObject); @@ -55,183 +71,6 @@ abstract class _ObjectHolder { int get hashCode => _nsObject.hashCode; } -/// Settings for controlling whether cookies will be accepted. -/// -/// See [HTTPCookieAcceptPolicy](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1408933-httpcookieacceptpolicy). -enum HTTPCookieAcceptPolicy { - httpCookieAcceptPolicyAlways, - httpCookieAcceptPolicyNever, - httpCookieAcceptPolicyOnlyFromMainDocumentDomain, -} - -/// Controls how response data is cached. -/// -/// See [URLRequestCachePolicy](https://developer.apple.com/documentation/foundation/nsurlrequestcachepolicy). -enum URLRequestCachePolicy { - useProtocolCachePolicy, - reloadIgnoringLocalCacheData, - returnCacheDataElseLoad, - returnCacheDataDontLoad, - reloadIgnoringLocalAndRemoteCacheData, - reloadRevalidatingCacheData, -} - -// Controls how multipath TCP should be used. -// -// See [NSURLSessionMultipathServiceType](https://developer.apple.com/documentation/foundation/nsurlsessionmultipathservicetype). -enum URLSessionMultipathServiceType { - multipathServiceTypeNone, - multipathServiceTypeHandover, - multipathServiceTypeInteractive, - multipathServiceTypeAggregate, -} - -/// Controls how [URLSessionTask] execute will proceed after the response is -/// received. -/// -/// See [NSURLSessionResponseDisposition](https://developer.apple.com/documentation/foundation/nsurlsessionresponsedisposition). -enum URLSessionResponseDisposition { - urlSessionResponseCancel, - urlSessionResponseAllow, - urlSessionResponseBecomeDownload, - urlSessionResponseBecomeStream -} - -/// Provides in indication to the operating system on what type of requests -/// are being sent. -/// -/// See [NSURLRequestNetworkServiceType](https://developer.apple.com/documentation/foundation/nsurlrequestnetworkservicetype). -enum URLRequestNetworkService { - networkServiceTypeDefault, - networkServiceTypeVoIP, - networkServiceTypeVideo, - networkServiceTypeBackground, - networkServiceTypeVoice, - networkServiceTypeResponsiveData, - networkServiceTypeAVStreaming, - networkServiceTypeResponsiveAV, - networkServiceTypeCallSignaling -} - -/// The type of a WebSocket message i.e. text or data. -/// -/// See [NSURLSessionWebSocketMessageType](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessagetype) -enum URLSessionWebSocketMessageType { - urlSessionWebSocketMessageTypeData, - urlSessionWebSocketMessageTypeString, -} - -ncb.NSInputStream _streamToNSInputStream(Stream> stream) { - const maxReadAheadSize = 4096; - final queue = StreamQueue(stream); - final port = ReceivePort(); - final inputStream = ncb.CUPHTTPStreamToNSInputStreamAdapter.alloc(helperLibs) - .initWithPort_(port.sendPort.nativePort); - - late StreamSubscription s; - // Messages from `CUPHTTPStreamToNSInputStreamAdapter` indicate that the task - // is attempting to read more data but there is none available. - s = port.listen((_) async { - if (inputStream.streamStatus == ncb.NSStreamStatus.NSStreamStatusClosed) { - return; - } - - // Prevent multiple executions of this code to be in flight at once. - s.pause(); - while (await queue.hasNext && - inputStream.streamStatus != ncb.NSStreamStatus.NSStreamStatusClosed) { - late final List next; - try { - next = await queue.next; - } catch (e) { - inputStream.setError_(Error.fromCustomDomain('DartError', 0, - localizedDescription: e.toString()) - ._nsObject); - break; - } - // In practice the read length request will be large (>1MB) so, - // instead of adding that much data, try to keep the buffer - // at least `maxReadAheadSize`. - if (inputStream.addData_(Data.fromList(next)._nsObject) > - maxReadAheadSize) { - break; - } - } - if (!await queue.hasNext) { - inputStream.setDone(); - } else { - s.resume(); - } - }); - return inputStream; -} - -/// Information about a failure. -/// -/// See [NSError](https://developer.apple.com/documentation/foundation/nserror) -class Error extends _ObjectHolder implements Exception { - Error._(super.c); - - /// Create an Error from a custom domain. - factory Error.fromCustomDomain(String domain, int code, - {String? localizedDescription}) { - final d = ncb.NSMutableDictionary.alloc(linkedLibs).init(); - - if (localizedDescription != null) { - d.setObject_forKey_( - localizedDescription.toNSString(linkedLibs), - ncb.NSString.castFromPointer( - linkedLibs, linkedLibs.NSLocalizedDescriptionKey), - ); - } - final e = ncb.NSError.alloc(linkedLibs) - .initWithDomain_code_userInfo_(domain.toNSString(linkedLibs), code, d); - return Error._(e); - } - - /// The numeric code for the error e.g. -1003 (kCFURLErrorCannotFindHost). - /// - /// The interpretation of this code will depend on the domain of the error - /// which, for URL loading, will usually be - /// [`kCFErrorDomainCFNetwork`](https://developer.apple.com/documentation/cfnetwork/kcferrordomaincfnetwork). - /// - /// See [NSError.code](https://developer.apple.com/documentation/foundation/nserror/1409165-code) - int get code => _nsObject.code; - - /// The error domain, for example `"NSPOSIXErrorDomain"`. - /// - /// See [NSError.domain](https://developer.apple.com/documentation/foundation/nserror/1413924-domain) - String get domain => _nsObject.domain.toString(); - - /// A description of the error in the current locale e.g. - /// 'A server with the specified hostname could not be found.' - /// - /// See [NSError.localizedDescription](https://developer.apple.com/documentation/foundation/nserror/1414418-localizeddescription) - String? get localizedDescription => - toStringOrNull(_nsObject.localizedDescription); - - /// An explanation of the reason for the error in the current locale. - /// - /// See [NSError.localizedFailureReason](https://developer.apple.com/documentation/foundation/nserror/1412752-localizedfailurereason) - String? get localizedFailureReason => - toStringOrNull(_nsObject.localizedFailureReason); - - /// An explanation of how to fix the error in the current locale. - /// - /// See [NSError.localizedRecoverySuggestion](https://developer.apple.com/documentation/foundation/nserror/1407500-localizedrecoverysuggestion) - String? get localizedRecoverySuggestion => - toStringOrNull(_nsObject.localizedRecoverySuggestion); - - @override - String toString() => '[Error ' - 'domain=$domain ' - 'code=$code ' - 'localizedDescription=$localizedDescription ' - 'localizedFailureReason=$localizedFailureReason ' - 'localizedRecoverySuggestion=$localizedRecoverySuggestion ' - ']'; -} - /// A cache for [URLRequest]s. Used by [URLSessionConfiguration.cache]. /// /// See [NSURLCache](https://developer.apple.com/documentation/foundation/nsurlcache) @@ -242,7 +81,7 @@ class URLCache extends _ObjectHolder { /// /// See [NSURLCache.sharedURLCache](https://developer.apple.com/documentation/foundation/nsurlcache/1413377-sharedurlcache) static URLCache? get sharedURLCache { - final sharedCache = ncb.NSURLCache.getSharedURLCache(linkedLibs); + final sharedCache = ncb.NSURLCache.getSharedURLCache(); return URLCache._(sharedCache); } @@ -256,7 +95,7 @@ class URLCache extends _ObjectHolder { /// See [NSURLCache initWithMemoryCapacity:diskCapacity:directoryURL:](https://developer.apple.com/documentation/foundation/nsurlcache/3240612-initwithmemorycapacity) factory URLCache.withCapacity( {int memoryCapacity = 0, int diskCapacity = 0, Uri? directory}) => - URLCache._(ncb.NSURLCache.alloc(linkedLibs) + URLCache._(ncb.NSURLCache.alloc() .initWithMemoryCapacity_diskCapacity_directoryURL_(memoryCapacity, diskCapacity, directory == null ? null : uriToNSURL(directory))); } @@ -281,7 +120,7 @@ class URLSessionConfiguration URLSessionConfiguration._( ncb.NSURLSessionConfiguration .backgroundSessionConfigurationWithIdentifier_( - linkedLibs, identifier.toNSString(linkedLibs)), + identifier.toNSString()), isBackground: true); /// A configuration that uses caching and saves cookies and credentials. @@ -290,8 +129,7 @@ class URLSessionConfiguration factory URLSessionConfiguration.defaultSessionConfiguration() => URLSessionConfiguration._( ncb.NSURLSessionConfiguration.castFrom( - ncb.NSURLSessionConfiguration.getDefaultSessionConfiguration( - linkedLibs)), + ncb.NSURLSessionConfiguration.getDefaultSessionConfiguration()), isBackground: false); /// A session configuration that uses no persistent storage for caches, @@ -301,8 +139,7 @@ class URLSessionConfiguration factory URLSessionConfiguration.ephemeralSessionConfiguration() => URLSessionConfiguration._( ncb.NSURLSessionConfiguration.castFrom( - ncb.NSURLSessionConfiguration.getEphemeralSessionConfiguration( - linkedLibs)), + ncb.NSURLSessionConfiguration.getEphemeralSessionConfiguration()), isBackground: false); /// Whether connections over a cellular network are allowed. @@ -350,7 +187,7 @@ class URLSessionConfiguration /// See [NSURLSessionConfiguration.HTTPAdditionalHeaders](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411532-httpadditionalheaders) Map? get httpAdditionalHeaders { if (_nsObject.HTTPAdditionalHeaders case var additionalHeaders?) { - final headers = ncb.NSDictionary.castFrom(additionalHeaders); + final headers = objc.NSDictionary.castFrom(additionalHeaders); return stringNSDictionaryToMap(headers); } return null; @@ -361,10 +198,9 @@ class URLSessionConfiguration _nsObject.HTTPAdditionalHeaders = null; return; } - final d = ncb.NSMutableDictionary.alloc(linkedLibs).init(); + final d = objc.NSMutableDictionary.alloc().init(); headers.forEach((key, value) { - d.setObject_forKey_( - value.toNSString(linkedLibs), key.toNSString(linkedLibs)); + d.setObject_forKey_(value.toNSString(), key.toNSString()); }); _nsObject.HTTPAdditionalHeaders = d; } @@ -372,10 +208,10 @@ class URLSessionConfiguration /// What policy to use when deciding whether to accept cookies. /// /// See [NSURLSessionConfiguration.HTTPCookieAcceptPolicy](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1408933-httpcookieacceptpolicy). - HTTPCookieAcceptPolicy get httpCookieAcceptPolicy => - HTTPCookieAcceptPolicy.values[_nsObject.HTTPCookieAcceptPolicy]; - set httpCookieAcceptPolicy(HTTPCookieAcceptPolicy value) => - _nsObject.HTTPCookieAcceptPolicy = value.index; + NSHTTPCookieAcceptPolicy get httpCookieAcceptPolicy => + _nsObject.HTTPCookieAcceptPolicy; + set httpCookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) => + _nsObject.HTTPCookieAcceptPolicy = value; /// The maximum number of connections that a URLSession can have open to the /// same host. @@ -403,27 +239,27 @@ class URLSessionConfiguration /// What type of Multipath TCP connections to use. /// /// See [NSURLSessionConfiguration.multipathServiceType](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/2875967-multipathservicetype) - URLSessionMultipathServiceType get multipathServiceType => - URLSessionMultipathServiceType.values[_nsObject.multipathServiceType]; - set multipathServiceType(URLSessionMultipathServiceType value) => - _nsObject.multipathServiceType = value.index; + NSURLSessionMultipathServiceType get multipathServiceType => + _nsObject.multipathServiceType; + set multipathServiceType(NSURLSessionMultipathServiceType value) => + _nsObject.multipathServiceType = value; /// Provides in indication to the operating system on what type of requests /// are being sent. /// /// See [NSURLSessionConfiguration.networkServiceType](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411606-networkservicetype). - URLRequestNetworkService get networkServiceType => - URLRequestNetworkService.values[_nsObject.networkServiceType]; - set networkServiceType(URLRequestNetworkService value) => - _nsObject.networkServiceType = value.index; + NSURLRequestNetworkServiceType get networkServiceType => + _nsObject.networkServiceType; + set networkServiceType(NSURLRequestNetworkServiceType value) => + _nsObject.networkServiceType = value; /// Controls how to deal with response caching. /// /// See [NSURLSessionConfiguration.requestCachePolicy](https://developer.apple.com/documentation/foundation/nsurlsessionconfiguration/1411655-requestcachepolicy) - URLRequestCachePolicy get requestCachePolicy => - URLRequestCachePolicy.values[_nsObject.requestCachePolicy]; - set requestCachePolicy(URLRequestCachePolicy value) => - _nsObject.requestCachePolicy = value.index; + NSURLRequestCachePolicy get requestCachePolicy => + _nsObject.requestCachePolicy; + set requestCachePolicy(NSURLRequestCachePolicy value) => + _nsObject.requestCachePolicy = value; /// Whether the app should be resumed when background tasks complete. /// @@ -480,102 +316,6 @@ class URLSessionConfiguration ']'; } -/// A container for byte data. -/// -/// See [NSData](https://developer.apple.com/documentation/foundation/nsdata) -class Data extends _ObjectHolder { - Data._(super.c); - - /// A new [Data] from an existing one. - /// - /// See [NSData dataWithData:](https://developer.apple.com/documentation/foundation/nsdata/1547230-datawithdata) - factory Data.fromData(Data d) => - Data._(ncb.NSData.dataWithData_(linkedLibs, d._nsObject)); - - /// A new [Data] object containing the given bytes. - factory Data.fromList(List l) { - final buffer = calloc(l.length); - try { - buffer.asTypedList(l.length).setAll(0, l); - - final data = - ncb.NSData.dataWithBytes_length_(linkedLibs, buffer.cast(), l.length); - return Data._(data); - } finally { - calloc.free(buffer); - } - } - - /// A new [Data] object containing the given bytes. - @Deprecated('Use Data.fromList instead') - factory Data.fromUint8List(Uint8List l) = Data.fromList; - - /// The number of bytes contained in the object. - /// - /// See [NSData.length](https://developer.apple.com/documentation/foundation/nsdata/1416769-length) - int get length => _nsObject.length; - - /// The data contained in the object. - /// - /// See [NSData.bytes](https://developer.apple.com/documentation/foundation/nsdata/1410616-bytes) - Uint8List get bytes { - final bytes = _nsObject.bytes; - if (bytes.address == 0) { - return Uint8List(0); - } else { - // `NSData.byte` has the same lifetime as the `NSData` so make a copy to - // ensure memory safety. - // TODO(https://github.com/dart-lang/ffigen/issues/375): Remove copy. - return Uint8List.fromList(bytes.cast().asTypedList(length)); - } - } - - @override - String toString() { - final subrange = - length == 0 ? Uint8List(0) : bytes.sublist(0, min(length - 1, 20)); - final b = subrange.map((e) => e.toRadixString(16)).join(); - return '[Data length=$length bytes=0x$b...]'; - } -} - -/// A container for byte data. -/// -/// See [NSMutableData](https://developer.apple.com/documentation/foundation/nsmutabledata) -class MutableData extends Data { - final ncb.NSMutableData _mutableData; - - MutableData._(ncb.NSMutableData super.c) - : _mutableData = c, - super._(); - - /// A new empty [MutableData]. - factory MutableData.empty() => - MutableData._(ncb.NSMutableData.dataWithCapacity_(linkedLibs, 0)!); - - /// Appends the given data. - /// - /// See [NSMutableData appendBytes:length:](https://developer.apple.com/documentation/foundation/nsmutabledata/1407704-appendbytes) - void appendBytes(List l) { - final f = calloc(l.length); - try { - f.asTypedList(l.length).setAll(0, l); - - _mutableData.appendBytes_length_(f.cast(), l.length); - } finally { - calloc.free(f); - } - } - - @override - String toString() { - final subrange = - length == 0 ? Uint8List(0) : bytes.sublist(0, min(length - 1, 20)); - final b = subrange.map((e) => e.toRadixString(16)).join(); - return '[MutableData length=$length bytes=0x$b...]'; - } -} - /// The response associated with loading an URL. /// /// See [NSURLResponse](https://developer.apple.com/documentation/foundation/nsurlresponse) @@ -597,7 +337,7 @@ class URLResponse extends _ObjectHolder { /// The MIME type of the response. /// /// See [NSURLResponse.MIMEType](https://developer.apple.com/documentation/foundation/nsurlresponse/1411613-mimetype) - String? get mimeType => toStringOrNull(_nsObject.MIMEType); + String? get mimeType => _nsObject.MIMEType?.toString(); @override String toString() => '[URLResponse ' @@ -625,7 +365,8 @@ class HTTPURLResponse extends URLResponse { /// /// See [HTTPURLResponse.allHeaderFields](https://developer.apple.com/documentation/foundation/nshttpurlresponse/1417930-allheaderfields) Map get allHeaderFields { - final headers = ncb.NSDictionary.castFrom(_httpUrlResponse.allHeaderFields); + final headers = + objc.NSDictionary.castFrom(_httpUrlResponse.allHeaderFields); return stringNSDictionaryToMap(headers); } @@ -637,16 +378,6 @@ class HTTPURLResponse extends URLResponse { ']'; } -/// The possible states of a [URLSessionTask]. -/// -/// See [NSURLSessionTaskState](https://developer.apple.com/documentation/foundation/nsurlsessiontaskstate) -enum URLSessionTaskState { - urlSessionTaskStateRunning, - urlSessionTaskStateSuspended, - urlSessionTaskStateCanceling, - urlSessionTaskStateCompleted, -} - /// A WebSocket message. /// /// See [NSURLSessionWebSocketMessage](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessage) @@ -657,38 +388,35 @@ class URLSessionWebSocketMessage /// Create a WebSocket data message. /// /// See [NSURLSessionWebSocketMessage initWithData:](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessage/3181192-initwithdata) - factory URLSessionWebSocketMessage.fromData(Data d) => + factory URLSessionWebSocketMessage.fromData(objc.NSData d) => URLSessionWebSocketMessage._( - ncb.NSURLSessionWebSocketMessage.alloc(linkedLibs) - .initWithData_(d._nsObject)); + ncb.NSURLSessionWebSocketMessage.alloc().initWithData_(d)); /// Create a WebSocket string message. /// /// See [NSURLSessionWebSocketMessage initWitString:](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessage/3181193-initwithstring) factory URLSessionWebSocketMessage.fromString(String s) => - URLSessionWebSocketMessage._( - ncb.NSURLSessionWebSocketMessage.alloc(linkedLibs) - .initWithString_(s.toNSString(linkedLibs))); + URLSessionWebSocketMessage._(ncb.NSURLSessionWebSocketMessage.alloc() + .initWithString_(s.toNSString())); /// The data associated with the WebSocket message. /// /// Will be `null` if the [URLSessionWebSocketMessage] is a string message. /// /// See [NSURLSessionWebSocketMessage.data](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessage/3181191-data) - Data? get data => _nsObject.data == null ? null : Data._(_nsObject.data!); + objc.NSData? get data => _nsObject.data; /// The string associated with the WebSocket message. /// /// Will be `null` if the [URLSessionWebSocketMessage] is a data message. /// /// See [NSURLSessionWebSocketMessage.string](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessage/3181194-string) - String? get string => toStringOrNull(_nsObject.string); + String? get string => _nsObject.string?.toString(); /// The type of the WebSocket message. /// /// See [NSURLSessionWebSocketMessage.type](https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketmessage/3181195-type) - URLSessionWebSocketMessageType get type => - URLSessionWebSocketMessageType.values[_nsObject.type]; + NSURLSessionWebSocketMessageType get type => _nsObject.type; @override String toString() => @@ -725,7 +453,7 @@ class URLSessionTask extends _ObjectHolder { /// The current state of the task. /// /// See [NSURLSessionTask.state](https://developer.apple.com/documentation/foundation/nsurlsessiontask/1409888-state) - URLSessionTaskState get state => URLSessionTaskState.values[_nsObject.state]; + NSURLSessionTaskState get state => _nsObject.state; /// The relative priority [0, 1] that the host should use to handle the /// request. @@ -783,14 +511,7 @@ class URLSessionTask extends _ObjectHolder { /// An error indicating why the task failed or `null` on success. /// /// See [NSURLSessionTask.error](https://developer.apple.com/documentation/foundation/nsurlsessiontask/1408145-error) - Error? get error { - final error = _nsObject.error; - if (error == null) { - return null; - } else { - return Error._(error); - } - } + objc.NSError? get error => _nsObject.error; /// The user-assigned description for the task. /// @@ -801,7 +522,7 @@ class URLSessionTask extends _ObjectHolder { /// /// See [NSURLSessionTask.taskDescription](https://developer.apple.com/documentation/foundation/nsurlsessiontask/1409798-taskdescription) set taskDescription(String value) => - _nsObject.taskDescription = value.toNSString(linkedLibs); + _nsObject.taskDescription = value.toNSString(); /// A unique ID for the [URLSessionTask] in a [URLSession]. /// @@ -886,14 +607,7 @@ class URLSessionWebSocketTask extends URLSessionTask { /// If there is no close reason available this property will be null. /// /// See [NSURLSessionWebSocketTask.closeReason](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask/3181202-closereason) - Data? get closeReason { - final reason = _urlSessionWebSocketTask.closeReason; - if (reason == null) { - return null; - } else { - return Data._(reason); - } - } + objc.NSData? get closeReason => _urlSessionWebSocketTask.closeReason; /// Sends a single WebSocket message. /// @@ -903,21 +617,15 @@ class URLSessionWebSocketTask extends URLSessionTask { /// See [NSURLSessionWebSocketTask.sendMessage:completionHandler:](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask/3181205-sendmessage) Future sendMessage(URLSessionWebSocketMessage message) async { final completer = Completer(); - final completionPort = ReceivePort(); - completionPort.listen((message) { - final ep = Pointer.fromAddress(message as int); - if (ep.address == 0) { + _urlSessionWebSocketTask.sendMessage_completionHandler_(message._nsObject, + ncb.ObjCBlock_ffiVoid_NSError.listener((error) { + if (error == null) { completer.complete(); } else { - final error = Error._(ncb.NSError.castFromPointer(linkedLibs, ep, - retain: false, release: true)); completer.completeError(error); } - completionPort.close(); - }); + })); - helperLibs.CUPHTTPSendMessage(_urlSessionWebSocketTask, message._nsObject, - completionPort.sendPort.nativePort); await completer.future; } @@ -928,42 +636,26 @@ class URLSessionWebSocketTask extends URLSessionTask { /// See [NSURLSessionWebSocketTask.receiveMessageWithCompletionHandler:](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask/3181204-receivemessagewithcompletionhand) Future receiveMessage() async { final completer = Completer(); - final completionPort = ReceivePort(); - completionPort.listen((d) { - final messageAndError = d as List; - - final mp = Pointer.fromAddress(messageAndError[0] as int); - final ep = Pointer.fromAddress(messageAndError[1] as int); - - final message = mp.address == 0 - ? null - : URLSessionWebSocketMessage._( - ncb.NSURLSessionWebSocketMessage.castFromPointer(linkedLibs, mp, - retain: false, release: true)); - final error = ep.address == 0 - ? null - : Error._(ncb.NSError.castFromPointer(linkedLibs, ep, - retain: false, release: true)); - + _urlSessionWebSocketTask.receiveMessageWithCompletionHandler_( + ncb.ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.listener( + (message, error) { if (error != null) { completer.completeError(error); + } else if (message != null) { + completer.complete(URLSessionWebSocketMessage._(message)); } else { - completer.complete(message!); + completer.completeError( + StateError('one of message or error must be non-null')); } - completionPort.close(); - }); - - helperLibs.CUPHTTPReceiveMessage( - _urlSessionWebSocketTask, completionPort.sendPort.nativePort); + })); return completer.future; } /// Sends close frame with the given code and optional reason. /// /// See [NSURLSessionWebSocketTask.cancelWithCloseCode:reason:](https://developer.apple.com/documentation/foundation/nsurlsessionwebsockettask/3181200-cancelwithclosecode) - void cancelWithCloseCode(int closeCode, Data? reason) { - _urlSessionWebSocketTask.cancelWithCloseCode_reason_( - closeCode, reason?._nsObject); + void cancelWithCloseCode(int closeCode, objc.NSData? reason) { + _urlSessionWebSocketTask.cancelWithCloseCode_reason_(closeCode, reason); } @override @@ -979,8 +671,8 @@ class URLRequest extends _ObjectHolder { /// Creates a request for a URL. /// /// See [NSURLRequest.requestWithURL:](https://developer.apple.com/documentation/foundation/nsurlrequest/1528603-requestwithurl) - factory URLRequest.fromUrl(Uri uri) => URLRequest._( - ncb.NSURLRequest.requestWithURL_(linkedLibs, uriToNSURL(uri))); + factory URLRequest.fromUrl(Uri uri) => + URLRequest._(ncb.NSURLRequest.requestWithURL_(uriToNSURL(uri))); /// Returns all of the HTTP headers for the request. /// @@ -989,27 +681,19 @@ class URLRequest extends _ObjectHolder { if (_nsObject.allHTTPHeaderFields == null) { return null; } else { - final headers = ncb.NSDictionary.castFrom(_nsObject.allHTTPHeaderFields!); - return stringNSDictionaryToMap(headers); + return stringNSDictionaryToMap(_nsObject.allHTTPHeaderFields!); } } /// Controls how to deal with caching for the request. /// /// See [NSURLSession.cachePolicy](https://developer.apple.com/documentation/foundation/nsurlrequest/1407944-cachepolicy) - URLRequestCachePolicy get cachePolicy => - URLRequestCachePolicy.values[_nsObject.cachePolicy]; + NSURLRequestCachePolicy get cachePolicy => _nsObject.cachePolicy; /// The body of the request. /// /// See [NSURLRequest.HTTPBody](https://developer.apple.com/documentation/foundation/nsurlrequest/1411317-httpbody) - Data? get httpBody { - final body = _nsObject.HTTPBody; - if (body == null) { - return null; - } - return Data._(ncb.NSData.castFrom(body)); - } + objc.NSData? get httpBody => _nsObject.HTTPBody; /// The HTTP request method (e.g. 'GET'). /// @@ -1035,7 +719,7 @@ class URLRequest extends _ObjectHolder { if (nsUrl == null) { return null; } - return Uri.parse(nsUrl.absoluteString!.toString()); + return nsurlToUri(nsUrl); } @override @@ -1063,28 +747,26 @@ class MutableURLRequest extends URLRequest { /// /// See [NSMutableURLRequest.requestWithURL:](https://developer.apple.com/documentation/foundation/nsmutableurlrequest/1414617-allhttpheaderfields) factory MutableURLRequest.fromUrl(Uri uri) { - final url = ncb.NSURL - .URLWithString_(linkedLibs, uri.toString().toNSString(linkedLibs))!; - return MutableURLRequest._( - ncb.NSMutableURLRequest.requestWithURL_(linkedLibs, url)); + final url = objc.NSURL.URLWithString_(uri.toString().toNSString())!; + return MutableURLRequest._(ncb.NSMutableURLRequest.requestWithURL_(url)); } - set cachePolicy(URLRequestCachePolicy value) => - _mutableUrlRequest.cachePolicy = value.index; + set cachePolicy(NSURLRequestCachePolicy value) => + _mutableUrlRequest.cachePolicy = value; - set httpBody(Data? data) { - _mutableUrlRequest.HTTPBody = data?._nsObject; + set httpBody(objc.NSData? data) { + _mutableUrlRequest.HTTPBody = data; } /// Sets the body of the request to the given [Stream]. /// /// See [NSMutableURLRequest.HTTPBodyStream](https://developer.apple.com/documentation/foundation/nsurlrequest/1407341-httpbodystream). - set httpBodyStream(Stream> stream) { - _mutableUrlRequest.HTTPBodyStream = _streamToNSInputStream(stream); + set httpBodyStream(objc.NSInputStream stream) { + _mutableUrlRequest.HTTPBodyStream = stream; } set httpMethod(String method) { - _mutableUrlRequest.HTTPMethod = method.toNSString(linkedLibs); + _mutableUrlRequest.HTTPMethod = method.toNSString(); } set timeoutInterval(Duration interval) { @@ -1097,7 +779,7 @@ class MutableURLRequest extends URLRequest { /// See [NSMutableURLRequest setValue:forHTTPHeaderField:](https://developer.apple.com/documentation/foundation/nsmutableurlrequest/1408793-setvalue) void setValueForHttpHeaderField(String value, String field) { _mutableUrlRequest.setValue_forHTTPHeaderField_( - field.toNSString(linkedLibs), value.toNSString(linkedLibs)); + field.toNSString(), value.toNSString()); } @override @@ -1111,279 +793,195 @@ class MutableURLRequest extends URLRequest { ']'; } -/// Setup delegation for the given [task] to the given methods. -/// -/// Specifically, this causes the Objective-C-implemented delegate installed -/// with -/// [sessionWithConfiguration:delegate:delegateQueue:](https://developer.apple.com/documentation/foundation/nsurlsession/1411597-sessionwithconfiguration) -/// to send a [ncb.CUPHTTPForwardedDelegate] object to a send port, which is -/// then processed by [_setupDelegation] and forwarded to the given methods. -void _setupDelegation( - ncb.CUPHTTPClientDelegate delegate, - URLSession session, - URLSessionTask task, { - URLRequest? Function(URLSession session, URLSessionTask task, - HTTPURLResponse response, URLRequest newRequest)? - onRedirect, - URLSessionResponseDisposition Function( - URLSession session, URLSessionTask task, URLResponse response)? - onResponse, - void Function(URLSession session, URLSessionTask task, Data error)? onData, - void Function(URLSession session, URLSessionDownloadTask task, Uri uri)? - onFinishedDownloading, - void Function(URLSession session, URLSessionTask task, Error? error)? - onComplete, - void Function( - URLSession session, URLSessionWebSocketTask task, String? protocol)? - onWebSocketTaskOpened, - void Function(URLSession session, URLSessionWebSocketTask task, int closeCode, - Data? reason)? - onWebSocketTaskClosed, -}) { - final responsePort = ReceivePort(); - responsePort.listen((d) { - final message = d as List; - final messageType = message[0]; - final dp = Pointer.fromAddress(message[1] as int); - - final forwardedDelegate = ncb.CUPHTTPForwardedDelegate.castFromPointer( - helperLibs, dp, - retain: true, release: true); - - switch (messageType) { - case ncb.MessageType.RedirectMessage: - final forwardedRedirect = - ncb.CUPHTTPForwardedRedirect.castFrom(forwardedDelegate); - URLRequest? redirectRequest; - - try { - final request = URLRequest._( - ncb.NSURLRequest.castFrom(forwardedRedirect.request)); - - if (onRedirect == null) { - redirectRequest = request; - break; - } - try { - final response = HTTPURLResponse._( - ncb.NSHTTPURLResponse.castFrom(forwardedRedirect.response)); - redirectRequest = onRedirect(session, task, response, request); - } catch (e) { - // TODO(https://github.com/dart-lang/ffigen/issues/386): Package - // this exception as an `Error` and call the completion function - // with it. - } - } finally { - forwardedRedirect.finishWithRequest_(redirectRequest?._nsObject); - } - break; - case ncb.MessageType.ResponseMessage: - final forwardedResponse = - ncb.CUPHTTPForwardedResponse.castFrom(forwardedDelegate); - var disposition = - URLSessionResponseDisposition.urlSessionResponseCancel; - - try { - if (onResponse == null) { - disposition = URLSessionResponseDisposition.urlSessionResponseAllow; - break; - } - final response = - URLResponse._exactURLResponseType(forwardedResponse.response); - - try { - disposition = onResponse(session, task, response); - } catch (e) { - // TODO(https://github.com/dart-lang/ffigen/issues/386): Package - // this exception as an `Error` and call the completion function - // with it. - } - } finally { - forwardedResponse.finishWithDisposition_(disposition.index); - } - break; - case ncb.MessageType.DataMessage: - final forwardedData = - ncb.CUPHTTPForwardedData.castFrom(forwardedDelegate); - - try { - if (onData == null) { - break; - } - try { - onData( - session, task, Data._(ncb.NSData.castFrom(forwardedData.data))); - } catch (e) { - // TODO(https://github.com/dart-lang/ffigen/issues/386): Package - // this exception as an `Error` and call the completion function - // with it. - } - } finally { - forwardedData.finish(); - } - break; - case ncb.MessageType.FinishedDownloading: - final finishedDownloading = - ncb.CUPHTTPForwardedFinishedDownloading.castFrom(forwardedDelegate); - try { - if (onFinishedDownloading == null) { - break; - } - try { - onFinishedDownloading( - session, - task as URLSessionDownloadTask, - Uri.parse( - finishedDownloading.location.absoluteString!.toString())); - } catch (e) { - // TODO(https://github.com/dart-lang/ffigen/issues/386): Package - // this exception as an `Error` and call the completion function - // with it. - } - } finally { - finishedDownloading.finish(); - } - break; - case ncb.MessageType.CompletedMessage: - final forwardedComplete = - ncb.CUPHTTPForwardedComplete.castFrom(forwardedDelegate); - - try { - if (onComplete == null) { - break; - } - Error? error; - if (forwardedComplete.error != null) { - error = Error._(ncb.NSError.castFrom(forwardedComplete.error!)); - } - try { - onComplete(session, task, error); - } catch (e) { - // TODO(https://github.com/dart-lang/ffigen/issues/386): Package - // this exception as an `Error` and call the completion function - // with it. - } - } finally { - forwardedComplete.finish(); - responsePort.close(); - } - break; - case ncb.MessageType.WebSocketOpened: - final webSocketOpened = - ncb.CUPHTTPForwardedWebSocketOpened.castFrom(forwardedDelegate); - - try { - if (onWebSocketTaskOpened == null) { - break; - } - try { - onWebSocketTaskOpened(session, task as URLSessionWebSocketTask, - webSocketOpened.protocol?.toString()); - } catch (e) { - // TODO(https://github.com/dart-lang/ffigen/issues/386): Package - // this exception as an `Error` and call the completion function - // with it. - } - } finally { - webSocketOpened.finish(); - } - break; - case ncb.MessageType.WebSocketClosed: - final webSocketClosed = - ncb.CUPHTTPForwardedWebSocketClosed.castFrom(forwardedDelegate); - - try { - if (onWebSocketTaskClosed == null) { - break; - } - try { - onWebSocketTaskClosed( - session, - task as URLSessionWebSocketTask, - webSocketClosed.closeCode, - webSocketClosed.reason == null - ? null - : Data._(webSocketClosed.reason!)); - } catch (e) { - // TODO(https://github.com/dart-lang/ffigen/issues/386): Package - // this exception as an `Error` and call the completion function - // with it. - } - } finally { - webSocketClosed.finish(); - } - break; - } - }); - final config = ncb.CUPHTTPTaskConfiguration.castFrom( - ncb.CUPHTTPTaskConfiguration.alloc(helperLibs) - .initWithPort_(responsePort.sendPort.nativePort)); - - delegate.registerTask_withConfiguration_(task._nsObject, config); -} - /// A client that can make network requests to a server. /// /// See [NSURLSession](https://developer.apple.com/documentation/foundation/nsurlsession) class URLSession extends _ObjectHolder { // Provide our own native delegate to `NSURLSession` because delegates can be // called on arbitrary threads and Dart code cannot be. - static final _delegate = ncb.CUPHTTPClientDelegate.new1(helperLibs); // Indicates if the session is a background session. Copied from the // [URLSessionConfiguration._isBackground] associated with this [URLSession]. final bool _isBackground; + final bool _hasDelegate; + // Pending Dart-implemented protocols/blocks do not keep the isolate alive. + // So we create a `ReceivePort` to keep the isolate alive. + // When a new task is created in a `URLSession` with a delegate installed + // (`_hasDelegate`), `_taskCount` is incremented. When a task completes, + // `_taskCount` is decremented. When `_taskCount` is 0 then the `ReceivePort` + // is closed. + static var _taskCount = 0; + static ReceivePort? _port; + + static void _incrementTaskCount() { + _port ??= ReceivePort(); + ++_taskCount; + } - final URLRequest? Function(URLSession session, URLSessionTask task, - HTTPURLResponse response, URLRequest newRequest)? _onRedirect; - final URLSessionResponseDisposition Function( - URLSession session, URLSessionTask task, URLResponse response)? - _onResponse; - final void Function(URLSession session, URLSessionTask task, Data error)? - _onData; - final void Function(URLSession session, URLSessionTask task, Error? error)? - _onComplete; - final void Function(URLSession session, URLSessionDownloadTask task, Uri uri)? - _onFinishedDownloading; - final void Function( - URLSession session, URLSessionWebSocketTask task, String? protocol)? - _onWebSocketTaskOpened; - final void Function(URLSession session, URLSessionWebSocketTask task, - int closeCode, Data? reason)? _onWebSocketTaskClosed; + static void _decrementTaskCount() { + assert(_taskCount > 0); + assert(_port != null); + --_taskCount; + if (_taskCount == 0) { + _port?.close(); + _port = null; + } + } - URLSession._( - super.c, { - required bool isBackground, + static objc.ObjCObjectBase delegate( + bool isBackground, { URLRequest? Function(URLSession session, URLSessionTask task, HTTPURLResponse response, URLRequest newRequest)? onRedirect, - URLSessionResponseDisposition Function( + NSURLSessionResponseDisposition Function( URLSession session, URLSessionTask task, URLResponse response)? onResponse, - void Function(URLSession session, URLSessionTask task, Data error)? onData, + void Function(URLSession session, URLSessionTask task, objc.NSData error)? + onData, void Function(URLSession session, URLSessionDownloadTask task, Uri uri)? onFinishedDownloading, - void Function(URLSession session, URLSessionTask task, Error? error)? + void Function(URLSession session, URLSessionTask task, objc.NSError? error)? onComplete, void Function( URLSession session, URLSessionWebSocketTask task, String? protocol)? onWebSocketTaskOpened, void Function(URLSession session, URLSessionWebSocketTask task, - int closeCode, Data? reason)? + int closeCode, objc.NSData? reason)? onWebSocketTaskClosed, + }) { + final protoBuilder = objc.ObjCProtocolBuilder(); + + ncb.NSURLSessionDataDelegate.addToBuilderAsListener( + protoBuilder, + URLSession_task_didCompleteWithError_: (nsSession, nsTask, nsError) { + _decrementTaskCount(); + if (onComplete != null) { + onComplete( + URLSession._(nsSession, + isBackground: isBackground, hasDelegate: true), + URLSessionTask._(nsTask), + nsError); + } + }, + ); + + if (onRedirect != null) { + ncb.NSURLSessionDataDelegate.addToBuilderAsListener(protoBuilder, + // ignore: lines_longer_than_80_chars + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_: + (nsSession, nsTask, nsResponse, nsRequest, nsRequestCompleter) { + final request = URLRequest._(nsRequest); + URLRequest? redirectRequest; + + try { + final response = + URLResponse._exactURLResponseType(nsResponse) as HTTPURLResponse; + redirectRequest = onRedirect( + URLSession._(nsSession, + isBackground: isBackground, hasDelegate: true), + URLSessionTask._(nsTask), + response, + request); + nsRequestCompleter.call(redirectRequest?._nsObject); + } catch (e) { + // TODO(https://github.com/dart-lang/ffigen/issues/386): Package + // this exception as an `Error` and call the completion function + // with it. + } + }); + } + + if (onResponse != null) { + ncb.NSURLSessionDataDelegate.addToBuilderAsListener(protoBuilder, + URLSession_dataTask_didReceiveResponse_completionHandler_: + (nsSession, nsDataTask, nsResponse, nsCompletionHandler) { + final exactResponse = URLResponse._exactURLResponseType(nsResponse); + final disposition = onResponse( + URLSession._(nsSession, + isBackground: isBackground, hasDelegate: true), + URLSessionTask._(nsDataTask), + exactResponse); + nsCompletionHandler.call(disposition); + }); + } + + if (onData != null) { + ncb.NSURLSessionDataDelegate.addToBuilderAsListener(protoBuilder, + URLSession_dataTask_didReceiveData_: (nsSession, nsDataTask, nsData) { + onData( + URLSession._(nsSession, + isBackground: isBackground, hasDelegate: true), + URLSessionTask._(nsDataTask), + nsData); + }); + } + + if (onFinishedDownloading != null) { + final asyncFinishDownloading = + // ignore: lines_longer_than_80_chars + ncb.ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL + .listener((nsCondition, nsSession, nsTask, nsUrl) { + try { + onFinishedDownloading( + URLSession._(nsSession, + isBackground: isBackground, hasDelegate: true), + URLSessionDownloadTask._(nsTask), + nsurlToUri(nsUrl)); + } finally { + nsCondition.unlock(); + } + }); + + final downloadDelegate = objc.getProtocol('NSURLSessionDownloadDelegate'); + final didFinishDownloadingToURL = objc + .registerName('URLSession:downloadTask:didFinishDownloadingToURL:'); + final signature = objc.getProtocolMethodSignature( + downloadDelegate, didFinishDownloadingToURL, + isRequired: true, isInstanceMethod: true); + protoBuilder.implementMethod(didFinishDownloadingToURL, signature, + linkedLibs.adaptFinishWithLock(asyncFinishDownloading)); + } + + if (onWebSocketTaskOpened != null) { + ncb.NSURLSessionWebSocketDelegate.addToBuilderAsListener(protoBuilder, + URLSession_webSocketTask_didOpenWithProtocol_: + (nsSession, nsTask, nsProtocol) { + onWebSocketTaskOpened( + URLSession._(nsSession, + isBackground: isBackground, hasDelegate: true), + URLSessionWebSocketTask._(nsTask), + nsProtocol?.toString()); + }); + } + + if (onWebSocketTaskClosed != null) { + ncb.NSURLSessionWebSocketDelegate.addToBuilderAsListener(protoBuilder, + URLSession_webSocketTask_didCloseWithCode_reason_: + (nsSession, nsTask, closeCode, reason) { + onWebSocketTaskClosed( + URLSession._(nsSession, + isBackground: isBackground, hasDelegate: true), + URLSessionWebSocketTask._(nsTask), + closeCode, + reason); + }); + } + + return protoBuilder.build(); + } + + URLSession._( + super.c, { + required bool isBackground, + required bool hasDelegate, }) : _isBackground = isBackground, - _onRedirect = onRedirect, - _onResponse = onResponse, - _onData = onData, - _onFinishedDownloading = onFinishedDownloading, - _onComplete = onComplete, - _onWebSocketTaskOpened = onWebSocketTaskOpened, - _onWebSocketTaskClosed = onWebSocketTaskClosed; + _hasDelegate = hasDelegate; /// A client with reasonable default behavior. /// /// See [NSURLSession.sharedSession](https://developer.apple.com/documentation/foundation/nsurlsession/1409000-sharedsession) - factory URLSession.sharedSession() => URLSession.sessionWithConfiguration( - URLSessionConfiguration.defaultSessionConfiguration()); + factory URLSession.sharedSession() => + URLSession._(ncb.NSURLSession.getSharedSession(), + isBackground: false, hasDelegate: false); /// A client with a given configuration. /// @@ -1398,7 +996,7 @@ class URLSession extends _ObjectHolder { /// [URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:](https://developer.apple.com/documentation/foundation/nsurlsessiontaskdelegate/1411626-urlsession) /// /// If [onResponse] is set then it will be called whenever a valid response - /// is received. The returned [URLSessionResponseDisposition] will decide + /// is received. The returned [NSURLSessionResponseDisposition] will decide /// how the content of the response is processed. See /// [URLSession:dataTask:didReceiveResponse:completionHandler:](https://developer.apple.com/documentation/foundation/nsurlsessiondatadelegate/1410027-urlsession) /// @@ -1429,43 +1027,60 @@ class URLSession extends _ObjectHolder { URLRequest? Function(URLSession session, URLSessionTask task, HTTPURLResponse response, URLRequest newRequest)? onRedirect, - URLSessionResponseDisposition Function( + NSURLSessionResponseDisposition Function( URLSession session, URLSessionTask task, URLResponse response)? onResponse, - void Function(URLSession session, URLSessionTask task, Data error)? onData, + void Function(URLSession session, URLSessionTask task, objc.NSData data)? + onData, void Function(URLSession session, URLSessionDownloadTask task, Uri uri)? onFinishedDownloading, - void Function(URLSession session, URLSessionTask task, Error? error)? + void Function(URLSession session, URLSessionTask task, objc.NSError? error)? onComplete, void Function( URLSession session, URLSessionWebSocketTask task, String? protocol)? onWebSocketTaskOpened, void Function(URLSession session, URLSessionWebSocketTask task, - int? closeCode, Data? reason)? + int? closeCode, objc.NSData? reason)? onWebSocketTaskClosed, }) { // Avoid the complexity of simultaneous or out-of-order delegate callbacks // by only allowing callbacks to execute sequentially. // See https://developer.apple.com/forums/thread/47252 - // NOTE: this is likely to reduce throughput when there are multiple - // requests in flight because each call to a delegate waits on a lock - // that is unlocked by Dart code. - final queue = ncb.NSOperationQueue.new1(linkedLibs) + final queue = ncb.NSOperationQueue.new1() ..maxConcurrentOperationCount = 1 - ..name = - 'cupertino_http.NSURLSessionDelegateQueue'.toNSString(linkedLibs); - - return URLSession._( + ..name = 'cupertino_http.NSURLSessionDelegateQueue'.toNSString(); + + final hasDelegate = (onRedirect ?? + onResponse ?? + onData ?? + onFinishedDownloading ?? + onComplete ?? + onWebSocketTaskOpened ?? + onWebSocketTaskClosed) != + null; + + if (hasDelegate) { + return URLSession._( ncb.NSURLSession.sessionWithConfiguration_delegate_delegateQueue_( - linkedLibs, config._nsObject, _delegate, queue), + config._nsObject, + delegate(config._isBackground, + onRedirect: onRedirect, + onResponse: onResponse, + onData: onData, + onFinishedDownloading: onFinishedDownloading, + onComplete: onComplete, + onWebSocketTaskOpened: onWebSocketTaskOpened, + onWebSocketTaskClosed: onWebSocketTaskClosed), + queue), isBackground: config._isBackground, - onRedirect: onRedirect, - onResponse: onResponse, - onData: onData, - onFinishedDownloading: onFinishedDownloading, - onComplete: onComplete, - onWebSocketTaskOpened: onWebSocketTaskOpened, - onWebSocketTaskClosed: onWebSocketTaskClosed); + hasDelegate: true, + ); + } else { + return URLSession._( + ncb.NSURLSession.sessionWithConfiguration_(config._nsObject), + isBackground: config._isBackground, + hasDelegate: false); + } } /// A **copy** of the configuration for this session. @@ -1478,10 +1093,9 @@ class URLSession extends _ObjectHolder { /// A description of the session that may be useful for debugging. /// /// See [NSURLSession.sessionDescription](https://developer.apple.com/documentation/foundation/nsurlsession/1408277-sessiondescription) - String? get sessionDescription => - toStringOrNull(_nsObject.sessionDescription); + String? get sessionDescription => _nsObject.sessionDescription?.toString(); set sessionDescription(String? value) => - _nsObject.sessionDescription = value?.toNSString(linkedLibs); + _nsObject.sessionDescription = value?.toNSString(); /// Create a [URLSessionTask] that accesses a server URL. /// @@ -1489,12 +1103,9 @@ class URLSession extends _ObjectHolder { URLSessionTask dataTaskWithRequest(URLRequest request) { final task = URLSessionTask._(_nsObject.dataTaskWithRequest_(request._nsObject)); - _setupDelegation(_delegate, this, task, - onComplete: _onComplete, - onData: _onData, - onFinishedDownloading: _onFinishedDownloading, - onRedirect: _onRedirect, - onResponse: _onResponse); + if (_hasDelegate) { + _incrementTaskCount(); + } return task; } @@ -1504,39 +1115,32 @@ class URLSession extends _ObjectHolder { /// See [NSURLSession dataTaskWithRequest:completionHandler:](https://developer.apple.com/documentation/foundation/nsurlsession/1407613-datataskwithrequest) URLSessionTask dataTaskWithCompletionHandler( URLRequest request, - void Function(Data? data, HTTPURLResponse? response, Error? error) + void Function( + objc.NSData? data, URLResponse? response, objc.NSError? error) completion) { - // This method cannot be implemented by simply calling - // `dataTaskWithRequest:completionHandler:` because the completion handler - // will invoke the Dart callback on an arbitrary thread and Dart code - // cannot be run that way - // (see https://github.com/dart-lang/sdk/issues/37022). - // - // Instead, we use `dataTaskWithRequest:` and: - // 1. create a port to receive information about the request. - // 2. use a delegate to send information about the task to the port - // 3. call the user-provided completion function when we receive the - // `CompletedMessage` message type. - final task = - URLSessionTask._(_nsObject.dataTaskWithRequest_(request._nsObject)); - - HTTPURLResponse? finalResponse; - MutableData? allData; - - _setupDelegation(_delegate, this, task, onRedirect: _onRedirect, onResponse: - (URLSession session, URLSessionTask task, URLResponse response) { - finalResponse = - HTTPURLResponse._(ncb.NSHTTPURLResponse.castFrom(response._nsObject)); - return URLSessionResponseDisposition.urlSessionResponseAllow; - }, onData: (URLSession session, URLSessionTask task, Data data) { - allData ??= MutableData.empty(); - allData!.appendBytes(data.bytes); - }, onComplete: (URLSession session, URLSessionTask task, Error? error) { - completion(allData == null ? null : Data.fromData(allData!), - finalResponse, error); + if (_isBackground) { + throw UnsupportedError( + 'dataTaskWithCompletionHandler is not supported in background ' + 'sessions'); + } + final completer = + ncb.ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.listener( + (data, response, error) { + _decrementTaskCount(); + completion( + data, + response == null ? null : URLResponse._exactURLResponseType(response), + error, + ); }); - return URLSessionTask._(task._nsObject); + final task = _nsObject.dataTaskWithRequest_completionHandler_( + request._nsObject, + completer, + ); + + _incrementTaskCount(); + return URLSessionTask._(task); } /// Creates a [URLSessionDownloadTask] that downloads the data from a server @@ -1549,12 +1153,9 @@ class URLSession extends _ObjectHolder { URLSessionDownloadTask downloadTaskWithRequest(URLRequest request) { final task = URLSessionDownloadTask._( _nsObject.downloadTaskWithRequest_(request._nsObject)); - _setupDelegation(_delegate, this, task, - onComplete: _onComplete, - onData: _onData, - onFinishedDownloading: _onFinishedDownloading, - onRedirect: _onRedirect, - onResponse: _onResponse); + if (_hasDelegate) { + _incrementTaskCount(); + } return task; } @@ -1572,14 +1173,9 @@ class URLSession extends _ObjectHolder { } final task = URLSessionWebSocketTask._( _nsObject.webSocketTaskWithRequest_(request._nsObject)); - _setupDelegation(_delegate, this, task, - onComplete: _onComplete, - onData: _onData, - onFinishedDownloading: _onFinishedDownloading, - onRedirect: _onRedirect, - onResponse: _onResponse, - onWebSocketTaskOpened: _onWebSocketTaskOpened, - onWebSocketTaskClosed: _onWebSocketTaskClosed); + if (_hasDelegate) { + _incrementTaskCount(); + } return task; } @@ -1593,7 +1189,6 @@ class URLSession extends _ObjectHolder { throw UnsupportedError( 'WebSocket tasks are not supported in background sessions'); } - final URLSessionWebSocketTask task; if (protocols == null) { task = URLSessionWebSocketTask._( @@ -1603,14 +1198,9 @@ class URLSession extends _ObjectHolder { _nsObject.webSocketTaskWithURL_protocols_( uriToNSURL(uri), stringIterableToNSArray(protocols))); } - _setupDelegation(_delegate, this, task, - onComplete: _onComplete, - onData: _onData, - onFinishedDownloading: _onFinishedDownloading, - onRedirect: _onRedirect, - onResponse: _onResponse, - onWebSocketTaskOpened: _onWebSocketTaskOpened, - onWebSocketTaskClosed: _onWebSocketTaskClosed); + if (_hasDelegate) { + _incrementTaskCount(); + } return task; } diff --git a/pkgs/cupertino_http/lib/src/cupertino_client.dart b/pkgs/cupertino_http/lib/src/cupertino_client.dart index eefa1189f0..041f7f584c 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_client.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_client.dart @@ -9,6 +9,7 @@ import 'dart:typed_data'; import 'package:async/async.dart'; import 'package:http/http.dart'; import 'package:http_profile/http_profile.dart'; +import 'package:objective_c/objective_c.dart'; import 'cupertino_api.dart'; @@ -164,11 +165,11 @@ class CupertinoClient extends BaseClient { static _TaskTracker _tracker(URLSessionTask task) => _tasks[task]!; static void _onComplete( - URLSession session, URLSessionTask task, Error? error) { + URLSession session, URLSessionTask task, NSError? error) { final taskTracker = _tracker(task); if (error != null) { final exception = ClientException( - error.localizedDescription ?? 'Unknown', taskTracker.request.url); + error.localizedDescription.toString(), taskTracker.request.url); if (taskTracker.profile != null && taskTracker.profile!.requestData.endTime == null) { // Error occurred during the request. @@ -196,10 +197,10 @@ class CupertinoClient extends BaseClient { _tasks.remove(task); } - static void _onData(URLSession session, URLSessionTask task, Data data) { + static void _onData(URLSession session, URLSessionTask task, NSData data) { final taskTracker = _tracker(task); - taskTracker.responseController.add(data.bytes); - taskTracker.profile?.responseData.bodySink.add(data.bytes); + taskTracker.responseController.add(data.toList()); + taskTracker.profile?.responseData.bodySink.add(data.toList()); } static URLRequest? _onRedirect(URLSession session, URLSessionTask task, @@ -218,13 +219,13 @@ class CupertinoClient extends BaseClient { return null; } - static URLSessionResponseDisposition _onResponse( + static NSURLSessionResponseDisposition _onResponse( URLSession session, URLSessionTask task, URLResponse response) { final taskTracker = _tracker(task); taskTracker.responseCompleter.complete(response); unawaited(taskTracker.profile?.requestData.close()); - return URLSessionResponseDisposition.urlSessionResponseAllow; + return NSURLSessionResponseDisposition.NSURLSessionResponseAllow; } /// A [Client] with the default configuration. @@ -319,17 +320,17 @@ class CupertinoClient extends BaseClient { if (request is Request) { // Optimize the (typical) `Request` case since assigning to // `httpBodyStream` requires a lot of expensive setup and data passing. - urlRequest.httpBody = Data.fromList(request.bodyBytes); + urlRequest.httpBody = request.bodyBytes.toNSData(); profile?.requestData.bodySink.add(request.bodyBytes); } else if (await _hasData(stream) case (true, final s)) { // If the request is supposed to be bodyless (e.g. GET requests) // then setting `httpBodyStream` will cause the request to fail - // even if the stream is empty. if (profile == null) { - urlRequest.httpBodyStream = s; + urlRequest.httpBodyStream = s.toNSInputStream(); } else { final splitter = StreamSplitter(s); - urlRequest.httpBodyStream = splitter.split(); + urlRequest.httpBodyStream = splitter.split().toNSInputStream(); unawaited(profile.requestData.bodySink.addStream(splitter.split())); } } diff --git a/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart b/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart index dc4d748c14..124e6c5ba2 100644 --- a/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart +++ b/pkgs/cupertino_http/lib/src/cupertino_web_socket.dart @@ -6,13 +6,14 @@ import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; +import 'package:objective_c/objective_c.dart' as objc; import 'package:web_socket/web_socket.dart'; import 'cupertino_api.dart'; /// An error occurred while connecting to the peer. class ConnectionException extends WebSocketException { - final Error error; + final objc.NSError error; ConnectionException(super.message, this.error); @@ -115,7 +116,7 @@ class CupertinoWebSocket implements WebSocket { // 3. an error occurred (e.g. network failure) and `_connectionClosed` // will signal that and close `event`. webSocket._connectionClosed( - 1006, Data.fromList('abnormal close'.codeUnits)); + 1006, 'abnormal close'.codeUnits.toNSData()); } }); @@ -138,11 +139,13 @@ class CupertinoWebSocket implements WebSocket { late WebSocketEvent event; switch (value.type) { - case URLSessionWebSocketMessageType.urlSessionWebSocketMessageTypeString: + case NSURLSessionWebSocketMessageType + .NSURLSessionWebSocketMessageTypeString: event = TextDataReceived(value.string!); break; - case URLSessionWebSocketMessageType.urlSessionWebSocketMessageTypeData: - event = BinaryDataReceived(value.data!.bytes); + case NSURLSessionWebSocketMessageType + .NSURLSessionWebSocketMessageTypeData: + event = BinaryDataReceived(value.data!.toList()); break; } _events.add(event); @@ -158,28 +161,30 @@ class CupertinoWebSocket implements WebSocket { /// Close the WebSocket connection due to an error and send the /// [CloseReceived] event. void _closeConnectionWithError(Object e) { - if (e is Error) { - if (e.domain == 'NSPOSIXErrorDomain' && e.code == 57) { + if (e is objc.NSError) { + if (e.domain.toString() == 'NSPOSIXErrorDomain' && e.code == 57) { // Socket is not connected. // onWebSocketTaskClosed/onComplete will be invoked and may indicate a // close code. return; } - var (int code, String? reason) = switch ([e.domain, e.code]) { - ['NSPOSIXErrorDomain', 100] => (1002, e.localizedDescription), - _ => (1006, e.localizedDescription) + var (int code, String? reason) = switch ([e.domain.toString(), e.code]) { + ['NSPOSIXErrorDomain', 100] => ( + 1002, + e.localizedDescription.toString() + ), + _ => (1006, e.localizedDescription.toString()) }; _task.cancel(); - _connectionClosed( - code, reason == null ? null : Data.fromList(reason.codeUnits)); + _connectionClosed(code, reason.codeUnits.toNSData()); } else { throw StateError('unexpected error: $e'); } } - void _connectionClosed(int? closeCode, Data? reason) { + void _connectionClosed(int? closeCode, objc.NSData? reason) { if (!_events.isClosed) { - final closeReason = reason == null ? '' : utf8.decode(reason.bytes); + final closeReason = reason == null ? '' : utf8.decode(reason.toList()); _events ..add(CloseReceived(closeCode, closeReason)) @@ -193,7 +198,7 @@ class CupertinoWebSocket implements WebSocket { throw WebSocketConnectionClosed(); } _task - .sendMessage(URLSessionWebSocketMessage.fromData(Data.fromList(b))) + .sendMessage(URLSessionWebSocketMessage.fromData(b.toNSData())) .then((value) => value, onError: _closeConnectionWithError); } @@ -226,7 +231,7 @@ class CupertinoWebSocket implements WebSocket { unawaited(_events.close()); if (code != null) { reason = reason ?? ''; - _task.cancelWithCloseCode(code, Data.fromList(utf8.encode(reason))); + _task.cancelWithCloseCode(code, utf8.encode(reason).toNSData()); } else { _task.cancel(); } diff --git a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart index 9c3b2c40b5..a4f2e61ccf 100644 --- a/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart +++ b/pkgs/cupertino_http/lib/src/native_cupertino_bindings.dart @@ -10,7 +10,7 @@ // Generated by `package:ffigen`. // ignore_for_file: type=lint import 'dart:ffi' as ffi; -import 'package:ffi/ffi.dart' as pkg_ffi; +import 'package:objective_c/objective_c.dart' as objc; /// Bindings for the Foundation URL Loading System and supporting libraries. /// @@ -199,13 +199,13 @@ class NativeCupertinoHttp { _waitpidPtr.asFunction, int)>(); int waitid( - int arg0, - int arg1, + idtype_t arg0, + Dart__uint32_t arg1, ffi.Pointer arg2, int arg3, ) { return _waitid( - arg0, + arg0.value, arg1, arg2, arg3, @@ -214,8 +214,8 @@ class NativeCupertinoHttp { late final _waitidPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int32, id_t, ffi.Pointer, ffi.Int)>>('waitid'); + ffi.Int Function(ffi.UnsignedInt, id_t, ffi.Pointer, + ffi.Int)>>('waitid'); late final _waitid = _waitidPtr .asFunction, int)>(); @@ -599,6 +599,23 @@ class NativeCupertinoHttp { late final _realloc = _reallocPtr .asFunction Function(ffi.Pointer, int)>(); + ffi.Pointer reallocf( + ffi.Pointer __ptr, + int __size, + ) { + return _reallocf( + __ptr, + __size, + ); + } + + late final _reallocfPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Size)>>('reallocf'); + late final _reallocf = _reallocfPtr + .asFunction Function(ffi.Pointer, int)>(); + ffi.Pointer valloc( int arg0, ) { @@ -1689,91 +1706,34 @@ class NativeCupertinoHttp { _arc4random_uniformPtr.asFunction(); int atexit_b( - ObjCBlock_ffiVoid arg0, + objc.ObjCBlock arg0, ) { return _atexit_b( - arg0._id, - ); - } - - late final _atexit_bPtr = - _lookup)>>( - 'atexit_b'); - late final _atexit_b = - _atexit_bPtr.asFunction)>(); - - ffi.Pointer<_ObjCBlockDesc> _newBlockDesc1() { - final d = - pkg_ffi.calloc.allocate<_ObjCBlockDesc>(ffi.sizeOf<_ObjCBlockDesc>()); - d.ref.reserved = 0; - d.ref.size = ffi.sizeOf<_ObjCBlock>(); - d.ref.copy_helper = ffi.nullptr; - d.ref.dispose_helper = ffi.nullptr; - d.ref.signature = ffi.nullptr; - 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.flags = 0; - b.ref.reserved = 0; - 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, + arg0.ref.pointer, ); } - late final __Block_copyPtr = _lookup< + late final _atexit_bPtr = _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)>(); + ffi.Int Function(ffi.Pointer)>>('atexit_b'); + late final _atexit_b = + _atexit_bPtr.asFunction)>(); - late final _objc_releaseFinalizer2 = - ffi.NativeFinalizer(__Block_releasePtr.cast()); ffi.Pointer bsearch_b( ffi.Pointer __key, ffi.Pointer __base, int __nel, int __width, - ObjCBlock_ffiInt_ffiVoid_ffiVoid __compar, + objc.ObjCBlock< + ffi.Int Function(ffi.Pointer, ffi.Pointer)> + __compar, ) { return _bsearch_b( __key, __base, __nel, __width, - __compar._id, + __compar.ref.pointer, ); } @@ -1784,10 +1744,10 @@ class NativeCupertinoHttp { ffi.Pointer, ffi.Size, ffi.Size, - ffi.Pointer<_ObjCBlock>)>>('bsearch_b'); + ffi.Pointer)>>('bsearch_b'); late final _bsearch_b = _bsearch_bPtr.asFunction< ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer, int, int, ffi.Pointer)>(); ffi.Pointer cgetcap( ffi.Pointer arg0, @@ -2116,22 +2076,25 @@ class NativeCupertinoHttp { ffi.Pointer __base, int __nel, int __width, - ObjCBlock_ffiInt_ffiVoid_ffiVoid __compar, + objc.ObjCBlock< + ffi.Int Function(ffi.Pointer, ffi.Pointer)> + __compar, ) { return _heapsort_b( __base, __nel, __width, - __compar._id, + __compar.ref.pointer, ); } late final _heapsort_bPtr = _lookup< ffi.NativeFunction< ffi.Int Function(ffi.Pointer, ffi.Size, ffi.Size, - ffi.Pointer<_ObjCBlock>)>>('heapsort_b'); + ffi.Pointer)>>('heapsort_b'); late final _heapsort_b = _heapsort_bPtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + int Function( + ffi.Pointer, int, int, ffi.Pointer)>(); int mergesort( ffi.Pointer __base, @@ -2174,22 +2137,25 @@ class NativeCupertinoHttp { ffi.Pointer __base, int __nel, int __width, - ObjCBlock_ffiInt_ffiVoid_ffiVoid __compar, + objc.ObjCBlock< + ffi.Int Function(ffi.Pointer, ffi.Pointer)> + __compar, ) { return _mergesort_b( __base, __nel, __width, - __compar._id, + __compar.ref.pointer, ); } late final _mergesort_bPtr = _lookup< ffi.NativeFunction< ffi.Int Function(ffi.Pointer, ffi.Size, ffi.Size, - ffi.Pointer<_ObjCBlock>)>>('mergesort_b'); + ffi.Pointer)>>('mergesort_b'); late final _mergesort_b = _mergesort_bPtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + int Function( + ffi.Pointer, int, int, ffi.Pointer)>(); void psort( ffi.Pointer __base, @@ -2232,23 +2198,25 @@ class NativeCupertinoHttp { ffi.Pointer __base, int __nel, int __width, - ObjCBlock_ffiInt_ffiVoid_ffiVoid __compar, + objc.ObjCBlock< + ffi.Int Function(ffi.Pointer, ffi.Pointer)> + __compar, ) { return _psort_b( __base, __nel, __width, - __compar._id, + __compar.ref.pointer, ); } late final _psort_bPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Size, ffi.Size, - ffi.Pointer<_ObjCBlock>)>>('psort_b'); + ffi.Pointer)>>('psort_b'); late final _psort_b = _psort_bPtr.asFunction< void Function( - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer, int, int, ffi.Pointer)>(); void psort_r( ffi.Pointer __base, @@ -2298,23 +2266,25 @@ class NativeCupertinoHttp { ffi.Pointer __base, int __nel, int __width, - ObjCBlock_ffiInt_ffiVoid_ffiVoid __compar, + objc.ObjCBlock< + ffi.Int Function(ffi.Pointer, ffi.Pointer)> + __compar, ) { return _qsort_b( __base, __nel, __width, - __compar._id, + __compar.ref.pointer, ); } late final _qsort_bPtr = _lookup< ffi.NativeFunction< ffi.Void Function(ffi.Pointer, ffi.Size, ffi.Size, - ffi.Pointer<_ObjCBlock>)>>('qsort_b'); + ffi.Pointer)>>('qsort_b'); late final _qsort_b = _qsort_bPtr.asFunction< void Function( - ffi.Pointer, int, int, ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer, int, int, ffi.Pointer)>(); void qsort_r( ffi.Pointer __base, @@ -2434,23 +2404,6 @@ class NativeCupertinoHttp { _lookup>('srandomdev'); late final _srandomdev = _srandomdevPtr.asFunction(); - ffi.Pointer reallocf( - ffi.Pointer __ptr, - int __size, - ) { - return _reallocf( - __ptr, - __size, - ); - } - - late final _reallocfPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('reallocf'); - late final _reallocf = _reallocfPtr - .asFunction Function(ffi.Pointer, int)>(); - int strtonum( ffi.Pointer __numstr, int __minval, @@ -2541,7 +2494,7 @@ class NativeCupertinoHttp { .asFunction, int)>(); ffi.Pointer sel_getName( - ffi.Pointer sel, + ffi.Pointer sel, ) { return _sel_getName( sel, @@ -2550,70 +2503,71 @@ class NativeCupertinoHttp { late final _sel_getNamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('sel_getName'); - late final _sel_getName = _sel_getNamePtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sel_getName'); + late final _sel_getName = _sel_getNamePtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - ffi.Pointer sel_registerName( + ffi.Pointer sel_registerName( ffi.Pointer str, ) { - return _sel_registerName1( + return _sel_registerName( str, ); } late final _sel_registerNamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( + ffi.Pointer Function( ffi.Pointer)>>('sel_registerName'); - late final _sel_registerName1 = _sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); + late final _sel_registerName = _sel_registerNamePtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); ffi.Pointer object_getClassName( - NSObject? obj, + objc.ObjCObjectBase? obj, ) { return _object_getClassName( - obj?._id ?? ffi.nullptr, + obj?.ref.pointer ?? ffi.nullptr, ); } late final _object_getClassNamePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('object_getClassName'); - late final _object_getClassName = _object_getClassNamePtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer)>>('object_getClassName'); + late final _object_getClassName = _object_getClassNamePtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); ffi.Pointer object_getIndexedIvars( - NSObject? obj, + objc.ObjCObjectBase? obj, ) { return _object_getIndexedIvars( - obj?._id ?? ffi.nullptr, + obj?.ref.pointer ?? ffi.nullptr, ); } late final _object_getIndexedIvarsPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer)>>('object_getIndexedIvars'); - late final _object_getIndexedIvars = _object_getIndexedIvarsPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer)>>('object_getIndexedIvars'); + late final _object_getIndexedIvars = _object_getIndexedIvarsPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); bool sel_isMapped( - ffi.Pointer sel, + ffi.Pointer sel, ) { return _sel_isMapped( sel, ); } - late final _sel_isMappedPtr = - _lookup)>>( - 'sel_isMapped'); - late final _sel_isMapped = - _sel_isMappedPtr.asFunction)>(); + late final _sel_isMappedPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer)>>('sel_isMapped'); + late final _sel_isMapped = _sel_isMappedPtr + .asFunction)>(); - ffi.Pointer sel_getUid( + ffi.Pointer sel_getUid( ffi.Pointer str, ) { return _sel_getUid( @@ -2623,11 +2577,12 @@ class NativeCupertinoHttp { late final _sel_getUidPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('sel_getUid'); - late final _sel_getUid = _sel_getUidPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('sel_getUid'); + late final _sel_getUid = _sel_getUidPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - NSObject? objc_retainedObject( + objc.ObjCObjectBase? objc_retainedObject( objc_objectptr_t obj, ) { return _objc_retainedObject( @@ -2635,23 +2590,22 @@ class NativeCupertinoHttp { ).address == 0 ? null - : NSObject._( + : objc.ObjCObjectBase( _objc_retainedObject( obj, ), - this, retain: true, release: true); } late final _objc_retainedObjectPtr = _lookup< - ffi - .NativeFunction Function(objc_objectptr_t)>>( - 'objc_retainedObject'); + ffi.NativeFunction< + ffi.Pointer Function( + objc_objectptr_t)>>('objc_retainedObject'); late final _objc_retainedObject = _objc_retainedObjectPtr - .asFunction Function(objc_objectptr_t)>(); + .asFunction Function(objc_objectptr_t)>(); - NSObject? objc_unretainedObject( + objc.ObjCObjectBase? objc_unretainedObject( objc_objectptr_t obj, ) { return _objc_unretainedObject( @@ -2659,73438 +2613,46610 @@ class NativeCupertinoHttp { ).address == 0 ? null - : NSObject._( + : objc.ObjCObjectBase( _objc_unretainedObject( obj, ), - this, retain: true, release: true); } late final _objc_unretainedObjectPtr = _lookup< - ffi - .NativeFunction Function(objc_objectptr_t)>>( - 'objc_unretainedObject'); + ffi.NativeFunction< + ffi.Pointer Function( + objc_objectptr_t)>>('objc_unretainedObject'); late final _objc_unretainedObject = _objc_unretainedObjectPtr - .asFunction Function(objc_objectptr_t)>(); + .asFunction Function(objc_objectptr_t)>(); objc_objectptr_t objc_unretainedPointer( - NSObject? obj, + objc.ObjCObjectBase? obj, ) { return _objc_unretainedPointer( - obj?._id ?? ffi.nullptr, + obj?.ref.pointer ?? ffi.nullptr, ); } late final _objc_unretainedPointerPtr = _lookup< - ffi - .NativeFunction)>>( - 'objc_unretainedPointer'); + ffi.NativeFunction< + objc_objectptr_t Function( + ffi.Pointer)>>('objc_unretainedPointer'); late final _objc_unretainedPointer = _objc_unretainedPointerPtr - .asFunction)>(); + .asFunction)>(); - 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 ffi.Pointer _NSFoundationVersionNumber = + _lookup('NSFoundationVersionNumber'); - late final __sel_registerNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('sel_registerName'); - late final __sel_registerName = __sel_registerNamePtr - .asFunction Function(ffi.Pointer)>(); + double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; - 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; - } + set NSFoundationVersionNumber(double value) => + _NSFoundationVersionNumber.value = value; - ffi.Pointer _objc_getClass( - ffi.Pointer str, + objc.NSString NSStringFromSelector( + ffi.Pointer aSelector, ) { - return __objc_getClass( - str, - ); + return objc.NSString.castFromPointer( + _NSStringFromSelector( + aSelector, + ), + retain: true, + release: true); } - late final __objc_getClassPtr = _lookup< + late final _NSStringFromSelectorPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('objc_getClass'); - late final __objc_getClass = __objc_getClassPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('NSStringFromSelector'); + late final _NSStringFromSelector = _NSStringFromSelectorPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - ffi.Pointer _objc_retain( - ffi.Pointer value, + ffi.Pointer NSSelectorFromString( + objc.NSString aSelectorName, ) { - return __objc_retain( - value, + return _NSSelectorFromString( + aSelectorName.ref.pointer, ); } - late final __objc_retainPtr = _lookup< + late final _NSSelectorFromStringPtr = _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)>(); + ffi.Pointer Function( + ffi.Pointer)>>('NSSelectorFromString'); + late final _NSSelectorFromString = _NSSelectorFromStringPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - late final _objc_releaseFinalizer11 = - 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, + objc.NSString NSStringFromClass( + objc.ObjCObjectBase aClass, ) { - return __objc_msgSend_1( - obj, - sel, - ); + return objc.NSString.castFromPointer( + _NSStringFromClass( + aClass.ref.pointer, + ), + retain: true, + release: true); } - late final __objc_msgSend_1Ptr = _lookup< + late final _NSStringFromClassPtr = _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)>(); + ffi.Pointer Function( + ffi.Pointer)>>('NSStringFromClass'); + late final _NSStringFromClass = _NSStringFromClassPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - late final _sel_initialize1 = _registerName1("initialize"); - late final _sel_init1 = _registerName1("init"); - instancetype _objc_msgSend_2( - ffi.Pointer obj, - ffi.Pointer sel, + objc.ObjCObjectBase? NSClassFromString( + objc.NSString aClassName, ) { - return __objc_msgSend_2( - obj, - sel, - ); + return _NSClassFromString( + aClassName.ref.pointer, + ).address == + 0 + ? null + : objc.ObjCObjectBase( + _NSClassFromString( + aClassName.ref.pointer, + ), + retain: true, + release: true); } - late final __objc_msgSend_2Ptr = _lookup< + late final _NSClassFromStringPtr = _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)>(); + ffi.Pointer Function( + ffi.Pointer)>>('NSClassFromString'); + late final _NSClassFromString = _NSClassFromStringPtr.asFunction< + ffi.Pointer Function(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, + objc.NSString NSStringFromProtocol( + objc.Protocol proto, ) { - return __objc_msgSend_3( - obj, - sel, - zone, - ); + return objc.NSString.castFromPointer( + _NSStringFromProtocol( + proto.ref.pointer, + ), + retain: true, + release: true); } - late final __objc_msgSend_3Ptr = _lookup< + late final _NSStringFromProtocolPtr = _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>)>(); + ffi.Pointer Function( + ffi.Pointer)>>('NSStringFromProtocol'); + late final _NSStringFromProtocol = _NSStringFromProtocolPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - 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, + objc.Protocol? NSProtocolFromString( + objc.NSString namestr, ) { - return __objc_msgSend_4( - obj, - sel, - aSelector, - ); + return _NSProtocolFromString( + namestr.ref.pointer, + ).address == + 0 + ? null + : objc.Protocol.castFromPointer( + _NSProtocolFromString( + namestr.ref.pointer, + ), + retain: true, + release: true); } - late final __objc_msgSend_4Ptr = _lookup< + late final _NSProtocolFromStringPtr = _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)>(); + ffi.Pointer Function( + ffi.Pointer)>>('NSProtocolFromString'); + late final _NSProtocolFromString = _NSProtocolFromStringPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - bool _objc_msgSend_0( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer clazz, + ffi.Pointer NSGetSizeAndAlignment( + ffi.Pointer typePtr, + ffi.Pointer sizep, + ffi.Pointer alignp, ) { - return __objc_msgSend_0( - obj, - sel, - clazz, + return _NSGetSizeAndAlignment( + typePtr, + sizep, + alignp, ); } - late final __objc_msgSend_0Ptr = _lookup< + late final _NSGetSizeAndAlignmentPtr = _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)>(); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('NSGetSizeAndAlignment'); + late final _NSGetSizeAndAlignment = _NSGetSizeAndAlignmentPtr.asFunction< + ffi.Pointer 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, + void NSLog( + objc.NSString format, ) { - return __objc_msgSend_5( - obj, - sel, - protocol, + return _NSLog( + format.ref.pointer, ); } - 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 _NSLogPtr = _lookup< + ffi.NativeFunction)>>( + 'NSLog'); + late final _NSLog = + _NSLogPtr.asFunction)>(); - late final _sel_methodForSelector_1 = _registerName1("methodForSelector:"); - IMP _objc_msgSend_6( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, + void NSLogv( + objc.NSString format, + va_list args, ) { - return __objc_msgSend_6( - obj, - sel, - aSelector, + return _NSLogv( + format.ref.pointer, + args, ); } - late final __objc_msgSend_6Ptr = _lookup< + late final _NSLogvPtr = _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)>(); + ffi.Void Function(ffi.Pointer, va_list)>>('NSLogv'); + late final _NSLogv = _NSLogvPtr.asFunction< + void Function(ffi.Pointer, va_list)>(); - 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 ffi.Pointer _NSNotFound = + _lookup('NSNotFound'); - 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)>(); + DartNSInteger get NSNotFound => _NSNotFound.value; - late final _sel_forwardingTargetForSelector_1 = - _registerName1("forwardingTargetForSelector:"); - ffi.Pointer _objc_msgSend_8( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, + ffi.Pointer _Block_copy( + ffi.Pointer aBlock, ) { - return __objc_msgSend_8( - obj, - sel, - aSelector, + return __Block_copy( + aBlock, ); } - late final __objc_msgSend_8Ptr = _lookup< + late final __Block_copyPtr = _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)>(); + ffi.Pointer Function( + ffi.Pointer)>>('_Block_copy'); + late final __Block_copy = __Block_copyPtr + .asFunction Function(ffi.Pointer)>(); - late final _class_NSInvocation1 = _getClass1("NSInvocation"); - late final _sel_forwardInvocation_1 = _registerName1("forwardInvocation:"); - void _objc_msgSend_9( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anInvocation, + void _Block_release( + ffi.Pointer aBlock, ) { - return __objc_msgSend_9( - obj, - sel, - anInvocation, + return __Block_release( + aBlock, ); } - late final __objc_msgSend_9Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_9 = __objc_msgSend_9Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __Block_releasePtr = + _lookup)>>( + '_Block_release'); + late final __Block_release = + __Block_releasePtr.asFunction)>(); - late final _class_NSMethodSignature1 = _getClass1("NSMethodSignature"); - late final _sel_methodSignatureForSelector_1 = - _registerName1("methodSignatureForSelector:"); - ffi.Pointer _objc_msgSend_10( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, + void _Block_object_assign( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __objc_msgSend_10( - obj, - sel, - aSelector, + return __Block_object_assign( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_10Ptr = _lookup< + late final __Block_object_assignPtr = _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.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('_Block_object_assign'); + late final __Block_object_assign = __Block_object_assignPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_instanceMethodSignatureForSelector_1 = - _registerName1("instanceMethodSignatureForSelector:"); - late final _sel_allowsWeakReference1 = _registerName1("allowsWeakReference"); - bool _objc_msgSend_11( - ffi.Pointer obj, - ffi.Pointer sel, + void _Block_object_dispose( + ffi.Pointer arg0, + int arg1, ) { - return __objc_msgSend_11( - obj, - sel, + return __Block_object_dispose( + arg0, + arg1, ); } - late final __objc_msgSend_11Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_11 = __objc_msgSend_11Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer)>(); - - 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_hash1 = _registerName1("hash"); - int _objc_msgSend_12( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_12( - obj, - sel, - ); - } + late final __Block_object_disposePtr = _lookup< + ffi + .NativeFunction, ffi.Int)>>( + '_Block_object_dispose'); + late final __Block_object_dispose = __Block_object_disposePtr + .asFunction, int)>(); - late final __objc_msgSend_12Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_12 = __objc_msgSend_12Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer>> + __NSConcreteGlobalBlock = + _lookup>>('_NSConcreteGlobalBlock'); - late final _sel_superclass1 = _registerName1("superclass"); - late final _sel_class1 = _registerName1("class"); - late final _class_NSString1 = _getClass1("NSString"); - late final _sel_length1 = _registerName1("length"); - late final _sel_characterAtIndex_1 = _registerName1("characterAtIndex:"); - int _objc_msgSend_13( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_13( - obj, - sel, - index, - ); - } + ffi.Pointer> get _NSConcreteGlobalBlock => + __NSConcreteGlobalBlock.value; - late final __objc_msgSend_13Ptr = _lookup< - ffi.NativeFunction< - unichar Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_13 = __objc_msgSend_13Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + set _NSConcreteGlobalBlock(ffi.Pointer> value) => + __NSConcreteGlobalBlock.value = value; - late final _class_NSCoder1 = _getClass1("NSCoder"); - late final _sel_initWithCoder_1 = _registerName1("initWithCoder:"); - instancetype _objc_msgSend_14( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, - ) { - return __objc_msgSend_14( - obj, - sel, - coder, - ); - } + late final ffi.Pointer>> + __NSConcreteStackBlock = + _lookup>>('_NSConcreteStackBlock'); - late final __objc_msgSend_14Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_14 = __objc_msgSend_14Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer> get _NSConcreteStackBlock => + __NSConcreteStackBlock.value; - late final _sel_substringFromIndex_1 = _registerName1("substringFromIndex:"); - ffi.Pointer _objc_msgSend_15( - ffi.Pointer obj, - ffi.Pointer sel, - int from, - ) { - return __objc_msgSend_15( - obj, - sel, - from, - ); + set _NSConcreteStackBlock(ffi.Pointer> value) => + __NSConcreteStackBlock.value = value; + + void Debugger() { + return _Debugger(); } - late final __objc_msgSend_15Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_15 = __objc_msgSend_15Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _DebuggerPtr = + _lookup>('Debugger'); + late final _Debugger = _DebuggerPtr.asFunction(); - late final _sel_substringToIndex_1 = _registerName1("substringToIndex:"); - late final _sel_substringWithRange_1 = _registerName1("substringWithRange:"); - ffi.Pointer _objc_msgSend_16( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, + void DebugStr( + ConstStr255Param debuggerMsg, ) { - return __objc_msgSend_16( - obj, - sel, - range, + return _DebugStr( + debuggerMsg, ); } - late final __objc_msgSend_16Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_16 = __objc_msgSend_16Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); + late final _DebugStrPtr = + _lookup>( + 'DebugStr'); + late final _DebugStr = + _DebugStrPtr.asFunction(); - late final _sel_getCharacters_range_1 = - _registerName1("getCharacters:range:"); - void _objc_msgSend_17( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - NSRange range, - ) { - return __objc_msgSend_17( - obj, - sel, - buffer, - range, - ); + void SysBreak() { + return _SysBreak(); } - late final __objc_msgSend_17Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_17 = __objc_msgSend_17Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); + late final _SysBreakPtr = + _lookup>('SysBreak'); + late final _SysBreak = _SysBreakPtr.asFunction(); - late final _sel_compare_1 = _registerName1("compare:"); - int _objc_msgSend_18( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, + void SysBreakStr( + ConstStr255Param debuggerMsg, ) { - return __objc_msgSend_18( - obj, - sel, - string, + return _SysBreakStr( + debuggerMsg, ); } - late final __objc_msgSend_18Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 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)>(); + late final _SysBreakStrPtr = + _lookup>( + 'SysBreakStr'); + late final _SysBreakStr = + _SysBreakStrPtr.asFunction(); - late final _sel_compare_options_1 = _registerName1("compare:options:"); - int _objc_msgSend_19( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, + void SysBreakFunc( + ConstStr255Param debuggerMsg, ) { - return __objc_msgSend_19( - obj, - sel, - string, - mask, + return _SysBreakFunc( + debuggerMsg, ); } - late final __objc_msgSend_19Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_19 = __objc_msgSend_19Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final _SysBreakFuncPtr = + _lookup>( + 'SysBreakFunc'); + late final _SysBreakFunc = + _SysBreakFuncPtr.asFunction(); - late final _sel_compare_options_range_1 = - _registerName1("compare:options:range:"); - int _objc_msgSend_20( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - NSRange rangeOfReceiverToCompare, - ) { - return __objc_msgSend_20( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - ); - } + late final ffi.Pointer _kCFCoreFoundationVersionNumber = + _lookup('kCFCoreFoundationVersionNumber'); - late final __objc_msgSend_20Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_20 = __objc_msgSend_20Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); + double get kCFCoreFoundationVersionNumber => + _kCFCoreFoundationVersionNumber.value; - late final _sel_compare_options_range_locale_1 = - _registerName1("compare:options:range:locale:"); - int _objc_msgSend_21( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer string, - int mask, - NSRange rangeOfReceiverToCompare, - ffi.Pointer locale, - ) { - return __objc_msgSend_21( - obj, - sel, - string, - mask, - rangeOfReceiverToCompare, - locale, - ); - } + set kCFCoreFoundationVersionNumber(double value) => + _kCFCoreFoundationVersionNumber.value = value; - late final __objc_msgSend_21Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_21 = __objc_msgSend_21Ptr.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:"); - bool _objc_msgSend_22( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - ) { - return __objc_msgSend_22( - obj, - sel, - aString, - ); - } + late final ffi.Pointer _kCFNotFound = + _lookup('kCFNotFound'); - late final __objc_msgSend_22Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_22 = __objc_msgSend_22Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + DartCFIndex get kCFNotFound => _kCFNotFound.value; - 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_23( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - int mask, + CFRange __CFRangeMake( + int loc, + int len, ) { - return __objc_msgSend_23( - obj, - sel, - str, - mask, + return ___CFRangeMake( + loc, + len, ); } - late final __objc_msgSend_23Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer 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, ffi.Pointer, int)>(); + late final ___CFRangeMakePtr = + _lookup>( + '__CFRangeMake'); + late final ___CFRangeMake = + ___CFRangeMakePtr.asFunction(); - 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_24( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer str, - ) { - return __objc_msgSend_24( - obj, - sel, - str, - ); + int CFNullGetTypeID() { + return _CFNullGetTypeID(); } - late final __objc_msgSend_24Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_24 = __objc_msgSend_24Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _CFNullGetTypeIDPtr = + _lookup>('CFNullGetTypeID'); + late final _CFNullGetTypeID = + _CFNullGetTypeIDPtr.asFunction(); - late final _sel_rangeOfString_1 = _registerName1("rangeOfString:"); - late final _sel_rangeOfString_options_1 = - _registerName1("rangeOfString:options:"); - NSRange _objc_msgSend_25( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - ) { - return __objc_msgSend_25( - obj, - sel, - searchString, - mask, - ); - } + late final ffi.Pointer _kCFNull = _lookup('kCFNull'); - late final __objc_msgSend_25Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_25 = __objc_msgSend_25Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + CFNullRef get kCFNull => _kCFNull.value; - late final _sel_rangeOfString_options_range_1 = - _registerName1("rangeOfString:options:range:"); - NSRange _objc_msgSend_26( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - NSRange rangeOfReceiverToSearch, - ) { - return __objc_msgSend_26( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - ); - } + late final ffi.Pointer _kCFAllocatorDefault = + _lookup('kCFAllocatorDefault'); - late final __objc_msgSend_26Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_26 = __objc_msgSend_26Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); + CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - late final _class_NSLocale1 = _getClass1("NSLocale"); - late final _sel_rangeOfString_options_range_locale_1 = - _registerName1("rangeOfString:options:range:locale:"); - NSRange _objc_msgSend_27( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchString, - int mask, - NSRange rangeOfReceiverToSearch, - ffi.Pointer locale, - ) { - return __objc_msgSend_27( - obj, - sel, - searchString, - mask, - rangeOfReceiverToSearch, - locale, - ); - } + late final ffi.Pointer _kCFAllocatorSystemDefault = + _lookup('kCFAllocatorSystemDefault'); - late final __objc_msgSend_27Ptr = _lookup< - ffi.NativeFunction< - NSRange Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_27 = __objc_msgSend_27Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange, ffi.Pointer)>(); + CFAllocatorRef get kCFAllocatorSystemDefault => + _kCFAllocatorSystemDefault.value; - late final _class_NSCharacterSet1 = _getClass1("NSCharacterSet"); - late final _sel_controlCharacterSet1 = _registerName1("controlCharacterSet"); - ffi.Pointer _objc_msgSend_28( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_28( - obj, - sel, - ); - } + late final ffi.Pointer _kCFAllocatorMalloc = + _lookup('kCFAllocatorMalloc'); - late final __objc_msgSend_28Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_28 = __objc_msgSend_28Ptr.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_29( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange aRange, - ) { - return __objc_msgSend_29( - obj, - sel, - aRange, - ); - } + CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - late final __objc_msgSend_29Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_29 = __objc_msgSend_29Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); + late final ffi.Pointer _kCFAllocatorMallocZone = + _lookup('kCFAllocatorMallocZone'); - late final _sel_characterSetWithCharactersInString_1 = - _registerName1("characterSetWithCharactersInString:"); - ffi.Pointer _objc_msgSend_30( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - ) { - return __objc_msgSend_30( - obj, - sel, - aString, - ); - } + CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - late final __objc_msgSend_30Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_30 = __objc_msgSend_30Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _kCFAllocatorNull = + _lookup('kCFAllocatorNull'); - late final _class_NSData1 = _getClass1("NSData"); - late final _sel_bytes1 = _registerName1("bytes"); - ffi.Pointer _objc_msgSend_31( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_31( - obj, - sel, - ); - } + CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - late final __objc_msgSend_31Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_31 = __objc_msgSend_31Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _kCFAllocatorUseContext = + _lookup('kCFAllocatorUseContext'); - late final _sel_description1 = _registerName1("description"); - ffi.Pointer _objc_msgSend_32( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_32( - obj, - sel, - ); + CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; + + int CFAllocatorGetTypeID() { + return _CFAllocatorGetTypeID(); } - late final __objc_msgSend_32Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_32 = __objc_msgSend_32Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFAllocatorGetTypeIDPtr = + _lookup>('CFAllocatorGetTypeID'); + late final _CFAllocatorGetTypeID = + _CFAllocatorGetTypeIDPtr.asFunction(); - late final _sel_getBytes_length_1 = _registerName1("getBytes:length:"); - void _objc_msgSend_33( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int length, + void CFAllocatorSetDefault( + CFAllocatorRef allocator, ) { - return __objc_msgSend_33( - obj, - sel, - buffer, - length, + return _CFAllocatorSetDefault( + allocator, ); } - late final __objc_msgSend_33Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_33 = __objc_msgSend_33Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_getBytes_range_1 = _registerName1("getBytes:range:"); - void _objc_msgSend_34( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - NSRange range, - ) { - return __objc_msgSend_34( - obj, - sel, - buffer, - range, - ); + late final _CFAllocatorSetDefaultPtr = + _lookup>( + 'CFAllocatorSetDefault'); + late final _CFAllocatorSetDefault = + _CFAllocatorSetDefaultPtr.asFunction(); + + CFAllocatorRef CFAllocatorGetDefault() { + return _CFAllocatorGetDefault(); } - late final __objc_msgSend_34Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(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, NSRange)>(); + late final _CFAllocatorGetDefaultPtr = + _lookup>( + 'CFAllocatorGetDefault'); + late final _CFAllocatorGetDefault = + _CFAllocatorGetDefaultPtr.asFunction(); - late final _sel_isEqualToData_1 = _registerName1("isEqualToData:"); - bool _objc_msgSend_35( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, + CFAllocatorRef CFAllocatorCreate( + CFAllocatorRef allocator, + ffi.Pointer context, ) { - return __objc_msgSend_35( - obj, - sel, - other, + return _CFAllocatorCreate( + allocator, + context, ); } - late final __objc_msgSend_35Ptr = _lookup< + late final _CFAllocatorCreatePtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_35 = __objc_msgSend_35Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + CFAllocatorRef Function(CFAllocatorRef, + ffi.Pointer)>>('CFAllocatorCreate'); + late final _CFAllocatorCreate = _CFAllocatorCreatePtr.asFunction< + CFAllocatorRef Function( + CFAllocatorRef, ffi.Pointer)>(); - late final _sel_subdataWithRange_1 = _registerName1("subdataWithRange:"); - ffi.Pointer _objc_msgSend_36( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, + ffi.Pointer CFAllocatorAllocate( + CFAllocatorRef allocator, + int size, + int hint, ) { - return __objc_msgSend_36( - obj, - sel, - range, + return _CFAllocatorAllocate( + allocator, + size, + hint, ); } - late final __objc_msgSend_36Ptr = _lookup< + late final _CFAllocatorAllocatePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_36 = __objc_msgSend_36Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); + ffi.Pointer Function( + CFAllocatorRef, CFIndex, CFOptionFlags)>>('CFAllocatorAllocate'); + late final _CFAllocatorAllocate = _CFAllocatorAllocatePtr.asFunction< + ffi.Pointer Function(CFAllocatorRef, int, int)>(); - late final _sel_writeToFile_atomically_1 = - _registerName1("writeToFile:atomically:"); - bool _objc_msgSend_37( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool useAuxiliaryFile, + ffi.Pointer CFAllocatorReallocate( + CFAllocatorRef allocator, + ffi.Pointer ptr, + int newsize, + int hint, ) { - return __objc_msgSend_37( - obj, - sel, - path, - useAuxiliaryFile, + return _CFAllocatorReallocate( + allocator, + ptr, + newsize, + hint, ); } - late final __objc_msgSend_37Ptr = _lookup< + late final _CFAllocatorReallocatePtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_37 = __objc_msgSend_37Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + ffi.Pointer Function(CFAllocatorRef, ffi.Pointer, + CFIndex, CFOptionFlags)>>('CFAllocatorReallocate'); + late final _CFAllocatorReallocate = _CFAllocatorReallocatePtr.asFunction< + ffi.Pointer Function( + CFAllocatorRef, ffi.Pointer, int, int)>(); - late final _class_NSURL1 = _getClass1("NSURL"); - late final _sel_initWithScheme_host_path_1 = - _registerName1("initWithScheme:host:path:"); - instancetype _objc_msgSend_38( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer scheme, - ffi.Pointer host, - ffi.Pointer path, + void CFAllocatorDeallocate( + CFAllocatorRef allocator, + ffi.Pointer ptr, ) { - return __objc_msgSend_38( - obj, - sel, - scheme, - host, - path, - ); - } - - late final __objc_msgSend_38Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_38 = __objc_msgSend_38Ptr.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_39( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_39( - obj, - sel, - path, - isDir, - baseURL, + return _CFAllocatorDeallocate( + allocator, + ptr, ); } - late final __objc_msgSend_39Ptr = _lookup< + late final _CFAllocatorDeallocatePtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_39 = __objc_msgSend_39Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool, ffi.Pointer)>(); + ffi.Void Function( + CFAllocatorRef, ffi.Pointer)>>('CFAllocatorDeallocate'); + late final _CFAllocatorDeallocate = _CFAllocatorDeallocatePtr.asFunction< + void Function(CFAllocatorRef, ffi.Pointer)>(); - late final _sel_initFileURLWithPath_relativeToURL_1 = - _registerName1("initFileURLWithPath:relativeToURL:"); - instancetype _objc_msgSend_40( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer baseURL, + int CFAllocatorGetPreferredSizeForSize( + CFAllocatorRef allocator, + int size, + int hint, ) { - return __objc_msgSend_40( - obj, - sel, - path, - baseURL, + return _CFAllocatorGetPreferredSizeForSize( + allocator, + size, + hint, ); } - late final __objc_msgSend_40Ptr = _lookup< + late final _CFAllocatorGetPreferredSizeForSizePtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_40 = __objc_msgSend_40Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + CFIndex Function(CFAllocatorRef, CFIndex, + CFOptionFlags)>>('CFAllocatorGetPreferredSizeForSize'); + late final _CFAllocatorGetPreferredSizeForSize = + _CFAllocatorGetPreferredSizeForSizePtr.asFunction< + int Function(CFAllocatorRef, int, int)>(); - late final _sel_initFileURLWithPath_isDirectory_1 = - _registerName1("initFileURLWithPath:isDirectory:"); - instancetype _objc_msgSend_41( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, + void CFAllocatorGetContext( + CFAllocatorRef allocator, + ffi.Pointer context, ) { - return __objc_msgSend_41( - obj, - sel, - path, - isDir, + return _CFAllocatorGetContext( + allocator, + context, ); } - late final __objc_msgSend_41Ptr = _lookup< + late final _CFAllocatorGetContextPtr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_41 = __objc_msgSend_41Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + ffi.Void Function(CFAllocatorRef, + ffi.Pointer)>>('CFAllocatorGetContext'); + late final _CFAllocatorGetContext = _CFAllocatorGetContextPtr.asFunction< + void Function(CFAllocatorRef, ffi.Pointer)>(); - late final _sel_initFileURLWithPath_1 = - _registerName1("initFileURLWithPath:"); - instancetype _objc_msgSend_42( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, + int CFGetTypeID( + CFTypeRef cf, ) { - return __objc_msgSend_42( - obj, - sel, - path, + return _CFGetTypeID( + cf, ); } - 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 _CFGetTypeIDPtr = + _lookup>('CFGetTypeID'); + late final _CFGetTypeID = + _CFGetTypeIDPtr.asFunction(); - late final _sel_fileURLWithPath_isDirectory_relativeToURL_1 = - _registerName1("fileURLWithPath:isDirectory:relativeToURL:"); - ffi.Pointer _objc_msgSend_43( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, + CFStringRef CFCopyTypeIDDescription( + int type_id, ) { - return __objc_msgSend_43( - obj, - sel, - path, - isDir, - baseURL, + return _CFCopyTypeIDDescription( + type_id, ); } - late final __objc_msgSend_43Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_43 = __objc_msgSend_43Ptr.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_44( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_44( - obj, - sel, - path, - baseURL, + late final _CFCopyTypeIDDescriptionPtr = + _lookup>( + 'CFCopyTypeIDDescription'); + late final _CFCopyTypeIDDescription = + _CFCopyTypeIDDescriptionPtr.asFunction(); + + CFTypeRef CFRetain( + CFTypeRef cf, + ) { + return _CFRetain( + cf, ); } - late final __objc_msgSend_44Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - 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, - ffi.Pointer)>(); + late final _CFRetainPtr = + _lookup>('CFRetain'); + late final _CFRetain = + _CFRetainPtr.asFunction(); - late final _sel_fileURLWithPath_isDirectory_1 = - _registerName1("fileURLWithPath:isDirectory:"); - ffi.Pointer _objc_msgSend_45( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, + void CFRelease( + CFTypeRef cf, ) { - return __objc_msgSend_45( - obj, - sel, - path, - isDir, + return _CFRelease( + cf, ); } - late final __objc_msgSend_45Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_45 = __objc_msgSend_45Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); + late final _CFReleasePtr = + _lookup>('CFRelease'); + late final _CFRelease = _CFReleasePtr.asFunction(); - late final _sel_fileURLWithPath_1 = _registerName1("fileURLWithPath:"); - ffi.Pointer _objc_msgSend_46( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, + CFTypeRef CFAutorelease( + CFTypeRef arg, ) { - return __objc_msgSend_46( - obj, - sel, - path, + return _CFAutorelease( + arg, ); } - late final __objc_msgSend_46Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_46 = __objc_msgSend_46Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _CFAutoreleasePtr = + _lookup>( + 'CFAutorelease'); + late final _CFAutorelease = + _CFAutoreleasePtr.asFunction(); - late final _sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1 = - _registerName1( - "initFileURLWithFileSystemRepresentation:isDirectory:relativeToURL:"); - instancetype _objc_msgSend_47( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, + int CFGetRetainCount( + CFTypeRef cf, ) { - return __objc_msgSend_47( - obj, - sel, - path, - isDir, - baseURL, + return _CFGetRetainCount( + cf, ); } - late final __objc_msgSend_47Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_47 = __objc_msgSend_47Ptr.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_48( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool isDir, - ffi.Pointer baseURL, + late final _CFGetRetainCountPtr = + _lookup>( + 'CFGetRetainCount'); + late final _CFGetRetainCount = + _CFGetRetainCountPtr.asFunction(); + + int CFEqual( + CFTypeRef cf1, + CFTypeRef cf2, ) { - return __objc_msgSend_48( - obj, - sel, - path, - isDir, - baseURL, + return _CFEqual( + cf1, + cf2, ); } - late final __objc_msgSend_48Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_48 = __objc_msgSend_48Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - ffi.Pointer)>(); + late final _CFEqualPtr = + _lookup>( + 'CFEqual'); + late final _CFEqual = + _CFEqualPtr.asFunction(); - late final _sel_initWithString_1 = _registerName1("initWithString:"); - instancetype _objc_msgSend_49( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URLString, + int CFHash( + CFTypeRef cf, ) { - return __objc_msgSend_49( - obj, - sel, - URLString, + return _CFHash( + cf, ); } - late final __objc_msgSend_49Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_49 = __objc_msgSend_49Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _CFHashPtr = + _lookup>('CFHash'); + late final _CFHash = _CFHashPtr.asFunction(); - late final _sel_initWithString_relativeToURL_1 = - _registerName1("initWithString:relativeToURL:"); - instancetype _objc_msgSend_50( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URLString, - ffi.Pointer baseURL, + CFStringRef CFCopyDescription( + CFTypeRef cf, ) { - return __objc_msgSend_50( - obj, - sel, - URLString, - baseURL, + return _CFCopyDescription( + cf, ); } - late final __objc_msgSend_50Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_50 = __objc_msgSend_50Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _CFCopyDescriptionPtr = + _lookup>( + 'CFCopyDescription'); + late final _CFCopyDescription = + _CFCopyDescriptionPtr.asFunction(); - late final _sel_URLWithString_1 = _registerName1("URLWithString:"); - late final _sel_URLWithString_relativeToURL_1 = - _registerName1("URLWithString:relativeToURL:"); - late final _sel_initWithString_encodingInvalidCharacters_1 = - _registerName1("initWithString:encodingInvalidCharacters:"); - instancetype _objc_msgSend_51( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URLString, - bool encodingInvalidCharacters, + CFAllocatorRef CFGetAllocator( + CFTypeRef cf, ) { - return __objc_msgSend_51( - obj, - sel, - URLString, - encodingInvalidCharacters, + return _CFGetAllocator( + cf, ); } - late final __objc_msgSend_51Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_51 = __objc_msgSend_51Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + late final _CFGetAllocatorPtr = + _lookup>( + 'CFGetAllocator'); + late final _CFGetAllocator = + _CFGetAllocatorPtr.asFunction(); - late final _sel_URLWithString_encodingInvalidCharacters_1 = - _registerName1("URLWithString:encodingInvalidCharacters:"); - late final _sel_initWithDataRepresentation_relativeToURL_1 = - _registerName1("initWithDataRepresentation:relativeToURL:"); - instancetype _objc_msgSend_52( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer baseURL, + CFTypeRef CFMakeCollectable( + CFTypeRef cf, ) { - return __objc_msgSend_52( - obj, - sel, - data, - baseURL, + return _CFMakeCollectable( + cf, ); } - late final __objc_msgSend_52Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_52 = __objc_msgSend_52Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _CFMakeCollectablePtr = + _lookup>( + 'CFMakeCollectable'); + late final _CFMakeCollectable = + _CFMakeCollectablePtr.asFunction(); - late final _sel_URLWithDataRepresentation_relativeToURL_1 = - _registerName1("URLWithDataRepresentation:relativeToURL:"); - ffi.Pointer _objc_msgSend_53( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_53( - obj, - sel, - data, - baseURL, - ); + ffi.Pointer NSDefaultMallocZone() { + return _NSDefaultMallocZone(); } - late final __objc_msgSend_53Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_53 = __objc_msgSend_53Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + late final _NSDefaultMallocZonePtr = + _lookup Function()>>( + 'NSDefaultMallocZone'); + late final _NSDefaultMallocZone = + _NSDefaultMallocZonePtr.asFunction Function()>(); - 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_54( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer NSCreateZone( + int startSize, + int granularity, + bool canFree, ) { - return __objc_msgSend_54( - obj, - sel, + return _NSCreateZone( + startSize, + granularity, + canFree, ); } - late final __objc_msgSend_54Ptr = _lookup< + late final _NSCreateZonePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_54 = __objc_msgSend_54Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + NSUInteger, NSUInteger, ffi.Bool)>>('NSCreateZone'); + late final _NSCreateZone = _NSCreateZonePtr.asFunction< + ffi.Pointer Function(int, int, bool)>(); - late final _sel_absoluteString1 = _registerName1("absoluteString"); - ffi.Pointer _objc_msgSend_55( - ffi.Pointer obj, - ffi.Pointer sel, + void NSRecycleZone( + ffi.Pointer zone, ) { - return __objc_msgSend_55( - obj, - sel, + return _NSRecycleZone( + zone, ); } - late final __objc_msgSend_55Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_55 = __objc_msgSend_55Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _NSRecycleZonePtr = + _lookup)>>( + 'NSRecycleZone'); + late final _NSRecycleZone = + _NSRecycleZonePtr.asFunction)>(); - late final _sel_relativeString1 = _registerName1("relativeString"); - late final _sel_baseURL1 = _registerName1("baseURL"); - ffi.Pointer _objc_msgSend_56( - ffi.Pointer obj, - ffi.Pointer sel, + void NSSetZoneName( + ffi.Pointer zone, + objc.NSString name, ) { - return __objc_msgSend_56( - obj, - sel, + return _NSSetZoneName( + zone, + name.ref.pointer, ); } - late final __objc_msgSend_56Ptr = _lookup< + late final _NSSetZoneNamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_56 = __objc_msgSend_56Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>('NSSetZoneName'); + late final _NSSetZoneName = _NSSetZoneNamePtr.asFunction< + void 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"); - ffi.Pointer _objc_msgSend_57( - ffi.Pointer obj, - ffi.Pointer sel, + objc.NSString NSZoneName( + ffi.Pointer zone, ) { - return __objc_msgSend_57( - obj, - sel, - ); + return objc.NSString.castFromPointer( + _NSZoneName( + zone, + ), + retain: true, + release: true); } - late final __objc_msgSend_57Ptr = _lookup< + late final _NSZoneNamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_57 = __objc_msgSend_57Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer)>>('NSZoneName'); + late final _NSZoneName = _NSZoneNamePtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - late final _sel_initWithBytes_objCType_1 = - _registerName1("initWithBytes:objCType:"); - instancetype _objc_msgSend_58( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, + ffi.Pointer NSZoneFromPointer( + ffi.Pointer ptr, ) { - return __objc_msgSend_58( - obj, - sel, - value, - type, + return _NSZoneFromPointer( + ptr, ); } - 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 _NSZoneFromPointerPtr = _lookup< + ffi + .NativeFunction Function(ffi.Pointer)>>( + 'NSZoneFromPointer'); + late final _NSZoneFromPointer = _NSZoneFromPointerPtr.asFunction< + ffi.Pointer Function(ffi.Pointer)>(); - late final _sel_valueWithBytes_objCType_1 = - _registerName1("valueWithBytes:objCType:"); - ffi.Pointer _objc_msgSend_59( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer type, + ffi.Pointer NSZoneMalloc( + ffi.Pointer zone, + int size, ) { - return __objc_msgSend_59( - obj, - sel, - value, - type, + return _NSZoneMalloc( + zone, + size, ); } - late final __objc_msgSend_59Ptr = _lookup< + late final _NSZoneMallocPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_59 = __objc_msgSend_59Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, NSUInteger)>>('NSZoneMalloc'); + late final _NSZoneMalloc = _NSZoneMallocPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int)>(); - late final _sel_value_withObjCType_1 = _registerName1("value:withObjCType:"); - late final _sel_valueWithNonretainedObject_1 = - _registerName1("valueWithNonretainedObject:"); - ffi.Pointer _objc_msgSend_60( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, + ffi.Pointer NSZoneCalloc( + ffi.Pointer zone, + int numElems, + int byteSize, ) { - return __objc_msgSend_60( - obj, - sel, - anObject, + return _NSZoneCalloc( + zone, + numElems, + byteSize, ); } - late final __objc_msgSend_60Ptr = _lookup< + late final _NSZoneCallocPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_60 = __objc_msgSend_60Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, NSUInteger, NSUInteger)>>('NSZoneCalloc'); + late final _NSZoneCalloc = _NSZoneCallocPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); - late final _sel_nonretainedObjectValue1 = - _registerName1("nonretainedObjectValue"); - ffi.Pointer _objc_msgSend_61( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer NSZoneRealloc( + ffi.Pointer zone, + ffi.Pointer ptr, + int size, ) { - return __objc_msgSend_61( - obj, - sel, + return _NSZoneRealloc( + zone, + ptr, + size, ); } - late final __objc_msgSend_61Ptr = _lookup< + late final _NSZoneReallocPtr = _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)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>('NSZoneRealloc'); + late final _NSZoneRealloc = _NSZoneReallocPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_valueWithPointer_1 = _registerName1("valueWithPointer:"); - ffi.Pointer _objc_msgSend_62( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pointer, + void NSZoneFree( + ffi.Pointer zone, + ffi.Pointer ptr, ) { - return __objc_msgSend_62( - obj, - sel, - pointer, + return _NSZoneFree( + zone, + ptr, ); } - late final __objc_msgSend_62Ptr = _lookup< + late final _NSZoneFreePtr = _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)>(); + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('NSZoneFree'); + late final _NSZoneFree = _NSZoneFreePtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer)>(); - late final _sel_pointerValue1 = _registerName1("pointerValue"); - late final _sel_isEqualToValue_1 = _registerName1("isEqualToValue:"); - bool _objc_msgSend_63( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer NSAllocateCollectable( + int size, + int options, ) { - return __objc_msgSend_63( - obj, - sel, - value, + return _NSAllocateCollectable( + size, + options, ); } - late final __objc_msgSend_63Ptr = _lookup< + late final _NSAllocateCollectablePtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_63 = __objc_msgSend_63Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + NSUInteger, NSUInteger)>>('NSAllocateCollectable'); + late final _NSAllocateCollectable = _NSAllocateCollectablePtr.asFunction< + ffi.Pointer Function(int, int)>(); - late final _sel_getValue_1 = _registerName1("getValue:"); - void _objc_msgSend_64( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer NSReallocateCollectable( + ffi.Pointer ptr, + int size, + int options, ) { - return __objc_msgSend_64( - obj, - sel, - value, + return _NSReallocateCollectable( + ptr, + size, + options, ); } - late final __objc_msgSend_64Ptr = _lookup< + late final _NSReallocateCollectablePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_64 = __objc_msgSend_64Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, NSUInteger, + NSUInteger)>>('NSReallocateCollectable'); + late final _NSReallocateCollectable = _NSReallocateCollectablePtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); - late final _sel_valueWithRange_1 = _registerName1("valueWithRange:"); - ffi.Pointer _objc_msgSend_65( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_65( - obj, - sel, - range, - ); + int NSPageSize() { + return _NSPageSize(); } - late final __objc_msgSend_65Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_65 = __objc_msgSend_65Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); + late final _NSPageSizePtr = + _lookup>('NSPageSize'); + late final _NSPageSize = _NSPageSizePtr.asFunction(); - late final _sel_rangeValue1 = _registerName1("rangeValue"); - NSRange _objc_msgSend_66( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_66( - obj, - sel, - ); + int NSLogPageSize() { + return _NSLogPageSize(); } - late final __objc_msgSend_66Ptr = _lookup< - ffi.NativeFunction< - NSRange Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_66 = __objc_msgSend_66Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer)>(); + late final _NSLogPageSizePtr = + _lookup>('NSLogPageSize'); + late final _NSLogPageSize = _NSLogPageSizePtr.asFunction(); - late final _sel_initWithChar_1 = _registerName1("initWithChar:"); - ffi.Pointer _objc_msgSend_67( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int NSRoundUpToMultipleOfPageSize( + int bytes, ) { - return __objc_msgSend_67( - obj, - sel, - value, + return _NSRoundUpToMultipleOfPageSize( + bytes, ); } - late final __objc_msgSend_67Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Char)>>('objc_msgSend'); - late final __objc_msgSend_67 = __objc_msgSend_67Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _NSRoundUpToMultipleOfPageSizePtr = + _lookup>( + 'NSRoundUpToMultipleOfPageSize'); + late final _NSRoundUpToMultipleOfPageSize = + _NSRoundUpToMultipleOfPageSizePtr.asFunction(); - late final _sel_initWithUnsignedChar_1 = - _registerName1("initWithUnsignedChar:"); - ffi.Pointer _objc_msgSend_68( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int NSRoundDownToMultipleOfPageSize( + int bytes, ) { - return __objc_msgSend_68( - obj, - sel, - value, + return _NSRoundDownToMultipleOfPageSize( + bytes, ); } - late final __objc_msgSend_68Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedChar)>>('objc_msgSend'); - late final __objc_msgSend_68 = __objc_msgSend_68Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _NSRoundDownToMultipleOfPageSizePtr = + _lookup>( + 'NSRoundDownToMultipleOfPageSize'); + late final _NSRoundDownToMultipleOfPageSize = + _NSRoundDownToMultipleOfPageSizePtr.asFunction(); - late final _sel_initWithShort_1 = _registerName1("initWithShort:"); - ffi.Pointer _objc_msgSend_69( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + ffi.Pointer NSAllocateMemoryPages( + int bytes, ) { - return __objc_msgSend_69( - obj, - sel, - value, + return _NSAllocateMemoryPages( + bytes, ); } - late final __objc_msgSend_69Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Short)>>('objc_msgSend'); - late final __objc_msgSend_69 = __objc_msgSend_69Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_initWithUnsignedShort_1 = - _registerName1("initWithUnsignedShort:"); - ffi.Pointer _objc_msgSend_70( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_70( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_70Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedShort)>>('objc_msgSend'); - late final __objc_msgSend_70 = __objc_msgSend_70Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _NSAllocateMemoryPagesPtr = + _lookup Function(NSUInteger)>>( + 'NSAllocateMemoryPages'); + late final _NSAllocateMemoryPages = _NSAllocateMemoryPagesPtr.asFunction< + ffi.Pointer Function(int)>(); - late final _sel_initWithInt_1 = _registerName1("initWithInt:"); - ffi.Pointer _objc_msgSend_71( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + void NSDeallocateMemoryPages( + ffi.Pointer ptr, + int bytes, ) { - return __objc_msgSend_71( - obj, - sel, - value, + return _NSDeallocateMemoryPages( + ptr, + bytes, ); } - late final __objc_msgSend_71Ptr = _lookup< + late final _NSDeallocateMemoryPagesPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>('objc_msgSend'); - late final __objc_msgSend_71 = __objc_msgSend_71Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Void Function( + ffi.Pointer, NSUInteger)>>('NSDeallocateMemoryPages'); + late final _NSDeallocateMemoryPages = _NSDeallocateMemoryPagesPtr.asFunction< + void Function(ffi.Pointer, int)>(); - late final _sel_initWithUnsignedInt_1 = - _registerName1("initWithUnsignedInt:"); - ffi.Pointer _objc_msgSend_72( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + void NSCopyMemoryPages( + ffi.Pointer source, + ffi.Pointer dest, + int bytes, ) { - return __objc_msgSend_72( - obj, - sel, - value, + return _NSCopyMemoryPages( + source, + dest, + bytes, ); } - late final __objc_msgSend_72Ptr = _lookup< + late final _NSCopyMemoryPagesPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedInt)>>('objc_msgSend'); - late final __objc_msgSend_72 = __objc_msgSend_72Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + NSUInteger)>>('NSCopyMemoryPages'); + late final _NSCopyMemoryPages = _NSCopyMemoryPagesPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_initWithLong_1 = _registerName1("initWithLong:"); - ffi.Pointer _objc_msgSend_73( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_73( - obj, - sel, - value, - ); + int NSRealMemoryAvailable() { + return _NSRealMemoryAvailable(); } - late final __objc_msgSend_73Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Long)>>('objc_msgSend'); - late final __objc_msgSend_73 = __objc_msgSend_73Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _NSRealMemoryAvailablePtr = + _lookup>( + 'NSRealMemoryAvailable'); + late final _NSRealMemoryAvailable = + _NSRealMemoryAvailablePtr.asFunction(); - late final _sel_initWithUnsignedLong_1 = - _registerName1("initWithUnsignedLong:"); - ffi.Pointer _objc_msgSend_74( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + objc.ObjCObjectBase NSAllocateObject( + objc.ObjCObjectBase aClass, + DartNSUInteger extraBytes, + ffi.Pointer zone, ) { - return __objc_msgSend_74( - obj, - sel, - value, - ); + return objc.ObjCObjectBase( + _NSAllocateObject( + aClass.ref.pointer, + extraBytes, + zone, + ), + retain: true, + release: true); } - late final __objc_msgSend_74Ptr = _lookup< + late final _NSAllocateObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLong)>>('objc_msgSend'); - late final __objc_msgSend_74 = __objc_msgSend_74Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, + NSUInteger, ffi.Pointer)>>('NSAllocateObject'); + late final _NSAllocateObject = _NSAllocateObjectPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer)>(); - late final _sel_initWithLongLong_1 = _registerName1("initWithLongLong:"); - ffi.Pointer _objc_msgSend_75( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + void NSDeallocateObject( + objc.ObjCObjectBase object, ) { - return __objc_msgSend_75( - obj, - sel, - value, + return _NSDeallocateObject( + object.ref.pointer, ); } - late final __objc_msgSend_75Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.LongLong)>>('objc_msgSend'); - late final __objc_msgSend_75 = __objc_msgSend_75Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _NSDeallocateObjectPtr = _lookup< + ffi.NativeFunction)>>( + 'NSDeallocateObject'); + late final _NSDeallocateObject = _NSDeallocateObjectPtr.asFunction< + void Function(ffi.Pointer)>(); - late final _sel_initWithUnsignedLongLong_1 = - _registerName1("initWithUnsignedLongLong:"); - ffi.Pointer _objc_msgSend_76( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + objc.ObjCObjectBase NSCopyObject( + objc.ObjCObjectBase object, + DartNSUInteger extraBytes, + ffi.Pointer zone, ) { - return __objc_msgSend_76( - obj, - sel, - value, - ); + return objc.ObjCObjectBase( + _NSCopyObject( + object.ref.pointer, + extraBytes, + zone, + ), + retain: true, + release: true); } - late final __objc_msgSend_76Ptr = _lookup< + late final _NSCopyObjectPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.UnsignedLongLong)>>('objc_msgSend'); - late final __objc_msgSend_76 = __objc_msgSend_76Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Pointer, + NSUInteger, ffi.Pointer)>>('NSCopyObject'); + late final _NSCopyObject = _NSCopyObjectPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer)>(); - late final _sel_initWithFloat_1 = _registerName1("initWithFloat:"); - ffi.Pointer _objc_msgSend_77( - ffi.Pointer obj, - ffi.Pointer sel, - double value, + bool NSShouldRetainWithZone( + objc.ObjCObjectBase anObject, + ffi.Pointer requestedZone, ) { - return __objc_msgSend_77( - obj, - sel, - value, + return _NSShouldRetainWithZone( + anObject.ref.pointer, + requestedZone, ); } - late final __objc_msgSend_77Ptr = _lookup< + late final _NSShouldRetainWithZonePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_77 = __objc_msgSend_77Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>>('NSShouldRetainWithZone'); + late final _NSShouldRetainWithZone = _NSShouldRetainWithZonePtr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer)>(); - late final _sel_initWithDouble_1 = _registerName1("initWithDouble:"); - ffi.Pointer _objc_msgSend_78( - ffi.Pointer obj, - ffi.Pointer sel, - double value, + void NSIncrementExtraRefCount( + objc.ObjCObjectBase object, ) { - return __objc_msgSend_78( - obj, - sel, - value, + return _NSIncrementExtraRefCount( + object.ref.pointer, ); } - late final __objc_msgSend_78Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_78 = __objc_msgSend_78Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, double)>(); + late final _NSIncrementExtraRefCountPtr = _lookup< + ffi.NativeFunction)>>( + 'NSIncrementExtraRefCount'); + late final _NSIncrementExtraRefCount = _NSIncrementExtraRefCountPtr + .asFunction)>(); - late final _sel_initWithBool_1 = _registerName1("initWithBool:"); - ffi.Pointer _objc_msgSend_79( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, + bool NSDecrementExtraRefCountWasZero( + objc.ObjCObjectBase object, ) { - return __objc_msgSend_79( - obj, - sel, - value, + return _NSDecrementExtraRefCountWasZero( + object.ref.pointer, ); } - late final __objc_msgSend_79Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_79 = __objc_msgSend_79Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); + late final _NSDecrementExtraRefCountWasZeroPtr = _lookup< + ffi.NativeFunction)>>( + 'NSDecrementExtraRefCountWasZero'); + late final _NSDecrementExtraRefCountWasZero = + _NSDecrementExtraRefCountWasZeroPtr.asFunction< + bool Function(ffi.Pointer)>(); - late final _sel_initWithInteger_1 = _registerName1("initWithInteger:"); - late final _sel_initWithUnsignedInteger_1 = - _registerName1("initWithUnsignedInteger:"); - late final _sel_charValue1 = _registerName1("charValue"); - int _objc_msgSend_80( - ffi.Pointer obj, - ffi.Pointer sel, + DartNSUInteger NSExtraRefCount( + objc.ObjCObjectBase object, ) { - return __objc_msgSend_80( - obj, - sel, + return _NSExtraRefCount( + object.ref.pointer, ); } - late final __objc_msgSend_80Ptr = _lookup< - ffi.NativeFunction< - ffi.Char Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_80 = __objc_msgSend_80Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final _NSExtraRefCountPtr = _lookup< + ffi + .NativeFunction)>>( + 'NSExtraRefCount'); + late final _NSExtraRefCount = _NSExtraRefCountPtr.asFunction< + int Function(ffi.Pointer)>(); - late final _sel_unsignedCharValue1 = _registerName1("unsignedCharValue"); - int _objc_msgSend_81( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_81( - obj, - sel, - ); - } + late final ffi.Pointer + _NSSystemClockDidChangeNotification = + _lookup('NSSystemClockDidChangeNotification'); - late final __objc_msgSend_81Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedChar Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_81 = __objc_msgSend_81Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + DartNSNotificationName get NSSystemClockDidChangeNotification => + objc.NSString.castFromPointer(_NSSystemClockDidChangeNotification.value, + retain: true, release: true); - late final _sel_shortValue1 = _registerName1("shortValue"); - int _objc_msgSend_82( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_82( - obj, - sel, - ); + set NSSystemClockDidChangeNotification(DartNSNotificationName value) { + objc.NSString.castFromPointer(_NSSystemClockDidChangeNotification.value, + retain: false, release: true) + .ref + .release(); + _NSSystemClockDidChangeNotification.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_82Ptr = _lookup< - ffi.NativeFunction< - ffi.Short Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_82 = __objc_msgSend_82Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSHTTPCookieManagerAcceptPolicyChangedNotification = + _lookup( + 'NSHTTPCookieManagerAcceptPolicyChangedNotification'); - late final _sel_unsignedShortValue1 = _registerName1("unsignedShortValue"); - int _objc_msgSend_83( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_83( - obj, - sel, - ); + DartNSNotificationName + get NSHTTPCookieManagerAcceptPolicyChangedNotification => + objc.NSString.castFromPointer( + _NSHTTPCookieManagerAcceptPolicyChangedNotification.value, + retain: true, + release: true); + + set NSHTTPCookieManagerAcceptPolicyChangedNotification( + DartNSNotificationName value) { + objc.NSString.castFromPointer( + _NSHTTPCookieManagerAcceptPolicyChangedNotification.value, + retain: false, + release: true) + .ref + .release(); + _NSHTTPCookieManagerAcceptPolicyChangedNotification.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_83Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedShort Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_83 = __objc_msgSend_83Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSHTTPCookieManagerCookiesChangedNotification = + _lookup( + 'NSHTTPCookieManagerCookiesChangedNotification'); - late final _sel_intValue1 = _registerName1("intValue"); - int _objc_msgSend_84( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_84( - obj, - sel, - ); + DartNSNotificationName get NSHTTPCookieManagerCookiesChangedNotification => + objc.NSString.castFromPointer( + _NSHTTPCookieManagerCookiesChangedNotification.value, + retain: true, + release: true); + + set NSHTTPCookieManagerCookiesChangedNotification( + DartNSNotificationName value) { + objc.NSString.castFromPointer( + _NSHTTPCookieManagerCookiesChangedNotification.value, + retain: false, + release: true) + .ref + .release(); + _NSHTTPCookieManagerCookiesChangedNotification.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_84Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_84 = __objc_msgSend_84Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressEstimatedTimeRemainingKey = + _lookup('NSProgressEstimatedTimeRemainingKey'); - late final _sel_unsignedIntValue1 = _registerName1("unsignedIntValue"); - int _objc_msgSend_85( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_85( - obj, - sel, - ); + DartNSProgressUserInfoKey get NSProgressEstimatedTimeRemainingKey => + objc.NSString.castFromPointer(_NSProgressEstimatedTimeRemainingKey.value, + retain: true, release: true); + + set NSProgressEstimatedTimeRemainingKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressEstimatedTimeRemainingKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressEstimatedTimeRemainingKey.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_85Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_85 = __objc_msgSend_85Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _NSProgressThroughputKey = + _lookup('NSProgressThroughputKey'); - late final _sel_longValue1 = _registerName1("longValue"); - int _objc_msgSend_86( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_86( - obj, - sel, - ); + DartNSProgressUserInfoKey get NSProgressThroughputKey => + objc.NSString.castFromPointer(_NSProgressThroughputKey.value, + retain: true, release: true); + + set NSProgressThroughputKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressThroughputKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressThroughputKey.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_86Ptr = _lookup< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_86 = __objc_msgSend_86Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer _NSProgressKindFile = + _lookup('NSProgressKindFile'); - late final _sel_unsignedLongValue1 = _registerName1("unsignedLongValue"); - late final _sel_longLongValue1 = _registerName1("longLongValue"); - int _objc_msgSend_87( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_87( - obj, - sel, - ); + DartNSProgressKind get NSProgressKindFile => + objc.NSString.castFromPointer(_NSProgressKindFile.value, + retain: true, release: true); + + set NSProgressKindFile(DartNSProgressKind value) { + objc.NSString.castFromPointer(_NSProgressKindFile.value, + retain: false, release: true) + .ref + .release(); + _NSProgressKindFile.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_87Ptr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_87 = __objc_msgSend_87Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileOperationKindKey = + _lookup('NSProgressFileOperationKindKey'); - late final _sel_unsignedLongLongValue1 = - _registerName1("unsignedLongLongValue"); - int _objc_msgSend_88( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_88( - obj, - sel, - ); + DartNSProgressUserInfoKey get NSProgressFileOperationKindKey => + objc.NSString.castFromPointer(_NSProgressFileOperationKindKey.value, + retain: true, release: true); + + set NSProgressFileOperationKindKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressFileOperationKindKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileOperationKindKey.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_88Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_88 = __objc_msgSend_88Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileOperationKindDownloading = + _lookup( + 'NSProgressFileOperationKindDownloading'); - late final _sel_floatValue1 = _registerName1("floatValue"); - late final _objc_msgSend_useVariants1 = ffi.Abi.current() == ffi.Abi.iosX64 || - ffi.Abi.current() == ffi.Abi.macosX64; - double _objc_msgSend_89( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_89( - obj, - sel, - ); + DartNSProgressFileOperationKind get NSProgressFileOperationKindDownloading => + objc.NSString.castFromPointer( + _NSProgressFileOperationKindDownloading.value, + retain: true, + release: true); + + set NSProgressFileOperationKindDownloading( + DartNSProgressFileOperationKind value) { + objc.NSString.castFromPointer(_NSProgressFileOperationKindDownloading.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileOperationKindDownloading.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_89Ptr = _lookup< - ffi.NativeFunction< - ffi.Float Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_89 = __objc_msgSend_89Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileOperationKindDecompressingAfterDownloading = + _lookup( + 'NSProgressFileOperationKindDecompressingAfterDownloading'); - double _objc_msgSend_89_fpret( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_89_fpret( - obj, - sel, - ); + DartNSProgressFileOperationKind + get NSProgressFileOperationKindDecompressingAfterDownloading => + objc.NSString.castFromPointer( + _NSProgressFileOperationKindDecompressingAfterDownloading.value, + retain: true, + release: true); + + set NSProgressFileOperationKindDecompressingAfterDownloading( + DartNSProgressFileOperationKind value) { + objc.NSString.castFromPointer( + _NSProgressFileOperationKindDecompressingAfterDownloading.value, + retain: false, + release: true) + .ref + .release(); + _NSProgressFileOperationKindDecompressingAfterDownloading.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_89_fpretPtr = _lookup< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); - late final __objc_msgSend_89_fpret = __objc_msgSend_89_fpretPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileOperationKindReceiving = + _lookup( + 'NSProgressFileOperationKindReceiving'); - late final _sel_doubleValue1 = _registerName1("doubleValue"); - double _objc_msgSend_90( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_90( - obj, - sel, - ); + DartNSProgressFileOperationKind get NSProgressFileOperationKindReceiving => + objc.NSString.castFromPointer(_NSProgressFileOperationKindReceiving.value, + retain: true, release: true); + + set NSProgressFileOperationKindReceiving( + DartNSProgressFileOperationKind value) { + objc.NSString.castFromPointer(_NSProgressFileOperationKindReceiving.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileOperationKindReceiving.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_90Ptr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_90 = __objc_msgSend_90Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileOperationKindCopying = + _lookup( + 'NSProgressFileOperationKindCopying'); - double _objc_msgSend_90_fpret( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_90_fpret( - obj, - sel, - ); + DartNSProgressFileOperationKind get NSProgressFileOperationKindCopying => + objc.NSString.castFromPointer(_NSProgressFileOperationKindCopying.value, + retain: true, release: true); + + set NSProgressFileOperationKindCopying( + DartNSProgressFileOperationKind value) { + objc.NSString.castFromPointer(_NSProgressFileOperationKindCopying.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileOperationKindCopying.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_90_fpretPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer)>>('objc_msgSend_fpret'); - late final __objc_msgSend_90_fpret = __objc_msgSend_90_fpretPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileOperationKindUploading = + _lookup( + 'NSProgressFileOperationKindUploading'); - 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_91( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherNumber, - ) { - return __objc_msgSend_91( - obj, - sel, - otherNumber, - ); + DartNSProgressFileOperationKind get NSProgressFileOperationKindUploading => + objc.NSString.castFromPointer(_NSProgressFileOperationKindUploading.value, + retain: true, release: true); + + set NSProgressFileOperationKindUploading( + DartNSProgressFileOperationKind value) { + objc.NSString.castFromPointer(_NSProgressFileOperationKindUploading.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileOperationKindUploading.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_91Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_91 = __objc_msgSend_91Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileOperationKindDuplicating = + _lookup( + 'NSProgressFileOperationKindDuplicating'); - late final _sel_isEqualToNumber_1 = _registerName1("isEqualToNumber:"); - bool _objc_msgSend_92( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer number, - ) { - return __objc_msgSend_92( - obj, - sel, - number, - ); + DartNSProgressFileOperationKind get NSProgressFileOperationKindDuplicating => + objc.NSString.castFromPointer( + _NSProgressFileOperationKindDuplicating.value, + retain: true, + release: true); + + set NSProgressFileOperationKindDuplicating( + DartNSProgressFileOperationKind value) { + objc.NSString.castFromPointer(_NSProgressFileOperationKindDuplicating.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileOperationKindDuplicating.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_92Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_92 = __objc_msgSend_92Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final ffi.Pointer _NSProgressFileURLKey = + _lookup('NSProgressFileURLKey'); - late final _sel_descriptionWithLocale_1 = - _registerName1("descriptionWithLocale:"); - ffi.Pointer _objc_msgSend_93( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - ) { - return __objc_msgSend_93( - obj, - sel, - locale, - ); + DartNSProgressUserInfoKey get NSProgressFileURLKey => + objc.NSString.castFromPointer(_NSProgressFileURLKey.value, + retain: true, release: true); + + set NSProgressFileURLKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressFileURLKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileURLKey.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_93Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_93 = __objc_msgSend_93Ptr.asFunction< - ffi.Pointer 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"); - ffi.Pointer _objc_msgSend_94( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_94( - obj, - sel, - ); + late final ffi.Pointer _NSProgressFileTotalCountKey = + _lookup('NSProgressFileTotalCountKey'); + + DartNSProgressUserInfoKey get NSProgressFileTotalCountKey => + objc.NSString.castFromPointer(_NSProgressFileTotalCountKey.value, + retain: true, release: true); + + set NSProgressFileTotalCountKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressFileTotalCountKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileTotalCountKey.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_94Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_94 = __objc_msgSend_94Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - 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_95( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferLength, - ) { - return __objc_msgSend_95( - obj, - sel, - buffer, - maxBufferLength, - ); - } - - late final __objc_msgSend_95Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_95 = __objc_msgSend_95Ptr.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_isFileReferenceURL1 = _registerName1("isFileReferenceURL"); - late final _sel_fileReferenceURL1 = _registerName1("fileReferenceURL"); - late final _sel_filePathURL1 = _registerName1("filePathURL"); - late final _class_NSError1 = _getClass1("NSError"); - late final _class_NSDictionary1 = _getClass1("NSDictionary"); - late final _sel_count1 = _registerName1("count"); - late final _sel_objectForKey_1 = _registerName1("objectForKey:"); - ffi.Pointer _objc_msgSend_96( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aKey, - ) { - return __objc_msgSend_96( - obj, - sel, - aKey, - ); + late final ffi.Pointer + _NSProgressFileCompletedCountKey = + _lookup('NSProgressFileCompletedCountKey'); + + DartNSProgressUserInfoKey get NSProgressFileCompletedCountKey => + objc.NSString.castFromPointer(_NSProgressFileCompletedCountKey.value, + retain: true, release: true); + + set NSProgressFileCompletedCountKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressFileCompletedCountKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileCompletedCountKey.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_96Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_96 = __objc_msgSend_96Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileAnimationImageKey = + _lookup('NSProgressFileAnimationImageKey'); - late final _class_NSEnumerator1 = _getClass1("NSEnumerator"); - late final _sel_nextObject1 = _registerName1("nextObject"); - late final _sel_allObjects1 = _registerName1("allObjects"); - late final _sel_keyEnumerator1 = _registerName1("keyEnumerator"); - ffi.Pointer _objc_msgSend_97( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_97( - obj, - sel, - ); + DartNSProgressUserInfoKey get NSProgressFileAnimationImageKey => + objc.NSString.castFromPointer(_NSProgressFileAnimationImageKey.value, + retain: true, release: true); + + set NSProgressFileAnimationImageKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressFileAnimationImageKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileAnimationImageKey.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_97Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_97 = __objc_msgSend_97Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final ffi.Pointer + _NSProgressFileAnimationImageOriginalRectKey = + _lookup( + 'NSProgressFileAnimationImageOriginalRectKey'); - late final _sel_initWithObjects_forKeys_count_1 = - _registerName1("initWithObjects:forKeys:count:"); - instancetype _objc_msgSend_98( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ffi.Pointer> keys, - int cnt, - ) { - return __objc_msgSend_98( - obj, - sel, - objects, - keys, - cnt, - ); + DartNSProgressUserInfoKey get NSProgressFileAnimationImageOriginalRectKey => + objc.NSString.castFromPointer( + _NSProgressFileAnimationImageOriginalRectKey.value, + retain: true, + release: true); + + set NSProgressFileAnimationImageOriginalRectKey( + DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer( + _NSProgressFileAnimationImageOriginalRectKey.value, + retain: false, + release: true) + .ref + .release(); + _NSProgressFileAnimationImageOriginalRectKey.value = + value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_98Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_98 = __objc_msgSend_98Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); + late final ffi.Pointer _NSProgressFileIconKey = + _lookup('NSProgressFileIconKey'); - late final _class_NSArray1 = _getClass1("NSArray"); - late final _sel_objectAtIndex_1 = _registerName1("objectAtIndex:"); - ffi.Pointer _objc_msgSend_99( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ) { - return __objc_msgSend_99( - obj, - sel, - index, - ); + DartNSProgressUserInfoKey get NSProgressFileIconKey => + objc.NSString.castFromPointer(_NSProgressFileIconKey.value, + retain: true, release: true); + + set NSProgressFileIconKey(DartNSProgressUserInfoKey value) { + objc.NSString.castFromPointer(_NSProgressFileIconKey.value, + retain: false, release: true) + .ref + .release(); + _NSProgressFileIconKey.value = value.ref.retainAndReturnPointer(); } - late final __objc_msgSend_99Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_99 = __objc_msgSend_99Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _kCFTypeArrayCallBacks = + _lookup('kCFTypeArrayCallBacks'); - late final _sel_initWithObjects_count_1 = - _registerName1("initWithObjects:count:"); - instancetype _objc_msgSend_100( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - int cnt, - ) { - return __objc_msgSend_100( - obj, - sel, - objects, - cnt, - ); + CFArrayCallBacks get kCFTypeArrayCallBacks => _kCFTypeArrayCallBacks.ref; + + int CFArrayGetTypeID() { + return _CFArrayGetTypeID(); } - late final __objc_msgSend_100Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_100 = __objc_msgSend_100Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, int)>(); + late final _CFArrayGetTypeIDPtr = + _lookup>('CFArrayGetTypeID'); + late final _CFArrayGetTypeID = + _CFArrayGetTypeIDPtr.asFunction(); - late final _sel_arrayByAddingObject_1 = - _registerName1("arrayByAddingObject:"); - ffi.Pointer _objc_msgSend_101( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, + CFArrayRef CFArrayCreate( + CFAllocatorRef allocator, + ffi.Pointer> values, + int numValues, + ffi.Pointer callBacks, ) { - return __objc_msgSend_101( - obj, - sel, - anObject, + return _CFArrayCreate( + allocator, + values, + numValues, + callBacks, ); } - late final __objc_msgSend_101Ptr = _lookup< + late final _CFArrayCreatePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_101 = __objc_msgSend_101Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + CFArrayRef Function( + CFAllocatorRef, + ffi.Pointer>, + CFIndex, + ffi.Pointer)>>('CFArrayCreate'); + late final _CFArrayCreate = _CFArrayCreatePtr.asFunction< + CFArrayRef Function(CFAllocatorRef, ffi.Pointer>, + int, ffi.Pointer)>(); - late final _sel_arrayByAddingObjectsFromArray_1 = - _registerName1("arrayByAddingObjectsFromArray:"); - ffi.Pointer _objc_msgSend_102( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, + CFArrayRef CFArrayCreateCopy( + CFAllocatorRef allocator, + CFArrayRef theArray, ) { - return __objc_msgSend_102( - obj, - sel, - otherArray, + return _CFArrayCreateCopy( + allocator, + theArray, ); } - late final __objc_msgSend_102Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_102 = __objc_msgSend_102Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _CFArrayCreateCopyPtr = _lookup< + ffi.NativeFunction>( + 'CFArrayCreateCopy'); + late final _CFArrayCreateCopy = _CFArrayCreateCopyPtr.asFunction< + CFArrayRef Function(CFAllocatorRef, CFArrayRef)>(); - late final _sel_componentsJoinedByString_1 = - _registerName1("componentsJoinedByString:"); - ffi.Pointer _objc_msgSend_103( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer separator, + CFMutableArrayRef CFArrayCreateMutable( + CFAllocatorRef allocator, + int capacity, + ffi.Pointer callBacks, ) { - return __objc_msgSend_103( - obj, - sel, - separator, + return _CFArrayCreateMutable( + allocator, + capacity, + callBacks, ); } - late final __objc_msgSend_103Ptr = _lookup< + late final _CFArrayCreateMutablePtr = _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)>(); + CFMutableArrayRef Function(CFAllocatorRef, CFIndex, + ffi.Pointer)>>('CFArrayCreateMutable'); + late final _CFArrayCreateMutable = _CFArrayCreateMutablePtr.asFunction< + CFMutableArrayRef Function( + CFAllocatorRef, int, ffi.Pointer)>(); - late final _sel_containsObject_1 = _registerName1("containsObject:"); - late final _sel_descriptionWithLocale_indent_1 = - _registerName1("descriptionWithLocale:indent:"); - ffi.Pointer _objc_msgSend_104( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - int level, + CFMutableArrayRef CFArrayCreateMutableCopy( + CFAllocatorRef allocator, + int capacity, + CFArrayRef theArray, ) { - return __objc_msgSend_104( - obj, - sel, - locale, - level, + return _CFArrayCreateMutableCopy( + allocator, + capacity, + theArray, ); } - late final __objc_msgSend_104Ptr = _lookup< + late final _CFArrayCreateMutableCopyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_104 = __objc_msgSend_104Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + CFMutableArrayRef Function(CFAllocatorRef, CFIndex, + CFArrayRef)>>('CFArrayCreateMutableCopy'); + late final _CFArrayCreateMutableCopy = + _CFArrayCreateMutableCopyPtr.asFunction< + CFMutableArrayRef Function(CFAllocatorRef, int, CFArrayRef)>(); - late final _sel_firstObjectCommonWithArray_1 = - _registerName1("firstObjectCommonWithArray:"); - ffi.Pointer _objc_msgSend_105( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, + int CFArrayGetCount( + CFArrayRef theArray, ) { - return __objc_msgSend_105( - obj, - sel, - otherArray, + return _CFArrayGetCount( + theArray, ); } - late final __objc_msgSend_105Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_105 = __objc_msgSend_105Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _CFArrayGetCountPtr = + _lookup>( + 'CFArrayGetCount'); + late final _CFArrayGetCount = + _CFArrayGetCountPtr.asFunction(); - late final _sel_getObjects_range_1 = _registerName1("getObjects:range:"); - void _objc_msgSend_106( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - NSRange range, + int CFArrayGetCountOfValue( + CFArrayRef theArray, + CFRange range, + ffi.Pointer value, ) { - return __objc_msgSend_106( - obj, - sel, - objects, + return _CFArrayGetCountOfValue( + theArray, range, + value, ); } - late final __objc_msgSend_106Ptr = _lookup< + late final _CFArrayGetCountOfValuePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_106 = __objc_msgSend_106Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>, NSRange)>(); + CFIndex Function(CFArrayRef, CFRange, + ffi.Pointer)>>('CFArrayGetCountOfValue'); + late final _CFArrayGetCountOfValue = _CFArrayGetCountOfValuePtr.asFunction< + int Function(CFArrayRef, CFRange, ffi.Pointer)>(); - late final _sel_indexOfObject_1 = _registerName1("indexOfObject:"); - int _objc_msgSend_107( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, + int CFArrayContainsValue( + CFArrayRef theArray, + CFRange range, + ffi.Pointer value, ) { - return __objc_msgSend_107( - obj, - sel, - anObject, + return _CFArrayContainsValue( + theArray, + range, + value, ); } - late final __objc_msgSend_107Ptr = _lookup< + late final _CFArrayContainsValuePtr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_107 = __objc_msgSend_107Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + Boolean Function(CFArrayRef, CFRange, + ffi.Pointer)>>('CFArrayContainsValue'); + late final _CFArrayContainsValue = _CFArrayContainsValuePtr.asFunction< + int Function(CFArrayRef, CFRange, ffi.Pointer)>(); - late final _sel_indexOfObject_inRange_1 = - _registerName1("indexOfObject:inRange:"); - int _objc_msgSend_108( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - NSRange range, + ffi.Pointer CFArrayGetValueAtIndex( + CFArrayRef theArray, + int idx, ) { - return __objc_msgSend_108( - obj, - sel, - anObject, - range, + return _CFArrayGetValueAtIndex( + theArray, + idx, ); } - late final __objc_msgSend_108Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_108 = __objc_msgSend_108Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); + late final _CFArrayGetValueAtIndexPtr = _lookup< + ffi + .NativeFunction Function(CFArrayRef, CFIndex)>>( + 'CFArrayGetValueAtIndex'); + late final _CFArrayGetValueAtIndex = _CFArrayGetValueAtIndexPtr.asFunction< + ffi.Pointer Function(CFArrayRef, int)>(); - 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_109( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, + void CFArrayGetValues( + CFArrayRef theArray, + CFRange range, + ffi.Pointer> values, ) { - return __objc_msgSend_109( - obj, - sel, - otherArray, + return _CFArrayGetValues( + theArray, + range, + values, ); } - late final __objc_msgSend_109Ptr = _lookup< + late final _CFArrayGetValuesPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_109 = __objc_msgSend_109Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Void Function(CFArrayRef, CFRange, + ffi.Pointer>)>>('CFArrayGetValues'); + late final _CFArrayGetValues = _CFArrayGetValuesPtr.asFunction< + void Function(CFArrayRef, CFRange, ffi.Pointer>)>(); - late final _sel_firstObject1 = _registerName1("firstObject"); - late final _sel_lastObject1 = _registerName1("lastObject"); - late final _sel_objectEnumerator1 = _registerName1("objectEnumerator"); - 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_110( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - comparator, + void CFArrayApplyFunction( + CFArrayRef theArray, + CFRange range, + CFArrayApplierFunction applier, ffi.Pointer context, ) { - return __objc_msgSend_110( - obj, - sel, - comparator, + return _CFArrayApplyFunction( + theArray, + range, + applier, context, ); } - late final __objc_msgSend_110Ptr = _lookup< + late final _CFArrayApplyFunctionPtr = _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_110 = __objc_msgSend_110Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, + ffi.Void Function(CFArrayRef, CFRange, CFArrayApplierFunction, + ffi.Pointer)>>('CFArrayApplyFunction'); + late final _CFArrayApplyFunction = _CFArrayApplyFunctionPtr.asFunction< + void Function(CFArrayRef, CFRange, CFArrayApplierFunction, ffi.Pointer)>(); - late final _sel_sortedArrayUsingFunction_context_hint_1 = - _registerName1("sortedArrayUsingFunction:context:hint:"); - ffi.Pointer _objc_msgSend_111( - 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, + int CFArrayGetFirstIndexOfValue( + CFArrayRef theArray, + CFRange range, + ffi.Pointer value, ) { - return __objc_msgSend_111( - obj, - sel, - comparator, - context, - hint, + return _CFArrayGetFirstIndexOfValue( + theArray, + range, + value, ); } - late final __objc_msgSend_111Ptr = _lookup< + late final _CFArrayGetFirstIndexOfValuePtr = _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_111 = __objc_msgSend_111Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer, - ffi.Pointer)>(); + CFIndex Function(CFArrayRef, CFRange, + ffi.Pointer)>>('CFArrayGetFirstIndexOfValue'); + late final _CFArrayGetFirstIndexOfValue = _CFArrayGetFirstIndexOfValuePtr + .asFunction)>(); - late final _sel_sortedArrayUsingSelector_1 = - _registerName1("sortedArrayUsingSelector:"); - ffi.Pointer _objc_msgSend_112( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer comparator, + int CFArrayGetLastIndexOfValue( + CFArrayRef theArray, + CFRange range, + ffi.Pointer value, ) { - return __objc_msgSend_112( - obj, - sel, - comparator, + return _CFArrayGetLastIndexOfValue( + theArray, + range, + value, ); } - late final __objc_msgSend_112Ptr = _lookup< + late final _CFArrayGetLastIndexOfValuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_112 = __objc_msgSend_112Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + CFIndex Function(CFArrayRef, CFRange, + ffi.Pointer)>>('CFArrayGetLastIndexOfValue'); + late final _CFArrayGetLastIndexOfValue = _CFArrayGetLastIndexOfValuePtr + .asFunction)>(); - late final _sel_subarrayWithRange_1 = _registerName1("subarrayWithRange:"); - ffi.Pointer _objc_msgSend_113( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, + int CFArrayBSearchValues( + CFArrayRef theArray, + CFRange range, + ffi.Pointer value, + CFComparatorFunction comparator, + ffi.Pointer context, ) { - return __objc_msgSend_113( - obj, - sel, + return _CFArrayBSearchValues( + theArray, range, + value, + comparator, + context, ); } - late final __objc_msgSend_113Ptr = _lookup< + late final _CFArrayBSearchValuesPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_113 = __objc_msgSend_113Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); + CFIndex Function( + CFArrayRef, + CFRange, + ffi.Pointer, + CFComparatorFunction, + ffi.Pointer)>>('CFArrayBSearchValues'); + late final _CFArrayBSearchValues = _CFArrayBSearchValuesPtr.asFunction< + int Function(CFArrayRef, CFRange, ffi.Pointer, + CFComparatorFunction, ffi.Pointer)>(); - late final _sel_writeToURL_error_1 = _registerName1("writeToURL:error:"); - bool _objc_msgSend_114( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, + void CFArrayAppendValue( + CFMutableArrayRef theArray, + ffi.Pointer value, ) { - return __objc_msgSend_114( - obj, - sel, - url, - error, - ); - } - - late final __objc_msgSend_114Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_114 = __objc_msgSend_114Ptr.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_115( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aSelector, - ffi.Pointer argument, - ) { - return __objc_msgSend_115( - obj, - sel, - aSelector, - argument, + return _CFArrayAppendValue( + theArray, + value, ); } - late final __objc_msgSend_115Ptr = _lookup< + late final _CFArrayAppendValuePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_115 = __objc_msgSend_115Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function( + CFMutableArrayRef, ffi.Pointer)>>('CFArrayAppendValue'); + late final _CFArrayAppendValue = _CFArrayAppendValuePtr.asFunction< + void Function(CFMutableArrayRef, 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_116( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, + void CFArrayInsertValueAtIndex( + CFMutableArrayRef theArray, + int idx, + ffi.Pointer value, ) { - return __objc_msgSend_116( - obj, - sel, - range, + return _CFArrayInsertValueAtIndex( + theArray, + idx, + value, ); } - late final __objc_msgSend_116Ptr = _lookup< + late final _CFArrayInsertValueAtIndexPtr = _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)>(); + ffi.Void Function(CFMutableArrayRef, CFIndex, + ffi.Pointer)>>('CFArrayInsertValueAtIndex'); + late final _CFArrayInsertValueAtIndex = + _CFArrayInsertValueAtIndexPtr.asFunction< + void Function(CFMutableArrayRef, int, ffi.Pointer)>(); - late final _sel_initWithIndexesInRange_1 = - _registerName1("initWithIndexesInRange:"); - late final _sel_initWithIndexSet_1 = _registerName1("initWithIndexSet:"); - instancetype _objc_msgSend_117( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, + void CFArraySetValueAtIndex( + CFMutableArrayRef theArray, + int idx, + ffi.Pointer value, ) { - return __objc_msgSend_117( - obj, - sel, - indexSet, + return _CFArraySetValueAtIndex( + theArray, + idx, + value, ); } - late final __objc_msgSend_117Ptr = _lookup< + late final _CFArraySetValueAtIndexPtr = _lookup< ffi.NativeFunction< - instancetype Function(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.Void Function(CFMutableArrayRef, CFIndex, + ffi.Pointer)>>('CFArraySetValueAtIndex'); + late final _CFArraySetValueAtIndex = _CFArraySetValueAtIndexPtr.asFunction< + void Function(CFMutableArrayRef, int, ffi.Pointer)>(); - late final _sel_initWithIndex_1 = _registerName1("initWithIndex:"); - late final _sel_isEqualToIndexSet_1 = _registerName1("isEqualToIndexSet:"); - bool _objc_msgSend_118( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, + void CFArrayRemoveValueAtIndex( + CFMutableArrayRef theArray, + int idx, ) { - return __objc_msgSend_118( - obj, - sel, - indexSet, + return _CFArrayRemoveValueAtIndex( + theArray, + idx, ); } - late final __objc_msgSend_118Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_118 = __objc_msgSend_118Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _CFArrayRemoveValueAtIndexPtr = _lookup< + ffi.NativeFunction>( + 'CFArrayRemoveValueAtIndex'); + late final _CFArrayRemoveValueAtIndex = _CFArrayRemoveValueAtIndexPtr + .asFunction(); - late final _sel_firstIndex1 = _registerName1("firstIndex"); - late final _sel_lastIndex1 = _registerName1("lastIndex"); - late final _sel_indexGreaterThanIndex_1 = - _registerName1("indexGreaterThanIndex:"); - int _objc_msgSend_119( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + void CFArrayRemoveAllValues( + CFMutableArrayRef theArray, ) { - return __objc_msgSend_119( - obj, - sel, - value, + return _CFArrayRemoveAllValues( + theArray, ); } - late final __objc_msgSend_119Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_119 = __objc_msgSend_119Ptr.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_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 _CFArrayRemoveAllValuesPtr = + _lookup>( + 'CFArrayRemoveAllValues'); + late final _CFArrayRemoveAllValues = + _CFArrayRemoveAllValuesPtr.asFunction(); - 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 _sel_countOfIndexesInRange_1 = - _registerName1("countOfIndexesInRange:"); - int _objc_msgSend_121( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, + void CFArrayReplaceValues( + CFMutableArrayRef theArray, + CFRange range, + ffi.Pointer> newValues, + int newCount, ) { - return __objc_msgSend_121( - obj, - sel, + return _CFArrayReplaceValues( + theArray, range, + newValues, + newCount, ); } - late final __objc_msgSend_121Ptr = _lookup< + late final _CFArrayReplaceValuesPtr = _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)>(); + ffi.Void Function( + CFMutableArrayRef, + CFRange, + ffi.Pointer>, + CFIndex)>>('CFArrayReplaceValues'); + late final _CFArrayReplaceValues = _CFArrayReplaceValuesPtr.asFunction< + void Function(CFMutableArrayRef, CFRange, + ffi.Pointer>, int)>(); - late final _sel_containsIndex_1 = _registerName1("containsIndex:"); - bool _objc_msgSend_122( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + void CFArrayExchangeValuesAtIndices( + CFMutableArrayRef theArray, + int idx1, + int idx2, ) { - return __objc_msgSend_122( - obj, - sel, - value, + return _CFArrayExchangeValuesAtIndices( + theArray, + idx1, + idx2, ); } - late final __objc_msgSend_122Ptr = _lookup< + late final _CFArrayExchangeValuesAtIndicesPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_122 = __objc_msgSend_122Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Void Function(CFMutableArrayRef, CFIndex, + CFIndex)>>('CFArrayExchangeValuesAtIndices'); + late final _CFArrayExchangeValuesAtIndices = + _CFArrayExchangeValuesAtIndicesPtr.asFunction< + void Function(CFMutableArrayRef, int, int)>(); - late final _sel_containsIndexesInRange_1 = - _registerName1("containsIndexesInRange:"); - bool _objc_msgSend_123( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, + void CFArraySortValues( + CFMutableArrayRef theArray, + CFRange range, + CFComparatorFunction comparator, + ffi.Pointer context, ) { - return __objc_msgSend_123( - obj, - sel, + return _CFArraySortValues( + theArray, range, + comparator, + context, ); } - late final __objc_msgSend_123Ptr = _lookup< + late final _CFArraySortValuesPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_123 = __objc_msgSend_123Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + ffi.Void Function(CFMutableArrayRef, CFRange, CFComparatorFunction, + ffi.Pointer)>>('CFArraySortValues'); + late final _CFArraySortValues = _CFArraySortValuesPtr.asFunction< + void Function(CFMutableArrayRef, CFRange, CFComparatorFunction, + ffi.Pointer)>(); - late final _sel_containsIndexes_1 = _registerName1("containsIndexes:"); - late final _sel_intersectsIndexesInRange_1 = - _registerName1("intersectsIndexesInRange:"); - late final _sel_enumerateIndexesUsingBlock_1 = - _registerName1("enumerateIndexesUsingBlock:"); - void _objc_msgSend_124( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + void CFArrayAppendArray( + CFMutableArrayRef theArray, + CFArrayRef otherArray, + CFRange otherRange, ) { - return __objc_msgSend_124( - obj, - sel, - block, + return _CFArrayAppendArray( + theArray, + otherArray, + otherRange, ); } - late final __objc_msgSend_124Ptr = _lookup< + late final _CFArrayAppendArrayPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_124 = __objc_msgSend_124Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + ffi.Void Function( + CFMutableArrayRef, CFArrayRef, CFRange)>>('CFArrayAppendArray'); + late final _CFArrayAppendArray = _CFArrayAppendArrayPtr.asFunction< + void Function(CFMutableArrayRef, CFArrayRef, CFRange)>(); - late final _sel_enumerateIndexesWithOptions_usingBlock_1 = - _registerName1("enumerateIndexesWithOptions:usingBlock:"); - void _objc_msgSend_125( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, + ffi.Pointer os_retain( + ffi.Pointer object, ) { - return __objc_msgSend_125( - obj, - sel, - opts, - block, + return _os_retain( + object, ); } - late final __objc_msgSend_125Ptr = _lookup< + late final _os_retainPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_125 = __objc_msgSend_125Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer Function(ffi.Pointer)>>('os_retain'); + late final _os_retain = _os_retainPtr + .asFunction Function(ffi.Pointer)>(); - late final _sel_enumerateIndexesInRange_options_usingBlock_1 = - _registerName1("enumerateIndexesInRange:options:usingBlock:"); - void _objc_msgSend_126( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, + void os_release( + ffi.Pointer object, ) { - return __objc_msgSend_126( - obj, - sel, - range, - opts, - block, + return _os_release( + object, ); } - late final __objc_msgSend_126Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_126 = __objc_msgSend_126Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); + late final _os_releasePtr = + _lookup)>>( + 'os_release'); + late final _os_release = + _os_releasePtr.asFunction)>(); - late final _sel_indexPassingTest_1 = _registerName1("indexPassingTest:"); - int _objc_msgSend_127( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, + ffi.Pointer sec_retain( + ffi.Pointer obj, ) { - return __objc_msgSend_127( + return _sec_retain( obj, - sel, - predicate, ); } - late final __objc_msgSend_127Ptr = _lookup< + late final _sec_retainPtr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_127 = __objc_msgSend_127Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer Function(ffi.Pointer)>>('sec_retain'); + late final _sec_retain = _sec_retainPtr + .asFunction Function(ffi.Pointer)>(); - late final _sel_indexWithOptions_passingTest_1 = - _registerName1("indexWithOptions:passingTest:"); - int _objc_msgSend_128( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, + void sec_release( + ffi.Pointer obj, ) { - return __objc_msgSend_128( + return _sec_release( obj, - sel, - opts, - predicate, ); } - late final __objc_msgSend_128Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_128 = __objc_msgSend_128Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); + late final _sec_releasePtr = + _lookup)>>( + 'sec_release'); + late final _sec_release = + _sec_releasePtr.asFunction)>(); - late final _sel_indexInRange_options_passingTest_1 = - _registerName1("indexInRange:options:passingTest:"); - int _objc_msgSend_129( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, + CFStringRef SecCopyErrorMessageString( + int status, + ffi.Pointer reserved, ) { - return __objc_msgSend_129( - obj, - sel, - range, - opts, - predicate, + return _SecCopyErrorMessageString( + status, + reserved, ); } - late final __objc_msgSend_129Ptr = _lookup< + late final _SecCopyErrorMessageStringPtr = _lookup< ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_129 = __objc_msgSend_129Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); + CFStringRef Function( + OSStatus, ffi.Pointer)>>('SecCopyErrorMessageString'); + late final _SecCopyErrorMessageString = _SecCopyErrorMessageStringPtr + .asFunction)>(); - late final _sel_indexesPassingTest_1 = _registerName1("indexesPassingTest:"); - ffi.Pointer _objc_msgSend_130( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, + void __assert_rtn( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer arg3, ) { - return __objc_msgSend_130( - obj, - sel, - predicate, + return ___assert_rtn( + arg0, + arg1, + arg2, + arg3, ); } - late final __objc_msgSend_130Ptr = _lookup< + late final ___assert_rtnPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_130 = __objc_msgSend_130Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Int, ffi.Pointer)>>('__assert_rtn'); + late final ___assert_rtn = ___assert_rtnPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int, + ffi.Pointer)>(); - late final _sel_indexesWithOptions_passingTest_1 = - _registerName1("indexesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_131( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_131( - obj, - sel, - opts, - predicate, - ); - } + late final ffi.Pointer<_RuneLocale> __DefaultRuneLocale = + _lookup<_RuneLocale>('_DefaultRuneLocale'); - late final __objc_msgSend_131Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_131 = __objc_msgSend_131Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + _RuneLocale get _DefaultRuneLocale => __DefaultRuneLocale.ref; - late final _sel_indexesInRange_options_passingTest_1 = - _registerName1("indexesInRange:options:passingTest:"); - ffi.Pointer _objc_msgSend_132( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_132( - obj, - sel, - range, - opts, - predicate, - ); - } + late final ffi.Pointer> __CurrentRuneLocale = + _lookup>('_CurrentRuneLocale'); - late final __objc_msgSend_132Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_132 = __objc_msgSend_132Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, int, ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer<_RuneLocale> get _CurrentRuneLocale => __CurrentRuneLocale.value; + + set _CurrentRuneLocale(ffi.Pointer<_RuneLocale> value) => + __CurrentRuneLocale.value = value; - late final _sel_enumerateRangesUsingBlock_1 = - _registerName1("enumerateRangesUsingBlock:"); - void _objc_msgSend_133( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + int ___runetype( + int arg0, ) { - return __objc_msgSend_133( - obj, - sel, - block, + return ____runetype( + arg0, ); } - late final __objc_msgSend_133Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_133 = __objc_msgSend_133Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + late final ____runetypePtr = _lookup< + ffi.NativeFunction>( + '___runetype'); + late final ____runetype = ____runetypePtr.asFunction(); - late final _sel_enumerateRangesWithOptions_usingBlock_1 = - _registerName1("enumerateRangesWithOptions:usingBlock:"); - void _objc_msgSend_134( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, + int ___tolower( + int arg0, ) { - return __objc_msgSend_134( - obj, - sel, - opts, - block, + return ____tolower( + arg0, ); } - late final __objc_msgSend_134Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_134 = __objc_msgSend_134Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); + late final ____tolowerPtr = _lookup< + ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( + '___tolower'); + late final ____tolower = ____tolowerPtr.asFunction(); - late final _sel_enumerateRangesInRange_options_usingBlock_1 = - _registerName1("enumerateRangesInRange:options:usingBlock:"); - void _objc_msgSend_135( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, + int ___toupper( + int arg0, ) { - return __objc_msgSend_135( - obj, - sel, - range, - opts, - block, + return ____toupper( + arg0, ); } - late final __objc_msgSend_135Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_135 = __objc_msgSend_135Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); + late final ____toupperPtr = _lookup< + ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( + '___toupper'); + late final ____toupper = ____toupperPtr.asFunction(); - late final _sel_objectsAtIndexes_1 = _registerName1("objectsAtIndexes:"); - ffi.Pointer _objc_msgSend_136( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, + int __maskrune( + int arg0, + int arg1, ) { - return __objc_msgSend_136( - obj, - sel, - indexes, + return ___maskrune( + arg0, + arg1, ); } - late final __objc_msgSend_136Ptr = _lookup< + late final ___maskrunePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(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.Int Function( + __darwin_ct_rune_t, ffi.UnsignedLong)>>('__maskrune'); + late final ___maskrune = ___maskrunePtr.asFunction(); - late final _sel_objectAtIndexedSubscript_1 = - _registerName1("objectAtIndexedSubscript:"); - late final _sel_enumerateObjectsUsingBlock_1 = - _registerName1("enumerateObjectsUsingBlock:"); - void _objc_msgSend_137( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + int __toupper( + int arg0, ) { - return __objc_msgSend_137( - obj, - sel, - block, + return ___toupper1( + arg0, ); } - 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 ___toupperPtr = _lookup< + ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( + '__toupper'); + late final ___toupper1 = ___toupperPtr.asFunction(); - late final _sel_enumerateObjectsWithOptions_usingBlock_1 = - _registerName1("enumerateObjectsWithOptions:usingBlock:"); - void _objc_msgSend_138( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, + int __tolower( + int arg0, ) { - return __objc_msgSend_138( - obj, - sel, - opts, - block, + return ___tolower1( + arg0, ); } - 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 ___tolowerPtr = _lookup< + ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( + '__tolower'); + late final ___tolower1 = ___tolowerPtr.asFunction(); - late final _sel_enumerateObjectsAtIndexes_options_usingBlock_1 = - _registerName1("enumerateObjectsAtIndexes:options:usingBlock:"); - void _objc_msgSend_139( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_139( - obj, - sel, - s, - opts, - block, - ); + ffi.Pointer __error() { + return ___error(); } - late final __objc_msgSend_139Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_139 = __objc_msgSend_139Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_indexOfObjectPassingTest_1 = - _registerName1("indexOfObjectPassingTest:"); - int _objc_msgSend_140( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_140( - obj, - sel, - predicate, - ); + late final ___errorPtr = + _lookup Function()>>('__error'); + late final ___error = + ___errorPtr.asFunction Function()>(); + + ffi.Pointer localeconv() { + return _localeconv(); } - late final __objc_msgSend_140Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_140 = __objc_msgSend_140Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + late final _localeconvPtr = + _lookup Function()>>('localeconv'); + late final _localeconv = + _localeconvPtr.asFunction Function()>(); - late final _sel_indexOfObjectWithOptions_passingTest_1 = - _registerName1("indexOfObjectWithOptions:passingTest:"); - int _objc_msgSend_141( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, + ffi.Pointer setlocale( + int arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_141( - obj, - sel, - opts, - predicate, + return _setlocale( + arg0, + arg1, ); } - late final __objc_msgSend_141Ptr = _lookup< + late final _setlocalePtr = _lookup< ffi.NativeFunction< - NSUInteger Function(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, int, - ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer Function( + ffi.Int, ffi.Pointer)>>('setlocale'); + late final _setlocale = _setlocalePtr + .asFunction Function(int, ffi.Pointer)>(); - late final _sel_indexOfObjectAtIndexes_options_passingTest_1 = - _registerName1("indexOfObjectAtIndexes:options:passingTest:"); - int _objc_msgSend_142( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, - ) { - return __objc_msgSend_142( - obj, - sel, - s, - opts, - predicate, - ); + int __math_errhandling() { + return ___math_errhandling(); } - late final __objc_msgSend_142Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_142 = __objc_msgSend_142Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + late final ___math_errhandlingPtr = + _lookup>('__math_errhandling'); + late final ___math_errhandling = + ___math_errhandlingPtr.asFunction(); - late final _sel_indexesOfObjectsPassingTest_1 = - _registerName1("indexesOfObjectsPassingTest:"); - ffi.Pointer _objc_msgSend_143( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, + int __fpclassifyf( + double arg0, ) { - return __objc_msgSend_143( - obj, - sel, - predicate, + return ___fpclassifyf( + arg0, ); } - late final __objc_msgSend_143Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_143 = __objc_msgSend_143Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + late final ___fpclassifyfPtr = + _lookup>('__fpclassifyf'); + late final ___fpclassifyf = + ___fpclassifyfPtr.asFunction(); - late final _sel_indexesOfObjectsWithOptions_passingTest_1 = - _registerName1("indexesOfObjectsWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_144( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, + int __fpclassifyd( + double arg0, ) { - return __objc_msgSend_144( - obj, - sel, - opts, - predicate, + return ___fpclassifyd( + arg0, ); } - late final __objc_msgSend_144Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - 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, int, ffi.Pointer<_ObjCBlock>)>(); + late final ___fpclassifydPtr = + _lookup>( + '__fpclassifyd'); + late final ___fpclassifyd = + ___fpclassifydPtr.asFunction(); - late final _sel_indexesOfObjectsAtIndexes_options_passingTest_1 = - _registerName1("indexesOfObjectsAtIndexes:options:passingTest:"); - ffi.Pointer _objc_msgSend_145( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer s, - int opts, - ffi.Pointer<_ObjCBlock> predicate, + double acosf( + double arg0, ) { - return __objc_msgSend_145( - obj, - sel, - s, - opts, - predicate, + return _acosf( + arg0, ); } - late final __objc_msgSend_145Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_145 = __objc_msgSend_145Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); + late final _acosfPtr = + _lookup>('acosf'); + late final _acosf = _acosfPtr.asFunction(); - late final _sel_sortedArrayUsingComparator_1 = - _registerName1("sortedArrayUsingComparator:"); - ffi.Pointer _objc_msgSend_146( - ffi.Pointer obj, - ffi.Pointer sel, - NSComparator cmptr, + double acos( + double arg0, ) { - return __objc_msgSend_146( - obj, - sel, - cmptr, + return _acos( + arg0, ); } - late final __objc_msgSend_146Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_146 = __objc_msgSend_146Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSComparator)>(); + late final _acosPtr = + _lookup>('acos'); + late final _acos = _acosPtr.asFunction(); - late final _sel_sortedArrayWithOptions_usingComparator_1 = - _registerName1("sortedArrayWithOptions:usingComparator:"); - ffi.Pointer _objc_msgSend_147( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - NSComparator cmptr, + double asinf( + double arg0, ) { - return __objc_msgSend_147( - obj, - sel, - opts, - cmptr, + return _asinf( + arg0, ); } - late final __objc_msgSend_147Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_147 = __objc_msgSend_147Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + late final _asinfPtr = + _lookup>('asinf'); + late final _asinf = _asinfPtr.asFunction(); - late final _sel_indexOfObject_inSortedRange_options_usingComparator_1 = - _registerName1("indexOfObject:inSortedRange:options:usingComparator:"); - int _objc_msgSend_148( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - NSRange r, - int opts, - NSComparator cmp, + double asin( + double arg0, ) { - return __objc_msgSend_148( - obj, - sel, - obj1, - r, - opts, - cmp, - ); - } - - late final __objc_msgSend_148Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Int32, - NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_148 = __objc_msgSend_148Ptr.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:"); - instancetype _objc_msgSend_149( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ) { - return __objc_msgSend_149( - obj, - sel, - anObject, + return _asin( + arg0, ); } - late final __objc_msgSend_149Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_149 = __objc_msgSend_149Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _asinPtr = + _lookup>('asin'); + late final _asin = _asinPtr.asFunction(); - late final _sel_arrayWithObjects_count_1 = - _registerName1("arrayWithObjects:count:"); - late final _sel_arrayWithObjects_1 = _registerName1("arrayWithObjects:"); - late final _sel_arrayWithArray_1 = _registerName1("arrayWithArray:"); - instancetype _objc_msgSend_150( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer array, + double atanf( + double arg0, ) { - return __objc_msgSend_150( - obj, - sel, - array, + return _atanf( + arg0, ); } - late final __objc_msgSend_150Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_150 = __objc_msgSend_150Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _atanfPtr = + _lookup>('atanf'); + late final _atanf = _atanfPtr.asFunction(); - 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_151( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer array, - bool flag, + double atan( + double arg0, ) { - return __objc_msgSend_151( - obj, - sel, - array, - flag, + return _atan( + arg0, ); } - late final __objc_msgSend_151Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_151 = __objc_msgSend_151Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + late final _atanPtr = + _lookup>('atan'); + late final _atan = _atanPtr.asFunction(); - late final _sel_initWithContentsOfURL_error_1 = - _registerName1("initWithContentsOfURL:error:"); - ffi.Pointer _objc_msgSend_152( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, + double atan2f( + double arg0, + double arg1, ) { - return __objc_msgSend_152( - obj, - sel, - url, - error, + return _atan2f( + arg0, + arg1, ); } - late final __objc_msgSend_152Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - 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, - ffi.Pointer>)>(); - - late final _sel_arrayWithContentsOfURL_error_1 = - _registerName1("arrayWithContentsOfURL:error:"); - late final _class_NSOrderedCollectionDifference1 = - _getClass1("NSOrderedCollectionDifference"); - late final _sel_initWithChanges_1 = _registerName1("initWithChanges:"); - late final _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1 = - _registerName1( - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:additionalChanges:"); - instancetype _objc_msgSend_153( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ffi.Pointer changes, - ) { - return __objc_msgSend_153( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - changes, - ); - } - - late final __objc_msgSend_153Ptr = _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_153 = __objc_msgSend_153Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1 = - _registerName1( - "initWithInsertIndexes:insertedObjects:removeIndexes:removedObjects:"); - instancetype _objc_msgSend_154( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inserts, - ffi.Pointer insertedObjects, - ffi.Pointer removes, - ffi.Pointer removedObjects, - ) { - return __objc_msgSend_154( - obj, - sel, - inserts, - insertedObjects, - removes, - removedObjects, - ); - } - - late final __objc_msgSend_154Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_154 = __objc_msgSend_154Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_insertions1 = _registerName1("insertions"); - late final _sel_removals1 = _registerName1("removals"); - late final _sel_hasChanges1 = _registerName1("hasChanges"); - late final _class_NSOrderedCollectionChange1 = - _getClass1("NSOrderedCollectionChange"); - late final _sel_changeWithObject_type_index_1 = - _registerName1("changeWithObject:type:index:"); - ffi.Pointer _objc_msgSend_155( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, + late final _atan2fPtr = + _lookup>( + 'atan2f'); + late final _atan2f = _atan2fPtr.asFunction(); + + double atan2( + double arg0, + double arg1, ) { - return __objc_msgSend_155( - obj, - sel, - anObject, - type, - index, + return _atan2( + arg0, + arg1, ); } - late final __objc_msgSend_155Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_155 = __objc_msgSend_155Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int)>(); + late final _atan2Ptr = + _lookup>( + 'atan2'); + late final _atan2 = _atan2Ptr.asFunction(); - late final _sel_changeWithObject_type_index_associatedIndex_1 = - _registerName1("changeWithObject:type:index:associatedIndex:"); - ffi.Pointer _objc_msgSend_156( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - int associatedIndex, + double cosf( + double arg0, ) { - return __objc_msgSend_156( - obj, - sel, - anObject, - type, - index, - associatedIndex, + return _cosf( + arg0, ); } - late final __objc_msgSend_156Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSUInteger, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_156 = __objc_msgSend_156Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int, int, int)>(); + late final _cosfPtr = + _lookup>('cosf'); + late final _cosf = _cosfPtr.asFunction(); - late final _sel_object1 = _registerName1("object"); - late final _sel_changeType1 = _registerName1("changeType"); - int _objc_msgSend_157( - ffi.Pointer obj, - ffi.Pointer sel, + double cos( + double arg0, ) { - return __objc_msgSend_157( - obj, - sel, + return _cos( + arg0, ); } - late final __objc_msgSend_157Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_157 = __objc_msgSend_157Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final _cosPtr = + _lookup>('cos'); + late final _cos = _cosPtr.asFunction(); - late final _sel_index1 = _registerName1("index"); - late final _sel_associatedIndex1 = _registerName1("associatedIndex"); - late final _sel_initWithObject_type_index_1 = - _registerName1("initWithObject:type:index:"); - instancetype _objc_msgSend_158( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, + double sinf( + double arg0, ) { - return __objc_msgSend_158( - obj, - sel, - anObject, - type, - index, + return _sinf( + arg0, ); } - late final __objc_msgSend_158Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_158 = __objc_msgSend_158Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + late final _sinfPtr = + _lookup>('sinf'); + late final _sinf = _sinfPtr.asFunction(); - late final _sel_initWithObject_type_index_associatedIndex_1 = - _registerName1("initWithObject:type:index:associatedIndex:"); - instancetype _objc_msgSend_159( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int type, - int index, - int associatedIndex, + double sin( + double arg0, ) { - return __objc_msgSend_159( - obj, - sel, - anObject, - type, - index, - associatedIndex, + return _sin( + arg0, ); } - late final __objc_msgSend_159Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSUInteger, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_159 = __objc_msgSend_159Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, int)>(); + late final _sinPtr = + _lookup>('sin'); + late final _sin = _sinPtr.asFunction(); - late final _sel_differenceByTransformingChangesWithBlock_1 = - _registerName1("differenceByTransformingChangesWithBlock:"); - ffi.Pointer _objc_msgSend_160( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + double tanf( + double arg0, ) { - return __objc_msgSend_160( - obj, - sel, - block, + return _tanf( + arg0, ); } - late final __objc_msgSend_160Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_160 = __objc_msgSend_160Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + late final _tanfPtr = + _lookup>('tanf'); + late final _tanf = _tanfPtr.asFunction(); - late final _sel_inverseDifference1 = _registerName1("inverseDifference"); - late final _sel_differenceFromArray_withOptions_usingEquivalenceTest_1 = - _registerName1("differenceFromArray:withOptions:usingEquivalenceTest:"); - ffi.Pointer _objc_msgSend_161( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - int options, - ffi.Pointer<_ObjCBlock> block, + double tan( + double arg0, ) { - return __objc_msgSend_161( - obj, - sel, - other, - options, - block, + return _tan( + arg0, ); } - late final __objc_msgSend_161Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_161 = __objc_msgSend_161Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_differenceFromArray_withOptions_1 = - _registerName1("differenceFromArray:withOptions:"); - ffi.Pointer _objc_msgSend_162( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - int options, + late final _tanPtr = + _lookup>('tan'); + late final _tan = _tanPtr.asFunction(); + + double acoshf( + double arg0, ) { - return __objc_msgSend_162( - obj, - sel, - other, - options, + return _acoshf( + arg0, ); } - late final __objc_msgSend_162Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_162 = __objc_msgSend_162Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); + late final _acoshfPtr = + _lookup>('acoshf'); + late final _acoshf = _acoshfPtr.asFunction(); - late final _sel_differenceFromArray_1 = - _registerName1("differenceFromArray:"); - ffi.Pointer _objc_msgSend_163( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, + double acosh( + double arg0, ) { - return __objc_msgSend_163( - obj, - sel, - other, + return _acosh( + arg0, ); } - late final __objc_msgSend_163Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_163 = __objc_msgSend_163Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _acoshPtr = + _lookup>('acosh'); + late final _acosh = _acoshPtr.asFunction(); - late final _sel_arrayByApplyingDifference_1 = - _registerName1("arrayByApplyingDifference:"); - ffi.Pointer _objc_msgSend_164( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer difference, + double asinhf( + double arg0, ) { - return __objc_msgSend_164( - obj, - sel, - difference, + return _asinhf( + arg0, ); } - late final __objc_msgSend_164Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_164 = __objc_msgSend_164Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _asinhfPtr = + _lookup>('asinhf'); + late final _asinhf = _asinhfPtr.asFunction(); - late final _sel_getObjects_1 = _registerName1("getObjects:"); - void _objc_msgSend_165( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, + double asinh( + double arg0, ) { - return __objc_msgSend_165( - obj, - sel, - objects, + return _asinh( + arg0, ); } - 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 _asinhPtr = + _lookup>('asinh'); + late final _asinh = _asinhPtr.asFunction(); - late final _sel_arrayWithContentsOfFile_1 = - _registerName1("arrayWithContentsOfFile:"); - ffi.Pointer _objc_msgSend_166( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, + double atanhf( + double arg0, ) { - return __objc_msgSend_166( - obj, - sel, - path, + return _atanhf( + arg0, ); } - late final __objc_msgSend_166Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_166 = __objc_msgSend_166Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _atanhfPtr = + _lookup>('atanhf'); + late final _atanhf = _atanhfPtr.asFunction(); - late final _sel_arrayWithContentsOfURL_1 = - _registerName1("arrayWithContentsOfURL:"); - ffi.Pointer _objc_msgSend_167( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, + double atanh( + double arg0, ) { - return __objc_msgSend_167( - obj, - sel, - url, + return _atanh( + arg0, ); } - late final __objc_msgSend_167Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_167 = __objc_msgSend_167Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _atanhPtr = + _lookup>('atanh'); + late final _atanh = _atanhPtr.asFunction(); - 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_168( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool atomically, + double coshf( + double arg0, ) { - return __objc_msgSend_168( - obj, - sel, - url, - atomically, + return _coshf( + arg0, ); } - late final __objc_msgSend_168Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_168 = __objc_msgSend_168Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + late final _coshfPtr = + _lookup>('coshf'); + late final _coshf = _coshfPtr.asFunction(); - late final _sel_allKeys1 = _registerName1("allKeys"); - ffi.Pointer _objc_msgSend_169( - ffi.Pointer obj, - ffi.Pointer sel, + double cosh( + double arg0, ) { - return __objc_msgSend_169( - obj, - sel, + return _cosh( + arg0, ); } - late final __objc_msgSend_169Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_169 = __objc_msgSend_169Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _coshPtr = + _lookup>('cosh'); + late final _cosh = _coshPtr.asFunction(); - 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_170( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherDictionary, + double sinhf( + double arg0, ) { - return __objc_msgSend_170( - obj, - sel, - otherDictionary, + return _sinhf( + arg0, ); } - late final __objc_msgSend_170Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_170 = __objc_msgSend_170Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _sinhfPtr = + _lookup>('sinhf'); + late final _sinhf = _sinhfPtr.asFunction(); - late final _sel_objectsForKeys_notFoundMarker_1 = - _registerName1("objectsForKeys:notFoundMarker:"); - ffi.Pointer _objc_msgSend_171( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer marker, - ) { - return __objc_msgSend_171( - obj, - sel, - keys, - marker, - ); - } - - late final __objc_msgSend_171Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - 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, - ffi.Pointer)>(); - - late final _sel_keysSortedByValueUsingSelector_1 = - _registerName1("keysSortedByValueUsingSelector:"); - late final _sel_getObjects_andKeys_count_1 = - _registerName1("getObjects:andKeys:count:"); - void _objc_msgSend_172( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ffi.Pointer> keys, - int count, + double sinh( + double arg0, ) { - return __objc_msgSend_172( - obj, - sel, - objects, - keys, - count, + return _sinh( + arg0, ); } - late final __objc_msgSend_172Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_172 = __objc_msgSend_172Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>, - int)>(); + late final _sinhPtr = + _lookup>('sinh'); + late final _sinh = _sinhPtr.asFunction(); - late final _sel_objectForKeyedSubscript_1 = - _registerName1("objectForKeyedSubscript:"); - late final _sel_enumerateKeysAndObjectsUsingBlock_1 = - _registerName1("enumerateKeysAndObjectsUsingBlock:"); - void _objc_msgSend_173( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + double tanhf( + double arg0, ) { - return __objc_msgSend_173( - obj, - sel, - block, + return _tanhf( + arg0, ); } - late final __objc_msgSend_173Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_173 = __objc_msgSend_173Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + late final _tanhfPtr = + _lookup>('tanhf'); + late final _tanhf = _tanhfPtr.asFunction(); - late final _sel_enumerateKeysAndObjectsWithOptions_usingBlock_1 = - _registerName1("enumerateKeysAndObjectsWithOptions:usingBlock:"); - void _objc_msgSend_174( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> block, + double tanh( + double arg0, ) { - return __objc_msgSend_174( - obj, - sel, - opts, - block, + return _tanh( + arg0, ); } - late final __objc_msgSend_174Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_174 = __objc_msgSend_174Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); + late final _tanhPtr = + _lookup>('tanh'); + late final _tanh = _tanhPtr.asFunction(); - late final _sel_keysSortedByValueUsingComparator_1 = - _registerName1("keysSortedByValueUsingComparator:"); - late final _sel_keysSortedByValueWithOptions_usingComparator_1 = - _registerName1("keysSortedByValueWithOptions:usingComparator:"); - late final _sel_keysOfEntriesPassingTest_1 = - _registerName1("keysOfEntriesPassingTest:"); - ffi.Pointer _objc_msgSend_175( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> predicate, + double expf( + double arg0, ) { - return __objc_msgSend_175( - obj, - sel, - predicate, + return _expf( + arg0, ); } - late final __objc_msgSend_175Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_175 = __objc_msgSend_175Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); + late final _expfPtr = + _lookup>('expf'); + late final _expf = _expfPtr.asFunction(); - late final _sel_keysOfEntriesWithOptions_passingTest_1 = - _registerName1("keysOfEntriesWithOptions:passingTest:"); - ffi.Pointer _objc_msgSend_176( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - ffi.Pointer<_ObjCBlock> predicate, + double exp( + double arg0, ) { - return __objc_msgSend_176( - obj, - sel, - opts, - predicate, + return _exp( + arg0, ); } - late final __objc_msgSend_176Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_176 = __objc_msgSend_176Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + late final _expPtr = + _lookup>('exp'); + late final _exp = _expPtr.asFunction(); - late final _sel_getObjects_andKeys_1 = _registerName1("getObjects:andKeys:"); - void _objc_msgSend_177( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> objects, - ffi.Pointer> keys, + double exp2f( + double arg0, ) { - return __objc_msgSend_177( - obj, - sel, - objects, - keys, + return _exp2f( + arg0, ); } - late final __objc_msgSend_177Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_177 = __objc_msgSend_177Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _sel_dictionaryWithContentsOfFile_1 = - _registerName1("dictionaryWithContentsOfFile:"); - ffi.Pointer _objc_msgSend_178( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_178( - obj, - sel, - path, + late final _exp2fPtr = + _lookup>('exp2f'); + late final _exp2f = _exp2fPtr.asFunction(); + + double exp2( + double arg0, + ) { + return _exp2( + arg0, ); } - late final __objc_msgSend_178Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_178 = __objc_msgSend_178Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _exp2Ptr = + _lookup>('exp2'); + late final _exp2 = _exp2Ptr.asFunction(); - late final _sel_dictionaryWithContentsOfURL_1 = - _registerName1("dictionaryWithContentsOfURL:"); - ffi.Pointer _objc_msgSend_179( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, + double expm1f( + double arg0, ) { - return __objc_msgSend_179( - obj, - sel, - url, + return _expm1f( + arg0, ); } - late final __objc_msgSend_179Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_179 = __objc_msgSend_179Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _expm1fPtr = + _lookup>('expm1f'); + late final _expm1f = _expm1fPtr.asFunction(); - late final _sel_dictionary1 = _registerName1("dictionary"); - late final _sel_dictionaryWithObject_forKey_1 = - _registerName1("dictionaryWithObject:forKey:"); - instancetype _objc_msgSend_180( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - ffi.Pointer key, + double expm1( + double arg0, ) { - return __objc_msgSend_180( - obj, - sel, - object, - key, + return _expm1( + arg0, ); } - late final __objc_msgSend_180Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_180 = __objc_msgSend_180Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _expm1Ptr = + _lookup>('expm1'); + late final _expm1 = _expm1Ptr.asFunction(); - 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_181( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dict, + double logf( + double arg0, ) { - return __objc_msgSend_181( - obj, - sel, - dict, + return _logf( + arg0, ); } - late final __objc_msgSend_181Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_181 = __objc_msgSend_181Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _logfPtr = + _lookup>('logf'); + late final _logf = _logfPtr.asFunction(); - late final _sel_dictionaryWithObjects_forKeys_1 = - _registerName1("dictionaryWithObjects:forKeys:"); - instancetype _objc_msgSend_182( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objects, - ffi.Pointer keys, + double log( + double arg0, ) { - return __objc_msgSend_182( - obj, - sel, - objects, - keys, + return _log( + arg0, ); } - 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 _logPtr = + _lookup>('log'); + late final _log = _logPtr.asFunction(); - 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_183( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherDictionary, - bool flag, + double log10f( + double arg0, ) { - return __objc_msgSend_183( - obj, - sel, - otherDictionary, - flag, + return _log10f( + arg0, ); } - late final __objc_msgSend_183Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_183 = __objc_msgSend_183Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + late final _log10fPtr = + _lookup>('log10f'); + late final _log10f = _log10fPtr.asFunction(); - late final _sel_initWithObjects_forKeys_1 = - _registerName1("initWithObjects:forKeys:"); - ffi.Pointer _objc_msgSend_184( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer> error, + double log10( + double arg0, ) { - return __objc_msgSend_184( - obj, - sel, - url, - error, + return _log10( + arg0, ); } - late final __objc_msgSend_184Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_184 = __objc_msgSend_184Ptr.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_185( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer state, - ffi.Pointer> buffer, - int len, + late final _log10Ptr = + _lookup>('log10'); + late final _log10 = _log10Ptr.asFunction(); + + double log2f( + double arg0, ) { - return __objc_msgSend_185( - obj, - sel, - state, - buffer, - len, + return _log2f( + arg0, ); } - late final __objc_msgSend_185Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_185 = __objc_msgSend_185Ptr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - int)>(); + late final _log2fPtr = + _lookup>('log2f'); + late final _log2f = _log2fPtr.asFunction(); - late final _sel_initWithDomain_code_userInfo_1 = - _registerName1("initWithDomain:code:userInfo:"); - instancetype _objc_msgSend_186( - ffi.Pointer obj, - ffi.Pointer sel, - NSErrorDomain domain, - int code, - ffi.Pointer dict, + double log2( + double arg0, ) { - return __objc_msgSend_186( - obj, - sel, - domain, - code, - dict, + return _log2( + arg0, ); } - late final __objc_msgSend_186Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - NSErrorDomain, - NSInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_186 = __objc_msgSend_186Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSErrorDomain, int, ffi.Pointer)>(); + late final _log2Ptr = + _lookup>('log2'); + late final _log2 = _log2Ptr.asFunction(); - late final _sel_errorWithDomain_code_userInfo_1 = - _registerName1("errorWithDomain:code:userInfo:"); - late final _sel_domain1 = _registerName1("domain"); - late final _sel_code1 = _registerName1("code"); - late final _sel_userInfo1 = _registerName1("userInfo"); - ffi.Pointer _objc_msgSend_187( - ffi.Pointer obj, - ffi.Pointer sel, + double log1pf( + double arg0, ) { - return __objc_msgSend_187( - obj, - sel, + return _log1pf( + arg0, ); } - late final __objc_msgSend_187Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_187 = __objc_msgSend_187Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _log1pfPtr = + _lookup>('log1pf'); + late final _log1pf = _log1pfPtr.asFunction(); - late final _sel_localizedDescription1 = - _registerName1("localizedDescription"); - late final _sel_localizedFailureReason1 = - _registerName1("localizedFailureReason"); - late final _sel_localizedRecoverySuggestion1 = - _registerName1("localizedRecoverySuggestion"); - late final _sel_localizedRecoveryOptions1 = - _registerName1("localizedRecoveryOptions"); - ffi.Pointer _objc_msgSend_188( - ffi.Pointer obj, - ffi.Pointer sel, + double log1p( + double arg0, ) { - return __objc_msgSend_188( - obj, - sel, + return _log1p( + arg0, ); } - late final __objc_msgSend_188Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_188 = __objc_msgSend_188Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _log1pPtr = + _lookup>('log1p'); + late final _log1p = _log1pPtr.asFunction(); - late final _sel_recoveryAttempter1 = _registerName1("recoveryAttempter"); - late final _sel_helpAnchor1 = _registerName1("helpAnchor"); - late final _sel_underlyingErrors1 = _registerName1("underlyingErrors"); - late final _sel_setUserInfoValueProviderForDomain_provider_1 = - _registerName1("setUserInfoValueProviderForDomain:provider:"); - void _objc_msgSend_189( - ffi.Pointer obj, - ffi.Pointer sel, - NSErrorDomain errorDomain, - ffi.Pointer<_ObjCBlock> provider, + double logbf( + double arg0, ) { - return __objc_msgSend_189( - obj, - sel, - errorDomain, - provider, + return _logbf( + arg0, ); } - late final __objc_msgSend_189Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSErrorDomain, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_189 = __objc_msgSend_189Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - NSErrorDomain, ffi.Pointer<_ObjCBlock>)>(); + late final _logbfPtr = + _lookup>('logbf'); + late final _logbf = _logbfPtr.asFunction(); - late final _sel_userInfoValueProviderForDomain_1 = - _registerName1("userInfoValueProviderForDomain:"); - ffi.Pointer<_ObjCBlock> _objc_msgSend_190( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer err, - NSErrorUserInfoKey userInfoKey, - NSErrorDomain errorDomain, + double logb( + double arg0, ) { - return __objc_msgSend_190( - obj, - sel, - err, - userInfoKey, - errorDomain, - ); - } - - late final __objc_msgSend_190Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSErrorUserInfoKey, - NSErrorDomain)>>('objc_msgSend'); - late final __objc_msgSend_190 = __objc_msgSend_190Ptr.asFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSErrorUserInfoKey, - NSErrorDomain)>(); - - late final _sel_getResourceValue_forKey_error_1 = - _registerName1("getResourceValue:forKey:error:"); - bool _objc_msgSend_191( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> value, - NSURLResourceKey key, - ffi.Pointer> error, - ) { - return __objc_msgSend_191( - obj, - sel, - value, - key, - error, + return _logb( + arg0, ); } - late final __objc_msgSend_191Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSURLResourceKey, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_191 = __objc_msgSend_191Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - NSURLResourceKey, - ffi.Pointer>)>(); - - late final _sel_resourceValuesForKeys_error_1 = - _registerName1("resourceValuesForKeys:error:"); - ffi.Pointer _objc_msgSend_192( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer> error, - ) { - return __objc_msgSend_192( - obj, - sel, - keys, - error, + late final _logbPtr = + _lookup>('logb'); + late final _logb = _logbPtr.asFunction(); + + double modff( + double arg0, + ffi.Pointer arg1, + ) { + return _modff( + arg0, + arg1, ); } - late final __objc_msgSend_192Ptr = _lookup< + late final _modffPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_192 = __objc_msgSend_192Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); + ffi.Float Function(ffi.Float, ffi.Pointer)>>('modff'); + late final _modff = + _modffPtr.asFunction)>(); - late final _sel_setResourceValue_forKey_error_1 = - _registerName1("setResourceValue:forKey:error:"); - bool _objc_msgSend_193( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - NSURLResourceKey key, - ffi.Pointer> error, + double modf( + double arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_193( - obj, - sel, - value, - key, - error, + return _modf( + arg0, + arg1, ); } - late final __objc_msgSend_193Ptr = _lookup< + late final _modfPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSURLResourceKey, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_193 = __objc_msgSend_193Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSURLResourceKey, - ffi.Pointer>)>(); - - late final _sel_setResourceValues_error_1 = - _registerName1("setResourceValues:error:"); - bool _objc_msgSend_194( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyedValues, - ffi.Pointer> error, - ) { - return __objc_msgSend_194( - obj, - sel, - keyedValues, - error, - ); - } + ffi.Double Function(ffi.Double, ffi.Pointer)>>('modf'); + late final _modf = + _modfPtr.asFunction)>(); - 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_removeCachedResourceValueForKey_1 = - _registerName1("removeCachedResourceValueForKey:"); - void _objc_msgSend_195( - ffi.Pointer obj, - ffi.Pointer sel, - NSURLResourceKey key, - ) { - return __objc_msgSend_195( - obj, - sel, - key, - ); - } - - late final __objc_msgSend_195Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSURLResourceKey)>>('objc_msgSend'); - late final __objc_msgSend_195 = __objc_msgSend_195Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, NSURLResourceKey)>(); - - late final _sel_removeAllCachedResourceValues1 = - _registerName1("removeAllCachedResourceValues"); - late final _sel_setTemporaryResourceValue_forKey_1 = - _registerName1("setTemporaryResourceValue:forKey:"); - void _objc_msgSend_196( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - NSURLResourceKey key, - ) { - return __objc_msgSend_196( - obj, - sel, - value, - key, + double ldexpf( + double arg0, + int arg1, + ) { + return _ldexpf( + arg0, + arg1, ); } - late final __objc_msgSend_196Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSURLResourceKey)>>('objc_msgSend'); - late final __objc_msgSend_196 = __objc_msgSend_196Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSURLResourceKey)>(); + late final _ldexpfPtr = + _lookup>( + 'ldexpf'); + late final _ldexpf = _ldexpfPtr.asFunction(); - late final _sel_bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_1 = - _registerName1( - "bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:"); - ffi.Pointer _objc_msgSend_197( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer keys, - ffi.Pointer relativeURL, - ffi.Pointer> error, + double ldexp( + double arg0, + int arg1, ) { - return __objc_msgSend_197( - obj, - sel, - options, - keys, - relativeURL, - error, + return _ldexp( + arg0, + arg1, ); } - late final __objc_msgSend_197Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_197 = __objc_msgSend_197Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1 = - _registerName1( - "initByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:"); - instancetype _objc_msgSend_198( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bookmarkData, - int options, - ffi.Pointer relativeURL, - ffi.Pointer isStale, - ffi.Pointer> error, + late final _ldexpPtr = + _lookup>( + 'ldexp'); + late final _ldexp = _ldexpPtr.asFunction(); + + double frexpf( + double arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_198( - obj, - sel, - bookmarkData, - options, - relativeURL, - isStale, - error, + return _frexpf( + arg0, + arg1, ); } - late final __objc_msgSend_198Ptr = _lookup< + late final _frexpfPtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_198 = __objc_msgSend_198Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1 = - _registerName1( - "URLByResolvingBookmarkData:options:relativeToURL:bookmarkDataIsStale:error:"); - late final _sel_resourceValuesForKeys_fromBookmarkData_1 = - _registerName1("resourceValuesForKeys:fromBookmarkData:"); - ffi.Pointer _objc_msgSend_199( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keys, - ffi.Pointer bookmarkData, - ) { - return __objc_msgSend_199( - obj, - sel, - keys, - bookmarkData, - ); - } - - late final __objc_msgSend_199Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_199 = __objc_msgSend_199Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_writeBookmarkData_toURL_options_error_1 = - _registerName1("writeBookmarkData:toURL:options:error:"); - bool _objc_msgSend_200( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bookmarkData, - ffi.Pointer bookmarkFileURL, - int options, - ffi.Pointer> error, + ffi.Float Function(ffi.Float, ffi.Pointer)>>('frexpf'); + late final _frexpf = + _frexpfPtr.asFunction)>(); + + double frexp( + double arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_200( - obj, - sel, - bookmarkData, - bookmarkFileURL, - options, - error, + return _frexp( + arg0, + arg1, ); } - late final __objc_msgSend_200Ptr = _lookup< + late final _frexpPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSURLBookmarkFileCreationOptions, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_200 = __objc_msgSend_200Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); + ffi.Double Function(ffi.Double, ffi.Pointer)>>('frexp'); + late final _frexp = + _frexpPtr.asFunction)>(); - late final _sel_bookmarkDataWithContentsOfURL_error_1 = - _registerName1("bookmarkDataWithContentsOfURL:error:"); - ffi.Pointer _objc_msgSend_201( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bookmarkFileURL, - ffi.Pointer> error, + int ilogbf( + double arg0, ) { - return __objc_msgSend_201( - obj, - sel, - bookmarkFileURL, - error, + return _ilogbf( + arg0, ); } - late final __objc_msgSend_201Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_201 = __objc_msgSend_201Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); + late final _ilogbfPtr = + _lookup>('ilogbf'); + late final _ilogbf = _ilogbfPtr.asFunction(); - late final _sel_URLByResolvingAliasFileAtURL_options_error_1 = - _registerName1("URLByResolvingAliasFileAtURL:options:error:"); - instancetype _objc_msgSend_202( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int options, - ffi.Pointer> error, + int ilogb( + double arg0, ) { - return __objc_msgSend_202( - obj, - sel, - url, - options, - error, + return _ilogb( + arg0, ); } - late final __objc_msgSend_202Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_202 = __objc_msgSend_202Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>)>(); - - late final _sel_startAccessingSecurityScopedResource1 = - _registerName1("startAccessingSecurityScopedResource"); - late final _sel_stopAccessingSecurityScopedResource1 = - _registerName1("stopAccessingSecurityScopedResource"); - late final _sel_getPromisedItemResourceValue_forKey_error_1 = - _registerName1("getPromisedItemResourceValue:forKey:error:"); - late final _sel_promisedItemResourceValuesForKeys_error_1 = - _registerName1("promisedItemResourceValuesForKeys:error:"); - late final _sel_checkPromisedItemIsReachableAndReturnError_1 = - _registerName1("checkPromisedItemIsReachableAndReturnError:"); - bool _objc_msgSend_203( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> error, - ) { - return __objc_msgSend_203( - obj, - sel, - error, + late final _ilogbPtr = + _lookup>('ilogb'); + late final _ilogb = _ilogbPtr.asFunction(); + + double scalbnf( + double arg0, + int arg1, + ) { + return _scalbnf( + arg0, + arg1, ); } - late final __objc_msgSend_203Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_203 = __objc_msgSend_203Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); + late final _scalbnfPtr = + _lookup>( + 'scalbnf'); + late final _scalbnf = _scalbnfPtr.asFunction(); - late final _sel_fileURLWithPathComponents_1 = - _registerName1("fileURLWithPathComponents:"); - ffi.Pointer _objc_msgSend_204( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer components, + double scalbn( + double arg0, + int arg1, ) { - return __objc_msgSend_204( - obj, - sel, - components, + return _scalbn( + arg0, + arg1, ); } - late final __objc_msgSend_204Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_204 = __objc_msgSend_204Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _scalbnPtr = + _lookup>( + 'scalbn'); + late final _scalbn = _scalbnPtr.asFunction(); - 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:"); - ffi.Pointer _objc_msgSend_205( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pathComponent, + double scalblnf( + double arg0, + int arg1, ) { - return __objc_msgSend_205( - obj, - sel, - pathComponent, + return _scalblnf( + arg0, + arg1, ); } - late final __objc_msgSend_205Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_205 = __objc_msgSend_205Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _scalblnfPtr = + _lookup>( + 'scalblnf'); + late final _scalblnf = + _scalblnfPtr.asFunction(); - late final _sel_URLByAppendingPathComponent_isDirectory_1 = - _registerName1("URLByAppendingPathComponent:isDirectory:"); - ffi.Pointer _objc_msgSend_206( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer pathComponent, - bool isDirectory, + double scalbln( + double arg0, + int arg1, ) { - return __objc_msgSend_206( - obj, - sel, - pathComponent, - isDirectory, + return _scalbln( + arg0, + arg1, ); } - late final __objc_msgSend_206Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_206 = __objc_msgSend_206Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, bool)>(); - - late final _sel_URLByDeletingLastPathComponent1 = - _registerName1("URLByDeletingLastPathComponent"); - late final _sel_URLByAppendingPathExtension_1 = - _registerName1("URLByAppendingPathExtension:"); - late final _sel_URLByDeletingPathExtension1 = - _registerName1("URLByDeletingPathExtension"); - late final _sel_checkResourceIsReachableAndReturnError_1 = - _registerName1("checkResourceIsReachableAndReturnError:"); - late final _sel_URLByStandardizingPath1 = - _registerName1("URLByStandardizingPath"); - late final _sel_URLByResolvingSymlinksInPath1 = - _registerName1("URLByResolvingSymlinksInPath"); - late final _sel_resourceDataUsingCache_1 = - _registerName1("resourceDataUsingCache:"); - ffi.Pointer _objc_msgSend_207( - ffi.Pointer obj, - ffi.Pointer sel, - bool shouldUseCache, - ) { - return __objc_msgSend_207( - obj, - sel, - shouldUseCache, + late final _scalblnPtr = + _lookup>( + 'scalbln'); + late final _scalbln = _scalblnPtr.asFunction(); + + double fabsf( + double arg0, + ) { + return _fabsf( + arg0, ); } - late final __objc_msgSend_207Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_207 = __objc_msgSend_207Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); + late final _fabsfPtr = + _lookup>('fabsf'); + late final _fabsf = _fabsfPtr.asFunction(); - late final _sel_loadResourceDataNotifyingClient_usingCache_1 = - _registerName1("loadResourceDataNotifyingClient:usingCache:"); - void _objc_msgSend_208( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer client, - bool shouldUseCache, + double fabs( + double arg0, ) { - return __objc_msgSend_208( - obj, - sel, - client, - shouldUseCache, + return _fabs( + arg0, ); } - late final __objc_msgSend_208Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_208 = __objc_msgSend_208Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + late final _fabsPtr = + _lookup>('fabs'); + late final _fabs = _fabsPtr.asFunction(); - 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_209( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer property, - ffi.Pointer propertyKey, + double cbrtf( + double arg0, ) { - return __objc_msgSend_209( - obj, - sel, - property, - propertyKey, + return _cbrtf( + arg0, ); } - late final __objc_msgSend_209Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_209 = __objc_msgSend_209Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLHandle1 = _getClass1("NSURLHandle"); - late final _sel_registerURLHandleClass_1 = - _registerName1("registerURLHandleClass:"); - void _objc_msgSend_210( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURLHandleSubclass, - ) { - return __objc_msgSend_210( - obj, - sel, - anURLHandleSubclass, + late final _cbrtfPtr = + _lookup>('cbrtf'); + late final _cbrtf = _cbrtfPtr.asFunction(); + + double cbrt( + double arg0, + ) { + return _cbrt( + arg0, ); } - late final __objc_msgSend_210Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_210 = __objc_msgSend_210Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _cbrtPtr = + _lookup>('cbrt'); + late final _cbrt = _cbrtPtr.asFunction(); - late final _sel_URLHandleClassForURL_1 = - _registerName1("URLHandleClassForURL:"); - ffi.Pointer _objc_msgSend_211( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, + double hypotf( + double arg0, + double arg1, ) { - return __objc_msgSend_211( - obj, - sel, - anURL, + return _hypotf( + arg0, + arg1, ); } - late final __objc_msgSend_211Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_211 = __objc_msgSend_211Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _hypotfPtr = + _lookup>( + 'hypotf'); + late final _hypotf = _hypotfPtr.asFunction(); - late final _sel_status1 = _registerName1("status"); - int _objc_msgSend_212( - ffi.Pointer obj, - ffi.Pointer sel, + double hypot( + double arg0, + double arg1, ) { - return __objc_msgSend_212( - obj, - sel, + return _hypot( + arg0, + arg1, ); } - late final __objc_msgSend_212Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 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_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_213( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer newBytes, - bool yorn, - ) { - return __objc_msgSend_213( - obj, - sel, - newBytes, - yorn, + late final _hypotPtr = + _lookup>( + 'hypot'); + late final _hypot = _hypotPtr.asFunction(); + + double powf( + double arg0, + double arg1, + ) { + return _powf( + arg0, + arg1, ); } - late final __objc_msgSend_213Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_213 = __objc_msgSend_213Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + late final _powfPtr = + _lookup>( + 'powf'); + late final _powf = _powfPtr.asFunction(); - late final _sel_canInitWithURL_1 = _registerName1("canInitWithURL:"); - bool _objc_msgSend_214( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, + double pow( + double arg0, + double arg1, ) { - return __objc_msgSend_214( - obj, - sel, - anURL, + return _pow( + arg0, + arg1, ); } - late final __objc_msgSend_214Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_214 = __objc_msgSend_214Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _powPtr = + _lookup>( + 'pow'); + late final _pow = _powPtr.asFunction(); - late final _sel_cachedHandleForURL_1 = _registerName1("cachedHandleForURL:"); - ffi.Pointer _objc_msgSend_215( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, + double sqrtf( + double arg0, ) { - return __objc_msgSend_215( - obj, - sel, - anURL, + return _sqrtf( + arg0, ); } - late final __objc_msgSend_215Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_215 = __objc_msgSend_215Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _sqrtfPtr = + _lookup>('sqrtf'); + late final _sqrtf = _sqrtfPtr.asFunction(); - late final _sel_initWithURL_cached_1 = _registerName1("initWithURL:cached:"); - ffi.Pointer _objc_msgSend_216( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anURL, - bool willCache, + double sqrt( + double arg0, ) { - return __objc_msgSend_216( - obj, - sel, - anURL, - willCache, - ); - } - - late final __objc_msgSend_216Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_216 = __objc_msgSend_216Ptr.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_217( - ffi.Pointer obj, - ffi.Pointer sel, - bool shouldUseCache, - ) { - return __objc_msgSend_217( - obj, - sel, - shouldUseCache, + return _sqrt( + arg0, ); } - late final __objc_msgSend_217Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_217 = __objc_msgSend_217Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, bool)>(); + late final _sqrtPtr = + _lookup>('sqrt'); + late final _sqrt = _sqrtPtr.asFunction(); - late final _sel_writeToFile_options_error_1 = - _registerName1("writeToFile:options:error:"); - bool _objc_msgSend_218( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - int writeOptionsMask, - ffi.Pointer> errorPtr, + double erff( + double arg0, ) { - return __objc_msgSend_218( - obj, - sel, - path, - writeOptionsMask, - errorPtr, + return _erff( + arg0, ); } - late final __objc_msgSend_218Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_218 = __objc_msgSend_218Ptr.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_219( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int writeOptionsMask, - ffi.Pointer> errorPtr, - ) { - return __objc_msgSend_219( - obj, - sel, - url, - writeOptionsMask, - errorPtr, - ); - } + late final _erffPtr = + _lookup>('erff'); + late final _erff = _erffPtr.asFunction(); - late final __objc_msgSend_219Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_219 = __objc_msgSend_219Ptr.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_220( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dataToFind, - int mask, - NSRange searchRange, + double erf( + double arg0, ) { - return __objc_msgSend_220( - obj, - sel, - dataToFind, - mask, - searchRange, + return _erf( + arg0, ); } - late final __objc_msgSend_220Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_220 = __objc_msgSend_220Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); + late final _erfPtr = + _lookup>('erf'); + late final _erf = _erfPtr.asFunction(); - late final _sel_enumerateByteRangesUsingBlock_1 = - _registerName1("enumerateByteRangesUsingBlock:"); - void _objc_msgSend_221( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + double erfcf( + double arg0, ) { - return __objc_msgSend_221( - obj, - sel, - block, + return _erfcf( + arg0, ); } - late final __objc_msgSend_221Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_221 = __objc_msgSend_221Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + late final _erfcfPtr = + _lookup>('erfcf'); + late final _erfcf = _erfcfPtr.asFunction(); - late final _sel_data1 = _registerName1("data"); - late final _sel_dataWithBytes_length_1 = - _registerName1("dataWithBytes:length:"); - instancetype _objc_msgSend_222( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, + double erfc( + double arg0, ) { - return __objc_msgSend_222( - obj, - sel, - bytes, - length, + return _erfc( + arg0, ); } - late final __objc_msgSend_222Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_222 = __objc_msgSend_222Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final _erfcPtr = + _lookup>('erfc'); + late final _erfc = _erfcPtr.asFunction(); - late final _sel_dataWithBytesNoCopy_length_1 = - _registerName1("dataWithBytesNoCopy:length:"); - late final _sel_dataWithBytesNoCopy_length_freeWhenDone_1 = - _registerName1("dataWithBytesNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_223( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - bool b, + double lgammaf( + double arg0, ) { - return __objc_msgSend_223( - obj, - sel, - bytes, - length, - b, + return _lgammaf( + arg0, ); } - late final __objc_msgSend_223Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_223 = __objc_msgSend_223Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, bool)>(); + late final _lgammafPtr = + _lookup>('lgammaf'); + late final _lgammaf = _lgammafPtr.asFunction(); - late final _sel_dataWithContentsOfFile_options_error_1 = - _registerName1("dataWithContentsOfFile:options:error:"); - instancetype _objc_msgSend_224( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - int readOptionsMask, - ffi.Pointer> errorPtr, + double lgamma( + double arg0, ) { - return __objc_msgSend_224( - obj, - sel, - path, - readOptionsMask, - errorPtr, + return _lgamma( + arg0, ); } - late final __objc_msgSend_224Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_224 = __objc_msgSend_224Ptr.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_225( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int readOptionsMask, - ffi.Pointer> errorPtr, - ) { - return __objc_msgSend_225( - obj, - sel, - url, - readOptionsMask, - errorPtr, - ); - } + late final _lgammaPtr = + _lookup>('lgamma'); + late final _lgamma = _lgammaPtr.asFunction(); - late final __objc_msgSend_225Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_225 = __objc_msgSend_225Ptr.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:"); - instancetype _objc_msgSend_226( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_226( - obj, - sel, - url, + double tgammaf( + double arg0, + ) { + return _tgammaf( + arg0, ); } - late final __objc_msgSend_226Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_226 = __objc_msgSend_226Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _tgammafPtr = + _lookup>('tgammaf'); + late final _tgammaf = _tgammafPtr.asFunction(); - 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_227( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - ffi.Pointer<_ObjCBlock> deallocator, + double tgamma( + double arg0, ) { - return __objc_msgSend_227( - obj, - sel, - bytes, - length, - deallocator, + return _tgamma( + arg0, ); } - late final __objc_msgSend_227Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_227 = __objc_msgSend_227Ptr.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_228( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_228( - obj, - sel, - data, + late final _tgammaPtr = + _lookup>('tgamma'); + late final _tgamma = _tgammaPtr.asFunction(); + + double ceilf( + double arg0, + ) { + return _ceilf( + arg0, ); } - late final __objc_msgSend_228Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_228 = __objc_msgSend_228Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _ceilfPtr = + _lookup>('ceilf'); + late final _ceilf = _ceilfPtr.asFunction(); - late final _sel_dataWithData_1 = _registerName1("dataWithData:"); - late final _sel_initWithBase64EncodedString_options_1 = - _registerName1("initWithBase64EncodedString:options:"); - instancetype _objc_msgSend_229( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer base64String, - int options, + double ceil( + double arg0, ) { - return __objc_msgSend_229( - obj, - sel, - base64String, - options, + return _ceil( + arg0, ); } - late final __objc_msgSend_229Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_229 = __objc_msgSend_229Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final _ceilPtr = + _lookup>('ceil'); + late final _ceil = _ceilPtr.asFunction(); - late final _sel_base64EncodedStringWithOptions_1 = - _registerName1("base64EncodedStringWithOptions:"); - ffi.Pointer _objc_msgSend_230( - ffi.Pointer obj, - ffi.Pointer sel, - int options, + double floorf( + double arg0, ) { - return __objc_msgSend_230( - obj, - sel, - options, + return _floorf( + arg0, ); } - late final __objc_msgSend_230Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_230 = __objc_msgSend_230Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _floorfPtr = + _lookup>('floorf'); + late final _floorf = _floorfPtr.asFunction(); - late final _sel_initWithBase64EncodedData_options_1 = - _registerName1("initWithBase64EncodedData:options:"); - instancetype _objc_msgSend_231( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer base64Data, - int options, + double floor( + double arg0, ) { - return __objc_msgSend_231( - obj, - sel, - base64Data, - options, + return _floor( + arg0, ); } - late final __objc_msgSend_231Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_231 = __objc_msgSend_231Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final _floorPtr = + _lookup>('floor'); + late final _floor = _floorPtr.asFunction(); - late final _sel_base64EncodedDataWithOptions_1 = - _registerName1("base64EncodedDataWithOptions:"); - ffi.Pointer _objc_msgSend_232( - ffi.Pointer obj, - ffi.Pointer sel, - int options, + double nearbyintf( + double arg0, ) { - return __objc_msgSend_232( - obj, - sel, - options, + return _nearbyintf( + arg0, ); } - late final __objc_msgSend_232Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_232 = __objc_msgSend_232Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _nearbyintfPtr = + _lookup>('nearbyintf'); + late final _nearbyintf = _nearbyintfPtr.asFunction(); - late final _sel_decompressedDataUsingAlgorithm_error_1 = - _registerName1("decompressedDataUsingAlgorithm:error:"); - instancetype _objc_msgSend_233( - ffi.Pointer obj, - ffi.Pointer sel, - int algorithm, - ffi.Pointer> error, + double nearbyint( + double arg0, ) { - return __objc_msgSend_233( - obj, - sel, - algorithm, - error, + return _nearbyint( + arg0, ); } - late final __objc_msgSend_233Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_233 = __objc_msgSend_233Ptr.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_characterSetWithBitmapRepresentation_1 = - _registerName1("characterSetWithBitmapRepresentation:"); - ffi.Pointer _objc_msgSend_234( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_234( - obj, - sel, - data, + late final _nearbyintPtr = + _lookup>('nearbyint'); + late final _nearbyint = _nearbyintPtr.asFunction(); + + double rintf( + double arg0, + ) { + return _rintf( + arg0, ); } - late final __objc_msgSend_234Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_234 = __objc_msgSend_234Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _rintfPtr = + _lookup>('rintf'); + late final _rintf = _rintfPtr.asFunction(); - late final _sel_characterSetWithContentsOfFile_1 = - _registerName1("characterSetWithContentsOfFile:"); - ffi.Pointer _objc_msgSend_235( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer fName, + double rint( + double arg0, ) { - return __objc_msgSend_235( - obj, - sel, - fName, + return _rint( + arg0, ); } - late final __objc_msgSend_235Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_235 = __objc_msgSend_235Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _rintPtr = + _lookup>('rint'); + late final _rint = _rintPtr.asFunction(); - instancetype _objc_msgSend_236( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer coder, + int lrintf( + double arg0, ) { - return __objc_msgSend_236( - obj, - sel, - coder, + return _lrintf( + arg0, ); } - late final __objc_msgSend_236Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_236 = __objc_msgSend_236Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _lrintfPtr = + _lookup>('lrintf'); + late final _lrintf = _lrintfPtr.asFunction(); - late final _sel_characterIsMember_1 = _registerName1("characterIsMember:"); - bool _objc_msgSend_237( - ffi.Pointer obj, - ffi.Pointer sel, - int aCharacter, + int lrint( + double arg0, ) { - return __objc_msgSend_237( - obj, - sel, - aCharacter, + return _lrint( + arg0, ); } - late final __objc_msgSend_237Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - unichar)>>('objc_msgSend'); - late final __objc_msgSend_237 = __objc_msgSend_237Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _lrintPtr = + _lookup>('lrint'); + late final _lrint = _lrintPtr.asFunction(); - late final _sel_bitmapRepresentation1 = - _registerName1("bitmapRepresentation"); - late final _sel_invertedSet1 = _registerName1("invertedSet"); - late final _sel_longCharacterIsMember_1 = - _registerName1("longCharacterIsMember:"); - bool _objc_msgSend_238( - ffi.Pointer obj, - ffi.Pointer sel, - int theLongChar, + double roundf( + double arg0, ) { - return __objc_msgSend_238( - obj, - sel, - theLongChar, + return _roundf( + arg0, ); } - late final __objc_msgSend_238Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - UTF32Char)>>('objc_msgSend'); - late final __objc_msgSend_238 = __objc_msgSend_238Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _roundfPtr = + _lookup>('roundf'); + late final _roundf = _roundfPtr.asFunction(); - late final _sel_isSupersetOfSet_1 = _registerName1("isSupersetOfSet:"); - bool _objc_msgSend_239( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer theOtherSet, + double round( + double arg0, ) { - return __objc_msgSend_239( - obj, - sel, - theOtherSet, + return _round( + arg0, ); } - late final __objc_msgSend_239Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_239 = __objc_msgSend_239Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _roundPtr = + _lookup>('round'); + late final _round = _roundPtr.asFunction(); - late final _sel_hasMemberInPlane_1 = _registerName1("hasMemberInPlane:"); - bool _objc_msgSend_240( - ffi.Pointer obj, - ffi.Pointer sel, - int thePlane, + int lroundf( + double arg0, ) { - return __objc_msgSend_240( - obj, - sel, - thePlane, + return _lroundf( + arg0, ); } - late final __objc_msgSend_240Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Uint8)>>('objc_msgSend'); - late final __objc_msgSend_240 = __objc_msgSend_240Ptr.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_rangeOfCharacterFromSet_1 = - _registerName1("rangeOfCharacterFromSet:"); - NSRange _objc_msgSend_241( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - ) { - return __objc_msgSend_241( - obj, - sel, - searchSet, + late final _lroundfPtr = + _lookup>('lroundf'); + late final _lroundf = _lroundfPtr.asFunction(); + + int lround( + double arg0, + ) { + return _lround( + arg0, ); } - late final __objc_msgSend_241Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_241 = __objc_msgSend_241Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _lroundPtr = + _lookup>('lround'); + late final _lround = _lroundPtr.asFunction(); - late final _sel_rangeOfCharacterFromSet_options_1 = - _registerName1("rangeOfCharacterFromSet:options:"); - NSRange _objc_msgSend_242( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - int mask, + int llrintf( + double arg0, ) { - return __objc_msgSend_242( - obj, - sel, - searchSet, - mask, + return _llrintf( + arg0, ); } - late final __objc_msgSend_242Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_242 = __objc_msgSend_242Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final _llrintfPtr = + _lookup>('llrintf'); + late final _llrintf = _llrintfPtr.asFunction(); - late final _sel_rangeOfCharacterFromSet_options_range_1 = - _registerName1("rangeOfCharacterFromSet:options:range:"); - NSRange _objc_msgSend_243( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer searchSet, - int mask, - NSRange rangeOfReceiverToSearch, + int llrint( + double arg0, ) { - return __objc_msgSend_243( - obj, - sel, - searchSet, - mask, - rangeOfReceiverToSearch, + return _llrint( + arg0, ); } - late final __objc_msgSend_243Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_243 = __objc_msgSend_243Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, NSRange)>(); + late final _llrintPtr = + _lookup>('llrint'); + late final _llrint = _llrintPtr.asFunction(); - late final _sel_rangeOfComposedCharacterSequenceAtIndex_1 = - _registerName1("rangeOfComposedCharacterSequenceAtIndex:"); - NSRange _objc_msgSend_244( - ffi.Pointer obj, - ffi.Pointer sel, - int index, + int llroundf( + double arg0, ) { - return __objc_msgSend_244( - obj, - sel, - index, + return _llroundf( + arg0, ); } - late final __objc_msgSend_244Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_244 = __objc_msgSend_244Ptr.asFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _llroundfPtr = + _lookup>('llroundf'); + late final _llroundf = _llroundfPtr.asFunction(); - late final _sel_rangeOfComposedCharacterSequencesForRange_1 = - _registerName1("rangeOfComposedCharacterSequencesForRange:"); - NSRange _objc_msgSend_245( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, + int llround( + double arg0, ) { - return __objc_msgSend_245( - obj, - sel, - range, + return _llround( + arg0, ); } - late final __objc_msgSend_245Ptr = _lookup< - ffi.NativeFunction< - NSRange Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_245 = __objc_msgSend_245Ptr.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_246( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer locale, - ) { - return __objc_msgSend_246( - obj, - sel, - locale, + late final _llroundPtr = + _lookup>('llround'); + late final _llround = _llroundPtr.asFunction(); + + double truncf( + double arg0, + ) { + return _truncf( + arg0, ); } - late final __objc_msgSend_246Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_246 = __objc_msgSend_246Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _truncfPtr = + _lookup>('truncf'); + late final _truncf = _truncfPtr.asFunction(); - 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_247( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer startPtr, - ffi.Pointer lineEndPtr, - ffi.Pointer contentsEndPtr, - NSRange range, + double trunc( + double arg0, ) { - return __objc_msgSend_247( - obj, - sel, - startPtr, - lineEndPtr, - contentsEndPtr, - range, + return _trunc( + arg0, ); } - late final __objc_msgSend_247Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_247 = __objc_msgSend_247Ptr.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_248( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - int opts, - ffi.Pointer<_ObjCBlock> block, + late final _truncPtr = + _lookup>('trunc'); + late final _trunc = _truncPtr.asFunction(); + + double fmodf( + double arg0, + double arg1, ) { - return __objc_msgSend_248( - obj, - sel, - range, - opts, - block, + return _fmodf( + arg0, + arg1, ); } - late final __objc_msgSend_248Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Int32, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_248 = __objc_msgSend_248Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, int, - ffi.Pointer<_ObjCBlock>)>(); + late final _fmodfPtr = + _lookup>( + 'fmodf'); + late final _fmodf = _fmodfPtr.asFunction(); - late final _sel_enumerateLinesUsingBlock_1 = - _registerName1("enumerateLinesUsingBlock:"); - void _objc_msgSend_249( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + double fmod( + double arg0, + double arg1, ) { - return __objc_msgSend_249( - obj, - sel, - block, + return _fmod( + arg0, + arg1, ); } - late final __objc_msgSend_249Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_249 = __objc_msgSend_249Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + late final _fmodPtr = + _lookup>( + 'fmod'); + late final _fmod = _fmodPtr.asFunction(); - 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_250( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, - bool lossy, + double remainderf( + double arg0, + double arg1, ) { - return __objc_msgSend_250( - obj, - sel, - encoding, - lossy, + return _remainderf( + arg0, + arg1, ); } - late final __objc_msgSend_250Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSStringEncoding, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_250 = __objc_msgSend_250Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, bool)>(); + late final _remainderfPtr = + _lookup>( + 'remainderf'); + late final _remainderf = + _remainderfPtr.asFunction(); - late final _sel_dataUsingEncoding_1 = _registerName1("dataUsingEncoding:"); - ffi.Pointer _objc_msgSend_251( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, + double remainder( + double arg0, + double arg1, ) { - return __objc_msgSend_251( - obj, - sel, - encoding, + return _remainder( + arg0, + arg1, ); } - late final __objc_msgSend_251Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_251 = __objc_msgSend_251Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _remainderPtr = + _lookup>( + 'remainder'); + late final _remainder = + _remainderPtr.asFunction(); - late final _sel_canBeConvertedToEncoding_1 = - _registerName1("canBeConvertedToEncoding:"); - late final _sel_cStringUsingEncoding_1 = - _registerName1("cStringUsingEncoding:"); - ffi.Pointer _objc_msgSend_252( - ffi.Pointer obj, - ffi.Pointer sel, - int encoding, + double remquof( + double arg0, + double arg1, + ffi.Pointer arg2, ) { - return __objc_msgSend_252( - obj, - sel, - encoding, + return _remquof( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_252Ptr = _lookup< + late final _remquofPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_252 = __objc_msgSend_252Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Float Function( + ffi.Float, ffi.Float, ffi.Pointer)>>('remquof'); + late final _remquof = _remquofPtr + .asFunction)>(); - late final _sel_getCString_maxLength_encoding_1 = - _registerName1("getCString:maxLength:encoding:"); - bool _objc_msgSend_253( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - int encoding, + double remquo( + double arg0, + double arg1, + ffi.Pointer arg2, ) { - return __objc_msgSend_253( - obj, - sel, - buffer, - maxBufferCount, - encoding, + return _remquo( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_253Ptr = _lookup< + late final _remquoPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_253 = __objc_msgSend_253Ptr.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_254( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int maxBufferCount, - ffi.Pointer usedBufferCount, - int encoding, - int options, - NSRange range, - NSRangePointer leftover, + ffi.Double Function( + ffi.Double, ffi.Double, ffi.Pointer)>>('remquo'); + late final _remquo = _remquoPtr + .asFunction)>(); + + double copysignf( + double arg0, + double arg1, ) { - return __objc_msgSend_254( - obj, - sel, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover, + return _copysignf( + arg0, + arg1, ); } - late final __objc_msgSend_254Ptr = _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_254 = __objc_msgSend_254Ptr.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_255( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_255( - obj, - sel, - ); - } + late final _copysignfPtr = + _lookup>( + 'copysignf'); + late final _copysignf = + _copysignfPtr.asFunction(); - late final __objc_msgSend_255Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_255 = __objc_msgSend_255Ptr.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:"); - ffi.Pointer _objc_msgSend_256( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer separator, - ) { - return __objc_msgSend_256( - obj, - sel, - separator, + double copysign( + double arg0, + double arg1, + ) { + return _copysign( + arg0, + arg1, ); } - late final __objc_msgSend_256Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_256 = __objc_msgSend_256Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _copysignPtr = + _lookup>( + 'copysign'); + late final _copysign = + _copysignPtr.asFunction(); - late final _sel_componentsSeparatedByCharactersInSet_1 = - _registerName1("componentsSeparatedByCharactersInSet:"); - ffi.Pointer _objc_msgSend_257( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer separator, + double nanf( + ffi.Pointer arg0, ) { - return __objc_msgSend_257( - obj, - sel, - separator, + return _nanf( + arg0, ); } - late final __objc_msgSend_257Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_257 = __objc_msgSend_257Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _nanfPtr = + _lookup)>>( + 'nanf'); + late final _nanf = + _nanfPtr.asFunction)>(); - late final _sel_stringByTrimmingCharactersInSet_1 = - _registerName1("stringByTrimmingCharactersInSet:"); - ffi.Pointer _objc_msgSend_258( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer set1, + double nan( + ffi.Pointer arg0, ) { - return __objc_msgSend_258( - obj, - sel, - set1, + return _nan( + arg0, ); } - late final __objc_msgSend_258Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_258 = __objc_msgSend_258Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _nanPtr = + _lookup)>>( + 'nan'); + late final _nan = + _nanPtr.asFunction)>(); - late final _sel_stringByPaddingToLength_withString_startingAtIndex_1 = - _registerName1("stringByPaddingToLength:withString:startingAtIndex:"); - ffi.Pointer _objc_msgSend_259( - ffi.Pointer obj, - ffi.Pointer sel, - int newLength, - ffi.Pointer padString, - int padIndex, + double nextafterf( + double arg0, + double arg1, ) { - return __objc_msgSend_259( - obj, - sel, - newLength, - padString, - padIndex, + return _nextafterf( + arg0, + arg1, ); } - late final __objc_msgSend_259Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_259 = __objc_msgSend_259Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); + late final _nextafterfPtr = + _lookup>( + 'nextafterf'); + late final _nextafterf = + _nextafterfPtr.asFunction(); - late final _sel_stringByFoldingWithOptions_locale_1 = - _registerName1("stringByFoldingWithOptions:locale:"); - ffi.Pointer _objc_msgSend_260( - ffi.Pointer obj, - ffi.Pointer sel, - int options, - ffi.Pointer locale, + double nextafter( + double arg0, + double arg1, ) { - return __objc_msgSend_260( - obj, - sel, - options, - locale, + return _nextafter( + arg0, + arg1, ); } - late final __objc_msgSend_260Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_260 = __objc_msgSend_260Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer)>(); + late final _nextafterPtr = + _lookup>( + 'nextafter'); + late final _nextafter = + _nextafterPtr.asFunction(); - late final _sel_stringByReplacingOccurrencesOfString_withString_options_range_1 = - _registerName1( - "stringByReplacingOccurrencesOfString:withString:options:range:"); - ffi.Pointer _objc_msgSend_261( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - NSRange searchRange, + double fdimf( + double arg0, + double arg1, ) { - return __objc_msgSend_261( - obj, - sel, - target, - replacement, - options, - searchRange, + return _fdimf( + arg0, + arg1, ); } - late final __objc_msgSend_261Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_261 = __objc_msgSend_261Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - NSRange)>(); + late final _fdimfPtr = + _lookup>( + 'fdimf'); + late final _fdimf = _fdimfPtr.asFunction(); - late final _sel_stringByReplacingOccurrencesOfString_withString_1 = - _registerName1("stringByReplacingOccurrencesOfString:withString:"); - ffi.Pointer _objc_msgSend_262( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, + double fdim( + double arg0, + double arg1, ) { - return __objc_msgSend_262( - obj, - sel, - target, - replacement, + return _fdim( + arg0, + arg1, ); } - late final __objc_msgSend_262Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_262 = __objc_msgSend_262Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + late final _fdimPtr = + _lookup>( + 'fdim'); + late final _fdim = _fdimPtr.asFunction(); - late final _sel_stringByReplacingCharactersInRange_withString_1 = - _registerName1("stringByReplacingCharactersInRange:withString:"); - ffi.Pointer _objc_msgSend_263( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer replacement, + double fmaxf( + double arg0, + double arg1, ) { - return __objc_msgSend_263( - obj, - sel, - range, - replacement, + return _fmaxf( + arg0, + arg1, ); } - late final __objc_msgSend_263Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSRange, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_263 = __objc_msgSend_263Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange, ffi.Pointer)>(); + late final _fmaxfPtr = + _lookup>( + 'fmaxf'); + late final _fmaxf = _fmaxfPtr.asFunction(); - late final _sel_stringByApplyingTransform_reverse_1 = - _registerName1("stringByApplyingTransform:reverse:"); - ffi.Pointer _objc_msgSend_264( - ffi.Pointer obj, - ffi.Pointer sel, - NSStringTransform transform, - bool reverse, + double fmax( + double arg0, + double arg1, ) { - return __objc_msgSend_264( - obj, - sel, - transform, - reverse, + return _fmax( + arg0, + arg1, ); } - late final __objc_msgSend_264Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSStringTransform, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_264 = __objc_msgSend_264Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringTransform, bool)>(); + late final _fmaxPtr = + _lookup>( + 'fmax'); + late final _fmax = _fmaxPtr.asFunction(); - late final _sel_writeToURL_atomically_encoding_error_1 = - _registerName1("writeToURL:atomically:encoding:error:"); - bool _objc_msgSend_265( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error, + double fminf( + double arg0, + double arg1, ) { - return __objc_msgSend_265( - obj, - sel, - url, - useAuxiliaryFile, - enc, - error, + return _fminf( + arg0, + arg1, ); } - late final __objc_msgSend_265Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_265 = __objc_msgSend_265Ptr.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_266( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - bool useAuxiliaryFile, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_266( - obj, - sel, - path, - useAuxiliaryFile, - enc, - error, - ); - } + late final _fminfPtr = + _lookup>( + 'fminf'); + late final _fminf = _fminfPtr.asFunction(); - late final __objc_msgSend_266Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Bool, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_266 = __objc_msgSend_266Ptr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - bool, - int, - ffi.Pointer>)>(); - - late final _sel_initWithCharactersNoCopy_length_freeWhenDone_1 = - _registerName1("initWithCharactersNoCopy:length:freeWhenDone:"); - instancetype _objc_msgSend_267( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, - bool freeBuffer, + double fmin( + double arg0, + double arg1, ) { - return __objc_msgSend_267( - obj, - sel, - characters, - length, - freeBuffer, + return _fmin( + arg0, + arg1, ); } - late final __objc_msgSend_267Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_267 = __objc_msgSend_267Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, bool)>(); + late final _fminPtr = + _lookup>( + 'fmin'); + late final _fmin = _fminPtr.asFunction(); - late final _sel_initWithCharactersNoCopy_length_deallocator_1 = - _registerName1("initWithCharactersNoCopy:length:deallocator:"); - instancetype _objc_msgSend_268( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer chars, - int len, - ffi.Pointer<_ObjCBlock> deallocator, + double fmaf( + double arg0, + double arg1, + double arg2, ) { - return __objc_msgSend_268( - obj, - sel, - chars, - len, - deallocator, + return _fmaf( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_268Ptr = _lookup< + late final _fmafPtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_268 = __objc_msgSend_268Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, ffi.Pointer<_ObjCBlock>)>(); + ffi.Float Function(ffi.Float, ffi.Float, ffi.Float)>>('fmaf'); + late final _fmaf = + _fmafPtr.asFunction(); - late final _sel_initWithCharacters_length_1 = - _registerName1("initWithCharacters:length:"); - instancetype _objc_msgSend_269( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer characters, - int length, + double fma( + double arg0, + double arg1, + double arg2, ) { - return __objc_msgSend_269( - obj, - sel, - characters, - length, + return _fma( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_269Ptr = _lookup< + late final _fmaPtr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_269 = __objc_msgSend_269Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Double Function(ffi.Double, ffi.Double, ffi.Double)>>('fma'); + late final _fma = + _fmaPtr.asFunction(); - late final _sel_initWithUTF8String_1 = _registerName1("initWithUTF8String:"); - instancetype _objc_msgSend_270( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, + double __exp10f( + double arg0, ) { - return __objc_msgSend_270( - obj, - sel, - nullTerminatedCString, + return ___exp10f( + arg0, ); } - late final __objc_msgSend_270Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_270 = __objc_msgSend_270Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final ___exp10fPtr = + _lookup>('__exp10f'); + late final ___exp10f = ___exp10fPtr.asFunction(); - late final _sel_initWithFormat_1 = _registerName1("initWithFormat:"); - late final _sel_initWithFormat_arguments_1 = - _registerName1("initWithFormat:arguments:"); - instancetype _objc_msgSend_271( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - va_list argList, + double __exp10( + double arg0, ) { - return __objc_msgSend_271( - obj, - sel, - format, - argList, + return ___exp10( + arg0, ); } - late final __objc_msgSend_271Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, va_list)>>('objc_msgSend'); - late final __objc_msgSend_271 = __objc_msgSend_271Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, va_list)>(); + late final ___exp10Ptr = + _lookup>('__exp10'); + late final ___exp10 = ___exp10Ptr.asFunction(); - late final _sel_initWithFormat_locale_1 = - _registerName1("initWithFormat:locale:"); - instancetype _objc_msgSend_272( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, + double __cospif( + double arg0, ) { - return __objc_msgSend_272( - obj, - sel, - format, - locale, + return ___cospif( + arg0, ); } - late final __objc_msgSend_272Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_272 = __objc_msgSend_272Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final ___cospifPtr = + _lookup>('__cospif'); + late final ___cospif = ___cospifPtr.asFunction(); - late final _sel_initWithFormat_locale_arguments_1 = - _registerName1("initWithFormat:locale:arguments:"); - instancetype _objc_msgSend_273( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer locale, - va_list argList, + double __cospi( + double arg0, ) { - return __objc_msgSend_273( - obj, - sel, - format, - locale, - argList, + return ___cospi( + arg0, ); } - late final __objc_msgSend_273Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - va_list)>>('objc_msgSend'); - late final __objc_msgSend_273 = __objc_msgSend_273Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, va_list)>(); + late final ___cospiPtr = + _lookup>('__cospi'); + late final ___cospi = ___cospiPtr.asFunction(); - late final _sel_initWithValidatedFormat_validFormatSpecifiers_error_1 = - _registerName1("initWithValidatedFormat:validFormatSpecifiers:error:"); - instancetype _objc_msgSend_274( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - ffi.Pointer> error, + double __sinpif( + double arg0, ) { - return __objc_msgSend_274( - obj, - sel, - format, - validFormatSpecifiers, - error, + return ___sinpif( + arg0, ); } - late final __objc_msgSend_274Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_274 = __objc_msgSend_274Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1 = - _registerName1( - "initWithValidatedFormat:validFormatSpecifiers:locale:error:"); - instancetype _objc_msgSend_275( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - ffi.Pointer locale, - ffi.Pointer> error, - ) { - return __objc_msgSend_275( - obj, - sel, - format, - validFormatSpecifiers, - locale, - error, - ); - } + late final ___sinpifPtr = + _lookup>('__sinpif'); + late final ___sinpif = ___sinpifPtr.asFunction(); - late final __objc_msgSend_275Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_275 = __objc_msgSend_275Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - late final _sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1 = - _registerName1( - "initWithValidatedFormat:validFormatSpecifiers:arguments:error:"); - instancetype _objc_msgSend_276( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - va_list argList, - ffi.Pointer> error, - ) { - return __objc_msgSend_276( - obj, - sel, - format, - validFormatSpecifiers, - argList, - error, + double __sinpi( + double arg0, + ) { + return ___sinpi( + arg0, ); } - late final __objc_msgSend_276Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - va_list, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_276 = __objc_msgSend_276Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - va_list, - ffi.Pointer>)>(); - - late final _sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1 = - _registerName1( - "initWithValidatedFormat:validFormatSpecifiers:locale:arguments:error:"); - instancetype _objc_msgSend_277( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer format, - ffi.Pointer validFormatSpecifiers, - ffi.Pointer locale, - va_list argList, - ffi.Pointer> error, - ) { - return __objc_msgSend_277( - obj, - sel, - format, - validFormatSpecifiers, - locale, - argList, - error, - ); - } + late final ___sinpiPtr = + _lookup>('__sinpi'); + late final ___sinpi = ___sinpiPtr.asFunction(); - late final __objc_msgSend_277Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - va_list, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_277 = __objc_msgSend_277Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - va_list, - ffi.Pointer>)>(); - - late final _sel_initWithData_encoding_1 = - _registerName1("initWithData:encoding:"); - instancetype _objc_msgSend_278( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - int encoding, + double __tanpif( + double arg0, ) { - return __objc_msgSend_278( - obj, - sel, - data, - encoding, + return ___tanpif( + arg0, ); } - late final __objc_msgSend_278Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_278 = __objc_msgSend_278Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final ___tanpifPtr = + _lookup>('__tanpif'); + late final ___tanpif = ___tanpifPtr.asFunction(); - late final _sel_initWithBytes_length_encoding_1 = - _registerName1("initWithBytes:length:encoding:"); - instancetype _objc_msgSend_279( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, + double __tanpi( + double arg0, ) { - return __objc_msgSend_279( - obj, - sel, - bytes, - len, - encoding, + return ___tanpi( + arg0, ); } - late final __objc_msgSend_279Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_279 = __objc_msgSend_279Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + late final ___tanpiPtr = + _lookup>('__tanpi'); + late final ___tanpi = ___tanpiPtr.asFunction(); - late final _sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1 = - _registerName1("initWithBytesNoCopy:length:encoding:freeWhenDone:"); - instancetype _objc_msgSend_280( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - bool freeBuffer, + __float2 __sincosf_stret( + double arg0, ) { - return __objc_msgSend_280( - obj, - sel, - bytes, - len, - encoding, - freeBuffer, + return ___sincosf_stret( + arg0, ); } - late final __objc_msgSend_280Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_280 = __objc_msgSend_280Ptr.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_281( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int len, - int encoding, - ffi.Pointer<_ObjCBlock> deallocator, + late final ___sincosf_stretPtr = + _lookup>( + '__sincosf_stret'); + late final ___sincosf_stret = + ___sincosf_stretPtr.asFunction<__float2 Function(double)>(); + + __double2 __sincos_stret( + double arg0, ) { - return __objc_msgSend_281( - obj, - sel, - bytes, - len, - encoding, - deallocator, + return ___sincos_stret( + arg0, ); } - late final __objc_msgSend_281Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSStringEncoding, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_281 = __objc_msgSend_281Ptr.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_stringWithValidatedFormat_validFormatSpecifiers_error_1 = - _registerName1("stringWithValidatedFormat:validFormatSpecifiers:error:"); - late final _sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1 = - _registerName1( - "localizedStringWithValidatedFormat:validFormatSpecifiers:error:"); - late final _sel_initWithCString_encoding_1 = - _registerName1("initWithCString:encoding:"); - instancetype _objc_msgSend_282( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer nullTerminatedCString, - int encoding, + late final ___sincos_stretPtr = + _lookup>( + '__sincos_stret'); + late final ___sincos_stret = + ___sincos_stretPtr.asFunction<__double2 Function(double)>(); + + __float2 __sincospif_stret( + double arg0, ) { - return __objc_msgSend_282( - obj, - sel, - nullTerminatedCString, - encoding, + return ___sincospif_stret( + arg0, ); } - late final __objc_msgSend_282Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_282 = __objc_msgSend_282Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final ___sincospif_stretPtr = + _lookup>( + '__sincospif_stret'); + late final ___sincospif_stret = + ___sincospif_stretPtr.asFunction<__float2 Function(double)>(); - late final _sel_stringWithCString_encoding_1 = - _registerName1("stringWithCString:encoding:"); - late final _sel_initWithContentsOfURL_encoding_error_1 = - _registerName1("initWithContentsOfURL:encoding:error:"); - instancetype _objc_msgSend_283( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int enc, - ffi.Pointer> error, + __double2 __sincospi_stret( + double arg0, ) { - return __objc_msgSend_283( - obj, - sel, - url, - enc, - error, + return ___sincospi_stret( + arg0, ); } - late final __objc_msgSend_283Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_283 = __objc_msgSend_283Ptr.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_284( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - int enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_284( - obj, - sel, - path, - enc, - error, - ); - } + late final ___sincospi_stretPtr = + _lookup>( + '__sincospi_stret'); + late final ___sincospi_stret = + ___sincospi_stretPtr.asFunction<__double2 Function(double)>(); - late final __objc_msgSend_284Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSStringEncoding, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_284 = __objc_msgSend_284Ptr.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_285( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_285( - obj, - sel, - url, - enc, - error, + double j0( + double arg0, + ) { + return _j0( + arg0, ); } - late final __objc_msgSend_285Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_285 = __objc_msgSend_285Ptr.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_286( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ffi.Pointer enc, - ffi.Pointer> error, - ) { - return __objc_msgSend_286( - obj, - sel, - path, - enc, - error, - ); - } + late final _j0Ptr = + _lookup>('j0'); + late final _j0 = _j0Ptr.asFunction(); - late final __objc_msgSend_286Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_286 = __objc_msgSend_286Ptr.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_287( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ffi.Pointer opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion, - ) { - return __objc_msgSend_287( - obj, - sel, - data, - opts, - string, - usedLossyConversion, + double j1( + double arg0, + ) { + return _j1( + arg0, ); } - late final __objc_msgSend_287Ptr = _lookup< - ffi.NativeFunction< - NSStringEncoding Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_287 = __objc_msgSend_287Ptr.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"); - ffi.Pointer _objc_msgSend_288( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_288( - obj, - sel, + late final _j1Ptr = + _lookup>('j1'); + late final _j1 = _j1Ptr.asFunction(); + + double jn( + int arg0, + double arg1, + ) { + return _jn( + arg0, + arg1, ); } - late final __objc_msgSend_288Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_288 = __objc_msgSend_288Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _jnPtr = + _lookup>( + 'jn'); + late final _jn = _jnPtr.asFunction(); - 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:"); - void _objc_msgSend_289( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, + double y0( + double arg0, ) { - return __objc_msgSend_289( - obj, - sel, - bytes, + return _y0( + arg0, ); } - late final __objc_msgSend_289Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_289 = __objc_msgSend_289Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _y0Ptr = + _lookup>('y0'); + late final _y0 = _y0Ptr.asFunction(); - late final _sel_getCString_maxLength_1 = - _registerName1("getCString:maxLength:"); - void _objc_msgSend_290( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, + double y1( + double arg0, ) { - return __objc_msgSend_290( - obj, - sel, - bytes, - maxLength, + return _y1( + arg0, ); } - late final __objc_msgSend_290Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_290 = __objc_msgSend_290Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final _y1Ptr = + _lookup>('y1'); + late final _y1 = _y1Ptr.asFunction(); - late final _sel_getCString_maxLength_range_remainingRange_1 = - _registerName1("getCString:maxLength:range:remainingRange:"); - void _objc_msgSend_291( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int maxLength, - NSRange aRange, - NSRangePointer leftoverRange, + double yn( + int arg0, + double arg1, ) { - return __objc_msgSend_291( - obj, - sel, - bytes, - maxLength, - aRange, - leftoverRange, + return _yn( + arg0, + arg1, ); } - late final __objc_msgSend_291Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_291 = __objc_msgSend_291Ptr.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_292( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer bytes, - int length, - bool freeBuffer, + late final _ynPtr = + _lookup>( + 'yn'); + late final _yn = _ynPtr.asFunction(); + + double scalb( + double arg0, + double arg1, ) { - return __objc_msgSend_292( - obj, - sel, - bytes, - length, - freeBuffer, + return _scalb( + arg0, + arg1, ); } - late final __objc_msgSend_292Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_292 = __objc_msgSend_292Ptr.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_293( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - ) { - return __objc_msgSend_293( - obj, - sel, - buffer, - ); - } + late final _scalbPtr = + _lookup>( + 'scalb'); + late final _scalb = _scalbPtr.asFunction(); - late final __objc_msgSend_293Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_293 = __objc_msgSend_293Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final ffi.Pointer _signgam = _lookup('signgam'); - late final _sel_stringByAddingPercentEncodingWithAllowedCharacters_1 = - _registerName1("stringByAddingPercentEncodingWithAllowedCharacters:"); - ffi.Pointer _objc_msgSend_294( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer allowedCharacters, - ) { - return __objc_msgSend_294( - obj, - sel, - allowedCharacters, - ); - } + int get signgam => _signgam.value; - late final __objc_msgSend_294Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_294 = __objc_msgSend_294Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + set signgam(int value) => _signgam.value = value; - late final _sel_stringByRemovingPercentEncoding1 = - _registerName1("stringByRemovingPercentEncoding"); - late final _sel_stringByAddingPercentEscapesUsingEncoding_1 = - _registerName1("stringByAddingPercentEscapesUsingEncoding:"); - ffi.Pointer _objc_msgSend_295( - ffi.Pointer obj, - ffi.Pointer sel, - int enc, + int setjmp( + ffi.Pointer arg0, ) { - return __objc_msgSend_295( - obj, - sel, - enc, + return _setjmp1( + arg0, ); } - late final __objc_msgSend_295Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSStringEncoding)>>('objc_msgSend'); - late final __objc_msgSend_295 = __objc_msgSend_295Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _setjmpPtr = + _lookup)>>( + 'setjmp'); + late final _setjmp1 = + _setjmpPtr.asFunction)>(); - late final _sel_stringByReplacingPercentEscapesUsingEncoding_1 = - _registerName1("stringByReplacingPercentEscapesUsingEncoding:"); - late final _sel_debugDescription1 = _registerName1("debugDescription"); - late final _sel_version1 = _registerName1("version"); - late final _sel_setVersion_1 = _registerName1("setVersion:"); - void _objc_msgSend_296( - ffi.Pointer obj, - ffi.Pointer sel, - int aVersion, + void longjmp( + ffi.Pointer arg0, + int arg1, ) { - return __objc_msgSend_296( - obj, - sel, - aVersion, - ); - } - - late final __objc_msgSend_296Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_296 = __objc_msgSend_296Ptr.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_URL_resourceDataDidBecomeAvailable_1 = - _registerName1("URL:resourceDataDidBecomeAvailable:"); - void _objc_msgSend_297( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sender, - ffi.Pointer newBytes, - ) { - return __objc_msgSend_297( - obj, - sel, - sender, - newBytes, + return _longjmp1( + arg0, + arg1, ); } - late final __objc_msgSend_297Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_297 = __objc_msgSend_297Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_URLResourceDidFinishLoading_1 = - _registerName1("URLResourceDidFinishLoading:"); - void _objc_msgSend_298( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sender, - ) { - return __objc_msgSend_298( - obj, - sel, - sender, + late final _longjmpPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'longjmp'); + late final _longjmp1 = + _longjmpPtr.asFunction, int)>(); + + int _setjmp( + ffi.Pointer arg0, + ) { + return __setjmp( + arg0, ); } - late final __objc_msgSend_298Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_298 = __objc_msgSend_298Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final __setjmpPtr = + _lookup)>>( + '_setjmp'); + late final __setjmp = + __setjmpPtr.asFunction)>(); - late final _sel_URLResourceDidCancelLoading_1 = - _registerName1("URLResourceDidCancelLoading:"); - late final _sel_URL_resourceDidFailLoadingWithReason_1 = - _registerName1("URL:resourceDidFailLoadingWithReason:"); - void _objc_msgSend_299( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer sender, - ffi.Pointer reason, + void _longjmp( + ffi.Pointer arg0, + int arg1, ) { - return __objc_msgSend_299( - obj, - sel, - sender, - reason, + return __longjmp( + arg0, + arg1, ); } - late final __objc_msgSend_299Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_299 = __objc_msgSend_299Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1 = - _registerName1( - "attemptRecoveryFromError:optionIndex:delegate:didRecoverSelector:contextInfo:"); - void _objc_msgSend_300( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer error, - int recoveryOptionIndex, - ffi.Pointer delegate, - ffi.Pointer didRecoverSelector, - ffi.Pointer contextInfo, - ) { - return __objc_msgSend_300( - obj, - sel, - error, - recoveryOptionIndex, - delegate, - didRecoverSelector, - contextInfo, + late final __longjmpPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + '_longjmp'); + late final __longjmp = + __longjmpPtr.asFunction, int)>(); + + int sigsetjmp( + ffi.Pointer arg0, + int arg1, + ) { + return _sigsetjmp( + arg0, + arg1, ); } - late final __objc_msgSend_300Ptr = _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_300 = __objc_msgSend_300Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + late final _sigsetjmpPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'sigsetjmp'); + late final _sigsetjmp = + _sigsetjmpPtr.asFunction, int)>(); - late final _sel_attemptRecoveryFromError_optionIndex_1 = - _registerName1("attemptRecoveryFromError:optionIndex:"); - bool _objc_msgSend_301( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer error, - int recoveryOptionIndex, + void siglongjmp( + ffi.Pointer arg0, + int arg1, ) { - return __objc_msgSend_301( - obj, - sel, - error, - recoveryOptionIndex, + return _siglongjmp( + arg0, + arg1, ); } - late final __objc_msgSend_301Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_301 = __objc_msgSend_301Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _NSFoundationVersionNumber = - _lookup('NSFoundationVersionNumber'); + late final _siglongjmpPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'siglongjmp'); + late final _siglongjmp = + _siglongjmpPtr.asFunction, int)>(); - double get NSFoundationVersionNumber => _NSFoundationVersionNumber.value; + void longjmperror() { + return _longjmperror(); + } - set NSFoundationVersionNumber(double value) => - _NSFoundationVersionNumber.value = value; + late final _longjmperrorPtr = + _lookup>('longjmperror'); + late final _longjmperror = _longjmperrorPtr.asFunction(); - NSString NSStringFromSelector( - ffi.Pointer aSelector, - ) { - return NSString._( - _NSStringFromSelector( - aSelector, - ), - this, - retain: true, - release: true); - } + late final ffi.Pointer>> _sys_signame = + _lookup>>('sys_signame'); - late final _NSStringFromSelectorPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSStringFromSelector'); - late final _NSStringFromSelector = _NSStringFromSelectorPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer> get sys_signame => _sys_signame.value; - ffi.Pointer NSSelectorFromString( - NSString aSelectorName, - ) { - return _NSSelectorFromString( - aSelectorName._id, - ); - } + set sys_signame(ffi.Pointer> value) => + _sys_signame.value = value; - late final _NSSelectorFromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSSelectorFromString'); - late final _NSSelectorFromString = _NSSelectorFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final ffi.Pointer>> _sys_siglist = + _lookup>>('sys_siglist'); - NSString NSStringFromClass( - NSObject aClass, - ) { - return NSString._( - _NSStringFromClass( - aClass._id, - ), - this, - retain: true, - release: true); - } + ffi.Pointer> get sys_siglist => _sys_siglist.value; - late final _NSStringFromClassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSStringFromClass'); - late final _NSStringFromClass = _NSStringFromClassPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + set sys_siglist(ffi.Pointer> value) => + _sys_siglist.value = value; - NSObject? NSClassFromString( - NSString aClassName, + int raise( + int arg0, ) { - return _NSClassFromString( - aClassName._id, - ).address == - 0 - ? null - : NSObject._( - _NSClassFromString( - aClassName._id, - ), - this, - retain: true, - release: true); + return _raise( + arg0, + ); } - late final _NSClassFromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSClassFromString'); - late final _NSClassFromString = _NSClassFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _raisePtr = + _lookup>('raise'); + late final _raise = _raisePtr.asFunction(); - NSString NSStringFromProtocol( - Protocol proto, + ffi.Pointer> bsd_signal( + int arg0, + ffi.Pointer> arg1, ) { - return NSString._( - _NSStringFromProtocol( - proto._id, - ), - this, - retain: true, - release: true); + return _bsd_signal( + arg0, + arg1, + ); } - late final _NSStringFromProtocolPtr = _lookup< + late final _bsd_signalPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSStringFromProtocol'); - late final _NSStringFromProtocol = _NSStringFromProtocolPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer> Function( + ffi.Int, + ffi.Pointer< + ffi + .NativeFunction>)>>('bsd_signal'); + late final _bsd_signal = _bsd_signalPtr.asFunction< + ffi.Pointer> Function( + int, ffi.Pointer>)>(); - Protocol? NSProtocolFromString( - NSString namestr, + int kill( + int arg0, + int arg1, ) { - return _NSProtocolFromString( - namestr._id, - ).address == - 0 - ? null - : Protocol._( - _NSProtocolFromString( - namestr._id, - ), - this, - retain: true, - release: true); + return _kill( + arg0, + arg1, + ); } - late final _NSProtocolFromStringPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('NSProtocolFromString'); - late final _NSProtocolFromString = _NSProtocolFromStringPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _killPtr = + _lookup>('kill'); + late final _kill = _killPtr.asFunction(); - ffi.Pointer NSGetSizeAndAlignment( - ffi.Pointer typePtr, - ffi.Pointer sizep, - ffi.Pointer alignp, + int killpg( + int arg0, + int arg1, ) { - return _NSGetSizeAndAlignment( - typePtr, - sizep, - alignp, + return _killpg( + arg0, + arg1, ); } - 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)>(); + late final _killpgPtr = + _lookup>('killpg'); + late final _killpg = _killpgPtr.asFunction(); - void NSLog( - NSString format, + int pthread_kill( + pthread_t arg0, + int arg1, ) { - return _NSLog( - format._id, + return _pthread_kill( + arg0, + arg1, ); } - late final _NSLogPtr = - _lookup)>>( - 'NSLog'); - late final _NSLog = - _NSLogPtr.asFunction)>(); + late final _pthread_killPtr = + _lookup>( + 'pthread_kill'); + late final _pthread_kill = + _pthread_killPtr.asFunction(); - void NSLogv( - NSString format, - va_list args, + int pthread_sigmask( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return _NSLogv( - format._id, - args, + return _pthread_sigmask( + arg0, + arg1, + arg2, ); } - late final _NSLogvPtr = _lookup< + late final _pthread_sigmaskPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, va_list)>>('NSLogv'); - late final _NSLogv = - _NSLogvPtr.asFunction, va_list)>(); - - late final ffi.Pointer _NSNotFound = - _lookup('NSNotFound'); - - int get NSNotFound => _NSNotFound.value; + ffi.Int Function(ffi.Int, ffi.Pointer, + ffi.Pointer)>>('pthread_sigmask'); + late final _pthread_sigmask = _pthread_sigmaskPtr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer _Block_copy1( - ffi.Pointer aBlock, + int sigaction1( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return __Block_copy1( - aBlock, + return _sigaction1( + arg0, + arg1, + arg2, ); } - late final __Block_copy1Ptr = _lookup< + late final _sigaction1Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('_Block_copy'); - late final __Block_copy1 = __Block_copy1Ptr - .asFunction Function(ffi.Pointer)>(); + ffi.Int Function(ffi.Int, ffi.Pointer, + ffi.Pointer)>>('sigaction'); + late final _sigaction1 = _sigaction1Ptr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer)>(); - void _Block_release1( - ffi.Pointer aBlock, + int sigaddset( + ffi.Pointer arg0, + int arg1, ) { - return __Block_release1( - aBlock, + return _sigaddset( + arg0, + arg1, ); } - late final __Block_release1Ptr = - _lookup)>>( - '_Block_release'); - late final __Block_release1 = - __Block_release1Ptr.asFunction)>(); + late final _sigaddsetPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'sigaddset'); + late final _sigaddset = + _sigaddsetPtr.asFunction, int)>(); - void _Block_object_assign( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + int sigaltstack( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __Block_object_assign( + return _sigaltstack( arg0, arg1, - arg2, ); } - late final __Block_object_assignPtr = _lookup< + late final _sigaltstackPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('_Block_object_assign'); - late final __Block_object_assign = __Block_object_assignPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('sigaltstack'); + late final _sigaltstack = _sigaltstackPtr + .asFunction, ffi.Pointer)>(); - void _Block_object_dispose( - ffi.Pointer arg0, + int sigdelset( + ffi.Pointer arg0, int arg1, ) { - return __Block_object_dispose( + return _sigdelset( arg0, arg1, ); } - late final __Block_object_disposePtr = _lookup< - ffi - .NativeFunction, ffi.Int)>>( - '_Block_object_dispose'); - late final __Block_object_dispose = __Block_object_disposePtr - .asFunction, int)>(); - - late final ffi.Pointer>> - __NSConcreteGlobalBlock = - _lookup>>('_NSConcreteGlobalBlock'); - - ffi.Pointer> get _NSConcreteGlobalBlock => - __NSConcreteGlobalBlock.value; - - set _NSConcreteGlobalBlock(ffi.Pointer> value) => - __NSConcreteGlobalBlock.value = value; - - late final ffi.Pointer>> - __NSConcreteStackBlock = - _lookup>>('_NSConcreteStackBlock'); - - ffi.Pointer> get _NSConcreteStackBlock => - __NSConcreteStackBlock.value; - - set _NSConcreteStackBlock(ffi.Pointer> value) => - __NSConcreteStackBlock.value = value; - - void Debugger() { - return _Debugger(); - } - - late final _DebuggerPtr = - _lookup>('Debugger'); - late final _Debugger = _DebuggerPtr.asFunction(); + late final _sigdelsetPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'sigdelset'); + late final _sigdelset = + _sigdelsetPtr.asFunction, int)>(); - void DebugStr( - ConstStr255Param debuggerMsg, + int sigemptyset( + ffi.Pointer arg0, ) { - return _DebugStr( - debuggerMsg, + return _sigemptyset( + arg0, ); } - late final _DebugStrPtr = - _lookup>( - 'DebugStr'); - late final _DebugStr = - _DebugStrPtr.asFunction(); - - void SysBreak() { - return _SysBreak(); - } - - late final _SysBreakPtr = - _lookup>('SysBreak'); - late final _SysBreak = _SysBreakPtr.asFunction(); + late final _sigemptysetPtr = + _lookup)>>( + 'sigemptyset'); + late final _sigemptyset = + _sigemptysetPtr.asFunction)>(); - void SysBreakStr( - ConstStr255Param debuggerMsg, + int sigfillset( + ffi.Pointer arg0, ) { - return _SysBreakStr( - debuggerMsg, + return _sigfillset( + arg0, ); } - late final _SysBreakStrPtr = - _lookup>( - 'SysBreakStr'); - late final _SysBreakStr = - _SysBreakStrPtr.asFunction(); + late final _sigfillsetPtr = + _lookup)>>( + 'sigfillset'); + late final _sigfillset = + _sigfillsetPtr.asFunction)>(); - void SysBreakFunc( - ConstStr255Param debuggerMsg, + int sighold( + int arg0, ) { - return _SysBreakFunc( - debuggerMsg, + return _sighold( + arg0, ); } - late final _SysBreakFuncPtr = - _lookup>( - 'SysBreakFunc'); - late final _SysBreakFunc = - _SysBreakFuncPtr.asFunction(); - - 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; + late final _sigholdPtr = + _lookup>('sighold'); + late final _sighold = _sigholdPtr.asFunction(); - CFRange __CFRangeMake( - int loc, - int len, + int sigignore( + int arg0, ) { - return ___CFRangeMake( - loc, - len, + return _sigignore( + arg0, ); } - 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; - - late final ffi.Pointer _kCFAllocatorDefault = - _lookup('kCFAllocatorDefault'); - - CFAllocatorRef get kCFAllocatorDefault => _kCFAllocatorDefault.value; - - late final ffi.Pointer _kCFAllocatorSystemDefault = - _lookup('kCFAllocatorSystemDefault'); - - CFAllocatorRef get kCFAllocatorSystemDefault => - _kCFAllocatorSystemDefault.value; - - late final ffi.Pointer _kCFAllocatorMalloc = - _lookup('kCFAllocatorMalloc'); - - CFAllocatorRef get kCFAllocatorMalloc => _kCFAllocatorMalloc.value; - - late final ffi.Pointer _kCFAllocatorMallocZone = - _lookup('kCFAllocatorMallocZone'); - - CFAllocatorRef get kCFAllocatorMallocZone => _kCFAllocatorMallocZone.value; - - late final ffi.Pointer _kCFAllocatorNull = - _lookup('kCFAllocatorNull'); - - CFAllocatorRef get kCFAllocatorNull => _kCFAllocatorNull.value; - - late final ffi.Pointer _kCFAllocatorUseContext = - _lookup('kCFAllocatorUseContext'); - - CFAllocatorRef get kCFAllocatorUseContext => _kCFAllocatorUseContext.value; - - int CFAllocatorGetTypeID() { - return _CFAllocatorGetTypeID(); - } - - late final _CFAllocatorGetTypeIDPtr = - _lookup>('CFAllocatorGetTypeID'); - late final _CFAllocatorGetTypeID = - _CFAllocatorGetTypeIDPtr.asFunction(); + late final _sigignorePtr = + _lookup>('sigignore'); + late final _sigignore = _sigignorePtr.asFunction(); - void CFAllocatorSetDefault( - CFAllocatorRef allocator, + int siginterrupt( + int arg0, + int arg1, ) { - return _CFAllocatorSetDefault( - allocator, + return _siginterrupt( + arg0, + arg1, ); } - late final _CFAllocatorSetDefaultPtr = - _lookup>( - 'CFAllocatorSetDefault'); - late final _CFAllocatorSetDefault = - _CFAllocatorSetDefaultPtr.asFunction(); + late final _siginterruptPtr = + _lookup>( + 'siginterrupt'); + late final _siginterrupt = + _siginterruptPtr.asFunction(); - CFAllocatorRef CFAllocatorGetDefault() { - return _CFAllocatorGetDefault(); + int sigismember( + ffi.Pointer arg0, + int arg1, + ) { + return _sigismember( + arg0, + arg1, + ); } - late final _CFAllocatorGetDefaultPtr = - _lookup>( - 'CFAllocatorGetDefault'); - late final _CFAllocatorGetDefault = - _CFAllocatorGetDefaultPtr.asFunction(); + late final _sigismemberPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'sigismember'); + late final _sigismember = + _sigismemberPtr.asFunction, int)>(); - CFAllocatorRef CFAllocatorCreate( - CFAllocatorRef allocator, - ffi.Pointer context, + int sigpause( + int arg0, ) { - return _CFAllocatorCreate( - allocator, - context, + return _sigpause( + arg0, ); } - late final _CFAllocatorCreatePtr = _lookup< - ffi.NativeFunction< - CFAllocatorRef Function(CFAllocatorRef, - ffi.Pointer)>>('CFAllocatorCreate'); - late final _CFAllocatorCreate = _CFAllocatorCreatePtr.asFunction< - CFAllocatorRef Function( - CFAllocatorRef, ffi.Pointer)>(); + late final _sigpausePtr = + _lookup>('sigpause'); + late final _sigpause = _sigpausePtr.asFunction(); - ffi.Pointer CFAllocatorAllocate( - CFAllocatorRef allocator, - int size, - int hint, + int sigpending( + ffi.Pointer arg0, ) { - return _CFAllocatorAllocate( - allocator, - size, - hint, + return _sigpending( + arg0, ); } - late final _CFAllocatorAllocatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - CFAllocatorRef, CFIndex, CFOptionFlags)>>('CFAllocatorAllocate'); - late final _CFAllocatorAllocate = _CFAllocatorAllocatePtr.asFunction< - ffi.Pointer Function(CFAllocatorRef, int, int)>(); + late final _sigpendingPtr = + _lookup)>>( + 'sigpending'); + late final _sigpending = + _sigpendingPtr.asFunction)>(); - ffi.Pointer CFAllocatorReallocate( - CFAllocatorRef allocator, - ffi.Pointer ptr, - int newsize, - int hint, + int sigprocmask( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return _CFAllocatorReallocate( - allocator, - ptr, - newsize, - hint, + return _sigprocmask( + arg0, + arg1, + arg2, ); } - late final _CFAllocatorReallocatePtr = _lookup< + late final _sigprocmaskPtr = _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)>(); + ffi.Int Function(ffi.Int, ffi.Pointer, + ffi.Pointer)>>('sigprocmask'); + late final _sigprocmask = _sigprocmaskPtr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer)>(); - void CFAllocatorDeallocate( - CFAllocatorRef allocator, - ffi.Pointer ptr, + int sigrelse( + int arg0, ) { - return _CFAllocatorDeallocate( - allocator, - ptr, + return _sigrelse( + arg0, ); } - late final _CFAllocatorDeallocatePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef, ffi.Pointer)>>('CFAllocatorDeallocate'); - late final _CFAllocatorDeallocate = _CFAllocatorDeallocatePtr.asFunction< - void Function(CFAllocatorRef, ffi.Pointer)>(); + late final _sigrelsePtr = + _lookup>('sigrelse'); + late final _sigrelse = _sigrelsePtr.asFunction(); - int CFAllocatorGetPreferredSizeForSize( - CFAllocatorRef allocator, - int size, - int hint, + ffi.Pointer> sigset( + int arg0, + ffi.Pointer> arg1, ) { - return _CFAllocatorGetPreferredSizeForSize( - allocator, - size, - hint, + return _sigset( + arg0, + arg1, ); } - late final _CFAllocatorGetPreferredSizeForSizePtr = _lookup< + late final _sigsetPtr = _lookup< ffi.NativeFunction< - CFIndex Function(CFAllocatorRef, CFIndex, - CFOptionFlags)>>('CFAllocatorGetPreferredSizeForSize'); - late final _CFAllocatorGetPreferredSizeForSize = - _CFAllocatorGetPreferredSizeForSizePtr.asFunction< - int Function(CFAllocatorRef, int, int)>(); + ffi.Pointer> Function( + ffi.Int, + ffi.Pointer< + ffi.NativeFunction>)>>('sigset'); + late final _sigset = _sigsetPtr.asFunction< + ffi.Pointer> Function( + int, ffi.Pointer>)>(); - void CFAllocatorGetContext( - CFAllocatorRef allocator, - ffi.Pointer context, + int sigsuspend( + ffi.Pointer arg0, ) { - return _CFAllocatorGetContext( - allocator, - context, + return _sigsuspend( + arg0, ); } - late final _CFAllocatorGetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFAllocatorRef, - ffi.Pointer)>>('CFAllocatorGetContext'); - late final _CFAllocatorGetContext = _CFAllocatorGetContextPtr.asFunction< - void Function(CFAllocatorRef, ffi.Pointer)>(); + late final _sigsuspendPtr = + _lookup)>>( + 'sigsuspend'); + late final _sigsuspend = + _sigsuspendPtr.asFunction)>(); - int CFGetTypeID( - CFTypeRef cf, + int sigwait( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _CFGetTypeID( - cf, + return _sigwait( + arg0, + arg1, ); } - late final _CFGetTypeIDPtr = - _lookup>('CFGetTypeID'); - late final _CFGetTypeID = - _CFGetTypeIDPtr.asFunction(); + late final _sigwaitPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('sigwait'); + late final _sigwait = _sigwaitPtr + .asFunction, ffi.Pointer)>(); - CFStringRef CFCopyTypeIDDescription( - int type_id, + void psignal( + int arg0, + ffi.Pointer arg1, ) { - return _CFCopyTypeIDDescription( - type_id, + return _psignal( + arg0, + arg1, ); } - late final _CFCopyTypeIDDescriptionPtr = - _lookup>( - 'CFCopyTypeIDDescription'); - late final _CFCopyTypeIDDescription = - _CFCopyTypeIDDescriptionPtr.asFunction(); + late final _psignalPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int, ffi.Pointer)>>('psignal'); + late final _psignal = + _psignalPtr.asFunction)>(); - CFTypeRef CFRetain( - CFTypeRef cf, + int sigblock( + int arg0, ) { - return _CFRetain( - cf, + return _sigblock( + arg0, ); } - late final _CFRetainPtr = - _lookup>('CFRetain'); - late final _CFRetain = - _CFRetainPtr.asFunction(); + late final _sigblockPtr = + _lookup>('sigblock'); + late final _sigblock = _sigblockPtr.asFunction(); - void CFRelease( - CFTypeRef cf, + int sigsetmask( + int arg0, ) { - return _CFRelease( - cf, + return _sigsetmask( + arg0, ); } - late final _CFReleasePtr = - _lookup>('CFRelease'); - late final _CFRelease = _CFReleasePtr.asFunction(); + late final _sigsetmaskPtr = + _lookup>('sigsetmask'); + late final _sigsetmask = _sigsetmaskPtr.asFunction(); - CFTypeRef CFAutorelease( - CFTypeRef arg, + int sigvec1( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return _CFAutorelease( - arg, + return _sigvec1( + arg0, + arg1, + arg2, ); } - late final _CFAutoreleasePtr = - _lookup>( - 'CFAutorelease'); - late final _CFAutorelease = - _CFAutoreleasePtr.asFunction(); + late final _sigvec1Ptr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Pointer)>>('sigvec'); + late final _sigvec1 = _sigvec1Ptr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer)>(); - int CFGetRetainCount( - CFTypeRef cf, + int renameat( + int arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer arg3, ) { - return _CFGetRetainCount( - cf, + return _renameat( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFGetRetainCountPtr = - _lookup>( - 'CFGetRetainCount'); - late final _CFGetRetainCount = - _CFGetRetainCountPtr.asFunction(); + late final _renameatPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, + ffi.Pointer)>>('renameat'); + late final _renameat = _renameatPtr.asFunction< + int Function(int, ffi.Pointer, int, ffi.Pointer)>(); - int CFEqual( - CFTypeRef cf1, - CFTypeRef cf2, + int renamex_np( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return _CFEqual( - cf1, - cf2, + return _renamex_np( + arg0, + arg1, + arg2, ); } - late final _CFEqualPtr = - _lookup>( - 'CFEqual'); - late final _CFEqual = - _CFEqualPtr.asFunction(); + late final _renamex_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedInt)>>('renamex_np'); + late final _renamex_np = _renamex_npPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - int CFHash( - CFTypeRef cf, + int renameatx_np( + int arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer arg3, + int arg4, ) { - return _CFHash( - cf, + return _renameatx_np( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFHashPtr = - _lookup>('CFHash'); - late final _CFHash = _CFHashPtr.asFunction(); + late final _renameatx_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, + ffi.Pointer, ffi.UnsignedInt)>>('renameatx_np'); + late final _renameatx_np = _renameatx_npPtr.asFunction< + int Function( + int, ffi.Pointer, int, ffi.Pointer, int)>(); - CFStringRef CFCopyDescription( - CFTypeRef cf, + late final ffi.Pointer> ___stdinp = + _lookup>('__stdinp'); + + ffi.Pointer get __stdinp => ___stdinp.value; + + set __stdinp(ffi.Pointer value) => ___stdinp.value = value; + + late final ffi.Pointer> ___stdoutp = + _lookup>('__stdoutp'); + + ffi.Pointer get __stdoutp => ___stdoutp.value; + + set __stdoutp(ffi.Pointer value) => ___stdoutp.value = value; + + late final ffi.Pointer> ___stderrp = + _lookup>('__stderrp'); + + ffi.Pointer get __stderrp => ___stderrp.value; + + set __stderrp(ffi.Pointer value) => ___stderrp.value = value; + + void clearerr( + ffi.Pointer arg0, ) { - return _CFCopyDescription( - cf, + return _clearerr( + arg0, ); } - late final _CFCopyDescriptionPtr = - _lookup>( - 'CFCopyDescription'); - late final _CFCopyDescription = - _CFCopyDescriptionPtr.asFunction(); + late final _clearerrPtr = + _lookup)>>( + 'clearerr'); + late final _clearerr = + _clearerrPtr.asFunction)>(); - CFAllocatorRef CFGetAllocator( - CFTypeRef cf, + int fclose( + ffi.Pointer arg0, ) { - return _CFGetAllocator( - cf, + return _fclose( + arg0, ); } - late final _CFGetAllocatorPtr = - _lookup>( - 'CFGetAllocator'); - late final _CFGetAllocator = - _CFGetAllocatorPtr.asFunction(); + late final _fclosePtr = + _lookup)>>( + 'fclose'); + late final _fclose = _fclosePtr.asFunction)>(); - CFTypeRef CFMakeCollectable( - CFTypeRef cf, + int feof( + ffi.Pointer arg0, ) { - return _CFMakeCollectable( - cf, + return _feof( + arg0, ); } - late final _CFMakeCollectablePtr = - _lookup>( - 'CFMakeCollectable'); - late final _CFMakeCollectable = - _CFMakeCollectablePtr.asFunction(); + late final _feofPtr = + _lookup)>>('feof'); + late final _feof = _feofPtr.asFunction)>(); - ffi.Pointer NSDefaultMallocZone() { - return _NSDefaultMallocZone(); + int ferror( + ffi.Pointer arg0, + ) { + return _ferror( + arg0, + ); } - late final _NSDefaultMallocZonePtr = - _lookup Function()>>( - 'NSDefaultMallocZone'); - late final _NSDefaultMallocZone = - _NSDefaultMallocZonePtr.asFunction Function()>(); + late final _ferrorPtr = + _lookup)>>( + 'ferror'); + late final _ferror = _ferrorPtr.asFunction)>(); - ffi.Pointer NSCreateZone( - int startSize, - int granularity, - bool canFree, + int fflush( + ffi.Pointer arg0, ) { - return _NSCreateZone( - startSize, - granularity, - canFree, + return _fflush( + arg0, ); } - late final _NSCreateZonePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - NSUInteger, NSUInteger, ffi.Bool)>>('NSCreateZone'); - late final _NSCreateZone = _NSCreateZonePtr.asFunction< - ffi.Pointer Function(int, int, bool)>(); + late final _fflushPtr = + _lookup)>>( + 'fflush'); + late final _fflush = _fflushPtr.asFunction)>(); - void NSRecycleZone( - ffi.Pointer zone, + int fgetc( + ffi.Pointer arg0, ) { - return _NSRecycleZone( - zone, + return _fgetc( + arg0, ); } - late final _NSRecycleZonePtr = - _lookup)>>( - 'NSRecycleZone'); - late final _NSRecycleZone = - _NSRecycleZonePtr.asFunction)>(); + late final _fgetcPtr = + _lookup)>>('fgetc'); + late final _fgetc = _fgetcPtr.asFunction)>(); - void NSSetZoneName( - ffi.Pointer zone, - NSString name, + int fgetpos( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _NSSetZoneName( - zone, - name._id, + return _fgetpos( + arg0, + arg1, ); } - late final _NSSetZoneNamePtr = _lookup< + late final _fgetposPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('NSSetZoneName'); - late final _NSSetZoneName = _NSSetZoneNamePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('fgetpos'); + late final _fgetpos = _fgetposPtr + .asFunction, ffi.Pointer)>(); - NSString NSZoneName( - ffi.Pointer zone, + ffi.Pointer fgets( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, ) { - return NSString._( - _NSZoneName( - zone, - ), - this, - retain: true, - release: true); + return _fgets( + arg0, + arg1, + arg2, + ); } - late final _NSZoneNamePtr = _lookup< + late final _fgetsPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('NSZoneName'); - late final _NSZoneName = _NSZoneNamePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int, ffi.Pointer)>>('fgets'); + late final _fgets = _fgetsPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer)>(); - ffi.Pointer NSZoneFromPointer( - ffi.Pointer ptr, + ffi.Pointer fopen( + ffi.Pointer __filename, + ffi.Pointer __mode, ) { - return _NSZoneFromPointer( - ptr, + return _fopen( + __filename, + __mode, ); } - late final _NSZoneFromPointerPtr = _lookup< - ffi - .NativeFunction Function(ffi.Pointer)>>( - 'NSZoneFromPointer'); - late final _NSZoneFromPointer = _NSZoneFromPointerPtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); + late final _fopenPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('fopen'); + late final _fopen = _fopenPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer NSZoneMalloc( - ffi.Pointer zone, - int size, + int fprintf( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _NSZoneMalloc( - zone, - size, + return _fprintf( + arg0, + arg1, ); } - late final _NSZoneMallocPtr = _lookup< + late final _fprintfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, NSUInteger)>>('NSZoneMalloc'); - late final _NSZoneMalloc = _NSZoneMallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('fprintf'); + late final _fprintf = _fprintfPtr + .asFunction, ffi.Pointer)>(); - ffi.Pointer NSZoneCalloc( - ffi.Pointer zone, - int numElems, - int byteSize, + int fputc( + int arg0, + ffi.Pointer arg1, ) { - return _NSZoneCalloc( - zone, - numElems, - byteSize, + return _fputc( + arg0, + arg1, ); } - 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)>(); + late final _fputcPtr = + _lookup)>>( + 'fputc'); + late final _fputc = + _fputcPtr.asFunction)>(); - ffi.Pointer NSZoneRealloc( - ffi.Pointer zone, - ffi.Pointer ptr, - int size, + int fputs( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _NSZoneRealloc( - zone, - ptr, - size, + return _fputs( + arg0, + arg1, ); } - late final _NSZoneReallocPtr = _lookup< + late final _fputsPtr = _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)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('fputs'); + late final _fputs = _fputsPtr + .asFunction, ffi.Pointer)>(); - void NSZoneFree( - ffi.Pointer zone, - ffi.Pointer ptr, + int fread( + ffi.Pointer __ptr, + int __size, + int __nitems, + ffi.Pointer __stream, ) { - return _NSZoneFree( - zone, - ptr, + return _fread( + __ptr, + __size, + __nitems, + __stream, ); } - late final _NSZoneFreePtr = _lookup< + late final _freadPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('NSZoneFree'); - late final _NSZoneFree = _NSZoneFreePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer)>(); + ffi.UnsignedLong Function(ffi.Pointer, ffi.Size, ffi.Size, + ffi.Pointer)>>('fread'); + late final _fread = _freadPtr.asFunction< + int Function(ffi.Pointer, int, int, ffi.Pointer)>(); - ffi.Pointer NSAllocateCollectable( - int size, - int options, + ffi.Pointer freopen( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return _NSAllocateCollectable( - size, - options, + return _freopen( + arg0, + arg1, + arg2, ); } - late final _NSAllocateCollectablePtr = _lookup< + late final _freopenPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - NSUInteger, NSUInteger)>>('NSAllocateCollectable'); - late final _NSAllocateCollectable = _NSAllocateCollectablePtr.asFunction< - ffi.Pointer Function(int, int)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('freopen'); + late final _freopen = _freopenPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer NSReallocateCollectable( - ffi.Pointer ptr, - int size, - int options, + int fscanf( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _NSReallocateCollectable( - ptr, - size, - options, + return _fscanf( + arg0, + arg1, ); } - late final _NSReallocateCollectablePtr = _lookup< + late final _fscanfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, NSUInteger, - NSUInteger)>>('NSReallocateCollectable'); - late final _NSReallocateCollectable = _NSReallocateCollectablePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('fscanf'); + late final _fscanf = _fscanfPtr + .asFunction, ffi.Pointer)>(); - int NSPageSize() { - return _NSPageSize(); + int fseek( + ffi.Pointer arg0, + int arg1, + int arg2, + ) { + return _fseek( + arg0, + arg1, + arg2, + ); } - late final _NSPageSizePtr = - _lookup>('NSPageSize'); - late final _NSPageSize = _NSPageSizePtr.asFunction(); + late final _fseekPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Long, ffi.Int)>>('fseek'); + late final _fseek = + _fseekPtr.asFunction, int, int)>(); - int NSLogPageSize() { - return _NSLogPageSize(); + int fsetpos( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _fsetpos( + arg0, + arg1, + ); } - late final _NSLogPageSizePtr = - _lookup>('NSLogPageSize'); - late final _NSLogPageSize = _NSLogPageSizePtr.asFunction(); + late final _fsetposPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('fsetpos'); + late final _fsetpos = _fsetposPtr + .asFunction, ffi.Pointer)>(); - int NSRoundUpToMultipleOfPageSize( - int bytes, + int ftell( + ffi.Pointer arg0, ) { - return _NSRoundUpToMultipleOfPageSize( - bytes, + return _ftell( + arg0, ); } - late final _NSRoundUpToMultipleOfPageSizePtr = - _lookup>( - 'NSRoundUpToMultipleOfPageSize'); - late final _NSRoundUpToMultipleOfPageSize = - _NSRoundUpToMultipleOfPageSizePtr.asFunction(); + late final _ftellPtr = + _lookup)>>( + 'ftell'); + late final _ftell = _ftellPtr.asFunction)>(); - int NSRoundDownToMultipleOfPageSize( - int bytes, + int fwrite( + ffi.Pointer __ptr, + int __size, + int __nitems, + ffi.Pointer __stream, ) { - return _NSRoundDownToMultipleOfPageSize( - bytes, + return _fwrite( + __ptr, + __size, + __nitems, + __stream, ); } - late final _NSRoundDownToMultipleOfPageSizePtr = - _lookup>( - 'NSRoundDownToMultipleOfPageSize'); - late final _NSRoundDownToMultipleOfPageSize = - _NSRoundDownToMultipleOfPageSizePtr.asFunction(); + late final _fwritePtr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLong Function(ffi.Pointer, ffi.Size, ffi.Size, + ffi.Pointer)>>('fwrite'); + late final _fwrite = _fwritePtr.asFunction< + int Function(ffi.Pointer, int, int, ffi.Pointer)>(); - ffi.Pointer NSAllocateMemoryPages( - int bytes, + int getc( + ffi.Pointer arg0, ) { - return _NSAllocateMemoryPages( - bytes, + return _getc( + arg0, ); } - late final _NSAllocateMemoryPagesPtr = - _lookup Function(NSUInteger)>>( - 'NSAllocateMemoryPages'); - late final _NSAllocateMemoryPages = _NSAllocateMemoryPagesPtr.asFunction< - ffi.Pointer Function(int)>(); + late final _getcPtr = + _lookup)>>('getc'); + late final _getc = _getcPtr.asFunction)>(); - void NSDeallocateMemoryPages( - ffi.Pointer ptr, - int bytes, - ) { - return _NSDeallocateMemoryPages( - ptr, - bytes, - ); + int getchar() { + return _getchar(); } - late final _NSDeallocateMemoryPagesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, NSUInteger)>>('NSDeallocateMemoryPages'); - late final _NSDeallocateMemoryPages = _NSDeallocateMemoryPagesPtr.asFunction< - void Function(ffi.Pointer, int)>(); + late final _getcharPtr = + _lookup>('getchar'); + late final _getchar = _getcharPtr.asFunction(); - void NSCopyMemoryPages( - ffi.Pointer source, - ffi.Pointer dest, - int bytes, + ffi.Pointer gets( + ffi.Pointer arg0, ) { - return _NSCopyMemoryPages( - source, - dest, - bytes, + return _gets( + arg0, ); } - late final _NSCopyMemoryPagesPtr = _lookup< + late final _getsPtr = _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 Function(ffi.Pointer)>>('gets'); + late final _gets = _getsPtr + .asFunction Function(ffi.Pointer)>(); - NSObject NSAllocateObject( - NSObject aClass, - DartNSUInteger extraBytes, - ffi.Pointer zone, + void perror( + ffi.Pointer arg0, ) { - return NSObject._( - _NSAllocateObject( - aClass._id, - extraBytes, - zone, - ), - this, - retain: true, - release: true); + return _perror( + arg0, + ); } - 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)>(); + late final _perrorPtr = + _lookup)>>( + 'perror'); + late final _perror = + _perrorPtr.asFunction)>(); - void NSDeallocateObject( - NSObject object, + int printf( + ffi.Pointer arg0, ) { - return _NSDeallocateObject( - object._id, + return _printf( + arg0, ); } - late final _NSDeallocateObjectPtr = - _lookup)>>( - 'NSDeallocateObject'); - late final _NSDeallocateObject = _NSDeallocateObjectPtr.asFunction< - void Function(ffi.Pointer)>(); + late final _printfPtr = + _lookup)>>( + 'printf'); + late final _printf = + _printfPtr.asFunction)>(); - NSObject NSCopyObject( - NSObject object, - DartNSUInteger extraBytes, - ffi.Pointer zone, + int putc( + int arg0, + ffi.Pointer arg1, ) { - return NSObject._( - _NSCopyObject( - object._id, - extraBytes, - zone, - ), - this, - retain: true, - release: true); + return _putc( + arg0, + arg1, + ); } - 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)>(); + late final _putcPtr = + _lookup)>>( + 'putc'); + late final _putc = + _putcPtr.asFunction)>(); - bool NSShouldRetainWithZone( - NSObject anObject, - ffi.Pointer requestedZone, + int putchar( + int arg0, ) { - return _NSShouldRetainWithZone( - anObject._id, - requestedZone, + return _putchar( + arg0, ); } - late final _NSShouldRetainWithZonePtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer)>>('NSShouldRetainWithZone'); - late final _NSShouldRetainWithZone = _NSShouldRetainWithZonePtr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer)>(); + late final _putcharPtr = + _lookup>('putchar'); + late final _putchar = _putcharPtr.asFunction(); - void NSIncrementExtraRefCount( - NSObject object, + int puts( + ffi.Pointer arg0, ) { - return _NSIncrementExtraRefCount( - object._id, + return _puts( + arg0, ); } - late final _NSIncrementExtraRefCountPtr = - _lookup)>>( - 'NSIncrementExtraRefCount'); - late final _NSIncrementExtraRefCount = _NSIncrementExtraRefCountPtr - .asFunction)>(); + late final _putsPtr = + _lookup)>>( + 'puts'); + late final _puts = _putsPtr.asFunction)>(); - bool NSDecrementExtraRefCountWasZero( - NSObject object, + int remove( + ffi.Pointer arg0, ) { - return _NSDecrementExtraRefCountWasZero( - object._id, + return _remove( + arg0, ); } - late final _NSDecrementExtraRefCountWasZeroPtr = - _lookup)>>( - 'NSDecrementExtraRefCountWasZero'); - late final _NSDecrementExtraRefCountWasZero = - _NSDecrementExtraRefCountWasZeroPtr.asFunction< - bool Function(ffi.Pointer)>(); + late final _removePtr = + _lookup)>>( + 'remove'); + late final _remove = + _removePtr.asFunction)>(); - DartNSUInteger NSExtraRefCount( - NSObject object, + int rename( + ffi.Pointer __old, + ffi.Pointer __new, ) { - return _NSExtraRefCount( - object._id, + return _rename( + __old, + __new, ); } - late final _NSExtraRefCountPtr = - _lookup)>>( - 'NSExtraRefCount'); - late final _NSExtraRefCount = - _NSExtraRefCountPtr.asFunction)>(); + late final _renamePtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('rename'); + late final _rename = _renamePtr + .asFunction, ffi.Pointer)>(); - NSRange NSUnionRange( - NSRange range1, - NSRange range2, + void rewind( + ffi.Pointer arg0, ) { - return _NSUnionRange( - range1, - range2, + return _rewind( + arg0, ); } - late final _NSUnionRangePtr = - _lookup>( - 'NSUnionRange'); - late final _NSUnionRange = - _NSUnionRangePtr.asFunction(); + late final _rewindPtr = + _lookup)>>( + 'rewind'); + late final _rewind = + _rewindPtr.asFunction)>(); - NSRange NSIntersectionRange( - NSRange range1, - NSRange range2, + int scanf( + ffi.Pointer arg0, ) { - return _NSIntersectionRange( - range1, - range2, + return _scanf( + arg0, ); } - late final _NSIntersectionRangePtr = - _lookup>( - 'NSIntersectionRange'); - late final _NSIntersectionRange = - _NSIntersectionRangePtr.asFunction(); + late final _scanfPtr = + _lookup)>>( + 'scanf'); + late final _scanf = + _scanfPtr.asFunction)>(); - NSString NSStringFromRange( - NSRange range, + void setbuf( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return NSString._( - _NSStringFromRange( - range, - ), - this, - retain: true, - release: true); + return _setbuf( + arg0, + arg1, + ); } - late final _NSStringFromRangePtr = - _lookup Function(NSRange)>>( - 'NSStringFromRange'); - late final _NSStringFromRange = _NSStringFromRangePtr.asFunction< - ffi.Pointer Function(NSRange)>(); + late final _setbufPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>>('setbuf'); + late final _setbuf = _setbufPtr + .asFunction, ffi.Pointer)>(); - NSRange NSRangeFromString( - NSString aString, + int setvbuf( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + int arg3, ) { - return _NSRangeFromString( - aString._id, + return _setvbuf( + arg0, + arg1, + arg2, + arg3, ); } - late final _NSRangeFromStringPtr = - _lookup)>>( - 'NSRangeFromString'); - late final _NSRangeFromString = _NSRangeFromStringPtr.asFunction< - NSRange Function(ffi.Pointer)>(); + late final _setvbufPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, + ffi.Size)>>('setvbuf'); + late final _setvbuf = _setvbufPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - late final _class_NSMutableIndexSet1 = _getClass1("NSMutableIndexSet"); - late final _sel_addIndexes_1 = _registerName1("addIndexes:"); - void _objc_msgSend_302( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexSet, + int sprintf( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_302( - obj, - sel, - indexSet, + return _sprintf( + arg0, + arg1, ); } - late final __objc_msgSend_302Ptr = _lookup< + late final _sprintfPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_302 = __objc_msgSend_302Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('sprintf'); + late final _sprintf = _sprintfPtr + .asFunction, ffi.Pointer)>(); - late final _sel_removeIndexes_1 = _registerName1("removeIndexes:"); - late final _sel_removeAllIndexes1 = _registerName1("removeAllIndexes"); - late final _sel_addIndex_1 = _registerName1("addIndex:"); - void _objc_msgSend_303( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int sscanf( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_303( - obj, - sel, - value, + return _sscanf( + arg0, + arg1, ); } - late final __objc_msgSend_303Ptr = _lookup< + late final _sscanfPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_303 = __objc_msgSend_303Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('sscanf'); + late final _sscanf = _sscanfPtr + .asFunction, ffi.Pointer)>(); - late final _sel_removeIndex_1 = _registerName1("removeIndex:"); - late final _sel_addIndexesInRange_1 = _registerName1("addIndexesInRange:"); - void _objc_msgSend_304( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ) { - return __objc_msgSend_304( - obj, - sel, - range, - ); + ffi.Pointer tmpfile() { + return _tmpfile(); } - late final __objc_msgSend_304Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_304 = __objc_msgSend_304Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange)>(); + late final _tmpfilePtr = + _lookup Function()>>('tmpfile'); + late final _tmpfile = _tmpfilePtr.asFunction Function()>(); - late final _sel_removeIndexesInRange_1 = - _registerName1("removeIndexesInRange:"); - late final _sel_shiftIndexesStartingAtIndex_by_1 = - _registerName1("shiftIndexesStartingAtIndex:by:"); - void _objc_msgSend_305( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - int delta, + ffi.Pointer tmpnam( + ffi.Pointer arg0, ) { - return __objc_msgSend_305( - obj, - sel, - index, - delta, + return _tmpnam( + arg0, ); } - late final __objc_msgSend_305Ptr = _lookup< + late final _tmpnamPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_305 = __objc_msgSend_305Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + ffi.Pointer Function(ffi.Pointer)>>('tmpnam'); + late final _tmpnam = _tmpnamPtr + .asFunction Function(ffi.Pointer)>(); - 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_306( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - int index, + int ungetc( + int arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_306( - obj, - sel, - anObject, - index, + return _ungetc( + arg0, + arg1, ); } - late final __objc_msgSend_306Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_306 = __objc_msgSend_306Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + late final _ungetcPtr = + _lookup)>>( + 'ungetc'); + late final _ungetc = + _ungetcPtr.asFunction)>(); - late final _sel_removeLastObject1 = _registerName1("removeLastObject"); - late final _sel_removeObjectAtIndex_1 = - _registerName1("removeObjectAtIndex:"); - late final _sel_replaceObjectAtIndex_withObject_1 = - _registerName1("replaceObjectAtIndex:withObject:"); - void _objc_msgSend_307( - ffi.Pointer obj, - ffi.Pointer sel, - int index, - ffi.Pointer anObject, + int vfprintf( + ffi.Pointer arg0, + ffi.Pointer arg1, + va_list arg2, ) { - return __objc_msgSend_307( - obj, - sel, - index, - anObject, + return _vfprintf( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_307Ptr = _lookup< + late final _vfprintfPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_307 = __objc_msgSend_307Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer, va_list)>>('vfprintf'); + late final _vfprintf = _vfprintfPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, va_list)>(); - late final _sel_initWithCapacity_1 = _registerName1("initWithCapacity:"); - late final _sel_addObjectsFromArray_1 = - _registerName1("addObjectsFromArray:"); - void _objc_msgSend_308( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherArray, + int vprintf( + ffi.Pointer arg0, + va_list arg1, ) { - return __objc_msgSend_308( - obj, - sel, - otherArray, + return _vprintf( + arg0, + arg1, ); } - late final __objc_msgSend_308Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_308 = __objc_msgSend_308Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _vprintfPtr = _lookup< + ffi.NativeFunction, va_list)>>( + 'vprintf'); + late final _vprintf = + _vprintfPtr.asFunction, va_list)>(); - late final _sel_exchangeObjectAtIndex_withObjectAtIndex_1 = - _registerName1("exchangeObjectAtIndex:withObjectAtIndex:"); - void _objc_msgSend_309( - ffi.Pointer obj, - ffi.Pointer sel, - int idx1, - int idx2, + int vsprintf( + ffi.Pointer arg0, + ffi.Pointer arg1, + va_list arg2, ) { - return __objc_msgSend_309( - obj, - sel, - idx1, - idx2, + return _vsprintf( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_309Ptr = _lookup< + late final _vsprintfPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_309 = __objc_msgSend_309Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, int)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + va_list)>>('vsprintf'); + late final _vsprintf = _vsprintfPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, va_list)>(); - late final _sel_removeAllObjects1 = _registerName1("removeAllObjects"); - late final _sel_removeObject_inRange_1 = - _registerName1("removeObject:inRange:"); - void _objc_msgSend_310( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - NSRange range, + ffi.Pointer ctermid( + ffi.Pointer arg0, ) { - return __objc_msgSend_310( - obj, - sel, - anObject, - range, + return _ctermid( + arg0, ); } - late final __objc_msgSend_310Ptr = _lookup< + late final _ctermidPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_310 = __objc_msgSend_310Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRange)>(); + ffi.Pointer Function(ffi.Pointer)>>('ctermid'); + late final _ctermid = _ctermidPtr + .asFunction Function(ffi.Pointer)>(); - 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_311( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indices, - int cnt, + ffi.Pointer fdopen( + int arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_311( - obj, - sel, - indices, - cnt, + return _fdopen( + arg0, + arg1, ); } - late final __objc_msgSend_311Ptr = _lookup< + late final _fdopenPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_311 = __objc_msgSend_311Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Int, ffi.Pointer)>>('fdopen'); + late final _fdopen = _fdopenPtr + .asFunction Function(int, ffi.Pointer)>(); - late final _sel_removeObjectsInArray_1 = - _registerName1("removeObjectsInArray:"); - late final _sel_removeObjectsInRange_1 = - _registerName1("removeObjectsInRange:"); - late final _sel_replaceObjectsInRange_withObjectsFromArray_range_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:range:"); - void _objc_msgSend_312( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer otherArray, - NSRange otherRange, + int fileno( + ffi.Pointer arg0, ) { - return __objc_msgSend_312( - obj, - sel, - range, - otherArray, - otherRange, + return _fileno( + arg0, ); } - late final __objc_msgSend_312Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_312 = __objc_msgSend_312Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer, NSRange)>(); + late final _filenoPtr = + _lookup)>>( + 'fileno'); + late final _fileno = _filenoPtr.asFunction)>(); - late final _sel_replaceObjectsInRange_withObjectsFromArray_1 = - _registerName1("replaceObjectsInRange:withObjectsFromArray:"); - void _objc_msgSend_313( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer otherArray, + int pclose( + ffi.Pointer arg0, ) { - return __objc_msgSend_313( - obj, - sel, - range, - otherArray, + return _pclose( + arg0, ); } - late final __objc_msgSend_313Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_313 = __objc_msgSend_313Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer)>(); + late final _pclosePtr = + _lookup)>>( + 'pclose'); + late final _pclose = _pclosePtr.asFunction)>(); - late final _sel_setArray_1 = _registerName1("setArray:"); - late final _sel_sortUsingFunction_context_1 = - _registerName1("sortUsingFunction:context:"); - void _objc_msgSend_314( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context, + ffi.Pointer popen( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_314( - obj, - sel, - compare, - context, + return _popen( + arg0, + arg1, ); } - late final __objc_msgSend_314Ptr = _lookup< + late final _popenPtr = _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_314 = __objc_msgSend_314Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('popen'); + late final _popen = _popenPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_sortUsingSelector_1 = _registerName1("sortUsingSelector:"); - late final _sel_insertObjects_atIndexes_1 = - _registerName1("insertObjects:atIndexes:"); - void _objc_msgSend_315( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer objects, - ffi.Pointer indexes, + int __srget( + ffi.Pointer arg0, ) { - return __objc_msgSend_315( - obj, - sel, - objects, - indexes, + return ___srget( + arg0, ); } - late final __objc_msgSend_315Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_315 = __objc_msgSend_315Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removeObjectsAtIndexes_1 = - _registerName1("removeObjectsAtIndexes:"); - late final _sel_replaceObjectsAtIndexes_withObjects_1 = - _registerName1("replaceObjectsAtIndexes:withObjects:"); - void _objc_msgSend_316( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer indexes, - ffi.Pointer objects, - ) { - return __objc_msgSend_316( - obj, - sel, - indexes, - objects, - ); - } + late final ___srgetPtr = + _lookup)>>( + '__srget'); + late final ___srget = + ___srgetPtr.asFunction)>(); - late final __objc_msgSend_316Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_316 = __objc_msgSend_316Ptr.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_317( - ffi.Pointer obj, - ffi.Pointer sel, - NSComparator cmptr, - ) { - return __objc_msgSend_317( - obj, - sel, - cmptr, + int __svfscanf( + ffi.Pointer arg0, + ffi.Pointer arg1, + va_list arg2, + ) { + return ___svfscanf( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_317Ptr = _lookup< + late final ___svfscanfPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_317 = __objc_msgSend_317Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, NSComparator)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + va_list)>>('__svfscanf'); + late final ___svfscanf = ___svfscanfPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, va_list)>(); - late final _sel_sortWithOptions_usingComparator_1 = - _registerName1("sortWithOptions:usingComparator:"); - void _objc_msgSend_318( - ffi.Pointer obj, - ffi.Pointer sel, - int opts, - NSComparator cmptr, + int __swbuf( + int arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_318( - obj, - sel, - opts, - cmptr, + return ___swbuf( + arg0, + arg1, ); } - late final __objc_msgSend_318Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, NSComparator)>>('objc_msgSend'); - late final __objc_msgSend_318 = __objc_msgSend_318Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, int, NSComparator)>(); + late final ___swbufPtr = + _lookup)>>( + '__swbuf'); + late final ___swbuf = + ___swbufPtr.asFunction)>(); - late final _sel_arrayWithCapacity_1 = _registerName1("arrayWithCapacity:"); - ffi.Pointer _objc_msgSend_319( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, + void flockfile( + ffi.Pointer arg0, ) { - return __objc_msgSend_319( - obj, - sel, - path, + return _flockfile( + arg0, ); } - 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 _flockfilePtr = + _lookup)>>( + 'flockfile'); + late final _flockfile = + _flockfilePtr.asFunction)>(); - ffi.Pointer _objc_msgSend_320( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, + int ftrylockfile( + ffi.Pointer arg0, ) { - return __objc_msgSend_320( - obj, - sel, - url, + return _ftrylockfile( + arg0, ); } - 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 _ftrylockfilePtr = + _lookup)>>( + 'ftrylockfile'); + late final _ftrylockfile = + _ftrylockfilePtr.asFunction)>(); - late final _sel_applyDifference_1 = _registerName1("applyDifference:"); - void _objc_msgSend_321( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer difference, + void funlockfile( + ffi.Pointer arg0, ) { - return __objc_msgSend_321( - obj, - sel, - difference, + return _funlockfile( + arg0, ); } - late final __objc_msgSend_321Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_321 = __objc_msgSend_321Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _funlockfilePtr = + _lookup)>>( + 'funlockfile'); + late final _funlockfile = + _funlockfilePtr.asFunction)>(); - late final _class_NSMutableData1 = _getClass1("NSMutableData"); - late final _sel_mutableBytes1 = _registerName1("mutableBytes"); - late final _sel_setLength_1 = _registerName1("setLength:"); - void _objc_msgSend_322( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int getc_unlocked( + ffi.Pointer arg0, ) { - return __objc_msgSend_322( - obj, - sel, - value, + return _getc_unlocked( + arg0, ); } - late final __objc_msgSend_322Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_322 = __objc_msgSend_322Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _getc_unlockedPtr = + _lookup)>>( + 'getc_unlocked'); + late final _getc_unlocked = + _getc_unlockedPtr.asFunction)>(); - late final _sel_appendBytes_length_1 = _registerName1("appendBytes:length:"); - late final _sel_appendData_1 = _registerName1("appendData:"); - void _objc_msgSend_323( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, - ) { - return __objc_msgSend_323( - obj, - sel, - other, - ); + int getchar_unlocked() { + return _getchar_unlocked(); } - late final __objc_msgSend_323Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_323 = __objc_msgSend_323Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _getchar_unlockedPtr = + _lookup>('getchar_unlocked'); + late final _getchar_unlocked = + _getchar_unlockedPtr.asFunction(); - late final _sel_increaseLengthBy_1 = _registerName1("increaseLengthBy:"); - late final _sel_replaceBytesInRange_withBytes_1 = - _registerName1("replaceBytesInRange:withBytes:"); - void _objc_msgSend_324( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer bytes, + int putc_unlocked( + int arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_324( - obj, - sel, - range, - bytes, + return _putc_unlocked( + arg0, + arg1, ); } - late final __objc_msgSend_324Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_324 = __objc_msgSend_324Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer)>(); + late final _putc_unlockedPtr = + _lookup)>>( + 'putc_unlocked'); + late final _putc_unlocked = + _putc_unlockedPtr.asFunction)>(); - 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_325( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer replacementBytes, - int replacementLength, + int putchar_unlocked( + int arg0, ) { - return __objc_msgSend_325( - obj, - sel, - range, - replacementBytes, - replacementLength, + return _putchar_unlocked( + arg0, ); } - late final __objc_msgSend_325Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_325 = __objc_msgSend_325Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer, int)>(); + late final _putchar_unlockedPtr = + _lookup>( + 'putchar_unlocked'); + late final _putchar_unlocked = + _putchar_unlockedPtr.asFunction(); - late final _sel_dataWithCapacity_1 = _registerName1("dataWithCapacity:"); - instancetype _objc_msgSend_326( - ffi.Pointer obj, - ffi.Pointer sel, - int aNumItems, + int getw( + ffi.Pointer arg0, ) { - return __objc_msgSend_326( - obj, - sel, - aNumItems, + return _getw( + arg0, ); } - late final __objc_msgSend_326Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_326 = __objc_msgSend_326Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _getwPtr = + _lookup)>>('getw'); + late final _getw = _getwPtr.asFunction)>(); - 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_327( - ffi.Pointer obj, - ffi.Pointer sel, - int algorithm, - ffi.Pointer> error, + int putw( + int arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_327( - obj, - sel, - algorithm, - error, + return _putw( + arg0, + arg1, ); } - late final __objc_msgSend_327Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_327 = __objc_msgSend_327Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer>)>(); - - late final _sel_compressUsingAlgorithm_error_1 = - _registerName1("compressUsingAlgorithm:error:"); - late final _class_NSPurgeableData1 = _getClass1("NSPurgeableData"); - 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_328( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anObject, - ffi.Pointer aKey, - ) { - return __objc_msgSend_328( - obj, - sel, - anObject, - aKey, - ); - } + late final _putwPtr = + _lookup)>>( + 'putw'); + late final _putw = + _putwPtr.asFunction)>(); - late final __objc_msgSend_328Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_328 = __objc_msgSend_328Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addEntriesFromDictionary_1 = - _registerName1("addEntriesFromDictionary:"); - void _objc_msgSend_329( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherDictionary, - ) { - return __objc_msgSend_329( - obj, - sel, - otherDictionary, + ffi.Pointer tempnam( + ffi.Pointer __dir, + ffi.Pointer __prefix, + ) { + return _tempnam( + __dir, + __prefix, ); } - late final __objc_msgSend_329Ptr = _lookup< + late final _tempnamPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_329 = __objc_msgSend_329Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('tempnam'); + late final _tempnam = _tempnamPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_removeObjectsForKeys_1 = - _registerName1("removeObjectsForKeys:"); - late final _sel_setDictionary_1 = _registerName1("setDictionary:"); - late final _sel_setObject_forKeyedSubscript_1 = - _registerName1("setObject:forKeyedSubscript:"); - void _objc_msgSend_330( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer obj1, - ffi.Pointer key, + int fseeko( + ffi.Pointer __stream, + int __offset, + int __whence, ) { - return __objc_msgSend_330( - obj, - sel, - obj1, - key, - ); - } - - late final __objc_msgSend_330Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_330 = __objc_msgSend_330Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dictionaryWithCapacity_1 = - _registerName1("dictionaryWithCapacity:"); - ffi.Pointer _objc_msgSend_331( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer path, - ) { - return __objc_msgSend_331( - obj, - sel, - path, + return _fseeko( + __stream, + __offset, + __whence, ); } - late final __objc_msgSend_331Ptr = _lookup< + late final _fseekoPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_331 = __objc_msgSend_331Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, off_t, ffi.Int)>>('fseeko'); + late final _fseeko = + _fseekoPtr.asFunction, int, int)>(); - ffi.Pointer _objc_msgSend_332( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, + int ftello( + ffi.Pointer __stream, ) { - return __objc_msgSend_332( - obj, - sel, - url, + return _ftello( + __stream, ); } - late final __objc_msgSend_332Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_332 = __objc_msgSend_332Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _ftelloPtr = + _lookup)>>('ftello'); + late final _ftello = _ftelloPtr.asFunction)>(); - late final _sel_dictionaryWithSharedKeySet_1 = - _registerName1("dictionaryWithSharedKeySet:"); - ffi.Pointer _objc_msgSend_333( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer keyset, + int snprintf( + ffi.Pointer __str, + int __size, + ffi.Pointer __format, ) { - return __objc_msgSend_333( - obj, - sel, - keyset, + return _snprintf( + __str, + __size, + __format, ); } - late final __objc_msgSend_333Ptr = _lookup< + late final _snprintfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_333 = __objc_msgSend_333Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Size, + ffi.Pointer)>>('snprintf'); + late final _snprintf = _snprintfPtr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer)>(); - late final _class_NSCachedURLResponse1 = _getClass1("NSCachedURLResponse"); - late final _class_NSURLResponse1 = _getClass1("NSURLResponse"); - late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1 = - _registerName1( - "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); - instancetype _objc_msgSend_334( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URL, - ffi.Pointer MIMEType, - int length, - ffi.Pointer name, + int vfscanf( + ffi.Pointer __stream, + ffi.Pointer __format, + va_list arg2, ) { - return __objc_msgSend_334( - obj, - sel, - URL, - MIMEType, - length, - name, - ); - } - - late final __objc_msgSend_334Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_334 = __objc_msgSend_334Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_URL1 = _registerName1("URL"); - 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_initWithResponse_data_1 = - _registerName1("initWithResponse:data:"); - instancetype _objc_msgSend_335( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer response, - ffi.Pointer data, - ) { - return __objc_msgSend_335( - obj, - sel, - response, - data, + return _vfscanf( + __stream, + __format, + arg2, ); } - late final __objc_msgSend_335Ptr = _lookup< + late final _vfscanfPtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_335 = __objc_msgSend_335Ptr.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_336( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer response, - ffi.Pointer data, - ffi.Pointer userInfo, - int storagePolicy, - ) { - return __objc_msgSend_336( - obj, - sel, - response, - data, - userInfo, - storagePolicy, - ); - } - - late final __objc_msgSend_336Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_336 = __objc_msgSend_336Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer, va_list)>>('vfscanf'); + late final _vfscanf = _vfscanfPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, va_list)>(); - late final _sel_response1 = _registerName1("response"); - ffi.Pointer _objc_msgSend_337( - ffi.Pointer obj, - ffi.Pointer sel, + int vscanf( + ffi.Pointer __format, + va_list arg1, ) { - return __objc_msgSend_337( - obj, - sel, + return _vscanf( + __format, + arg1, ); } - late final __objc_msgSend_337Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_337 = __objc_msgSend_337Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _vscanfPtr = _lookup< + ffi.NativeFunction, va_list)>>( + 'vscanf'); + late final _vscanf = + _vscanfPtr.asFunction, va_list)>(); - late final _sel_storagePolicy1 = _registerName1("storagePolicy"); - int _objc_msgSend_338( - ffi.Pointer obj, - ffi.Pointer sel, + int vsnprintf( + ffi.Pointer __str, + int __size, + ffi.Pointer __format, + va_list arg3, ) { - return __objc_msgSend_338( - obj, - sel, + return _vsnprintf( + __str, + __size, + __format, + arg3, ); } - late final __objc_msgSend_338Ptr = _lookup< + late final _vsnprintfPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_338 = __objc_msgSend_338Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Size, + ffi.Pointer, va_list)>>('vsnprintf'); + late final _vsnprintf = _vsnprintfPtr.asFunction< + int Function( + ffi.Pointer, int, ffi.Pointer, va_list)>(); - late final _class_NSURLCache1 = _getClass1("NSURLCache"); - late final _sel_sharedURLCache1 = _registerName1("sharedURLCache"); - ffi.Pointer _objc_msgSend_339( - ffi.Pointer obj, - ffi.Pointer sel, + int vsscanf( + ffi.Pointer __str, + ffi.Pointer __format, + va_list arg2, ) { - return __objc_msgSend_339( - obj, - sel, + return _vsscanf( + __str, + __format, + arg2, ); } - late final __objc_msgSend_339Ptr = _lookup< + late final _vsscanfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_339 = __objc_msgSend_339Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + va_list)>>('vsscanf'); + late final _vsscanf = _vsscanfPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, va_list)>(); - late final _sel_setSharedURLCache_1 = _registerName1("setSharedURLCache:"); - void _objc_msgSend_340( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + int dprintf( + int arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_340( - obj, - sel, - value, + return _dprintf( + arg0, + arg1, ); } - late final __objc_msgSend_340Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_340 = __objc_msgSend_340Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _dprintfPtr = _lookup< + ffi.NativeFunction)>>( + 'dprintf'); + late final _dprintf = + _dprintfPtr.asFunction)>(); - late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_1 = - _registerName1("initWithMemoryCapacity:diskCapacity:diskPath:"); - instancetype _objc_msgSend_341( - ffi.Pointer obj, - ffi.Pointer sel, - int memoryCapacity, - int diskCapacity, - ffi.Pointer path, + int vdprintf( + int arg0, + ffi.Pointer arg1, + va_list arg2, ) { - return __objc_msgSend_341( - obj, - sel, - memoryCapacity, - diskCapacity, - path, + return _vdprintf( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_341Ptr = _lookup< + late final _vdprintfPtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSUInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_341 = __objc_msgSend_341Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - int, ffi.Pointer)>(); + ffi.Int Function( + ffi.Int, ffi.Pointer, va_list)>>('vdprintf'); + late final _vdprintf = _vdprintfPtr + .asFunction, va_list)>(); - late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_1 = - _registerName1("initWithMemoryCapacity:diskCapacity:directoryURL:"); - instancetype _objc_msgSend_342( - ffi.Pointer obj, - ffi.Pointer sel, - int memoryCapacity, - int diskCapacity, - ffi.Pointer directoryURL, + int getdelim( + ffi.Pointer> __linep, + ffi.Pointer __linecapp, + int __delimiter, + ffi.Pointer __stream, ) { - return __objc_msgSend_342( - obj, - sel, - memoryCapacity, - diskCapacity, - directoryURL, - ); - } - - late final __objc_msgSend_342Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSUInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_342 = __objc_msgSend_342Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, int, - int, ffi.Pointer)>(); - - 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_343( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer URL, - int cachePolicy, - double timeoutInterval, - ) { - return __objc_msgSend_343( - obj, - sel, - URL, - cachePolicy, - timeoutInterval, + return _getdelim( + __linep, + __linecapp, + __delimiter, + __stream, ); } - late final __objc_msgSend_343Ptr = _lookup< + late final _getdelimPtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSTimeInterval)>>('objc_msgSend'); - late final __objc_msgSend_343 = __objc_msgSend_343Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, double)>(); + ssize_t Function(ffi.Pointer>, + ffi.Pointer, ffi.Int, ffi.Pointer)>>('getdelim'); + late final _getdelim = _getdelimPtr.asFunction< + int Function(ffi.Pointer>, ffi.Pointer, + int, ffi.Pointer)>(); - late final _sel_initWithURL_1 = _registerName1("initWithURL:"); - late final _sel_initWithURL_cachePolicy_timeoutInterval_1 = - _registerName1("initWithURL:cachePolicy:timeoutInterval:"); - late final _sel_cachePolicy1 = _registerName1("cachePolicy"); - int _objc_msgSend_344( - ffi.Pointer obj, - ffi.Pointer sel, + int getline( + ffi.Pointer> __linep, + ffi.Pointer __linecapp, + ffi.Pointer __stream, ) { - return __objc_msgSend_344( - obj, - sel, + return _getline( + __linep, + __linecapp, + __stream, ); } - late final __objc_msgSend_344Ptr = _lookup< + late final _getlinePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_344 = __objc_msgSend_344Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ssize_t Function(ffi.Pointer>, + ffi.Pointer, ffi.Pointer)>>('getline'); + late final _getline = _getlinePtr.asFunction< + int Function(ffi.Pointer>, 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_345( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer fmemopen( + ffi.Pointer __buf, + int __size, + ffi.Pointer __mode, ) { - return __objc_msgSend_345( - obj, - sel, + return _fmemopen( + __buf, + __size, + __mode, ); } - late final __objc_msgSend_345Ptr = _lookup< + late final _fmemopenPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_345 = __objc_msgSend_345Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Size, + ffi.Pointer)>>('fmemopen'); + late final _fmemopen = _fmemopenPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, 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_346( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer open_memstream( + ffi.Pointer> __bufp, + ffi.Pointer __sizep, ) { - return __objc_msgSend_346( - obj, - sel, + return _open_memstream( + __bufp, + __sizep, ); } - late final __objc_msgSend_346Ptr = _lookup< + late final _open_memstreamPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_346 = __objc_msgSend_346Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer>, + ffi.Pointer)>>('open_memstream'); + late final _open_memstream = _open_memstreamPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer>, ffi.Pointer)>(); + + late final ffi.Pointer _sys_nerr = _lookup('sys_nerr'); + + int get sys_nerr => _sys_nerr.value; + + late final ffi.Pointer>> _sys_errlist = + _lookup>>('sys_errlist'); + + ffi.Pointer> get sys_errlist => _sys_errlist.value; + + set sys_errlist(ffi.Pointer> value) => + _sys_errlist.value = value; - late final _sel_requiresDNSSECValidation1 = - _registerName1("requiresDNSSECValidation"); - late final _sel_HTTPMethod1 = _registerName1("HTTPMethod"); - late final _sel_allHTTPHeaderFields1 = _registerName1("allHTTPHeaderFields"); - late final _sel_valueForHTTPHeaderField_1 = - _registerName1("valueForHTTPHeaderField:"); - ffi.Pointer _objc_msgSend_347( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer field, + int asprintf( + ffi.Pointer> arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_347( - obj, - sel, - field, + return _asprintf( + arg0, + arg1, ); } - late final __objc_msgSend_347Ptr = _lookup< + late final _asprintfPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_347 = __objc_msgSend_347Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer>, + ffi.Pointer)>>('asprintf'); + late final _asprintf = _asprintfPtr.asFunction< + int Function( + ffi.Pointer>, ffi.Pointer)>(); - late final _sel_HTTPBody1 = _registerName1("HTTPBody"); - ffi.Pointer _objc_msgSend_348( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer ctermid_r( + ffi.Pointer arg0, ) { - return __objc_msgSend_348( - obj, - sel, + return _ctermid_r( + arg0, ); } - late final __objc_msgSend_348Ptr = _lookup< + late final _ctermid_rPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_348 = __objc_msgSend_348Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>>('ctermid_r'); + late final _ctermid_r = _ctermid_rPtr + .asFunction Function(ffi.Pointer)>(); - 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_delegate1 = _registerName1("delegate"); - late final _sel_setDelegate_1 = _registerName1("setDelegate:"); - void _objc_msgSend_349( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer fgetln( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_349( - obj, - sel, - value, + return _fgetln( + arg0, + arg1, ); } - late final __objc_msgSend_349Ptr = _lookup< + late final _fgetlnPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_349 = __objc_msgSend_349Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('fgetln'); + late final _fgetln = _fgetlnPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - bool _objc_msgSend_350( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer property, - NSStreamPropertyKey key, + ffi.Pointer fmtcheck( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_350( - obj, - sel, - property, - key, + return _fmtcheck( + arg0, + arg1, ); } - late final __objc_msgSend_350Ptr = _lookup< + late final _fmtcheckPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStreamPropertyKey)>>('objc_msgSend'); - late final __objc_msgSend_350 = __objc_msgSend_350Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSStreamPropertyKey)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('fmtcheck'); + late final _fmtcheck = _fmtcheckPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _class_NSRunLoop1 = _getClass1("NSRunLoop"); - late final _sel_scheduleInRunLoop_forMode_1 = - _registerName1("scheduleInRunLoop:forMode:"); - void _objc_msgSend_351( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aRunLoop, - NSRunLoopMode mode, + int fpurge( + ffi.Pointer arg0, ) { - return __objc_msgSend_351( - obj, - sel, - aRunLoop, - mode, + return _fpurge( + arg0, ); } - late final __objc_msgSend_351Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRunLoopMode)>>('objc_msgSend'); - late final __objc_msgSend_351 = __objc_msgSend_351Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSRunLoopMode)>(); + late final _fpurgePtr = + _lookup)>>( + 'fpurge'); + late final _fpurge = _fpurgePtr.asFunction)>(); - late final _sel_removeFromRunLoop_forMode_1 = - _registerName1("removeFromRunLoop:forMode:"); - late final _sel_streamStatus1 = _registerName1("streamStatus"); - int _objc_msgSend_352( - ffi.Pointer obj, - ffi.Pointer sel, + void setbuffer( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __objc_msgSend_352( - obj, - sel, + return _setbuffer( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_352Ptr = _lookup< + late final _setbufferPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_352 = __objc_msgSend_352Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>>('setbuffer'); + late final _setbuffer = _setbufferPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_streamError1 = _registerName1("streamError"); - ffi.Pointer _objc_msgSend_353( - ffi.Pointer obj, - ffi.Pointer sel, + int setlinebuf( + ffi.Pointer arg0, ) { - return __objc_msgSend_353( - obj, - sel, + return _setlinebuf( + arg0, ); } - late final __objc_msgSend_353Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_353 = __objc_msgSend_353Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _setlinebufPtr = + _lookup)>>( + 'setlinebuf'); + late final _setlinebuf = + _setlinebufPtr.asFunction)>(); - late final _class_NSOutputStream1 = _getClass1("NSOutputStream"); - late final _sel_write_maxLength_1 = _registerName1("write:maxLength:"); - int _objc_msgSend_354( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int len, + int vasprintf( + ffi.Pointer> arg0, + ffi.Pointer arg1, + va_list arg2, ) { - return __objc_msgSend_354( - obj, - sel, - buffer, - len, + return _vasprintf( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_354Ptr = _lookup< + late final _vasprintfPtr = _lookup< ffi.NativeFunction< - NSInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_354 = __objc_msgSend_354Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Int Function(ffi.Pointer>, + ffi.Pointer, va_list)>>('vasprintf'); + late final _vasprintf = _vasprintfPtr.asFunction< + int Function(ffi.Pointer>, ffi.Pointer, + va_list)>(); - late final _sel_hasSpaceAvailable1 = _registerName1("hasSpaceAvailable"); - late final _sel_initToMemory1 = _registerName1("initToMemory"); - late final _sel_initToBuffer_capacity_1 = - _registerName1("initToBuffer:capacity:"); - instancetype _objc_msgSend_355( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer buffer, - int capacity, + ffi.Pointer funopen( + ffi.Pointer arg0, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> + arg1, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> + arg2, + ffi.Pointer< + ffi.NativeFunction< + fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>> + arg3, + ffi.Pointer)>> + arg4, ) { - return __objc_msgSend_355( - obj, - sel, - buffer, - capacity, + return _funopen( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final __objc_msgSend_355Ptr = _lookup< + late final _funopenPtr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_355 = __objc_msgSend_355Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_initWithURL_append_1 = _registerName1("initWithURL:append:"); - instancetype _objc_msgSend_356( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - bool shouldAppend, - ) { - return __objc_msgSend_356( - obj, - sel, - url, - shouldAppend, - ); - } - - late final __objc_msgSend_356Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_356 = __objc_msgSend_356Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); - - 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_357( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer hostname, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream, - ) { - return __objc_msgSend_357( - obj, - sel, - hostname, - port, - inputStream, - outputStream, - ); - } + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>, + ffi.Pointer< + ffi.NativeFunction< + fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer)>>)>>('funopen'); + late final _funopen = _funopenPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>>, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>>, + ffi.Pointer< + ffi.NativeFunction< + fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>>, + ffi.Pointer< + ffi.NativeFunction)>>)>(); - late final __objc_msgSend_357Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_357 = __objc_msgSend_357Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer>, - ffi.Pointer>)>(); - - late final _class_NSHost1 = _getClass1("NSHost"); - late final _sel_getStreamsToHost_port_inputStream_outputStream_1 = - _registerName1("getStreamsToHost:port:inputStream:outputStream:"); - void _objc_msgSend_358( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer host, - int port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream, + int __sprintf_chk( + ffi.Pointer arg0, + int arg1, + int arg2, + ffi.Pointer arg3, ) { - return __objc_msgSend_358( - obj, - sel, - host, - port, - inputStream, - outputStream, + return ___sprintf_chk( + arg0, + arg1, + arg2, + arg3, ); } - late final __objc_msgSend_358Ptr = _lookup< + late final ___sprintf_chkPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_358 = __objc_msgSend_358Ptr.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_359( - ffi.Pointer obj, - ffi.Pointer sel, - int bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream, + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Size, + ffi.Pointer)>>('__sprintf_chk'); + late final ___sprintf_chk = ___sprintf_chkPtr.asFunction< + int Function(ffi.Pointer, int, int, ffi.Pointer)>(); + + int __snprintf_chk( + ffi.Pointer arg0, + int arg1, + int arg2, + int arg3, + ffi.Pointer arg4, ) { - return __objc_msgSend_359( - obj, - sel, - bufferSize, - inputStream, - outputStream, + return ___snprintf_chk( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final __objc_msgSend_359Ptr = _lookup< + late final ___snprintf_chkPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - ffi.Pointer>, - ffi.Pointer>)>>('objc_msgSend'); - late final __objc_msgSend_359 = __objc_msgSend_359Ptr.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_360( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer> buffer, - ffi.Pointer len, - ) { - return __objc_msgSend_360( - obj, - sel, - buffer, - len, - ); - } + ffi.Int Function(ffi.Pointer, ffi.Size, ffi.Int, ffi.Size, + ffi.Pointer)>>('__snprintf_chk'); + late final ___snprintf_chk = ___snprintf_chkPtr.asFunction< + int Function( + ffi.Pointer, int, int, int, ffi.Pointer)>(); - late final __objc_msgSend_360Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_360 = __objc_msgSend_360Ptr.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:"); - instancetype _objc_msgSend_361( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_361( - obj, - sel, - data, + int __vsprintf_chk( + ffi.Pointer arg0, + int arg1, + int arg2, + ffi.Pointer arg3, + va_list arg4, + ) { + return ___vsprintf_chk( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final __objc_msgSend_361Ptr = _lookup< + late final ___vsprintf_chkPtr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_361 = __objc_msgSend_361Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Size, + ffi.Pointer, va_list)>>('__vsprintf_chk'); + late final ___vsprintf_chk = ___vsprintf_chkPtr.asFunction< + int Function( + ffi.Pointer, int, int, ffi.Pointer, va_list)>(); - late final _sel_inputStreamWithFileAtPath_1 = - _registerName1("inputStreamWithFileAtPath:"); - late final _sel_inputStreamWithURL_1 = _registerName1("inputStreamWithURL:"); - late final _sel_HTTPBodyStream1 = _registerName1("HTTPBodyStream"); - ffi.Pointer _objc_msgSend_362( - ffi.Pointer obj, - ffi.Pointer sel, + int __vsnprintf_chk( + ffi.Pointer arg0, + int arg1, + int arg2, + int arg3, + ffi.Pointer arg4, + va_list arg5, ) { - return __objc_msgSend_362( - obj, - sel, + return ___vsnprintf_chk( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, ); } - late final __objc_msgSend_362Ptr = _lookup< + late final ___vsnprintf_chkPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_362 = __objc_msgSend_362Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Size, ffi.Int, ffi.Size, + ffi.Pointer, va_list)>>('__vsnprintf_chk'); + late final ___vsnprintf_chk = ___vsnprintf_chkPtr.asFunction< + int Function(ffi.Pointer, int, int, int, ffi.Pointer, + va_list)>(); - late final _sel_HTTPShouldHandleCookies1 = - _registerName1("HTTPShouldHandleCookies"); - late final _sel_HTTPShouldUsePipelining1 = - _registerName1("HTTPShouldUsePipelining"); - late final _sel_cachedResponseForRequest_1 = - _registerName1("cachedResponseForRequest:"); - ffi.Pointer _objc_msgSend_363( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, + ffi.Pointer memchr( + ffi.Pointer __s, + int __c, + int __n, ) { - return __objc_msgSend_363( - obj, - sel, - request, + return _memchr( + __s, + __c, + __n, ); } - late final __objc_msgSend_363Ptr = _lookup< + late final _memchrPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_363 = __objc_msgSend_363Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int, ffi.Size)>>('memchr'); + late final _memchr = _memchrPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); - late final _sel_storeCachedResponse_forRequest_1 = - _registerName1("storeCachedResponse:forRequest:"); - void _objc_msgSend_364( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cachedResponse, - ffi.Pointer request, + int memcmp( + ffi.Pointer __s1, + ffi.Pointer __s2, + int __n, ) { - return __objc_msgSend_364( - obj, - sel, - cachedResponse, - request, + return _memcmp( + __s1, + __s2, + __n, ); } - late final __objc_msgSend_364Ptr = _lookup< + late final _memcmpPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_364 = __objc_msgSend_364Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_removeCachedResponseForRequest_1 = - _registerName1("removeCachedResponseForRequest:"); - void _objc_msgSend_365( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_365( - obj, - sel, - request, + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('memcmp'); + late final _memcmp = _memcmpPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer memcpy( + ffi.Pointer __dst, + ffi.Pointer __src, + int __n, + ) { + return _memcpy( + __dst, + __src, + __n, ); } - late final __objc_msgSend_365Ptr = _lookup< + late final _memcpyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_365 = __objc_msgSend_365Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('memcpy'); + late final _memcpy = _memcpyPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_removeAllCachedResponses1 = - _registerName1("removeAllCachedResponses"); - late final _class_NSDate1 = _getClass1("NSDate"); - late final _sel_timeIntervalSinceReferenceDate1 = - _registerName1("timeIntervalSinceReferenceDate"); - late final _sel_initWithTimeIntervalSinceReferenceDate_1 = - _registerName1("initWithTimeIntervalSinceReferenceDate:"); - instancetype _objc_msgSend_366( - ffi.Pointer obj, - ffi.Pointer sel, - double ti, + ffi.Pointer memmove( + ffi.Pointer __dst, + ffi.Pointer __src, + int __len, ) { - return __objc_msgSend_366( - obj, - sel, - ti, + return _memmove( + __dst, + __src, + __len, ); } - late final __objc_msgSend_366Ptr = _lookup< + late final _memmovePtr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSTimeInterval)>>('objc_msgSend'); - late final __objc_msgSend_366 = __objc_msgSend_366Ptr.asFunction< - instancetype Function( - ffi.Pointer, ffi.Pointer, double)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('memmove'); + late final _memmove = _memmovePtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_timeIntervalSinceDate_1 = - _registerName1("timeIntervalSinceDate:"); - double _objc_msgSend_367( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anotherDate, + ffi.Pointer memset( + ffi.Pointer __b, + int __c, + int __len, ) { - return __objc_msgSend_367( - obj, - sel, - anotherDate, + return _memset( + __b, + __c, + __len, ); } - late final __objc_msgSend_367Ptr = _lookup< + late final _memsetPtr = _lookup< ffi.NativeFunction< - NSTimeInterval Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_367 = __objc_msgSend_367Ptr.asFunction< - double Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int, ffi.Size)>>('memset'); + late final _memset = _memsetPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); - 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_368( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer anotherDate, + ffi.Pointer strcat( + ffi.Pointer __s1, + ffi.Pointer __s2, ) { - return __objc_msgSend_368( - obj, - sel, - anotherDate, + return _strcat( + __s1, + __s2, ); } - late final __objc_msgSend_368Ptr = _lookup< + late final _strcatPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_368 = __objc_msgSend_368Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('strcat'); + late final _strcat = _strcatPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_laterDate_1 = _registerName1("laterDate:"); - int _objc_msgSend_369( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer other, + ffi.Pointer strchr( + ffi.Pointer __s, + int __c, ) { - return __objc_msgSend_369( - obj, - sel, - other, + return _strchr( + __s, + __c, ); } - late final __objc_msgSend_369Ptr = _lookup< + late final _strchrPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_369 = __objc_msgSend_369Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('strchr'); + late final _strchr = _strchrPtr + .asFunction Function(ffi.Pointer, int)>(); - late final _sel_isEqualToDate_1 = _registerName1("isEqualToDate:"); - bool _objc_msgSend_370( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherDate, + int strcmp( + ffi.Pointer __s1, + ffi.Pointer __s2, ) { - return __objc_msgSend_370( - obj, - sel, - otherDate, + return _strcmp( + __s1, + __s2, ); } - late final __objc_msgSend_370Ptr = _lookup< + late final _strcmpPtr = _lookup< ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_370 = __objc_msgSend_370Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('strcmp'); + late final _strcmp = _strcmpPtr + .asFunction, 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_371( - ffi.Pointer obj, - ffi.Pointer sel, - double secsToBeAdded, - ffi.Pointer date, + int strcoll( + ffi.Pointer __s1, + ffi.Pointer __s2, ) { - return __objc_msgSend_371( - obj, - sel, - secsToBeAdded, - date, + return _strcoll( + __s1, + __s2, ); } - late final __objc_msgSend_371Ptr = _lookup< + late final _strcollPtr = _lookup< ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSTimeInterval, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_371 = __objc_msgSend_371Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - double, ffi.Pointer)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('strcoll'); + late final _strcoll = _strcollPtr + .asFunction, ffi.Pointer)>(); - late final _sel_distantFuture1 = _registerName1("distantFuture"); - ffi.Pointer _objc_msgSend_372( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer strcpy( + ffi.Pointer __dst, + ffi.Pointer __src, ) { - return __objc_msgSend_372( - obj, - sel, + return _strcpy( + __dst, + __src, ); } - late final __objc_msgSend_372Ptr = _lookup< + late final _strcpyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_372 = __objc_msgSend_372Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('strcpy'); + late final _strcpy = _strcpyPtr.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_removeCachedResponsesSinceDate_1 = - _registerName1("removeCachedResponsesSinceDate:"); - void _objc_msgSend_373( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer date, + int strcspn( + ffi.Pointer __s, + ffi.Pointer __charset, ) { - return __objc_msgSend_373( - obj, - sel, - date, + return _strcspn( + __s, + __charset, ); } - late final __objc_msgSend_373Ptr = _lookup< + late final _strcspnPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_373 = __objc_msgSend_373Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.UnsignedLong Function( + ffi.Pointer, ffi.Pointer)>>('strcspn'); + late final _strcspn = _strcspnPtr + .asFunction, ffi.Pointer)>(); - 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 _class_NSURLSessionTask1 = _getClass1("NSURLSessionTask"); - late final _sel_taskIdentifier1 = _registerName1("taskIdentifier"); - late final _sel_originalRequest1 = _registerName1("originalRequest"); - ffi.Pointer _objc_msgSend_374( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer strerror( + int __errnum, ) { - return __objc_msgSend_374( - obj, - sel, + return _strerror( + __errnum, ); } - late final __objc_msgSend_374Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_374 = __objc_msgSend_374Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _strerrorPtr = + _lookup Function(ffi.Int)>>( + 'strerror'); + late final _strerror = + _strerrorPtr.asFunction Function(int)>(); - late final _sel_currentRequest1 = _registerName1("currentRequest"); - ffi.Pointer _objc_msgSend_375( - ffi.Pointer obj, - ffi.Pointer sel, + int strlen( + ffi.Pointer __s, ) { - return __objc_msgSend_375( - obj, - sel, + return _strlen( + __s, ); } - late final __objc_msgSend_375Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_375 = __objc_msgSend_375Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _strlenPtr = _lookup< + ffi.NativeFunction)>>( + 'strlen'); + late final _strlen = + _strlenPtr.asFunction)>(); - late final _class_NSProgress1 = _getClass1("NSProgress"); - late final _sel_currentProgress1 = _registerName1("currentProgress"); - ffi.Pointer _objc_msgSend_376( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer strncat( + ffi.Pointer __s1, + ffi.Pointer __s2, + int __n, ) { - return __objc_msgSend_376( - obj, - sel, + return _strncat( + __s1, + __s2, + __n, ); } - late final __objc_msgSend_376Ptr = _lookup< + late final _strncatPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_376 = __objc_msgSend_376Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('strncat'); + late final _strncat = _strncatPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_progressWithTotalUnitCount_1 = - _registerName1("progressWithTotalUnitCount:"); - ffi.Pointer _objc_msgSend_377( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, + int strncmp( + ffi.Pointer __s1, + ffi.Pointer __s2, + int __n, ) { - return __objc_msgSend_377( - obj, - sel, - unitCount, + return _strncmp( + __s1, + __s2, + __n, ); } - late final __objc_msgSend_377Ptr = _lookup< + late final _strncmpPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_377 = __objc_msgSend_377Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('strncmp'); + late final _strncmp = _strncmpPtr.asFunction< + int 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_378( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, - ffi.Pointer parent, - int portionOfParentTotalUnitCount, + ffi.Pointer strncpy( + ffi.Pointer __dst, + ffi.Pointer __src, + int __n, ) { - return __objc_msgSend_378( - obj, - sel, - unitCount, - parent, - portionOfParentTotalUnitCount, + return _strncpy( + __dst, + __src, + __n, ); } - late final __objc_msgSend_378Ptr = _lookup< + late final _strncpyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Int64, - ffi.Pointer, - ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_378 = __objc_msgSend_378Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, int, ffi.Pointer, int)>(); - - late final _sel_initWithParent_userInfo_1 = - _registerName1("initWithParent:userInfo:"); - instancetype _objc_msgSend_379( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer parentProgressOrNil, - ffi.Pointer userInfoOrNil, - ) { - return __objc_msgSend_379( - obj, - sel, - parentProgressOrNil, - userInfoOrNil, + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('strncpy'); + late final _strncpy = _strncpyPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer strpbrk( + ffi.Pointer __s, + ffi.Pointer __charset, + ) { + return _strpbrk( + __s, + __charset, ); } - late final __objc_msgSend_379Ptr = _lookup< + late final _strpbrkPtr = _lookup< ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_379 = __objc_msgSend_379Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('strpbrk'); + late final _strpbrk = _strpbrkPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_becomeCurrentWithPendingUnitCount_1 = - _registerName1("becomeCurrentWithPendingUnitCount:"); - void _objc_msgSend_380( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, + ffi.Pointer strrchr( + ffi.Pointer __s, + int __c, ) { - return __objc_msgSend_380( - obj, - sel, - unitCount, + return _strrchr( + __s, + __c, ); } - late final __objc_msgSend_380Ptr = _lookup< + late final _strrchrPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_380 = __objc_msgSend_380Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('strrchr'); + late final _strrchr = _strrchrPtr + .asFunction Function(ffi.Pointer, int)>(); - late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_1 = - _registerName1("performAsCurrentWithPendingUnitCount:usingBlock:"); - void _objc_msgSend_381( - ffi.Pointer obj, - ffi.Pointer sel, - int unitCount, - ffi.Pointer<_ObjCBlock> work, + int strspn( + ffi.Pointer __s, + ffi.Pointer __charset, ) { - return __objc_msgSend_381( - obj, - sel, - unitCount, - work, + return _strspn( + __s, + __charset, ); } - late final __objc_msgSend_381Ptr = _lookup< + late final _strspnPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int64, ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_381 = __objc_msgSend_381Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer<_ObjCBlock>)>(); + ffi.UnsignedLong Function( + ffi.Pointer, ffi.Pointer)>>('strspn'); + late final _strspn = _strspnPtr + .asFunction, ffi.Pointer)>(); - late final _sel_resignCurrent1 = _registerName1("resignCurrent"); - late final _sel_addChild_withPendingUnitCount_1 = - _registerName1("addChild:withPendingUnitCount:"); - void _objc_msgSend_382( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer child, - int inUnitCount, + ffi.Pointer strstr( + ffi.Pointer __big, + ffi.Pointer __little, ) { - return __objc_msgSend_382( - obj, - sel, - child, - inUnitCount, + return _strstr( + __big, + __little, ); } - late final __objc_msgSend_382Ptr = _lookup< + late final _strstrPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_382 = __objc_msgSend_382Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('strstr'); + late final _strstr = _strstrPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_totalUnitCount1 = _registerName1("totalUnitCount"); - int _objc_msgSend_383( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer strtok( + ffi.Pointer __str, + ffi.Pointer __sep, ) { - return __objc_msgSend_383( - obj, - sel, + return _strtok( + __str, + __sep, ); } - late final __objc_msgSend_383Ptr = _lookup< + late final _strtokPtr = _lookup< ffi.NativeFunction< - ffi.Int64 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_383 = __objc_msgSend_383Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('strtok'); + late final _strtok = _strtokPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_setTotalUnitCount_1 = _registerName1("setTotalUnitCount:"); - void _objc_msgSend_384( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int strxfrm( + ffi.Pointer __s1, + ffi.Pointer __s2, + int __n, ) { - return __objc_msgSend_384( - obj, - sel, - value, + return _strxfrm( + __s1, + __s2, + __n, ); } - late final __objc_msgSend_384Ptr = _lookup< + late final _strxfrmPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int64)>>('objc_msgSend'); - late final __objc_msgSend_384 = __objc_msgSend_384Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('strxfrm'); + late final _strxfrm = _strxfrmPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_completedUnitCount1 = _registerName1("completedUnitCount"); - late final _sel_setCompletedUnitCount_1 = - _registerName1("setCompletedUnitCount:"); - late final _sel_setLocalizedDescription_1 = - _registerName1("setLocalizedDescription:"); - void _objc_msgSend_385( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer strtok_r( + ffi.Pointer __str, + ffi.Pointer __sep, + ffi.Pointer> __lasts, ) { - return __objc_msgSend_385( - obj, - sel, - value, + return _strtok_r( + __str, + __sep, + __lasts, ); } - late final __objc_msgSend_385Ptr = _lookup< + late final _strtok_rPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_385 = __objc_msgSend_385Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>('strtok_r'); + late final _strtok_r = _strtok_rPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer>)>(); - 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:"); - void _objc_msgSend_386( - ffi.Pointer obj, - ffi.Pointer sel, - bool value, + int strerror_r( + int __errnum, + ffi.Pointer __strerrbuf, + int __buflen, ) { - return __objc_msgSend_386( - obj, - sel, - value, + return _strerror_r( + __errnum, + __strerrbuf, + __buflen, ); } - late final __objc_msgSend_386Ptr = _lookup< + late final _strerror_rPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_386 = __objc_msgSend_386Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, bool)>(); + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Size)>>('strerror_r'); + late final _strerror_r = _strerror_rPtr + .asFunction, int)>(); - late final _sel_isPausable1 = _registerName1("isPausable"); - late final _sel_setPausable_1 = _registerName1("setPausable:"); - late final _sel_isCancelled1 = _registerName1("isCancelled"); - late final _sel_isPaused1 = _registerName1("isPaused"); - late final _sel_cancellationHandler1 = _registerName1("cancellationHandler"); - ffi.Pointer<_ObjCBlock> _objc_msgSend_387( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer strdup( + ffi.Pointer __s1, ) { - return __objc_msgSend_387( - obj, - sel, + return _strdup( + __s1, ); } - late final __objc_msgSend_387Ptr = _lookup< + late final _strdupPtr = _lookup< ffi.NativeFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_387 = __objc_msgSend_387Ptr.asFunction< - ffi.Pointer<_ObjCBlock> Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>>('strdup'); + late final _strdup = _strdupPtr + .asFunction Function(ffi.Pointer)>(); - late final _sel_setCancellationHandler_1 = - _registerName1("setCancellationHandler:"); - void _objc_msgSend_388( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> value, + ffi.Pointer memccpy( + ffi.Pointer __dst, + ffi.Pointer __src, + int __c, + int __n, ) { - return __objc_msgSend_388( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_388Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_388 = __objc_msgSend_388Ptr.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_isFinished1 = _registerName1("isFinished"); - late final _sel_cancel1 = _registerName1("cancel"); - late final _sel_pause1 = _registerName1("pause"); - late final _sel_resume1 = _registerName1("resume"); - late final _sel_kind1 = _registerName1("kind"); - late final _sel_setKind_1 = _registerName1("setKind:"); - late final _sel_estimatedTimeRemaining1 = - _registerName1("estimatedTimeRemaining"); - late final _sel_setEstimatedTimeRemaining_1 = - _registerName1("setEstimatedTimeRemaining:"); - void _objc_msgSend_389( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_389( - obj, - sel, - value, + return _memccpy( + __dst, + __src, + __c, + __n, ); } - late final __objc_msgSend_389Ptr = _lookup< + late final _memccpyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_389 = __objc_msgSend_389Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int, ffi.Size)>>('memccpy'); + late final _memccpy = _memccpyPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, int)>(); - late final _sel_throughput1 = _registerName1("throughput"); - late final _sel_setThroughput_1 = _registerName1("setThroughput:"); - late final _sel_fileOperationKind1 = _registerName1("fileOperationKind"); - late final _sel_setFileOperationKind_1 = - _registerName1("setFileOperationKind:"); - late final _sel_fileURL1 = _registerName1("fileURL"); - late final _sel_setFileURL_1 = _registerName1("setFileURL:"); - void _objc_msgSend_390( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer stpcpy( + ffi.Pointer __dst, + ffi.Pointer __src, ) { - return __objc_msgSend_390( - obj, - sel, - value, + return _stpcpy( + __dst, + __src, ); } - late final __objc_msgSend_390Ptr = _lookup< + late final _stpcpyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_390 = __objc_msgSend_390Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('stpcpy'); + late final _stpcpy = _stpcpyPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_fileTotalCount1 = _registerName1("fileTotalCount"); - late final _sel_setFileTotalCount_1 = _registerName1("setFileTotalCount:"); - late final _sel_fileCompletedCount1 = _registerName1("fileCompletedCount"); - late final _sel_setFileCompletedCount_1 = - _registerName1("setFileCompletedCount:"); - late final _sel_publish1 = _registerName1("publish"); - late final _sel_unpublish1 = _registerName1("unpublish"); - late final _sel_addSubscriberForFileURL_withPublishingHandler_1 = - _registerName1("addSubscriberForFileURL:withPublishingHandler:"); - ffi.Pointer _objc_msgSend_391( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - NSProgressPublishingHandler publishingHandler, + ffi.Pointer stpncpy( + ffi.Pointer __dst, + ffi.Pointer __src, + int __n, ) { - return __objc_msgSend_391( - obj, - sel, - url, - publishingHandler, + return _stpncpy( + __dst, + __src, + __n, ); } - late final __objc_msgSend_391Ptr = _lookup< + late final _stpncpyPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSProgressPublishingHandler)>>('objc_msgSend'); - late final __objc_msgSend_391 = __objc_msgSend_391Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSProgressPublishingHandler)>(); + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('stpncpy'); + late final _stpncpy = _stpncpyPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_removeSubscriber_1 = _registerName1("removeSubscriber:"); - late final _sel_isOld1 = _registerName1("isOld"); - late final _sel_progress1 = _registerName1("progress"); - ffi.Pointer _objc_msgSend_392( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer strndup( + ffi.Pointer __s1, + int __n, ) { - return __objc_msgSend_392( - obj, - sel, + return _strndup( + __s1, + __n, ); } - late final __objc_msgSend_392Ptr = _lookup< + late final _strndupPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_392 = __objc_msgSend_392Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Size)>>('strndup'); + late final _strndup = _strndupPtr + .asFunction Function(ffi.Pointer, int)>(); - late final _sel_earliestBeginDate1 = _registerName1("earliestBeginDate"); - ffi.Pointer _objc_msgSend_393( - ffi.Pointer obj, - ffi.Pointer sel, + int strnlen( + ffi.Pointer __s1, + int __n, ) { - return __objc_msgSend_393( - obj, - sel, + return _strnlen( + __s1, + __n, ); } - late final __objc_msgSend_393Ptr = _lookup< + late final _strnlenPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_393 = __objc_msgSend_393Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Size Function(ffi.Pointer, ffi.Size)>>('strnlen'); + late final _strnlen = + _strnlenPtr.asFunction, int)>(); - late final _sel_setEarliestBeginDate_1 = - _registerName1("setEarliestBeginDate:"); - void _objc_msgSend_394( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer strsignal( + int __sig, ) { - return __objc_msgSend_394( - obj, - sel, - value, + return _strsignal( + __sig, ); } - late final __objc_msgSend_394Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_394 = __objc_msgSend_394Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - 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:"); - void _objc_msgSend_395( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_395( - obj, - sel, - value, + late final _strsignalPtr = + _lookup Function(ffi.Int)>>( + 'strsignal'); + late final _strsignal = + _strsignalPtr.asFunction Function(int)>(); + + int memset_s( + ffi.Pointer __s, + int __smax, + int __c, + int __n, + ) { + return _memset_s( + __s, + __smax, + __c, + __n, ); } - late final __objc_msgSend_395Ptr = _lookup< + late final _memset_sPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_395 = __objc_msgSend_395Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + errno_t Function( + ffi.Pointer, rsize_t, ffi.Int, rsize_t)>>('memset_s'); + late final _memset_s = _memset_sPtr + .asFunction, int, int, int)>(); - late final _sel_state1 = _registerName1("state"); - int _objc_msgSend_396( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer memmem( + ffi.Pointer __big, + int __big_len, + ffi.Pointer __little, + int __little_len, ) { - return __objc_msgSend_396( - obj, - sel, + return _memmem( + __big, + __big_len, + __little, + __little_len, ); } - late final __objc_msgSend_396Ptr = _lookup< + late final _memmemPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_396 = __objc_msgSend_396Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer, ffi.Size, + ffi.Pointer, ffi.Size)>>('memmem'); + late final _memmem = _memmemPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, ffi.Pointer, int)>(); - late final _sel_error1 = _registerName1("error"); - late final _sel_suspend1 = _registerName1("suspend"); - late final _sel_priority1 = _registerName1("priority"); - late final _sel_setPriority_1 = _registerName1("setPriority:"); - void _objc_msgSend_397( - ffi.Pointer obj, - ffi.Pointer sel, - double value, + void memset_pattern4( + ffi.Pointer __b, + ffi.Pointer __pattern4, + int __len, ) { - return __objc_msgSend_397( - obj, - sel, - value, + return _memset_pattern4( + __b, + __pattern4, + __len, ); } - late final __objc_msgSend_397Ptr = _lookup< + late final _memset_pattern4Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Float)>>('objc_msgSend'); - late final __objc_msgSend_397 = __objc_msgSend_397Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('memset_pattern4'); + late final _memset_pattern4 = _memset_pattern4Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_prefersIncrementalDelivery1 = - _registerName1("prefersIncrementalDelivery"); - late final _sel_setPrefersIncrementalDelivery_1 = - _registerName1("setPrefersIncrementalDelivery:"); - late final _sel_storeCachedResponse_forDataTask_1 = - _registerName1("storeCachedResponse:forDataTask:"); - void _objc_msgSend_398( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cachedResponse, - ffi.Pointer dataTask, + void memset_pattern8( + ffi.Pointer __b, + ffi.Pointer __pattern8, + int __len, ) { - return __objc_msgSend_398( - obj, - sel, - cachedResponse, - dataTask, + return _memset_pattern8( + __b, + __pattern8, + __len, ); } - late final __objc_msgSend_398Ptr = _lookup< + late final _memset_pattern8Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_398 = __objc_msgSend_398Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getCachedResponseForDataTask_completionHandler_1 = - _registerName1("getCachedResponseForDataTask:completionHandler:"); - void _objc_msgSend_399( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dataTask, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_399( - obj, - sel, - dataTask, - completionHandler, - ); - } + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('memset_pattern8'); + late final _memset_pattern8 = _memset_pattern8Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final __objc_msgSend_399Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_399 = __objc_msgSend_399Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_removeCachedResponseForDataTask_1 = - _registerName1("removeCachedResponseForDataTask:"); - void _objc_msgSend_400( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer dataTask, - ) { - return __objc_msgSend_400( - obj, - sel, - dataTask, + void memset_pattern16( + ffi.Pointer __b, + ffi.Pointer __pattern16, + int __len, + ) { + return _memset_pattern16( + __b, + __pattern16, + __len, ); } - late final __objc_msgSend_400Ptr = _lookup< + late final _memset_pattern16Ptr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_400 = __objc_msgSend_400Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('memset_pattern16'); + late final _memset_pattern16 = _memset_pattern16Ptr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _class_NSNotification1 = _getClass1("NSNotification"); - late final _sel_name1 = _registerName1("name"); - late final _sel_initWithName_object_userInfo_1 = - _registerName1("initWithName:object:userInfo:"); - instancetype _objc_msgSend_401( - ffi.Pointer obj, - ffi.Pointer sel, - NSNotificationName name, - ffi.Pointer object, - ffi.Pointer userInfo, + ffi.Pointer strcasestr( + ffi.Pointer __big, + ffi.Pointer __little, ) { - return __objc_msgSend_401( - obj, - sel, - name, - object, - userInfo, - ); - } - - late final __objc_msgSend_401Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_401 = __objc_msgSend_401Ptr.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_NSNotificationCenter1 = _getClass1("NSNotificationCenter"); - late final _sel_defaultCenter1 = _registerName1("defaultCenter"); - ffi.Pointer _objc_msgSend_402( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_402( - obj, - sel, + return _strcasestr( + __big, + __little, ); } - late final __objc_msgSend_402Ptr = _lookup< + late final _strcasestrPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_402 = __objc_msgSend_402Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('strcasestr'); + late final _strcasestr = _strcasestrPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final _sel_addObserver_selector_name_object_1 = - _registerName1("addObserver:selector:name:object:"); - void _objc_msgSend_403( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - ffi.Pointer aSelector, - NSNotificationName aName, - ffi.Pointer anObject, + ffi.Pointer strnstr( + ffi.Pointer __big, + ffi.Pointer __little, + int __len, ) { - return __objc_msgSend_403( - obj, - sel, - observer, - aSelector, - aName, - anObject, + return _strnstr( + __big, + __little, + __len, ); } - late final __objc_msgSend_403Ptr = _lookup< + late final _strnstrPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_403 = __objc_msgSend_403Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer)>(); - - late final _sel_postNotification_1 = _registerName1("postNotification:"); - void _objc_msgSend_404( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer notification, - ) { - return __objc_msgSend_404( - obj, - sel, - notification, + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('strnstr'); + late final _strnstr = _strnstrPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); + + int strlcat( + ffi.Pointer __dst, + ffi.Pointer __source, + int __size, + ) { + return _strlcat( + __dst, + __source, + __size, ); } - late final __objc_msgSend_404Ptr = _lookup< + late final _strlcatPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_404 = __objc_msgSend_404Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('strlcat'); + late final _strlcat = _strlcatPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_postNotificationName_object_1 = - _registerName1("postNotificationName:object:"); - void _objc_msgSend_405( - ffi.Pointer obj, - ffi.Pointer sel, - NSNotificationName aName, - ffi.Pointer anObject, + int strlcpy( + ffi.Pointer __dst, + ffi.Pointer __source, + int __size, ) { - return __objc_msgSend_405( - obj, - sel, - aName, - anObject, + return _strlcpy( + __dst, + __source, + __size, ); } - late final __objc_msgSend_405Ptr = _lookup< + late final _strlcpyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSNotificationName, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_405 = __objc_msgSend_405Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - NSNotificationName, ffi.Pointer)>(); + ffi.UnsignedLong Function(ffi.Pointer, + ffi.Pointer, ffi.Size)>>('strlcpy'); + late final _strlcpy = _strlcpyPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_postNotificationName_object_userInfo_1 = - _registerName1("postNotificationName:object:userInfo:"); - void _objc_msgSend_406( - ffi.Pointer obj, - ffi.Pointer sel, - NSNotificationName aName, - ffi.Pointer anObject, - ffi.Pointer aUserInfo, + void strmode( + int __mode, + ffi.Pointer __bp, ) { - return __objc_msgSend_406( - obj, - sel, - aName, - anObject, - aUserInfo, + return _strmode( + __mode, + __bp, ); } - late final __objc_msgSend_406Ptr = _lookup< + late final _strmodePtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_406 = __objc_msgSend_406Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_removeObserver_1 = _registerName1("removeObserver:"); - late final _sel_removeObserver_name_object_1 = - _registerName1("removeObserver:name:object:"); - void _objc_msgSend_407( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer observer, - NSNotificationName aName, - ffi.Pointer anObject, - ) { - return __objc_msgSend_407( - obj, - sel, - observer, - aName, - anObject, - ); - } + ffi.Void Function(ffi.Int, ffi.Pointer)>>('strmode'); + late final _strmode = + _strmodePtr.asFunction)>(); - late final __objc_msgSend_407Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_407 = __objc_msgSend_407Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer)>(); - - late final _class_NSOperationQueue1 = _getClass1("NSOperationQueue"); - late final _class_NSOperation1 = _getClass1("NSOperation"); - late final _sel_start1 = _registerName1("start"); - late final _sel_main1 = _registerName1("main"); - late final _sel_isExecuting1 = _registerName1("isExecuting"); - 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_408( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer op, - ) { - return __objc_msgSend_408( - obj, - sel, - op, + ffi.Pointer strsep( + ffi.Pointer> __stringp, + ffi.Pointer __delim, + ) { + return _strsep( + __stringp, + __delim, ); } - late final __objc_msgSend_408Ptr = _lookup< + late final _strsepPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(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 Function(ffi.Pointer>, + ffi.Pointer)>>('strsep'); + late final _strsep = _strsepPtr.asFunction< + ffi.Pointer Function( + 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_409( - ffi.Pointer obj, - ffi.Pointer sel, + void swab( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __objc_msgSend_409( - obj, - sel, + return _swab( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_409Ptr = _lookup< + late final _swabPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_409 = __objc_msgSend_409Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function( + ffi.Pointer, ffi.Pointer, ssize_t)>>('swab'); + late final _swab = _swabPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_setQueuePriority_1 = _registerName1("setQueuePriority:"); - void _objc_msgSend_410( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int timingsafe_bcmp( + ffi.Pointer __b1, + ffi.Pointer __b2, + int __len, ) { - return __objc_msgSend_410( - obj, - sel, - value, + return _timingsafe_bcmp( + __b1, + __b2, + __len, ); } - late final __objc_msgSend_410Ptr = _lookup< + late final _timingsafe_bcmpPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_410 = __objc_msgSend_410Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('timingsafe_bcmp'); + late final _timingsafe_bcmp = _timingsafe_bcmpPtr.asFunction< + int 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_threadPriority1 = _registerName1("threadPriority"); - late final _sel_setThreadPriority_1 = _registerName1("setThreadPriority:"); - void _objc_msgSend_411( - ffi.Pointer obj, - ffi.Pointer sel, - double value, + int strsignal_r( + int __sig, + ffi.Pointer __strsignalbuf, + int __buflen, ) { - return __objc_msgSend_411( - obj, - sel, - value, + return _strsignal_r( + __sig, + __strsignalbuf, + __buflen, ); } - late final __objc_msgSend_411Ptr = _lookup< + late final _strsignal_rPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Double)>>('objc_msgSend'); - late final __objc_msgSend_411 = __objc_msgSend_411Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, double)>(); + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Size)>>('strsignal_r'); + late final _strsignal_r = _strsignal_rPtr + .asFunction, int)>(); - late final _sel_qualityOfService1 = _registerName1("qualityOfService"); - int _objc_msgSend_412( - ffi.Pointer obj, - ffi.Pointer sel, + int bcmp( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __objc_msgSend_412( - obj, - sel, + return _bcmp( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_412Ptr = _lookup< + late final _bcmpPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_412 = __objc_msgSend_412Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Size)>>('bcmp'); + late final _bcmp = _bcmpPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_setQualityOfService_1 = - _registerName1("setQualityOfService:"); - void _objc_msgSend_413( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + void bcopy( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __objc_msgSend_413( - obj, - sel, - value, + return _bcopy( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_413Ptr = _lookup< + late final _bcopyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_413 = __objc_msgSend_413Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Void Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('bcopy'); + late final _bcopy = _bcopyPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_setName_1 = _registerName1("setName:"); - late final _sel_addOperation_1 = _registerName1("addOperation:"); - late final _sel_addOperations_waitUntilFinished_1 = - _registerName1("addOperations:waitUntilFinished:"); - void _objc_msgSend_414( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer ops, - bool wait, + void bzero( + ffi.Pointer arg0, + int arg1, ) { - return __objc_msgSend_414( - obj, - sel, - ops, - wait, + return _bzero( + arg0, + arg1, ); } - late final __objc_msgSend_414Ptr = _lookup< + late final _bzeroPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Bool)>>('objc_msgSend'); - late final __objc_msgSend_414 = __objc_msgSend_414Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, bool)>(); + ffi.Void Function(ffi.Pointer, ffi.Size)>>('bzero'); + late final _bzero = + _bzeroPtr.asFunction, int)>(); - late final _sel_addOperationWithBlock_1 = - _registerName1("addOperationWithBlock:"); - void _objc_msgSend_415( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, + ffi.Pointer index( + ffi.Pointer arg0, + int arg1, ) { - return __objc_msgSend_415( - obj, - sel, - block, + return _index( + arg0, + arg1, ); } - late final __objc_msgSend_415Ptr = _lookup< + late final _indexPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_415 = __objc_msgSend_415Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('index'); + late final _index = _indexPtr + .asFunction Function(ffi.Pointer, int)>(); - late final _sel_addBarrierBlock_1 = _registerName1("addBarrierBlock:"); - late final _sel_maxConcurrentOperationCount1 = - _registerName1("maxConcurrentOperationCount"); - late final _sel_setMaxConcurrentOperationCount_1 = - _registerName1("setMaxConcurrentOperationCount:"); - void _objc_msgSend_416( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + ffi.Pointer rindex( + ffi.Pointer arg0, + int arg1, ) { - return __objc_msgSend_416( - obj, - sel, - value, + return _rindex( + arg0, + arg1, ); } - late final __objc_msgSend_416Ptr = _lookup< + late final _rindexPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_416 = __objc_msgSend_416Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Int)>>('rindex'); + late final _rindex = _rindexPtr + .asFunction Function(ffi.Pointer, int)>(); - late final _sel_isSuspended1 = _registerName1("isSuspended"); - late final _sel_setSuspended_1 = _registerName1("setSuspended:"); - late final _sel_underlyingQueue1 = _registerName1("underlyingQueue"); - dispatch_queue_t _objc_msgSend_417( - ffi.Pointer obj, - ffi.Pointer sel, + int ffs( + int arg0, ) { - return __objc_msgSend_417( - obj, - sel, + return _ffs( + arg0, ); } - late final __objc_msgSend_417Ptr = _lookup< - ffi.NativeFunction< - dispatch_queue_t Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_417 = __objc_msgSend_417Ptr.asFunction< - dispatch_queue_t Function( - ffi.Pointer, ffi.Pointer)>(); + late final _ffsPtr = + _lookup>('ffs'); + late final _ffs = _ffsPtr.asFunction(); - late final _sel_setUnderlyingQueue_1 = _registerName1("setUnderlyingQueue:"); - void _objc_msgSend_418( - ffi.Pointer obj, - ffi.Pointer sel, - dispatch_queue_t value, + int strcasecmp( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_418( - obj, - sel, - value, + return _strcasecmp( + arg0, + arg1, ); } - late final __objc_msgSend_418Ptr = _lookup< + late final _strcasecmpPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - dispatch_queue_t)>>('objc_msgSend'); - late final __objc_msgSend_418 = __objc_msgSend_418Ptr.asFunction< - void Function( - ffi.Pointer, ffi.Pointer, dispatch_queue_t)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('strcasecmp'); + late final _strcasecmp = _strcasecmpPtr + .asFunction, ffi.Pointer)>(); - late final _sel_cancelAllOperations1 = _registerName1("cancelAllOperations"); - late final _sel_waitUntilAllOperationsAreFinished1 = - _registerName1("waitUntilAllOperationsAreFinished"); - late final _sel_currentQueue1 = _registerName1("currentQueue"); - ffi.Pointer _objc_msgSend_419( - ffi.Pointer obj, - ffi.Pointer sel, + int strncasecmp( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __objc_msgSend_419( - obj, - sel, + return _strncasecmp( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_419Ptr = _lookup< + late final _strncasecmpPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_419 = __objc_msgSend_419Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('strncasecmp'); + late final _strncasecmp = _strncasecmpPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final _sel_mainQueue1 = _registerName1("mainQueue"); - ffi.Pointer _objc_msgSend_420( - ffi.Pointer obj, - ffi.Pointer sel, + int ffsl( + int arg0, ) { - return __objc_msgSend_420( - obj, - sel, + return _ffsl( + arg0, ); } - late final __objc_msgSend_420Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_420 = __objc_msgSend_420Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _ffslPtr = + _lookup>('ffsl'); + late final _ffsl = _ffslPtr.asFunction(); - late final _sel_operations1 = _registerName1("operations"); - late final _sel_operationCount1 = _registerName1("operationCount"); - late final _sel_addObserverForName_object_queue_usingBlock_1 = - _registerName1("addObserverForName:object:queue:usingBlock:"); - ffi.Pointer _objc_msgSend_421( - ffi.Pointer obj, - ffi.Pointer sel, - NSNotificationName name, - ffi.Pointer obj1, - ffi.Pointer queue, - ffi.Pointer<_ObjCBlock> block, + int ffsll( + int arg0, ) { - return __objc_msgSend_421( - obj, - sel, - name, - obj1, - queue, - block, - ); - } - - late final __objc_msgSend_421Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_421 = __objc_msgSend_421Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSNotificationName, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _NSSystemClockDidChangeNotification = - _lookup('NSSystemClockDidChangeNotification'); - - NSNotificationName get NSSystemClockDidChangeNotification => - _NSSystemClockDidChangeNotification.value; + return _ffsll( + arg0, + ); + } - set NSSystemClockDidChangeNotification(NSNotificationName value) => - _NSSystemClockDidChangeNotification.value = value; + late final _ffsllPtr = + _lookup>('ffsll'); + late final _ffsll = _ffsllPtr.asFunction(); - late final _class_NSMutableURLRequest1 = _getClass1("NSMutableURLRequest"); - late final _sel_setURL_1 = _registerName1("setURL:"); - late final _sel_setCachePolicy_1 = _registerName1("setCachePolicy:"); - void _objc_msgSend_422( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int fls( + int arg0, ) { - return __objc_msgSend_422( - obj, - sel, - value, + return _fls( + arg0, ); } - late final __objc_msgSend_422Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_422 = __objc_msgSend_422Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _flsPtr = + _lookup>('fls'); + late final _fls = _flsPtr.asFunction(); - late final _sel_setTimeoutInterval_1 = _registerName1("setTimeoutInterval:"); - late final _sel_setMainDocumentURL_1 = _registerName1("setMainDocumentURL:"); - late final _sel_setNetworkServiceType_1 = - _registerName1("setNetworkServiceType:"); - void _objc_msgSend_423( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + int flsl( + int arg0, ) { - return __objc_msgSend_423( - obj, - sel, - value, + return _flsl( + arg0, ); } - late final __objc_msgSend_423Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_423 = __objc_msgSend_423Ptr.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_424( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + late final _flslPtr = + _lookup>('flsl'); + late final _flsl = _flslPtr.asFunction(); + + int flsll( + int arg0, ) { - return __objc_msgSend_424( - obj, - sel, - value, + return _flsll( + arg0, ); } - late final __objc_msgSend_424Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_424 = __objc_msgSend_424Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _flsllPtr = + _lookup>('flsll'); + late final _flsll = _flsllPtr.asFunction(); + + late final ffi.Pointer>> _tzname = + _lookup>>('tzname'); + + ffi.Pointer> get tzname => _tzname.value; + + set tzname(ffi.Pointer> value) => _tzname.value = value; + + late final ffi.Pointer _getdate_err = + _lookup('getdate_err'); + + int get getdate_err => _getdate_err.value; + + set getdate_err(int value) => _getdate_err.value = value; + + late final ffi.Pointer _timezone = _lookup('timezone'); + + int get timezone => _timezone.value; + + set timezone(int value) => _timezone.value = value; + + late final ffi.Pointer _daylight = _lookup('daylight'); + + int get daylight => _daylight.value; + + set daylight(int value) => _daylight.value = value; - late final _sel_setRequiresDNSSECValidation_1 = - _registerName1("setRequiresDNSSECValidation:"); - late final _sel_setHTTPMethod_1 = _registerName1("setHTTPMethod:"); - late final _sel_setAllHTTPHeaderFields_1 = - _registerName1("setAllHTTPHeaderFields:"); - void _objc_msgSend_425( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer asctime( + ffi.Pointer arg0, ) { - return __objc_msgSend_425( - obj, - sel, - value, + return _asctime( + arg0, ); } - late final __objc_msgSend_425Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_425 = __objc_msgSend_425Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _asctimePtr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'asctime'); + late final _asctime = + _asctimePtr.asFunction Function(ffi.Pointer)>(); + + int clock() { + return _clock(); + } + + late final _clockPtr = + _lookup>('clock'); + late final _clock = _clockPtr.asFunction(); - late final _sel_setValue_forHTTPHeaderField_1 = - _registerName1("setValue:forHTTPHeaderField:"); - void _objc_msgSend_426( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer field, + ffi.Pointer ctime( + ffi.Pointer arg0, ) { - return __objc_msgSend_426( - obj, - sel, - value, - field, + return _ctime( + arg0, ); } - late final __objc_msgSend_426Ptr = _lookup< + late final _ctimePtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_426 = __objc_msgSend_426Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_addValue_forHTTPHeaderField_1 = - _registerName1("addValue:forHTTPHeaderField:"); - void _objc_msgSend_427( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ffi.Pointer field, - ) { - return __objc_msgSend_427( - obj, - sel, - value, - field, + ffi.Pointer Function(ffi.Pointer)>>('ctime'); + late final _ctime = _ctimePtr + .asFunction Function(ffi.Pointer)>(); + + double difftime( + int arg0, + int arg1, + ) { + return _difftime( + arg0, + arg1, ); } - late final __objc_msgSend_427Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - 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, ffi.Pointer)>(); - - late final _sel_setHTTPBody_1 = _registerName1("setHTTPBody:"); - void _objc_msgSend_428( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_428( - obj, - sel, - value, + late final _difftimePtr = + _lookup>( + 'difftime'); + late final _difftime = _difftimePtr.asFunction(); + + ffi.Pointer getdate( + ffi.Pointer arg0, + ) { + return _getdate( + arg0, ); } - late final __objc_msgSend_428Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_428 = __objc_msgSend_428Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _getdatePtr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'getdate'); + late final _getdate = + _getdatePtr.asFunction Function(ffi.Pointer)>(); - late final _sel_setHTTPBodyStream_1 = _registerName1("setHTTPBodyStream:"); - void _objc_msgSend_429( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, + ffi.Pointer gmtime( + ffi.Pointer arg0, ) { - return __objc_msgSend_429( - obj, - sel, - value, + return _gmtime( + arg0, ); } - late final __objc_msgSend_429Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_429 = __objc_msgSend_429Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + late final _gmtimePtr = _lookup< + ffi + .NativeFunction Function(ffi.Pointer)>>('gmtime'); + late final _gmtime = + _gmtimePtr.asFunction Function(ffi.Pointer)>(); - late final _sel_setHTTPShouldHandleCookies_1 = - _registerName1("setHTTPShouldHandleCookies:"); - late final _sel_setHTTPShouldUsePipelining_1 = - _registerName1("setHTTPShouldUsePipelining:"); - late final _class_NSHTTPCookieStorage1 = _getClass1("NSHTTPCookieStorage"); - late final _sel_sharedHTTPCookieStorage1 = - _registerName1("sharedHTTPCookieStorage"); - ffi.Pointer _objc_msgSend_430( - ffi.Pointer obj, - ffi.Pointer sel, + ffi.Pointer localtime( + ffi.Pointer arg0, ) { - return __objc_msgSend_430( - obj, - sel, + return _localtime( + arg0, ); } - late final __objc_msgSend_430Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_430 = __objc_msgSend_430Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _localtimePtr = _lookup< + ffi.NativeFunction Function(ffi.Pointer)>>( + 'localtime'); + late final _localtime = + _localtimePtr.asFunction Function(ffi.Pointer)>(); - late final _sel_sharedCookieStorageForGroupContainerIdentifier_1 = - _registerName1("sharedCookieStorageForGroupContainerIdentifier:"); - ffi.Pointer _objc_msgSend_431( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer identifier, + int mktime( + ffi.Pointer arg0, ) { - return __objc_msgSend_431( - obj, - sel, - identifier, + return _mktime( + arg0, ); } - late final __objc_msgSend_431Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_431 = __objc_msgSend_431Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _mktimePtr = + _lookup)>>('mktime'); + late final _mktime = _mktimePtr.asFunction)>(); - late final _sel_cookies1 = _registerName1("cookies"); - late final _class_NSHTTPCookie1 = _getClass1("NSHTTPCookie"); - late final _sel_setCookie_1 = _registerName1("setCookie:"); - void _objc_msgSend_432( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cookie, + int strftime( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) { - return __objc_msgSend_432( - obj, - sel, - cookie, + return _strftime( + arg0, + arg1, + arg2, + arg3, ); } - late final __objc_msgSend_432Ptr = _lookup< + late final _strftimePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_432 = __objc_msgSend_432Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); + ffi.Size Function(ffi.Pointer, ffi.Size, + ffi.Pointer, ffi.Pointer)>>('strftime'); + late final _strftime = _strftimePtr.asFunction< + int Function(ffi.Pointer, int, 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_433( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cookies, - ffi.Pointer URL, - ffi.Pointer mainDocumentURL, + ffi.Pointer strptime( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return __objc_msgSend_433( - obj, - sel, - cookies, - URL, - mainDocumentURL, + return _strptime( + arg0, + arg1, + arg2, ); } - late final __objc_msgSend_433Ptr = _lookup< + late final _strptimePtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_433 = __objc_msgSend_433Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_cookieAcceptPolicy1 = _registerName1("cookieAcceptPolicy"); - int _objc_msgSend_434( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_434( - obj, - sel, + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('strptime'); + late final _strptime = _strptimePtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + + int time( + ffi.Pointer arg0, + ) { + return _time( + arg0, ); } - late final __objc_msgSend_434Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_434 = __objc_msgSend_434Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final _timePtr = + _lookup)>>('time'); + late final _time = _timePtr.asFunction)>(); - late final _sel_setCookieAcceptPolicy_1 = - _registerName1("setCookieAcceptPolicy:"); - void _objc_msgSend_435( - ffi.Pointer obj, - ffi.Pointer sel, - int value, + void tzset() { + return _tzset(); + } + + late final _tzsetPtr = + _lookup>('tzset'); + late final _tzset = _tzsetPtr.asFunction(); + + ffi.Pointer asctime_r( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_435( - obj, - sel, - value, + return _asctime_r( + arg0, + arg1, ); } - late final __objc_msgSend_435Ptr = _lookup< + late final _asctime_rPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_435 = __objc_msgSend_435Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('asctime_r'); + late final _asctime_r = _asctime_rPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); - late final _sel_sortedCookiesUsingDescriptors_1 = - _registerName1("sortedCookiesUsingDescriptors:"); - late final _sel_storeCookies_forTask_1 = - _registerName1("storeCookies:forTask:"); - void _objc_msgSend_436( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer cookies, - ffi.Pointer task, + ffi.Pointer ctime_r( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return __objc_msgSend_436( - obj, - sel, - cookies, - task, + return _ctime_r( + arg0, + arg1, ); } - late final __objc_msgSend_436Ptr = _lookup< + late final _ctime_rPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_436 = __objc_msgSend_436Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_getCookiesForTask_completionHandler_1 = - _registerName1("getCookiesForTask:completionHandler:"); - void _objc_msgSend_437( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer task, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_437( - obj, - sel, - task, - completionHandler, + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('ctime_r'); + late final _ctime_r = _ctime_rPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); + + ffi.Pointer gmtime_r( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _gmtime_r( + arg0, + arg1, ); } - late final __objc_msgSend_437Ptr = _lookup< + late final _gmtime_rPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_437 = __objc_msgSend_437Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer - _NSHTTPCookieManagerAcceptPolicyChangedNotification = - _lookup( - 'NSHTTPCookieManagerAcceptPolicyChangedNotification'); - - NSNotificationName get NSHTTPCookieManagerAcceptPolicyChangedNotification => - _NSHTTPCookieManagerAcceptPolicyChangedNotification.value; - - set NSHTTPCookieManagerAcceptPolicyChangedNotification( - NSNotificationName value) => - _NSHTTPCookieManagerAcceptPolicyChangedNotification.value = value; - - late final ffi.Pointer - _NSHTTPCookieManagerCookiesChangedNotification = - _lookup( - 'NSHTTPCookieManagerCookiesChangedNotification'); - - NSNotificationName get NSHTTPCookieManagerCookiesChangedNotification => - _NSHTTPCookieManagerCookiesChangedNotification.value; - - set NSHTTPCookieManagerCookiesChangedNotification(NSNotificationName value) => - _NSHTTPCookieManagerCookiesChangedNotification.value = value; - - late final ffi.Pointer - _NSProgressEstimatedTimeRemainingKey = - _lookup('NSProgressEstimatedTimeRemainingKey'); - - NSProgressUserInfoKey get NSProgressEstimatedTimeRemainingKey => - _NSProgressEstimatedTimeRemainingKey.value; - - set NSProgressEstimatedTimeRemainingKey(NSProgressUserInfoKey value) => - _NSProgressEstimatedTimeRemainingKey.value = value; - - late final ffi.Pointer _NSProgressThroughputKey = - _lookup('NSProgressThroughputKey'); - - NSProgressUserInfoKey get NSProgressThroughputKey => - _NSProgressThroughputKey.value; - - set NSProgressThroughputKey(NSProgressUserInfoKey value) => - _NSProgressThroughputKey.value = value; - - late final ffi.Pointer _NSProgressKindFile = - _lookup('NSProgressKindFile'); - - NSProgressKind get NSProgressKindFile => _NSProgressKindFile.value; - - set NSProgressKindFile(NSProgressKind value) => - _NSProgressKindFile.value = value; - - late final ffi.Pointer - _NSProgressFileOperationKindKey = - _lookup('NSProgressFileOperationKindKey'); - - NSProgressUserInfoKey get NSProgressFileOperationKindKey => - _NSProgressFileOperationKindKey.value; - - set NSProgressFileOperationKindKey(NSProgressUserInfoKey value) => - _NSProgressFileOperationKindKey.value = value; - - late final ffi.Pointer - _NSProgressFileOperationKindDownloading = - _lookup( - 'NSProgressFileOperationKindDownloading'); - - NSProgressFileOperationKind get NSProgressFileOperationKindDownloading => - _NSProgressFileOperationKindDownloading.value; - - set NSProgressFileOperationKindDownloading( - NSProgressFileOperationKind value) => - _NSProgressFileOperationKindDownloading.value = value; - - late final ffi.Pointer - _NSProgressFileOperationKindDecompressingAfterDownloading = - _lookup( - 'NSProgressFileOperationKindDecompressingAfterDownloading'); - - NSProgressFileOperationKind - get NSProgressFileOperationKindDecompressingAfterDownloading => - _NSProgressFileOperationKindDecompressingAfterDownloading.value; - - set NSProgressFileOperationKindDecompressingAfterDownloading( - NSProgressFileOperationKind value) => - _NSProgressFileOperationKindDecompressingAfterDownloading.value = value; - - late final ffi.Pointer - _NSProgressFileOperationKindReceiving = - _lookup( - 'NSProgressFileOperationKindReceiving'); - - NSProgressFileOperationKind get NSProgressFileOperationKindReceiving => - _NSProgressFileOperationKindReceiving.value; - - set NSProgressFileOperationKindReceiving(NSProgressFileOperationKind value) => - _NSProgressFileOperationKindReceiving.value = value; - - late final ffi.Pointer - _NSProgressFileOperationKindCopying = - _lookup( - 'NSProgressFileOperationKindCopying'); - - NSProgressFileOperationKind get NSProgressFileOperationKindCopying => - _NSProgressFileOperationKindCopying.value; - - set NSProgressFileOperationKindCopying(NSProgressFileOperationKind value) => - _NSProgressFileOperationKindCopying.value = value; - - late final ffi.Pointer - _NSProgressFileOperationKindUploading = - _lookup( - 'NSProgressFileOperationKindUploading'); - - NSProgressFileOperationKind get NSProgressFileOperationKindUploading => - _NSProgressFileOperationKindUploading.value; - - set NSProgressFileOperationKindUploading(NSProgressFileOperationKind value) => - _NSProgressFileOperationKindUploading.value = value; - - late final ffi.Pointer - _NSProgressFileOperationKindDuplicating = - _lookup( - 'NSProgressFileOperationKindDuplicating'); - - NSProgressFileOperationKind get NSProgressFileOperationKindDuplicating => - _NSProgressFileOperationKindDuplicating.value; - - set NSProgressFileOperationKindDuplicating( - NSProgressFileOperationKind value) => - _NSProgressFileOperationKindDuplicating.value = value; - - late final ffi.Pointer _NSProgressFileURLKey = - _lookup('NSProgressFileURLKey'); - - NSProgressUserInfoKey get NSProgressFileURLKey => _NSProgressFileURLKey.value; - - set NSProgressFileURLKey(NSProgressUserInfoKey value) => - _NSProgressFileURLKey.value = value; - - late final ffi.Pointer _NSProgressFileTotalCountKey = - _lookup('NSProgressFileTotalCountKey'); - - NSProgressUserInfoKey get NSProgressFileTotalCountKey => - _NSProgressFileTotalCountKey.value; - - set NSProgressFileTotalCountKey(NSProgressUserInfoKey value) => - _NSProgressFileTotalCountKey.value = value; - - late final ffi.Pointer - _NSProgressFileCompletedCountKey = - _lookup('NSProgressFileCompletedCountKey'); - - NSProgressUserInfoKey get NSProgressFileCompletedCountKey => - _NSProgressFileCompletedCountKey.value; - - set NSProgressFileCompletedCountKey(NSProgressUserInfoKey value) => - _NSProgressFileCompletedCountKey.value = value; - - late final ffi.Pointer - _NSProgressFileAnimationImageKey = - _lookup('NSProgressFileAnimationImageKey'); - - NSProgressUserInfoKey get NSProgressFileAnimationImageKey => - _NSProgressFileAnimationImageKey.value; - - set NSProgressFileAnimationImageKey(NSProgressUserInfoKey value) => - _NSProgressFileAnimationImageKey.value = value; - - late final ffi.Pointer - _NSProgressFileAnimationImageOriginalRectKey = - _lookup( - 'NSProgressFileAnimationImageOriginalRectKey'); - - NSProgressUserInfoKey get NSProgressFileAnimationImageOriginalRectKey => - _NSProgressFileAnimationImageOriginalRectKey.value; + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('gmtime_r'); + late final _gmtime_r = _gmtime_rPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); - set NSProgressFileAnimationImageOriginalRectKey( - NSProgressUserInfoKey value) => - _NSProgressFileAnimationImageOriginalRectKey.value = value; + ffi.Pointer localtime_r( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _localtime_r( + arg0, + arg1, + ); + } - late final ffi.Pointer _NSProgressFileIconKey = - _lookup('NSProgressFileIconKey'); + late final _localtime_rPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('localtime_r'); + late final _localtime_r = _localtime_rPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); - NSProgressUserInfoKey get NSProgressFileIconKey => - _NSProgressFileIconKey.value; + int posix2time( + int arg0, + ) { + return _posix2time( + arg0, + ); + } - set NSProgressFileIconKey(NSProgressUserInfoKey value) => - _NSProgressFileIconKey.value = value; + late final _posix2timePtr = + _lookup>('posix2time'); + late final _posix2time = _posix2timePtr.asFunction(); - late final ffi.Pointer _kCFTypeArrayCallBacks = - _lookup('kCFTypeArrayCallBacks'); + void tzsetwall() { + return _tzsetwall(); + } - CFArrayCallBacks get kCFTypeArrayCallBacks => _kCFTypeArrayCallBacks.ref; + late final _tzsetwallPtr = + _lookup>('tzsetwall'); + late final _tzsetwall = _tzsetwallPtr.asFunction(); - int CFArrayGetTypeID() { - return _CFArrayGetTypeID(); + int time2posix( + int arg0, + ) { + return _time2posix( + arg0, + ); } - late final _CFArrayGetTypeIDPtr = - _lookup>('CFArrayGetTypeID'); - late final _CFArrayGetTypeID = - _CFArrayGetTypeIDPtr.asFunction(); + late final _time2posixPtr = + _lookup>('time2posix'); + late final _time2posix = _time2posixPtr.asFunction(); - CFArrayRef CFArrayCreate( - CFAllocatorRef allocator, - ffi.Pointer> values, - int numValues, - ffi.Pointer callBacks, + int timelocal( + ffi.Pointer arg0, ) { - return _CFArrayCreate( - allocator, - values, - numValues, - callBacks, + return _timelocal( + arg0, ); } - late final _CFArrayCreatePtr = _lookup< - ffi.NativeFunction< - CFArrayRef Function( - CFAllocatorRef, - ffi.Pointer>, - CFIndex, - ffi.Pointer)>>('CFArrayCreate'); - late final _CFArrayCreate = _CFArrayCreatePtr.asFunction< - CFArrayRef Function(CFAllocatorRef, ffi.Pointer>, - int, ffi.Pointer)>(); + late final _timelocalPtr = + _lookup)>>( + 'timelocal'); + late final _timelocal = + _timelocalPtr.asFunction)>(); - CFArrayRef CFArrayCreateCopy( - CFAllocatorRef allocator, - CFArrayRef theArray, + int timegm( + ffi.Pointer arg0, ) { - return _CFArrayCreateCopy( - allocator, - theArray, + return _timegm( + arg0, ); } - late final _CFArrayCreateCopyPtr = _lookup< - ffi.NativeFunction>( - 'CFArrayCreateCopy'); - late final _CFArrayCreateCopy = _CFArrayCreateCopyPtr.asFunction< - CFArrayRef Function(CFAllocatorRef, CFArrayRef)>(); + late final _timegmPtr = + _lookup)>>('timegm'); + late final _timegm = _timegmPtr.asFunction)>(); - CFMutableArrayRef CFArrayCreateMutable( - CFAllocatorRef allocator, - int capacity, - ffi.Pointer callBacks, + int nanosleep( + ffi.Pointer __rqtp, + ffi.Pointer __rmtp, ) { - return _CFArrayCreateMutable( - allocator, - capacity, - callBacks, + return _nanosleep( + __rqtp, + __rmtp, ); } - late final _CFArrayCreateMutablePtr = _lookup< + late final _nanosleepPtr = _lookup< ffi.NativeFunction< - CFMutableArrayRef Function(CFAllocatorRef, CFIndex, - ffi.Pointer)>>('CFArrayCreateMutable'); - late final _CFArrayCreateMutable = _CFArrayCreateMutablePtr.asFunction< - CFMutableArrayRef Function( - CFAllocatorRef, int, ffi.Pointer)>(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('nanosleep'); + late final _nanosleep = _nanosleepPtr + .asFunction, ffi.Pointer)>(); - CFMutableArrayRef CFArrayCreateMutableCopy( - CFAllocatorRef allocator, - int capacity, - CFArrayRef theArray, + int clock_getres( + clockid_t __clock_id, + ffi.Pointer __res, ) { - return _CFArrayCreateMutableCopy( - allocator, - capacity, - theArray, + return _clock_getres( + __clock_id.value, + __res, ); } - late final _CFArrayCreateMutableCopyPtr = _lookup< + late final _clock_getresPtr = _lookup< ffi.NativeFunction< - CFMutableArrayRef Function(CFAllocatorRef, CFIndex, - CFArrayRef)>>('CFArrayCreateMutableCopy'); - late final _CFArrayCreateMutableCopy = - _CFArrayCreateMutableCopyPtr.asFunction< - CFMutableArrayRef Function(CFAllocatorRef, int, CFArrayRef)>(); + ffi.Int Function( + ffi.UnsignedInt, ffi.Pointer)>>('clock_getres'); + late final _clock_getres = + _clock_getresPtr.asFunction)>(); - int CFArrayGetCount( - CFArrayRef theArray, + int clock_gettime( + clockid_t __clock_id, + ffi.Pointer __tp, ) { - return _CFArrayGetCount( - theArray, + return _clock_gettime( + __clock_id.value, + __tp, ); } - late final _CFArrayGetCountPtr = - _lookup>( - 'CFArrayGetCount'); - late final _CFArrayGetCount = - _CFArrayGetCountPtr.asFunction(); + late final _clock_gettimePtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.UnsignedInt, ffi.Pointer)>>('clock_gettime'); + late final _clock_gettime = + _clock_gettimePtr.asFunction)>(); - int CFArrayGetCountOfValue( - CFArrayRef theArray, - CFRange range, - ffi.Pointer value, + Dart__uint64_t clock_gettime_nsec_np( + clockid_t __clock_id, ) { - return _CFArrayGetCountOfValue( - theArray, - range, - value, + return _clock_gettime_nsec_np( + __clock_id.value, ); } - late final _CFArrayGetCountOfValuePtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFArrayRef, CFRange, - ffi.Pointer)>>('CFArrayGetCountOfValue'); - late final _CFArrayGetCountOfValue = _CFArrayGetCountOfValuePtr.asFunction< - int Function(CFArrayRef, CFRange, ffi.Pointer)>(); + late final _clock_gettime_nsec_npPtr = + _lookup>( + 'clock_gettime_nsec_np'); + late final _clock_gettime_nsec_np = + _clock_gettime_nsec_npPtr.asFunction(); - int CFArrayContainsValue( - CFArrayRef theArray, - CFRange range, - ffi.Pointer value, + int clock_settime( + clockid_t __clock_id, + ffi.Pointer __tp, ) { - return _CFArrayContainsValue( - theArray, - range, - value, + return _clock_settime( + __clock_id.value, + __tp, ); } - late final _CFArrayContainsValuePtr = _lookup< + late final _clock_settimePtr = _lookup< ffi.NativeFunction< - Boolean Function(CFArrayRef, CFRange, - ffi.Pointer)>>('CFArrayContainsValue'); - late final _CFArrayContainsValue = _CFArrayContainsValuePtr.asFunction< - int Function(CFArrayRef, CFRange, ffi.Pointer)>(); + ffi.Int Function( + ffi.UnsignedInt, ffi.Pointer)>>('clock_settime'); + late final _clock_settime = + _clock_settimePtr.asFunction)>(); - ffi.Pointer CFArrayGetValueAtIndex( - CFArrayRef theArray, - int idx, + int timespec_get( + ffi.Pointer ts, + int base, ) { - return _CFArrayGetValueAtIndex( - theArray, - idx, + return _timespec_get( + ts, + base, ); } - late final _CFArrayGetValueAtIndexPtr = _lookup< - ffi - .NativeFunction Function(CFArrayRef, CFIndex)>>( - 'CFArrayGetValueAtIndex'); - late final _CFArrayGetValueAtIndex = _CFArrayGetValueAtIndexPtr.asFunction< - ffi.Pointer Function(CFArrayRef, int)>(); + late final _timespec_getPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'timespec_get'); + late final _timespec_get = + _timespec_getPtr.asFunction, int)>(); - void CFArrayGetValues( - CFArrayRef theArray, - CFRange range, - ffi.Pointer> values, + int imaxabs( + int j, ) { - return _CFArrayGetValues( - theArray, - range, - values, + return _imaxabs( + j, ); } - late final _CFArrayGetValuesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFArrayRef, CFRange, - ffi.Pointer>)>>('CFArrayGetValues'); - late final _CFArrayGetValues = _CFArrayGetValuesPtr.asFunction< - void Function(CFArrayRef, CFRange, ffi.Pointer>)>(); + late final _imaxabsPtr = + _lookup>('imaxabs'); + late final _imaxabs = _imaxabsPtr.asFunction(); - void CFArrayApplyFunction( - CFArrayRef theArray, - CFRange range, - CFArrayApplierFunction applier, - ffi.Pointer context, + imaxdiv_t imaxdiv( + int __numer, + int __denom, ) { - return _CFArrayApplyFunction( - theArray, - range, - applier, - context, + return _imaxdiv( + __numer, + __denom, ); } - late final _CFArrayApplyFunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFArrayRef, CFRange, CFArrayApplierFunction, - ffi.Pointer)>>('CFArrayApplyFunction'); - late final _CFArrayApplyFunction = _CFArrayApplyFunctionPtr.asFunction< - void Function(CFArrayRef, CFRange, CFArrayApplierFunction, - ffi.Pointer)>(); + late final _imaxdivPtr = + _lookup>( + 'imaxdiv'); + late final _imaxdiv = _imaxdivPtr.asFunction(); - int CFArrayGetFirstIndexOfValue( - CFArrayRef theArray, - CFRange range, - ffi.Pointer value, + int strtoimax( + ffi.Pointer __nptr, + ffi.Pointer> __endptr, + int __base, ) { - return _CFArrayGetFirstIndexOfValue( - theArray, - range, - value, + return _strtoimax( + __nptr, + __endptr, + __base, ); } - late final _CFArrayGetFirstIndexOfValuePtr = _lookup< + late final _strtoimaxPtr = _lookup< ffi.NativeFunction< - CFIndex Function(CFArrayRef, CFRange, - ffi.Pointer)>>('CFArrayGetFirstIndexOfValue'); - late final _CFArrayGetFirstIndexOfValue = _CFArrayGetFirstIndexOfValuePtr - .asFunction)>(); + intmax_t Function(ffi.Pointer, + ffi.Pointer>, ffi.Int)>>('strtoimax'); + late final _strtoimax = _strtoimaxPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>, int)>(); - int CFArrayGetLastIndexOfValue( - CFArrayRef theArray, - CFRange range, - ffi.Pointer value, + int strtoumax( + ffi.Pointer __nptr, + ffi.Pointer> __endptr, + int __base, ) { - return _CFArrayGetLastIndexOfValue( - theArray, - range, - value, + return _strtoumax( + __nptr, + __endptr, + __base, ); } - late final _CFArrayGetLastIndexOfValuePtr = _lookup< + late final _strtoumaxPtr = _lookup< ffi.NativeFunction< - CFIndex Function(CFArrayRef, CFRange, - ffi.Pointer)>>('CFArrayGetLastIndexOfValue'); - late final _CFArrayGetLastIndexOfValue = _CFArrayGetLastIndexOfValuePtr - .asFunction)>(); + uintmax_t Function(ffi.Pointer, + ffi.Pointer>, ffi.Int)>>('strtoumax'); + late final _strtoumax = _strtoumaxPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>, int)>(); - int CFArrayBSearchValues( - CFArrayRef theArray, - CFRange range, - ffi.Pointer value, - CFComparatorFunction comparator, - ffi.Pointer context, + int wcstoimax( + ffi.Pointer __nptr, + ffi.Pointer> __endptr, + int __base, ) { - return _CFArrayBSearchValues( - theArray, - range, - value, - comparator, - context, + return _wcstoimax( + __nptr, + __endptr, + __base, ); } - late final _CFArrayBSearchValuesPtr = _lookup< + late final _wcstoimaxPtr = _lookup< ffi.NativeFunction< - CFIndex Function( - CFArrayRef, - CFRange, - ffi.Pointer, - CFComparatorFunction, - ffi.Pointer)>>('CFArrayBSearchValues'); - late final _CFArrayBSearchValues = _CFArrayBSearchValuesPtr.asFunction< - int Function(CFArrayRef, CFRange, ffi.Pointer, - CFComparatorFunction, ffi.Pointer)>(); + intmax_t Function(ffi.Pointer, + ffi.Pointer>, ffi.Int)>>('wcstoimax'); + late final _wcstoimax = _wcstoimaxPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>, int)>(); - void CFArrayAppendValue( - CFMutableArrayRef theArray, - ffi.Pointer value, + int wcstoumax( + ffi.Pointer __nptr, + ffi.Pointer> __endptr, + int __base, ) { - return _CFArrayAppendValue( - theArray, - value, + return _wcstoumax( + __nptr, + __endptr, + __base, ); } - late final _CFArrayAppendValuePtr = _lookup< + late final _wcstoumaxPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFMutableArrayRef, ffi.Pointer)>>('CFArrayAppendValue'); - late final _CFArrayAppendValue = _CFArrayAppendValuePtr.asFunction< - void Function(CFMutableArrayRef, ffi.Pointer)>(); + uintmax_t Function(ffi.Pointer, + ffi.Pointer>, ffi.Int)>>('wcstoumax'); + late final _wcstoumax = _wcstoumaxPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>, int)>(); - void CFArrayInsertValueAtIndex( - CFMutableArrayRef theArray, - int idx, - ffi.Pointer value, - ) { - return _CFArrayInsertValueAtIndex( - theArray, - idx, - value, - ); + late final ffi.Pointer _kCFTypeBagCallBacks = + _lookup('kCFTypeBagCallBacks'); + + CFBagCallBacks get kCFTypeBagCallBacks => _kCFTypeBagCallBacks.ref; + + late final ffi.Pointer _kCFCopyStringBagCallBacks = + _lookup('kCFCopyStringBagCallBacks'); + + CFBagCallBacks get kCFCopyStringBagCallBacks => + _kCFCopyStringBagCallBacks.ref; + + int CFBagGetTypeID() { + return _CFBagGetTypeID(); } - late final _CFArrayInsertValueAtIndexPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableArrayRef, CFIndex, - ffi.Pointer)>>('CFArrayInsertValueAtIndex'); - late final _CFArrayInsertValueAtIndex = - _CFArrayInsertValueAtIndexPtr.asFunction< - void Function(CFMutableArrayRef, int, ffi.Pointer)>(); + late final _CFBagGetTypeIDPtr = + _lookup>('CFBagGetTypeID'); + late final _CFBagGetTypeID = _CFBagGetTypeIDPtr.asFunction(); - void CFArraySetValueAtIndex( - CFMutableArrayRef theArray, - int idx, - ffi.Pointer value, + CFBagRef CFBagCreate( + CFAllocatorRef allocator, + ffi.Pointer> values, + int numValues, + ffi.Pointer callBacks, ) { - return _CFArraySetValueAtIndex( - theArray, - idx, - value, + return _CFBagCreate( + allocator, + values, + numValues, + callBacks, ); } - late final _CFArraySetValueAtIndexPtr = _lookup< + late final _CFBagCreatePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFMutableArrayRef, CFIndex, - ffi.Pointer)>>('CFArraySetValueAtIndex'); - late final _CFArraySetValueAtIndex = _CFArraySetValueAtIndexPtr.asFunction< - void Function(CFMutableArrayRef, int, ffi.Pointer)>(); + CFBagRef Function(CFAllocatorRef, ffi.Pointer>, + CFIndex, ffi.Pointer)>>('CFBagCreate'); + late final _CFBagCreate = _CFBagCreatePtr.asFunction< + CFBagRef Function(CFAllocatorRef, ffi.Pointer>, int, + ffi.Pointer)>(); - void CFArrayRemoveValueAtIndex( - CFMutableArrayRef theArray, - int idx, + CFBagRef CFBagCreateCopy( + CFAllocatorRef allocator, + CFBagRef theBag, ) { - return _CFArrayRemoveValueAtIndex( - theArray, - idx, + return _CFBagCreateCopy( + allocator, + theBag, ); } - late final _CFArrayRemoveValueAtIndexPtr = _lookup< - ffi.NativeFunction>( - 'CFArrayRemoveValueAtIndex'); - late final _CFArrayRemoveValueAtIndex = _CFArrayRemoveValueAtIndexPtr - .asFunction(); + late final _CFBagCreateCopyPtr = + _lookup>( + 'CFBagCreateCopy'); + late final _CFBagCreateCopy = _CFBagCreateCopyPtr.asFunction< + CFBagRef Function(CFAllocatorRef, CFBagRef)>(); - void CFArrayRemoveAllValues( - CFMutableArrayRef theArray, + CFMutableBagRef CFBagCreateMutable( + CFAllocatorRef allocator, + int capacity, + ffi.Pointer callBacks, ) { - return _CFArrayRemoveAllValues( - theArray, + return _CFBagCreateMutable( + allocator, + capacity, + callBacks, ); } - late final _CFArrayRemoveAllValuesPtr = - _lookup>( - 'CFArrayRemoveAllValues'); - late final _CFArrayRemoveAllValues = - _CFArrayRemoveAllValuesPtr.asFunction(); + late final _CFBagCreateMutablePtr = _lookup< + ffi.NativeFunction< + CFMutableBagRef Function(CFAllocatorRef, CFIndex, + ffi.Pointer)>>('CFBagCreateMutable'); + late final _CFBagCreateMutable = _CFBagCreateMutablePtr.asFunction< + CFMutableBagRef Function( + CFAllocatorRef, int, ffi.Pointer)>(); - void CFArrayReplaceValues( - CFMutableArrayRef theArray, - CFRange range, - ffi.Pointer> newValues, - int newCount, + CFMutableBagRef CFBagCreateMutableCopy( + CFAllocatorRef allocator, + int capacity, + CFBagRef theBag, ) { - return _CFArrayReplaceValues( - theArray, - range, - newValues, - newCount, + return _CFBagCreateMutableCopy( + allocator, + capacity, + theBag, ); } - late final _CFArrayReplaceValuesPtr = _lookup< + late final _CFBagCreateMutableCopyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFMutableArrayRef, - CFRange, - ffi.Pointer>, - CFIndex)>>('CFArrayReplaceValues'); - late final _CFArrayReplaceValues = _CFArrayReplaceValuesPtr.asFunction< - void Function(CFMutableArrayRef, CFRange, - ffi.Pointer>, int)>(); + CFMutableBagRef Function( + CFAllocatorRef, CFIndex, CFBagRef)>>('CFBagCreateMutableCopy'); + late final _CFBagCreateMutableCopy = _CFBagCreateMutableCopyPtr.asFunction< + CFMutableBagRef Function(CFAllocatorRef, int, CFBagRef)>(); - void CFArrayExchangeValuesAtIndices( - CFMutableArrayRef theArray, - int idx1, - int idx2, + int CFBagGetCount( + CFBagRef theBag, ) { - return _CFArrayExchangeValuesAtIndices( - theArray, - idx1, - idx2, + return _CFBagGetCount( + theBag, ); } - late final _CFArrayExchangeValuesAtIndicesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableArrayRef, CFIndex, - CFIndex)>>('CFArrayExchangeValuesAtIndices'); - late final _CFArrayExchangeValuesAtIndices = - _CFArrayExchangeValuesAtIndicesPtr.asFunction< - void Function(CFMutableArrayRef, int, int)>(); + late final _CFBagGetCountPtr = + _lookup>('CFBagGetCount'); + late final _CFBagGetCount = + _CFBagGetCountPtr.asFunction(); - void CFArraySortValues( - CFMutableArrayRef theArray, - CFRange range, - CFComparatorFunction comparator, - ffi.Pointer context, + int CFBagGetCountOfValue( + CFBagRef theBag, + ffi.Pointer value, ) { - return _CFArraySortValues( - theArray, - range, - comparator, - context, + return _CFBagGetCountOfValue( + theBag, + value, ); } - late final _CFArraySortValuesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableArrayRef, CFRange, CFComparatorFunction, - ffi.Pointer)>>('CFArraySortValues'); - late final _CFArraySortValues = _CFArraySortValuesPtr.asFunction< - void Function(CFMutableArrayRef, CFRange, CFComparatorFunction, - ffi.Pointer)>(); + late final _CFBagGetCountOfValuePtr = _lookup< + ffi + .NativeFunction)>>( + 'CFBagGetCountOfValue'); + late final _CFBagGetCountOfValue = _CFBagGetCountOfValuePtr.asFunction< + int Function(CFBagRef, ffi.Pointer)>(); - void CFArrayAppendArray( - CFMutableArrayRef theArray, - CFArrayRef otherArray, - CFRange otherRange, + int CFBagContainsValue( + CFBagRef theBag, + ffi.Pointer value, ) { - return _CFArrayAppendArray( - theArray, - otherArray, - otherRange, + return _CFBagContainsValue( + theBag, + value, ); } - late final _CFArrayAppendArrayPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableArrayRef, CFArrayRef, CFRange)>>('CFArrayAppendArray'); - late final _CFArrayAppendArray = _CFArrayAppendArrayPtr.asFunction< - void Function(CFMutableArrayRef, CFArrayRef, CFRange)>(); + late final _CFBagContainsValuePtr = _lookup< + ffi + .NativeFunction)>>( + 'CFBagContainsValue'); + late final _CFBagContainsValue = _CFBagContainsValuePtr.asFunction< + int Function(CFBagRef, ffi.Pointer)>(); - ffi.Pointer os_retain( - ffi.Pointer object, + ffi.Pointer CFBagGetValue( + CFBagRef theBag, + ffi.Pointer value, ) { - return _os_retain( - object, + return _CFBagGetValue( + theBag, + value, ); } - late final _os_retainPtr = _lookup< + late final _CFBagGetValuePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('os_retain'); - late final _os_retain = _os_retainPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Pointer Function( + CFBagRef, ffi.Pointer)>>('CFBagGetValue'); + late final _CFBagGetValue = _CFBagGetValuePtr.asFunction< + ffi.Pointer Function(CFBagRef, ffi.Pointer)>(); - void os_release( - ffi.Pointer object, + int CFBagGetValueIfPresent( + CFBagRef theBag, + ffi.Pointer candidate, + ffi.Pointer> value, ) { - return _os_release( - object, + return _CFBagGetValueIfPresent( + theBag, + candidate, + value, ); } - late final _os_releasePtr = - _lookup)>>( - 'os_release'); - late final _os_release = - _os_releasePtr.asFunction)>(); + late final _CFBagGetValueIfPresentPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFBagRef, ffi.Pointer, + ffi.Pointer>)>>('CFBagGetValueIfPresent'); + late final _CFBagGetValueIfPresent = _CFBagGetValueIfPresentPtr.asFunction< + int Function(CFBagRef, ffi.Pointer, + ffi.Pointer>)>(); - ffi.Pointer sec_retain( - ffi.Pointer obj, + void CFBagGetValues( + CFBagRef theBag, + ffi.Pointer> values, ) { - return _sec_retain( - obj, + return _CFBagGetValues( + theBag, + values, ); } - late final _sec_retainPtr = _lookup< + late final _CFBagGetValuesPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('sec_retain'); - late final _sec_retain = _sec_retainPtr - .asFunction Function(ffi.Pointer)>(); - - void sec_release( - ffi.Pointer obj, - ) { - return _sec_release( - obj, - ); - } - - late final _sec_releasePtr = - _lookup)>>( - 'sec_release'); - late final _sec_release = - _sec_releasePtr.asFunction)>(); + ffi.Void Function( + CFBagRef, ffi.Pointer>)>>('CFBagGetValues'); + late final _CFBagGetValues = _CFBagGetValuesPtr.asFunction< + void Function(CFBagRef, ffi.Pointer>)>(); - CFStringRef SecCopyErrorMessageString( - int status, - ffi.Pointer reserved, + void CFBagApplyFunction( + CFBagRef theBag, + CFBagApplierFunction applier, + ffi.Pointer context, ) { - return _SecCopyErrorMessageString( - status, - reserved, + return _CFBagApplyFunction( + theBag, + applier, + context, ); } - late final _SecCopyErrorMessageStringPtr = _lookup< + late final _CFBagApplyFunctionPtr = _lookup< ffi.NativeFunction< - CFStringRef Function( - OSStatus, ffi.Pointer)>>('SecCopyErrorMessageString'); - late final _SecCopyErrorMessageString = _SecCopyErrorMessageStringPtr - .asFunction)>(); + ffi.Void Function(CFBagRef, CFBagApplierFunction, + ffi.Pointer)>>('CFBagApplyFunction'); + late final _CFBagApplyFunction = _CFBagApplyFunctionPtr.asFunction< + void Function(CFBagRef, CFBagApplierFunction, ffi.Pointer)>(); - void __assert_rtn( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer arg3, + void CFBagAddValue( + CFMutableBagRef theBag, + ffi.Pointer value, ) { - return ___assert_rtn( - arg0, - arg1, - arg2, - arg3, + return _CFBagAddValue( + theBag, + value, ); } - late final ___assert_rtnPtr = _lookup< + late final _CFBagAddValuePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int, ffi.Pointer)>>('__assert_rtn'); - late final ___assert_rtn = ___assert_rtnPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - late final ffi.Pointer<_RuneLocale> __DefaultRuneLocale = - _lookup<_RuneLocale>('_DefaultRuneLocale'); - - _RuneLocale get _DefaultRuneLocale => __DefaultRuneLocale.ref; - - late final ffi.Pointer> __CurrentRuneLocale = - _lookup>('_CurrentRuneLocale'); - - ffi.Pointer<_RuneLocale> get _CurrentRuneLocale => __CurrentRuneLocale.value; - - set _CurrentRuneLocale(ffi.Pointer<_RuneLocale> value) => - __CurrentRuneLocale.value = value; - - int ___runetype( - int arg0, - ) { - return ____runetype( - arg0, - ); - } - - late final ____runetypePtr = _lookup< - ffi.NativeFunction>( - '___runetype'); - late final ____runetype = ____runetypePtr.asFunction(); - - int ___tolower( - int arg0, - ) { - return ____tolower( - arg0, - ); - } - - late final ____tolowerPtr = _lookup< - ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( - '___tolower'); - late final ____tolower = ____tolowerPtr.asFunction(); + ffi.Void Function( + CFMutableBagRef, ffi.Pointer)>>('CFBagAddValue'); + late final _CFBagAddValue = _CFBagAddValuePtr.asFunction< + void Function(CFMutableBagRef, ffi.Pointer)>(); - int ___toupper( - int arg0, + void CFBagReplaceValue( + CFMutableBagRef theBag, + ffi.Pointer value, ) { - return ____toupper( - arg0, + return _CFBagReplaceValue( + theBag, + value, ); } - late final ____toupperPtr = _lookup< - ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( - '___toupper'); - late final ____toupper = ____toupperPtr.asFunction(); + late final _CFBagReplaceValuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFMutableBagRef, ffi.Pointer)>>('CFBagReplaceValue'); + late final _CFBagReplaceValue = _CFBagReplaceValuePtr.asFunction< + void Function(CFMutableBagRef, ffi.Pointer)>(); - int __maskrune( - int arg0, - int arg1, + void CFBagSetValue( + CFMutableBagRef theBag, + ffi.Pointer value, ) { - return ___maskrune( - arg0, - arg1, + return _CFBagSetValue( + theBag, + value, ); } - late final ___maskrunePtr = _lookup< + late final _CFBagSetValuePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - __darwin_ct_rune_t, ffi.UnsignedLong)>>('__maskrune'); - late final ___maskrune = ___maskrunePtr.asFunction(); + ffi.Void Function( + CFMutableBagRef, ffi.Pointer)>>('CFBagSetValue'); + late final _CFBagSetValue = _CFBagSetValuePtr.asFunction< + void Function(CFMutableBagRef, ffi.Pointer)>(); - int __toupper( - int arg0, + void CFBagRemoveValue( + CFMutableBagRef theBag, + ffi.Pointer value, ) { - return ___toupper1( - arg0, + return _CFBagRemoveValue( + theBag, + value, ); } - late final ___toupperPtr = _lookup< - ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( - '__toupper'); - late final ___toupper1 = ___toupperPtr.asFunction(); + late final _CFBagRemoveValuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFMutableBagRef, ffi.Pointer)>>('CFBagRemoveValue'); + late final _CFBagRemoveValue = _CFBagRemoveValuePtr.asFunction< + void Function(CFMutableBagRef, ffi.Pointer)>(); - int __tolower( - int arg0, + void CFBagRemoveAllValues( + CFMutableBagRef theBag, ) { - return ___tolower1( - arg0, + return _CFBagRemoveAllValues( + theBag, ); } - late final ___tolowerPtr = _lookup< - ffi.NativeFunction<__darwin_ct_rune_t Function(__darwin_ct_rune_t)>>( - '__tolower'); - late final ___tolower1 = ___tolowerPtr.asFunction(); + late final _CFBagRemoveAllValuesPtr = + _lookup>( + 'CFBagRemoveAllValues'); + late final _CFBagRemoveAllValues = + _CFBagRemoveAllValuesPtr.asFunction(); - ffi.Pointer __error() { - return ___error(); - } + late final ffi.Pointer _kCFStringBinaryHeapCallBacks = + _lookup('kCFStringBinaryHeapCallBacks'); - late final ___errorPtr = - _lookup Function()>>('__error'); - late final ___error = - ___errorPtr.asFunction Function()>(); + CFBinaryHeapCallBacks get kCFStringBinaryHeapCallBacks => + _kCFStringBinaryHeapCallBacks.ref; - ffi.Pointer localeconv() { - return _localeconv(); + int CFBinaryHeapGetTypeID() { + return _CFBinaryHeapGetTypeID(); } - late final _localeconvPtr = - _lookup Function()>>('localeconv'); - late final _localeconv = - _localeconvPtr.asFunction Function()>(); + late final _CFBinaryHeapGetTypeIDPtr = + _lookup>('CFBinaryHeapGetTypeID'); + late final _CFBinaryHeapGetTypeID = + _CFBinaryHeapGetTypeIDPtr.asFunction(); - ffi.Pointer setlocale( - int arg0, - ffi.Pointer arg1, + CFBinaryHeapRef CFBinaryHeapCreate( + CFAllocatorRef allocator, + int capacity, + ffi.Pointer callBacks, + ffi.Pointer compareContext, ) { - return _setlocale( - arg0, - arg1, + return _CFBinaryHeapCreate( + allocator, + capacity, + callBacks, + compareContext, ); } - late final _setlocalePtr = _lookup< + late final _CFBinaryHeapCreatePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, ffi.Pointer)>>('setlocale'); - late final _setlocale = _setlocalePtr - .asFunction Function(int, ffi.Pointer)>(); - - int __math_errhandling() { - return ___math_errhandling(); - } - - late final ___math_errhandlingPtr = - _lookup>('__math_errhandling'); - late final ___math_errhandling = - ___math_errhandlingPtr.asFunction(); + CFBinaryHeapRef Function( + CFAllocatorRef, + CFIndex, + ffi.Pointer, + ffi.Pointer)>>('CFBinaryHeapCreate'); + late final _CFBinaryHeapCreate = _CFBinaryHeapCreatePtr.asFunction< + CFBinaryHeapRef Function( + CFAllocatorRef, + int, + ffi.Pointer, + ffi.Pointer)>(); - int __fpclassifyf( - double arg0, + CFBinaryHeapRef CFBinaryHeapCreateCopy( + CFAllocatorRef allocator, + int capacity, + CFBinaryHeapRef heap, ) { - return ___fpclassifyf( - arg0, + return _CFBinaryHeapCreateCopy( + allocator, + capacity, + heap, ); } - late final ___fpclassifyfPtr = - _lookup>('__fpclassifyf'); - late final ___fpclassifyf = - ___fpclassifyfPtr.asFunction(); + late final _CFBinaryHeapCreateCopyPtr = _lookup< + ffi.NativeFunction< + CFBinaryHeapRef Function(CFAllocatorRef, CFIndex, + CFBinaryHeapRef)>>('CFBinaryHeapCreateCopy'); + late final _CFBinaryHeapCreateCopy = _CFBinaryHeapCreateCopyPtr.asFunction< + CFBinaryHeapRef Function(CFAllocatorRef, int, CFBinaryHeapRef)>(); - int __fpclassifyd( - double arg0, + int CFBinaryHeapGetCount( + CFBinaryHeapRef heap, ) { - return ___fpclassifyd( - arg0, + return _CFBinaryHeapGetCount( + heap, ); } - late final ___fpclassifydPtr = - _lookup>( - '__fpclassifyd'); - late final ___fpclassifyd = - ___fpclassifydPtr.asFunction(); + late final _CFBinaryHeapGetCountPtr = + _lookup>( + 'CFBinaryHeapGetCount'); + late final _CFBinaryHeapGetCount = + _CFBinaryHeapGetCountPtr.asFunction(); - double acosf( - double arg0, + int CFBinaryHeapGetCountOfValue( + CFBinaryHeapRef heap, + ffi.Pointer value, ) { - return _acosf( - arg0, + return _CFBinaryHeapGetCountOfValue( + heap, + value, ); } - late final _acosfPtr = - _lookup>('acosf'); - late final _acosf = _acosfPtr.asFunction(); + late final _CFBinaryHeapGetCountOfValuePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFBinaryHeapRef, + ffi.Pointer)>>('CFBinaryHeapGetCountOfValue'); + late final _CFBinaryHeapGetCountOfValue = _CFBinaryHeapGetCountOfValuePtr + .asFunction)>(); - double acos( - double arg0, + int CFBinaryHeapContainsValue( + CFBinaryHeapRef heap, + ffi.Pointer value, ) { - return _acos( - arg0, + return _CFBinaryHeapContainsValue( + heap, + value, ); } - late final _acosPtr = - _lookup>('acos'); - late final _acos = _acosPtr.asFunction(); + late final _CFBinaryHeapContainsValuePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFBinaryHeapRef, + ffi.Pointer)>>('CFBinaryHeapContainsValue'); + late final _CFBinaryHeapContainsValue = _CFBinaryHeapContainsValuePtr + .asFunction)>(); - double asinf( - double arg0, + ffi.Pointer CFBinaryHeapGetMinimum( + CFBinaryHeapRef heap, ) { - return _asinf( - arg0, + return _CFBinaryHeapGetMinimum( + heap, ); } - late final _asinfPtr = - _lookup>('asinf'); - late final _asinf = _asinfPtr.asFunction(); + late final _CFBinaryHeapGetMinimumPtr = _lookup< + ffi.NativeFunction Function(CFBinaryHeapRef)>>( + 'CFBinaryHeapGetMinimum'); + late final _CFBinaryHeapGetMinimum = _CFBinaryHeapGetMinimumPtr.asFunction< + ffi.Pointer Function(CFBinaryHeapRef)>(); - double asin( - double arg0, + int CFBinaryHeapGetMinimumIfPresent( + CFBinaryHeapRef heap, + ffi.Pointer> value, ) { - return _asin( - arg0, + return _CFBinaryHeapGetMinimumIfPresent( + heap, + value, ); } - late final _asinPtr = - _lookup>('asin'); - late final _asin = _asinPtr.asFunction(); + late final _CFBinaryHeapGetMinimumIfPresentPtr = _lookup< + ffi.NativeFunction< + Boolean Function( + CFBinaryHeapRef, ffi.Pointer>)>>( + 'CFBinaryHeapGetMinimumIfPresent'); + late final _CFBinaryHeapGetMinimumIfPresent = + _CFBinaryHeapGetMinimumIfPresentPtr.asFunction< + int Function(CFBinaryHeapRef, ffi.Pointer>)>(); - double atanf( - double arg0, + void CFBinaryHeapGetValues( + CFBinaryHeapRef heap, + ffi.Pointer> values, ) { - return _atanf( - arg0, + return _CFBinaryHeapGetValues( + heap, + values, ); } - late final _atanfPtr = - _lookup>('atanf'); - late final _atanf = _atanfPtr.asFunction(); + late final _CFBinaryHeapGetValuesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFBinaryHeapRef, + ffi.Pointer>)>>('CFBinaryHeapGetValues'); + late final _CFBinaryHeapGetValues = _CFBinaryHeapGetValuesPtr.asFunction< + void Function(CFBinaryHeapRef, ffi.Pointer>)>(); - double atan( - double arg0, + void CFBinaryHeapApplyFunction( + CFBinaryHeapRef heap, + CFBinaryHeapApplierFunction applier, + ffi.Pointer context, ) { - return _atan( - arg0, + return _CFBinaryHeapApplyFunction( + heap, + applier, + context, ); } - late final _atanPtr = - _lookup>('atan'); - late final _atan = _atanPtr.asFunction(); + late final _CFBinaryHeapApplyFunctionPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFBinaryHeapRef, CFBinaryHeapApplierFunction, + ffi.Pointer)>>('CFBinaryHeapApplyFunction'); + late final _CFBinaryHeapApplyFunction = + _CFBinaryHeapApplyFunctionPtr.asFunction< + void Function(CFBinaryHeapRef, CFBinaryHeapApplierFunction, + ffi.Pointer)>(); - double atan2f( - double arg0, - double arg1, + void CFBinaryHeapAddValue( + CFBinaryHeapRef heap, + ffi.Pointer value, ) { - return _atan2f( - arg0, - arg1, + return _CFBinaryHeapAddValue( + heap, + value, ); } - late final _atan2fPtr = - _lookup>( - 'atan2f'); - late final _atan2f = _atan2fPtr.asFunction(); + late final _CFBinaryHeapAddValuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFBinaryHeapRef, ffi.Pointer)>>('CFBinaryHeapAddValue'); + late final _CFBinaryHeapAddValue = _CFBinaryHeapAddValuePtr.asFunction< + void Function(CFBinaryHeapRef, ffi.Pointer)>(); - double atan2( - double arg0, - double arg1, + void CFBinaryHeapRemoveMinimumValue( + CFBinaryHeapRef heap, ) { - return _atan2( - arg0, - arg1, + return _CFBinaryHeapRemoveMinimumValue( + heap, ); } - late final _atan2Ptr = - _lookup>( - 'atan2'); - late final _atan2 = _atan2Ptr.asFunction(); + late final _CFBinaryHeapRemoveMinimumValuePtr = + _lookup>( + 'CFBinaryHeapRemoveMinimumValue'); + late final _CFBinaryHeapRemoveMinimumValue = + _CFBinaryHeapRemoveMinimumValuePtr.asFunction< + void Function(CFBinaryHeapRef)>(); - double cosf( - double arg0, + void CFBinaryHeapRemoveAllValues( + CFBinaryHeapRef heap, ) { - return _cosf( - arg0, + return _CFBinaryHeapRemoveAllValues( + heap, ); } - late final _cosfPtr = - _lookup>('cosf'); - late final _cosf = _cosfPtr.asFunction(); + late final _CFBinaryHeapRemoveAllValuesPtr = + _lookup>( + 'CFBinaryHeapRemoveAllValues'); + late final _CFBinaryHeapRemoveAllValues = _CFBinaryHeapRemoveAllValuesPtr + .asFunction(); - double cos( - double arg0, - ) { - return _cos( - arg0, - ); + int CFBitVectorGetTypeID() { + return _CFBitVectorGetTypeID(); } - late final _cosPtr = - _lookup>('cos'); - late final _cos = _cosPtr.asFunction(); + late final _CFBitVectorGetTypeIDPtr = + _lookup>('CFBitVectorGetTypeID'); + late final _CFBitVectorGetTypeID = + _CFBitVectorGetTypeIDPtr.asFunction(); - double sinf( - double arg0, + CFBitVectorRef CFBitVectorCreate( + CFAllocatorRef allocator, + ffi.Pointer bytes, + int numBits, ) { - return _sinf( - arg0, + return _CFBitVectorCreate( + allocator, + bytes, + numBits, ); } - late final _sinfPtr = - _lookup>('sinf'); - late final _sinf = _sinfPtr.asFunction(); + late final _CFBitVectorCreatePtr = _lookup< + ffi.NativeFunction< + CFBitVectorRef Function(CFAllocatorRef, ffi.Pointer, + CFIndex)>>('CFBitVectorCreate'); + late final _CFBitVectorCreate = _CFBitVectorCreatePtr.asFunction< + CFBitVectorRef Function(CFAllocatorRef, ffi.Pointer, int)>(); - double sin( - double arg0, + CFBitVectorRef CFBitVectorCreateCopy( + CFAllocatorRef allocator, + CFBitVectorRef bv, ) { - return _sin( - arg0, + return _CFBitVectorCreateCopy( + allocator, + bv, ); } - late final _sinPtr = - _lookup>('sin'); - late final _sin = _sinPtr.asFunction(); + late final _CFBitVectorCreateCopyPtr = _lookup< + ffi.NativeFunction< + CFBitVectorRef Function( + CFAllocatorRef, CFBitVectorRef)>>('CFBitVectorCreateCopy'); + late final _CFBitVectorCreateCopy = _CFBitVectorCreateCopyPtr.asFunction< + CFBitVectorRef Function(CFAllocatorRef, CFBitVectorRef)>(); - double tanf( - double arg0, + CFMutableBitVectorRef CFBitVectorCreateMutable( + CFAllocatorRef allocator, + int capacity, ) { - return _tanf( - arg0, + return _CFBitVectorCreateMutable( + allocator, + capacity, ); } - late final _tanfPtr = - _lookup>('tanf'); - late final _tanf = _tanfPtr.asFunction(); + late final _CFBitVectorCreateMutablePtr = _lookup< + ffi.NativeFunction< + CFMutableBitVectorRef Function( + CFAllocatorRef, CFIndex)>>('CFBitVectorCreateMutable'); + late final _CFBitVectorCreateMutable = _CFBitVectorCreateMutablePtr + .asFunction(); - double tan( - double arg0, + CFMutableBitVectorRef CFBitVectorCreateMutableCopy( + CFAllocatorRef allocator, + int capacity, + CFBitVectorRef bv, ) { - return _tan( - arg0, + return _CFBitVectorCreateMutableCopy( + allocator, + capacity, + bv, ); } - late final _tanPtr = - _lookup>('tan'); - late final _tan = _tanPtr.asFunction(); + late final _CFBitVectorCreateMutableCopyPtr = _lookup< + ffi.NativeFunction< + CFMutableBitVectorRef Function(CFAllocatorRef, CFIndex, + CFBitVectorRef)>>('CFBitVectorCreateMutableCopy'); + late final _CFBitVectorCreateMutableCopy = + _CFBitVectorCreateMutableCopyPtr.asFunction< + CFMutableBitVectorRef Function( + CFAllocatorRef, int, CFBitVectorRef)>(); - double acoshf( - double arg0, + int CFBitVectorGetCount( + CFBitVectorRef bv, ) { - return _acoshf( - arg0, + return _CFBitVectorGetCount( + bv, ); } - late final _acoshfPtr = - _lookup>('acoshf'); - late final _acoshf = _acoshfPtr.asFunction(); + late final _CFBitVectorGetCountPtr = + _lookup>( + 'CFBitVectorGetCount'); + late final _CFBitVectorGetCount = + _CFBitVectorGetCountPtr.asFunction(); - double acosh( - double arg0, + int CFBitVectorGetCountOfBit( + CFBitVectorRef bv, + CFRange range, + int value, ) { - return _acosh( - arg0, + return _CFBitVectorGetCountOfBit( + bv, + range, + value, ); } - late final _acoshPtr = - _lookup>('acosh'); - late final _acosh = _acoshPtr.asFunction(); + late final _CFBitVectorGetCountOfBitPtr = _lookup< + ffi.NativeFunction>( + 'CFBitVectorGetCountOfBit'); + late final _CFBitVectorGetCountOfBit = _CFBitVectorGetCountOfBitPtr + .asFunction(); - double asinhf( - double arg0, + int CFBitVectorContainsBit( + CFBitVectorRef bv, + CFRange range, + int value, ) { - return _asinhf( - arg0, + return _CFBitVectorContainsBit( + bv, + range, + value, ); } - late final _asinhfPtr = - _lookup>('asinhf'); - late final _asinhf = _asinhfPtr.asFunction(); + late final _CFBitVectorContainsBitPtr = _lookup< + ffi.NativeFunction>( + 'CFBitVectorContainsBit'); + late final _CFBitVectorContainsBit = _CFBitVectorContainsBitPtr.asFunction< + int Function(CFBitVectorRef, CFRange, int)>(); - double asinh( - double arg0, + int CFBitVectorGetBitAtIndex( + CFBitVectorRef bv, + int idx, ) { - return _asinh( - arg0, + return _CFBitVectorGetBitAtIndex( + bv, + idx, ); } - late final _asinhPtr = - _lookup>('asinh'); - late final _asinh = _asinhPtr.asFunction(); + late final _CFBitVectorGetBitAtIndexPtr = + _lookup>( + 'CFBitVectorGetBitAtIndex'); + late final _CFBitVectorGetBitAtIndex = _CFBitVectorGetBitAtIndexPtr + .asFunction(); - double atanhf( - double arg0, + void CFBitVectorGetBits( + CFBitVectorRef bv, + CFRange range, + ffi.Pointer bytes, ) { - return _atanhf( - arg0, + return _CFBitVectorGetBits( + bv, + range, + bytes, ); } - late final _atanhfPtr = - _lookup>('atanhf'); - late final _atanhf = _atanhfPtr.asFunction(); + late final _CFBitVectorGetBitsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFBitVectorRef, CFRange, + ffi.Pointer)>>('CFBitVectorGetBits'); + late final _CFBitVectorGetBits = _CFBitVectorGetBitsPtr.asFunction< + void Function(CFBitVectorRef, CFRange, ffi.Pointer)>(); - double atanh( - double arg0, + int CFBitVectorGetFirstIndexOfBit( + CFBitVectorRef bv, + CFRange range, + int value, ) { - return _atanh( - arg0, + return _CFBitVectorGetFirstIndexOfBit( + bv, + range, + value, ); } - late final _atanhPtr = - _lookup>('atanh'); - late final _atanh = _atanhPtr.asFunction(); + late final _CFBitVectorGetFirstIndexOfBitPtr = _lookup< + ffi.NativeFunction>( + 'CFBitVectorGetFirstIndexOfBit'); + late final _CFBitVectorGetFirstIndexOfBit = _CFBitVectorGetFirstIndexOfBitPtr + .asFunction(); - double coshf( - double arg0, + int CFBitVectorGetLastIndexOfBit( + CFBitVectorRef bv, + CFRange range, + int value, ) { - return _coshf( - arg0, + return _CFBitVectorGetLastIndexOfBit( + bv, + range, + value, ); } - late final _coshfPtr = - _lookup>('coshf'); - late final _coshf = _coshfPtr.asFunction(); + late final _CFBitVectorGetLastIndexOfBitPtr = _lookup< + ffi.NativeFunction>( + 'CFBitVectorGetLastIndexOfBit'); + late final _CFBitVectorGetLastIndexOfBit = _CFBitVectorGetLastIndexOfBitPtr + .asFunction(); - double cosh( - double arg0, + void CFBitVectorSetCount( + CFMutableBitVectorRef bv, + int count, ) { - return _cosh( - arg0, + return _CFBitVectorSetCount( + bv, + count, ); } - late final _coshPtr = - _lookup>('cosh'); - late final _cosh = _coshPtr.asFunction(); + late final _CFBitVectorSetCountPtr = _lookup< + ffi + .NativeFunction>( + 'CFBitVectorSetCount'); + late final _CFBitVectorSetCount = _CFBitVectorSetCountPtr.asFunction< + void Function(CFMutableBitVectorRef, int)>(); - double sinhf( - double arg0, + void CFBitVectorFlipBitAtIndex( + CFMutableBitVectorRef bv, + int idx, ) { - return _sinhf( - arg0, + return _CFBitVectorFlipBitAtIndex( + bv, + idx, ); } - late final _sinhfPtr = - _lookup>('sinhf'); - late final _sinhf = _sinhfPtr.asFunction(); + late final _CFBitVectorFlipBitAtIndexPtr = _lookup< + ffi + .NativeFunction>( + 'CFBitVectorFlipBitAtIndex'); + late final _CFBitVectorFlipBitAtIndex = _CFBitVectorFlipBitAtIndexPtr + .asFunction(); - double sinh( - double arg0, + void CFBitVectorFlipBits( + CFMutableBitVectorRef bv, + CFRange range, ) { - return _sinh( - arg0, + return _CFBitVectorFlipBits( + bv, + range, ); } - late final _sinhPtr = - _lookup>('sinh'); - late final _sinh = _sinhPtr.asFunction(); + late final _CFBitVectorFlipBitsPtr = _lookup< + ffi + .NativeFunction>( + 'CFBitVectorFlipBits'); + late final _CFBitVectorFlipBits = _CFBitVectorFlipBitsPtr.asFunction< + void Function(CFMutableBitVectorRef, CFRange)>(); - double tanhf( - double arg0, + void CFBitVectorSetBitAtIndex( + CFMutableBitVectorRef bv, + int idx, + int value, ) { - return _tanhf( - arg0, + return _CFBitVectorSetBitAtIndex( + bv, + idx, + value, ); } - late final _tanhfPtr = - _lookup>('tanhf'); - late final _tanhf = _tanhfPtr.asFunction(); + late final _CFBitVectorSetBitAtIndexPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableBitVectorRef, CFIndex, + CFBit)>>('CFBitVectorSetBitAtIndex'); + late final _CFBitVectorSetBitAtIndex = _CFBitVectorSetBitAtIndexPtr + .asFunction(); - double tanh( - double arg0, + void CFBitVectorSetBits( + CFMutableBitVectorRef bv, + CFRange range, + int value, ) { - return _tanh( - arg0, + return _CFBitVectorSetBits( + bv, + range, + value, ); } - late final _tanhPtr = - _lookup>('tanh'); - late final _tanh = _tanhPtr.asFunction(); + late final _CFBitVectorSetBitsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFMutableBitVectorRef, CFRange, CFBit)>>('CFBitVectorSetBits'); + late final _CFBitVectorSetBits = _CFBitVectorSetBitsPtr.asFunction< + void Function(CFMutableBitVectorRef, CFRange, int)>(); - double expf( - double arg0, + void CFBitVectorSetAllBits( + CFMutableBitVectorRef bv, + int value, ) { - return _expf( - arg0, + return _CFBitVectorSetAllBits( + bv, + value, ); } - late final _expfPtr = - _lookup>('expf'); - late final _expf = _expfPtr.asFunction(); + late final _CFBitVectorSetAllBitsPtr = _lookup< + ffi.NativeFunction>( + 'CFBitVectorSetAllBits'); + late final _CFBitVectorSetAllBits = _CFBitVectorSetAllBitsPtr.asFunction< + void Function(CFMutableBitVectorRef, int)>(); - double exp( - double arg0, - ) { - return _exp( - arg0, - ); - } + late final ffi.Pointer + _kCFTypeDictionaryKeyCallBacks = + _lookup('kCFTypeDictionaryKeyCallBacks'); - late final _expPtr = - _lookup>('exp'); - late final _exp = _expPtr.asFunction(); + CFDictionaryKeyCallBacks get kCFTypeDictionaryKeyCallBacks => + _kCFTypeDictionaryKeyCallBacks.ref; - double exp2f( - double arg0, - ) { - return _exp2f( - arg0, - ); - } + late final ffi.Pointer + _kCFCopyStringDictionaryKeyCallBacks = + _lookup('kCFCopyStringDictionaryKeyCallBacks'); - late final _exp2fPtr = - _lookup>('exp2f'); - late final _exp2f = _exp2fPtr.asFunction(); + CFDictionaryKeyCallBacks get kCFCopyStringDictionaryKeyCallBacks => + _kCFCopyStringDictionaryKeyCallBacks.ref; - double exp2( - double arg0, - ) { - return _exp2( - arg0, - ); + late final ffi.Pointer + _kCFTypeDictionaryValueCallBacks = + _lookup('kCFTypeDictionaryValueCallBacks'); + + CFDictionaryValueCallBacks get kCFTypeDictionaryValueCallBacks => + _kCFTypeDictionaryValueCallBacks.ref; + + int CFDictionaryGetTypeID() { + return _CFDictionaryGetTypeID(); } - late final _exp2Ptr = - _lookup>('exp2'); - late final _exp2 = _exp2Ptr.asFunction(); + late final _CFDictionaryGetTypeIDPtr = + _lookup>('CFDictionaryGetTypeID'); + late final _CFDictionaryGetTypeID = + _CFDictionaryGetTypeIDPtr.asFunction(); - double expm1f( - double arg0, + CFDictionaryRef CFDictionaryCreate( + CFAllocatorRef allocator, + ffi.Pointer> keys, + ffi.Pointer> values, + int numValues, + ffi.Pointer keyCallBacks, + ffi.Pointer valueCallBacks, ) { - return _expm1f( - arg0, + return _CFDictionaryCreate( + allocator, + keys, + values, + numValues, + keyCallBacks, + valueCallBacks, ); } - late final _expm1fPtr = - _lookup>('expm1f'); - late final _expm1f = _expm1fPtr.asFunction(); + late final _CFDictionaryCreatePtr = _lookup< + ffi.NativeFunction< + CFDictionaryRef Function( + CFAllocatorRef, + ffi.Pointer>, + ffi.Pointer>, + CFIndex, + ffi.Pointer, + ffi.Pointer)>>('CFDictionaryCreate'); + late final _CFDictionaryCreate = _CFDictionaryCreatePtr.asFunction< + CFDictionaryRef Function( + CFAllocatorRef, + ffi.Pointer>, + ffi.Pointer>, + int, + ffi.Pointer, + ffi.Pointer)>(); - double expm1( - double arg0, + CFDictionaryRef CFDictionaryCreateCopy( + CFAllocatorRef allocator, + CFDictionaryRef theDict, ) { - return _expm1( - arg0, + return _CFDictionaryCreateCopy( + allocator, + theDict, ); } - late final _expm1Ptr = - _lookup>('expm1'); - late final _expm1 = _expm1Ptr.asFunction(); + late final _CFDictionaryCreateCopyPtr = _lookup< + ffi.NativeFunction< + CFDictionaryRef Function( + CFAllocatorRef, CFDictionaryRef)>>('CFDictionaryCreateCopy'); + late final _CFDictionaryCreateCopy = _CFDictionaryCreateCopyPtr.asFunction< + CFDictionaryRef Function(CFAllocatorRef, CFDictionaryRef)>(); - double logf( - double arg0, + CFMutableDictionaryRef CFDictionaryCreateMutable( + CFAllocatorRef allocator, + int capacity, + ffi.Pointer keyCallBacks, + ffi.Pointer valueCallBacks, ) { - return _logf( - arg0, + return _CFDictionaryCreateMutable( + allocator, + capacity, + keyCallBacks, + valueCallBacks, ); } - late final _logfPtr = - _lookup>('logf'); - late final _logf = _logfPtr.asFunction(); + late final _CFDictionaryCreateMutablePtr = _lookup< + ffi.NativeFunction< + CFMutableDictionaryRef Function( + CFAllocatorRef, + CFIndex, + ffi.Pointer, + ffi.Pointer)>>( + 'CFDictionaryCreateMutable'); + late final _CFDictionaryCreateMutable = + _CFDictionaryCreateMutablePtr.asFunction< + CFMutableDictionaryRef Function( + CFAllocatorRef, + int, + ffi.Pointer, + ffi.Pointer)>(); - double log( - double arg0, + CFMutableDictionaryRef CFDictionaryCreateMutableCopy( + CFAllocatorRef allocator, + int capacity, + CFDictionaryRef theDict, ) { - return _log( - arg0, + return _CFDictionaryCreateMutableCopy( + allocator, + capacity, + theDict, ); } - late final _logPtr = - _lookup>('log'); - late final _log = _logPtr.asFunction(); + late final _CFDictionaryCreateMutableCopyPtr = _lookup< + ffi.NativeFunction< + CFMutableDictionaryRef Function(CFAllocatorRef, CFIndex, + CFDictionaryRef)>>('CFDictionaryCreateMutableCopy'); + late final _CFDictionaryCreateMutableCopy = + _CFDictionaryCreateMutableCopyPtr.asFunction< + CFMutableDictionaryRef Function( + CFAllocatorRef, int, CFDictionaryRef)>(); - double log10f( - double arg0, + int CFDictionaryGetCount( + CFDictionaryRef theDict, ) { - return _log10f( - arg0, + return _CFDictionaryGetCount( + theDict, ); } - late final _log10fPtr = - _lookup>('log10f'); - late final _log10f = _log10fPtr.asFunction(); + late final _CFDictionaryGetCountPtr = + _lookup>( + 'CFDictionaryGetCount'); + late final _CFDictionaryGetCount = + _CFDictionaryGetCountPtr.asFunction(); - double log10( - double arg0, + int CFDictionaryGetCountOfKey( + CFDictionaryRef theDict, + ffi.Pointer key, ) { - return _log10( - arg0, + return _CFDictionaryGetCountOfKey( + theDict, + key, ); } - late final _log10Ptr = - _lookup>('log10'); - late final _log10 = _log10Ptr.asFunction(); + late final _CFDictionaryGetCountOfKeyPtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFDictionaryRef, + ffi.Pointer)>>('CFDictionaryGetCountOfKey'); + late final _CFDictionaryGetCountOfKey = _CFDictionaryGetCountOfKeyPtr + .asFunction)>(); - double log2f( - double arg0, + int CFDictionaryGetCountOfValue( + CFDictionaryRef theDict, + ffi.Pointer value, ) { - return _log2f( - arg0, + return _CFDictionaryGetCountOfValue( + theDict, + value, ); } - late final _log2fPtr = - _lookup>('log2f'); - late final _log2f = _log2fPtr.asFunction(); + late final _CFDictionaryGetCountOfValuePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFDictionaryRef, + ffi.Pointer)>>('CFDictionaryGetCountOfValue'); + late final _CFDictionaryGetCountOfValue = _CFDictionaryGetCountOfValuePtr + .asFunction)>(); - double log2( - double arg0, + int CFDictionaryContainsKey( + CFDictionaryRef theDict, + ffi.Pointer key, ) { - return _log2( - arg0, + return _CFDictionaryContainsKey( + theDict, + key, ); } - late final _log2Ptr = - _lookup>('log2'); - late final _log2 = _log2Ptr.asFunction(); + late final _CFDictionaryContainsKeyPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFDictionaryRef, + ffi.Pointer)>>('CFDictionaryContainsKey'); + late final _CFDictionaryContainsKey = _CFDictionaryContainsKeyPtr.asFunction< + int Function(CFDictionaryRef, ffi.Pointer)>(); - double log1pf( - double arg0, + int CFDictionaryContainsValue( + CFDictionaryRef theDict, + ffi.Pointer value, ) { - return _log1pf( - arg0, + return _CFDictionaryContainsValue( + theDict, + value, ); } - late final _log1pfPtr = - _lookup>('log1pf'); - late final _log1pf = _log1pfPtr.asFunction(); + late final _CFDictionaryContainsValuePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFDictionaryRef, + ffi.Pointer)>>('CFDictionaryContainsValue'); + late final _CFDictionaryContainsValue = _CFDictionaryContainsValuePtr + .asFunction)>(); - double log1p( - double arg0, + ffi.Pointer CFDictionaryGetValue( + CFDictionaryRef theDict, + ffi.Pointer key, ) { - return _log1p( - arg0, + return _CFDictionaryGetValue( + theDict, + key, ); } - late final _log1pPtr = - _lookup>('log1p'); - late final _log1p = _log1pPtr.asFunction(); + late final _CFDictionaryGetValuePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CFDictionaryRef, ffi.Pointer)>>('CFDictionaryGetValue'); + late final _CFDictionaryGetValue = _CFDictionaryGetValuePtr.asFunction< + ffi.Pointer Function(CFDictionaryRef, ffi.Pointer)>(); - double logbf( - double arg0, + int CFDictionaryGetValueIfPresent( + CFDictionaryRef theDict, + ffi.Pointer key, + ffi.Pointer> value, ) { - return _logbf( - arg0, + return _CFDictionaryGetValueIfPresent( + theDict, + key, + value, ); } - late final _logbfPtr = - _lookup>('logbf'); - late final _logbf = _logbfPtr.asFunction(); + late final _CFDictionaryGetValueIfPresentPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFDictionaryRef, ffi.Pointer, + ffi.Pointer>)>>( + 'CFDictionaryGetValueIfPresent'); + late final _CFDictionaryGetValueIfPresent = + _CFDictionaryGetValueIfPresentPtr.asFunction< + int Function(CFDictionaryRef, ffi.Pointer, + ffi.Pointer>)>(); - double logb( - double arg0, + void CFDictionaryGetKeysAndValues( + CFDictionaryRef theDict, + ffi.Pointer> keys, + ffi.Pointer> values, ) { - return _logb( - arg0, + return _CFDictionaryGetKeysAndValues( + theDict, + keys, + values, ); } - late final _logbPtr = - _lookup>('logb'); - late final _logb = _logbPtr.asFunction(); + late final _CFDictionaryGetKeysAndValuesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFDictionaryRef, + ffi.Pointer>, + ffi.Pointer>)>>( + 'CFDictionaryGetKeysAndValues'); + late final _CFDictionaryGetKeysAndValues = + _CFDictionaryGetKeysAndValuesPtr.asFunction< + void Function(CFDictionaryRef, ffi.Pointer>, + ffi.Pointer>)>(); - double modff( - double arg0, - ffi.Pointer arg1, + void CFDictionaryApplyFunction( + CFDictionaryRef theDict, + CFDictionaryApplierFunction applier, + ffi.Pointer context, ) { - return _modff( - arg0, - arg1, + return _CFDictionaryApplyFunction( + theDict, + applier, + context, ); } - late final _modffPtr = _lookup< + late final _CFDictionaryApplyFunctionPtr = _lookup< ffi.NativeFunction< - ffi.Float Function(ffi.Float, ffi.Pointer)>>('modff'); - late final _modff = - _modffPtr.asFunction)>(); + ffi.Void Function(CFDictionaryRef, CFDictionaryApplierFunction, + ffi.Pointer)>>('CFDictionaryApplyFunction'); + late final _CFDictionaryApplyFunction = + _CFDictionaryApplyFunctionPtr.asFunction< + void Function(CFDictionaryRef, CFDictionaryApplierFunction, + ffi.Pointer)>(); - double modf( - double arg0, - ffi.Pointer arg1, + void CFDictionaryAddValue( + CFMutableDictionaryRef theDict, + ffi.Pointer key, + ffi.Pointer value, ) { - return _modf( - arg0, - arg1, + return _CFDictionaryAddValue( + theDict, + key, + value, ); } - late final _modfPtr = _lookup< + late final _CFDictionaryAddValuePtr = _lookup< ffi.NativeFunction< - ffi.Double Function(ffi.Double, ffi.Pointer)>>('modf'); - late final _modf = - _modfPtr.asFunction)>(); + ffi.Void Function(CFMutableDictionaryRef, ffi.Pointer, + ffi.Pointer)>>('CFDictionaryAddValue'); + late final _CFDictionaryAddValue = _CFDictionaryAddValuePtr.asFunction< + void Function(CFMutableDictionaryRef, ffi.Pointer, + ffi.Pointer)>(); - double ldexpf( - double arg0, - int arg1, + void CFDictionarySetValue( + CFMutableDictionaryRef theDict, + ffi.Pointer key, + ffi.Pointer value, ) { - return _ldexpf( - arg0, - arg1, + return _CFDictionarySetValue( + theDict, + key, + value, ); } - late final _ldexpfPtr = - _lookup>( - 'ldexpf'); - late final _ldexpf = _ldexpfPtr.asFunction(); + late final _CFDictionarySetValuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableDictionaryRef, ffi.Pointer, + ffi.Pointer)>>('CFDictionarySetValue'); + late final _CFDictionarySetValue = _CFDictionarySetValuePtr.asFunction< + void Function(CFMutableDictionaryRef, ffi.Pointer, + ffi.Pointer)>(); - double ldexp( - double arg0, - int arg1, + void CFDictionaryReplaceValue( + CFMutableDictionaryRef theDict, + ffi.Pointer key, + ffi.Pointer value, ) { - return _ldexp( - arg0, - arg1, + return _CFDictionaryReplaceValue( + theDict, + key, + value, ); } - late final _ldexpPtr = - _lookup>( - 'ldexp'); - late final _ldexp = _ldexpPtr.asFunction(); + late final _CFDictionaryReplaceValuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableDictionaryRef, ffi.Pointer, + ffi.Pointer)>>('CFDictionaryReplaceValue'); + late final _CFDictionaryReplaceValue = + _CFDictionaryReplaceValuePtr.asFunction< + void Function(CFMutableDictionaryRef, ffi.Pointer, + ffi.Pointer)>(); - double frexpf( - double arg0, - ffi.Pointer arg1, + void CFDictionaryRemoveValue( + CFMutableDictionaryRef theDict, + ffi.Pointer key, ) { - return _frexpf( - arg0, - arg1, + return _CFDictionaryRemoveValue( + theDict, + key, ); } - late final _frexpfPtr = _lookup< + late final _CFDictionaryRemoveValuePtr = _lookup< ffi.NativeFunction< - ffi.Float Function(ffi.Float, ffi.Pointer)>>('frexpf'); - late final _frexpf = - _frexpfPtr.asFunction)>(); + ffi.Void Function(CFMutableDictionaryRef, + ffi.Pointer)>>('CFDictionaryRemoveValue'); + late final _CFDictionaryRemoveValue = _CFDictionaryRemoveValuePtr.asFunction< + void Function(CFMutableDictionaryRef, ffi.Pointer)>(); - double frexp( - double arg0, - ffi.Pointer arg1, + void CFDictionaryRemoveAllValues( + CFMutableDictionaryRef theDict, ) { - return _frexp( - arg0, - arg1, + return _CFDictionaryRemoveAllValues( + theDict, ); } - late final _frexpPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Double, ffi.Pointer)>>('frexp'); - late final _frexp = - _frexpPtr.asFunction)>(); + late final _CFDictionaryRemoveAllValuesPtr = + _lookup>( + 'CFDictionaryRemoveAllValues'); + late final _CFDictionaryRemoveAllValues = _CFDictionaryRemoveAllValuesPtr + .asFunction(); - int ilogbf( - double arg0, - ) { - return _ilogbf( - arg0, - ); + int CFNotificationCenterGetTypeID() { + return _CFNotificationCenterGetTypeID(); } - late final _ilogbfPtr = - _lookup>('ilogbf'); - late final _ilogbf = _ilogbfPtr.asFunction(); + late final _CFNotificationCenterGetTypeIDPtr = + _lookup>( + 'CFNotificationCenterGetTypeID'); + late final _CFNotificationCenterGetTypeID = + _CFNotificationCenterGetTypeIDPtr.asFunction(); - int ilogb( - double arg0, - ) { - return _ilogb( - arg0, - ); + CFNotificationCenterRef CFNotificationCenterGetLocalCenter() { + return _CFNotificationCenterGetLocalCenter(); } - late final _ilogbPtr = - _lookup>('ilogb'); - late final _ilogb = _ilogbPtr.asFunction(); + late final _CFNotificationCenterGetLocalCenterPtr = + _lookup>( + 'CFNotificationCenterGetLocalCenter'); + late final _CFNotificationCenterGetLocalCenter = + _CFNotificationCenterGetLocalCenterPtr.asFunction< + CFNotificationCenterRef Function()>(); - double scalbnf( - double arg0, - int arg1, - ) { - return _scalbnf( - arg0, - arg1, - ); + CFNotificationCenterRef CFNotificationCenterGetDistributedCenter() { + return _CFNotificationCenterGetDistributedCenter(); } - late final _scalbnfPtr = - _lookup>( - 'scalbnf'); - late final _scalbnf = _scalbnfPtr.asFunction(); + late final _CFNotificationCenterGetDistributedCenterPtr = + _lookup>( + 'CFNotificationCenterGetDistributedCenter'); + late final _CFNotificationCenterGetDistributedCenter = + _CFNotificationCenterGetDistributedCenterPtr.asFunction< + CFNotificationCenterRef Function()>(); - double scalbn( - double arg0, - int arg1, - ) { - return _scalbn( - arg0, - arg1, - ); + CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter() { + return _CFNotificationCenterGetDarwinNotifyCenter(); } - late final _scalbnPtr = - _lookup>( - 'scalbn'); - late final _scalbn = _scalbnPtr.asFunction(); + late final _CFNotificationCenterGetDarwinNotifyCenterPtr = + _lookup>( + 'CFNotificationCenterGetDarwinNotifyCenter'); + late final _CFNotificationCenterGetDarwinNotifyCenter = + _CFNotificationCenterGetDarwinNotifyCenterPtr.asFunction< + CFNotificationCenterRef Function()>(); - double scalblnf( - double arg0, - int arg1, + void CFNotificationCenterAddObserver( + CFNotificationCenterRef center, + ffi.Pointer observer, + CFNotificationCallback callBack, + CFStringRef name, + ffi.Pointer object, + CFNotificationSuspensionBehavior suspensionBehavior, ) { - return _scalblnf( - arg0, - arg1, + return _CFNotificationCenterAddObserver( + center, + observer, + callBack, + name, + object, + suspensionBehavior.value, ); } - late final _scalblnfPtr = - _lookup>( - 'scalblnf'); - late final _scalblnf = - _scalblnfPtr.asFunction(); + late final _CFNotificationCenterAddObserverPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFNotificationCenterRef, + ffi.Pointer, + CFNotificationCallback, + CFStringRef, + ffi.Pointer, + CFIndex)>>('CFNotificationCenterAddObserver'); + late final _CFNotificationCenterAddObserver = + _CFNotificationCenterAddObserverPtr.asFunction< + void Function( + CFNotificationCenterRef, + ffi.Pointer, + CFNotificationCallback, + CFStringRef, + ffi.Pointer, + int)>(); - double scalbln( - double arg0, - int arg1, + void CFNotificationCenterRemoveObserver( + CFNotificationCenterRef center, + ffi.Pointer observer, + CFNotificationName name, + ffi.Pointer object, ) { - return _scalbln( - arg0, - arg1, + return _CFNotificationCenterRemoveObserver( + center, + observer, + name, + object, ); } - late final _scalblnPtr = - _lookup>( - 'scalbln'); - late final _scalbln = _scalblnPtr.asFunction(); + late final _CFNotificationCenterRemoveObserverPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFNotificationCenterRef, + ffi.Pointer, + CFNotificationName, + ffi.Pointer)>>('CFNotificationCenterRemoveObserver'); + late final _CFNotificationCenterRemoveObserver = + _CFNotificationCenterRemoveObserverPtr.asFunction< + void Function(CFNotificationCenterRef, ffi.Pointer, + CFNotificationName, ffi.Pointer)>(); - double fabsf( - double arg0, + void CFNotificationCenterRemoveEveryObserver( + CFNotificationCenterRef center, + ffi.Pointer observer, ) { - return _fabsf( - arg0, + return _CFNotificationCenterRemoveEveryObserver( + center, + observer, ); } - late final _fabsfPtr = - _lookup>('fabsf'); - late final _fabsf = _fabsfPtr.asFunction(); + late final _CFNotificationCenterRemoveEveryObserverPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFNotificationCenterRef, ffi.Pointer)>>( + 'CFNotificationCenterRemoveEveryObserver'); + late final _CFNotificationCenterRemoveEveryObserver = + _CFNotificationCenterRemoveEveryObserverPtr.asFunction< + void Function(CFNotificationCenterRef, ffi.Pointer)>(); - double fabs( - double arg0, + void CFNotificationCenterPostNotification( + CFNotificationCenterRef center, + CFNotificationName name, + ffi.Pointer object, + CFDictionaryRef userInfo, + int deliverImmediately, ) { - return _fabs( - arg0, + return _CFNotificationCenterPostNotification( + center, + name, + object, + userInfo, + deliverImmediately, ); } - late final _fabsPtr = - _lookup>('fabs'); - late final _fabs = _fabsPtr.asFunction(); + late final _CFNotificationCenterPostNotificationPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFNotificationCenterRef, + CFNotificationName, + ffi.Pointer, + CFDictionaryRef, + Boolean)>>('CFNotificationCenterPostNotification'); + late final _CFNotificationCenterPostNotification = + _CFNotificationCenterPostNotificationPtr.asFunction< + void Function(CFNotificationCenterRef, CFNotificationName, + ffi.Pointer, CFDictionaryRef, int)>(); - double cbrtf( - double arg0, + void CFNotificationCenterPostNotificationWithOptions( + CFNotificationCenterRef center, + CFNotificationName name, + ffi.Pointer object, + CFDictionaryRef userInfo, + int options, ) { - return _cbrtf( - arg0, + return _CFNotificationCenterPostNotificationWithOptions( + center, + name, + object, + userInfo, + options, ); } - late final _cbrtfPtr = - _lookup>('cbrtf'); - late final _cbrtf = _cbrtfPtr.asFunction(); + late final _CFNotificationCenterPostNotificationWithOptionsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFNotificationCenterRef, CFNotificationName, + ffi.Pointer, CFDictionaryRef, CFOptionFlags)>>( + 'CFNotificationCenterPostNotificationWithOptions'); + late final _CFNotificationCenterPostNotificationWithOptions = + _CFNotificationCenterPostNotificationWithOptionsPtr.asFunction< + void Function(CFNotificationCenterRef, CFNotificationName, + ffi.Pointer, CFDictionaryRef, int)>(); - double cbrt( - double arg0, - ) { - return _cbrt( - arg0, - ); + int CFLocaleGetTypeID() { + return _CFLocaleGetTypeID(); } - late final _cbrtPtr = - _lookup>('cbrt'); - late final _cbrt = _cbrtPtr.asFunction(); + late final _CFLocaleGetTypeIDPtr = + _lookup>('CFLocaleGetTypeID'); + late final _CFLocaleGetTypeID = + _CFLocaleGetTypeIDPtr.asFunction(); - double hypotf( - double arg0, - double arg1, - ) { - return _hypotf( - arg0, - arg1, - ); + CFLocaleRef CFLocaleGetSystem() { + return _CFLocaleGetSystem(); } - late final _hypotfPtr = - _lookup>( - 'hypotf'); - late final _hypotf = _hypotfPtr.asFunction(); + late final _CFLocaleGetSystemPtr = + _lookup>('CFLocaleGetSystem'); + late final _CFLocaleGetSystem = + _CFLocaleGetSystemPtr.asFunction(); - double hypot( - double arg0, - double arg1, - ) { - return _hypot( - arg0, - arg1, - ); + CFLocaleRef CFLocaleCopyCurrent() { + return _CFLocaleCopyCurrent(); } - late final _hypotPtr = - _lookup>( - 'hypot'); - late final _hypot = _hypotPtr.asFunction(); + late final _CFLocaleCopyCurrentPtr = + _lookup>( + 'CFLocaleCopyCurrent'); + late final _CFLocaleCopyCurrent = + _CFLocaleCopyCurrentPtr.asFunction(); - double powf( - double arg0, - double arg1, - ) { - return _powf( - arg0, - arg1, - ); + CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers() { + return _CFLocaleCopyAvailableLocaleIdentifiers(); } - late final _powfPtr = - _lookup>( - 'powf'); - late final _powf = _powfPtr.asFunction(); + late final _CFLocaleCopyAvailableLocaleIdentifiersPtr = + _lookup>( + 'CFLocaleCopyAvailableLocaleIdentifiers'); + late final _CFLocaleCopyAvailableLocaleIdentifiers = + _CFLocaleCopyAvailableLocaleIdentifiersPtr.asFunction< + CFArrayRef Function()>(); - double pow( - double arg0, - double arg1, - ) { - return _pow( - arg0, - arg1, - ); + CFArrayRef CFLocaleCopyISOLanguageCodes() { + return _CFLocaleCopyISOLanguageCodes(); } - late final _powPtr = - _lookup>( - 'pow'); - late final _pow = _powPtr.asFunction(); + late final _CFLocaleCopyISOLanguageCodesPtr = + _lookup>( + 'CFLocaleCopyISOLanguageCodes'); + late final _CFLocaleCopyISOLanguageCodes = + _CFLocaleCopyISOLanguageCodesPtr.asFunction(); - double sqrtf( - double arg0, - ) { - return _sqrtf( - arg0, - ); + CFArrayRef CFLocaleCopyISOCountryCodes() { + return _CFLocaleCopyISOCountryCodes(); } - late final _sqrtfPtr = - _lookup>('sqrtf'); - late final _sqrtf = _sqrtfPtr.asFunction(); + late final _CFLocaleCopyISOCountryCodesPtr = + _lookup>( + 'CFLocaleCopyISOCountryCodes'); + late final _CFLocaleCopyISOCountryCodes = + _CFLocaleCopyISOCountryCodesPtr.asFunction(); - double sqrt( - double arg0, - ) { - return _sqrt( - arg0, - ); + CFArrayRef CFLocaleCopyISOCurrencyCodes() { + return _CFLocaleCopyISOCurrencyCodes(); } - late final _sqrtPtr = - _lookup>('sqrt'); - late final _sqrt = _sqrtPtr.asFunction(); + late final _CFLocaleCopyISOCurrencyCodesPtr = + _lookup>( + 'CFLocaleCopyISOCurrencyCodes'); + late final _CFLocaleCopyISOCurrencyCodes = + _CFLocaleCopyISOCurrencyCodesPtr.asFunction(); - double erff( - double arg0, - ) { - return _erff( - arg0, - ); + CFArrayRef CFLocaleCopyCommonISOCurrencyCodes() { + return _CFLocaleCopyCommonISOCurrencyCodes(); } - late final _erffPtr = - _lookup>('erff'); - late final _erff = _erffPtr.asFunction(); + late final _CFLocaleCopyCommonISOCurrencyCodesPtr = + _lookup>( + 'CFLocaleCopyCommonISOCurrencyCodes'); + late final _CFLocaleCopyCommonISOCurrencyCodes = + _CFLocaleCopyCommonISOCurrencyCodesPtr.asFunction< + CFArrayRef Function()>(); - double erf( - double arg0, - ) { - return _erf( - arg0, - ); + CFArrayRef CFLocaleCopyPreferredLanguages() { + return _CFLocaleCopyPreferredLanguages(); } - late final _erfPtr = - _lookup>('erf'); - late final _erf = _erfPtr.asFunction(); + late final _CFLocaleCopyPreferredLanguagesPtr = + _lookup>( + 'CFLocaleCopyPreferredLanguages'); + late final _CFLocaleCopyPreferredLanguages = + _CFLocaleCopyPreferredLanguagesPtr.asFunction(); - double erfcf( - double arg0, + CFLocaleIdentifier CFLocaleCreateCanonicalLanguageIdentifierFromString( + CFAllocatorRef allocator, + CFStringRef localeIdentifier, ) { - return _erfcf( - arg0, + return _CFLocaleCreateCanonicalLanguageIdentifierFromString( + allocator, + localeIdentifier, ); } - late final _erfcfPtr = - _lookup>('erfcf'); - late final _erfcf = _erfcfPtr.asFunction(); + late final _CFLocaleCreateCanonicalLanguageIdentifierFromStringPtr = _lookup< + ffi.NativeFunction< + CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>>( + 'CFLocaleCreateCanonicalLanguageIdentifierFromString'); + late final _CFLocaleCreateCanonicalLanguageIdentifierFromString = + _CFLocaleCreateCanonicalLanguageIdentifierFromStringPtr.asFunction< + CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>(); - double erfc( - double arg0, + CFLocaleIdentifier CFLocaleCreateCanonicalLocaleIdentifierFromString( + CFAllocatorRef allocator, + CFStringRef localeIdentifier, ) { - return _erfc( - arg0, + return _CFLocaleCreateCanonicalLocaleIdentifierFromString( + allocator, + localeIdentifier, ); } - late final _erfcPtr = - _lookup>('erfc'); - late final _erfc = _erfcPtr.asFunction(); + late final _CFLocaleCreateCanonicalLocaleIdentifierFromStringPtr = _lookup< + ffi.NativeFunction< + CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>>( + 'CFLocaleCreateCanonicalLocaleIdentifierFromString'); + late final _CFLocaleCreateCanonicalLocaleIdentifierFromString = + _CFLocaleCreateCanonicalLocaleIdentifierFromStringPtr.asFunction< + CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>(); - double lgammaf( - double arg0, + CFLocaleIdentifier + CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes( + CFAllocatorRef allocator, + int lcode, + int rcode, ) { - return _lgammaf( - arg0, + return _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes( + allocator, + lcode, + rcode, ); } - late final _lgammafPtr = - _lookup>('lgammaf'); - late final _lgammaf = _lgammafPtr.asFunction(); + late final _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodesPtr = + _lookup< + ffi.NativeFunction< + CFLocaleIdentifier Function( + CFAllocatorRef, LangCode, RegionCode)>>( + 'CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes'); + late final _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes = + _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodesPtr + .asFunction(); - double lgamma( - double arg0, + CFLocaleIdentifier CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode( + CFAllocatorRef allocator, + int lcid, ) { - return _lgamma( - arg0, + return _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode( + allocator, + lcid, ); } - late final _lgammaPtr = - _lookup>('lgamma'); - late final _lgamma = _lgammaPtr.asFunction(); + late final _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCodePtr = _lookup< + ffi.NativeFunction< + CFLocaleIdentifier Function(CFAllocatorRef, ffi.Uint32)>>( + 'CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode'); + late final _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode = + _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCodePtr.asFunction< + CFLocaleIdentifier Function(CFAllocatorRef, int)>(); - double tgammaf( - double arg0, + int CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier( + CFLocaleIdentifier localeIdentifier, ) { - return _tgammaf( - arg0, + return _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier( + localeIdentifier, ); } - late final _tgammafPtr = - _lookup>('tgammaf'); - late final _tgammaf = _tgammafPtr.asFunction(); + late final _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifierPtr = + _lookup>( + 'CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier'); + late final _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier = + _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifierPtr.asFunction< + int Function(CFLocaleIdentifier)>(); - double tgamma( - double arg0, + CFLocaleLanguageDirection CFLocaleGetLanguageCharacterDirection( + CFStringRef isoLangCode, ) { - return _tgamma( - arg0, - ); + return CFLocaleLanguageDirection.fromValue( + _CFLocaleGetLanguageCharacterDirection( + isoLangCode, + )); } - late final _tgammaPtr = - _lookup>('tgamma'); - late final _tgamma = _tgammaPtr.asFunction(); + late final _CFLocaleGetLanguageCharacterDirectionPtr = + _lookup>( + 'CFLocaleGetLanguageCharacterDirection'); + late final _CFLocaleGetLanguageCharacterDirection = + _CFLocaleGetLanguageCharacterDirectionPtr.asFunction< + int Function(CFStringRef)>(); - double ceilf( - double arg0, + CFLocaleLanguageDirection CFLocaleGetLanguageLineDirection( + CFStringRef isoLangCode, ) { - return _ceilf( - arg0, - ); + return CFLocaleLanguageDirection.fromValue( + _CFLocaleGetLanguageLineDirection( + isoLangCode, + )); } - late final _ceilfPtr = - _lookup>('ceilf'); - late final _ceilf = _ceilfPtr.asFunction(); + late final _CFLocaleGetLanguageLineDirectionPtr = + _lookup>( + 'CFLocaleGetLanguageLineDirection'); + late final _CFLocaleGetLanguageLineDirection = + _CFLocaleGetLanguageLineDirectionPtr.asFunction< + int Function(CFStringRef)>(); - double ceil( - double arg0, + CFDictionaryRef CFLocaleCreateComponentsFromLocaleIdentifier( + CFAllocatorRef allocator, + CFLocaleIdentifier localeID, ) { - return _ceil( - arg0, + return _CFLocaleCreateComponentsFromLocaleIdentifier( + allocator, + localeID, ); } - late final _ceilPtr = - _lookup>('ceil'); - late final _ceil = _ceilPtr.asFunction(); + late final _CFLocaleCreateComponentsFromLocaleIdentifierPtr = _lookup< + ffi.NativeFunction< + CFDictionaryRef Function(CFAllocatorRef, CFLocaleIdentifier)>>( + 'CFLocaleCreateComponentsFromLocaleIdentifier'); + late final _CFLocaleCreateComponentsFromLocaleIdentifier = + _CFLocaleCreateComponentsFromLocaleIdentifierPtr.asFunction< + CFDictionaryRef Function(CFAllocatorRef, CFLocaleIdentifier)>(); - double floorf( - double arg0, + CFLocaleIdentifier CFLocaleCreateLocaleIdentifierFromComponents( + CFAllocatorRef allocator, + CFDictionaryRef dictionary, ) { - return _floorf( - arg0, + return _CFLocaleCreateLocaleIdentifierFromComponents( + allocator, + dictionary, ); } - late final _floorfPtr = - _lookup>('floorf'); - late final _floorf = _floorfPtr.asFunction(); + late final _CFLocaleCreateLocaleIdentifierFromComponentsPtr = _lookup< + ffi.NativeFunction< + CFLocaleIdentifier Function(CFAllocatorRef, CFDictionaryRef)>>( + 'CFLocaleCreateLocaleIdentifierFromComponents'); + late final _CFLocaleCreateLocaleIdentifierFromComponents = + _CFLocaleCreateLocaleIdentifierFromComponentsPtr.asFunction< + CFLocaleIdentifier Function(CFAllocatorRef, CFDictionaryRef)>(); - double floor( - double arg0, + CFLocaleRef CFLocaleCreate( + CFAllocatorRef allocator, + CFLocaleIdentifier localeIdentifier, ) { - return _floor( - arg0, + return _CFLocaleCreate( + allocator, + localeIdentifier, ); } - late final _floorPtr = - _lookup>('floor'); - late final _floor = _floorPtr.asFunction(); + late final _CFLocaleCreatePtr = _lookup< + ffi.NativeFunction< + CFLocaleRef Function( + CFAllocatorRef, CFLocaleIdentifier)>>('CFLocaleCreate'); + late final _CFLocaleCreate = _CFLocaleCreatePtr.asFunction< + CFLocaleRef Function(CFAllocatorRef, CFLocaleIdentifier)>(); - double nearbyintf( - double arg0, + CFLocaleRef CFLocaleCreateCopy( + CFAllocatorRef allocator, + CFLocaleRef locale, ) { - return _nearbyintf( - arg0, + return _CFLocaleCreateCopy( + allocator, + locale, ); } - late final _nearbyintfPtr = - _lookup>('nearbyintf'); - late final _nearbyintf = _nearbyintfPtr.asFunction(); + late final _CFLocaleCreateCopyPtr = _lookup< + ffi + .NativeFunction>( + 'CFLocaleCreateCopy'); + late final _CFLocaleCreateCopy = _CFLocaleCreateCopyPtr.asFunction< + CFLocaleRef Function(CFAllocatorRef, CFLocaleRef)>(); - double nearbyint( - double arg0, + CFLocaleIdentifier CFLocaleGetIdentifier( + CFLocaleRef locale, ) { - return _nearbyint( - arg0, + return _CFLocaleGetIdentifier( + locale, ); } - late final _nearbyintPtr = - _lookup>('nearbyint'); - late final _nearbyint = _nearbyintPtr.asFunction(); + late final _CFLocaleGetIdentifierPtr = + _lookup>( + 'CFLocaleGetIdentifier'); + late final _CFLocaleGetIdentifier = _CFLocaleGetIdentifierPtr.asFunction< + CFLocaleIdentifier Function(CFLocaleRef)>(); - double rintf( - double arg0, + CFTypeRef CFLocaleGetValue( + CFLocaleRef locale, + CFLocaleKey key, ) { - return _rintf( - arg0, + return _CFLocaleGetValue( + locale, + key, ); } - late final _rintfPtr = - _lookup>('rintf'); - late final _rintf = _rintfPtr.asFunction(); + late final _CFLocaleGetValuePtr = + _lookup>( + 'CFLocaleGetValue'); + late final _CFLocaleGetValue = _CFLocaleGetValuePtr.asFunction< + CFTypeRef Function(CFLocaleRef, CFLocaleKey)>(); - double rint( - double arg0, + CFStringRef CFLocaleCopyDisplayNameForPropertyValue( + CFLocaleRef displayLocale, + CFLocaleKey key, + CFStringRef value, ) { - return _rint( - arg0, + return _CFLocaleCopyDisplayNameForPropertyValue( + displayLocale, + key, + value, ); } - late final _rintPtr = - _lookup>('rint'); - late final _rint = _rintPtr.asFunction(); + late final _CFLocaleCopyDisplayNameForPropertyValuePtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFLocaleRef, CFLocaleKey, + CFStringRef)>>('CFLocaleCopyDisplayNameForPropertyValue'); + late final _CFLocaleCopyDisplayNameForPropertyValue = + _CFLocaleCopyDisplayNameForPropertyValuePtr.asFunction< + CFStringRef Function(CFLocaleRef, CFLocaleKey, CFStringRef)>(); - int lrintf( - double arg0, - ) { - return _lrintf( - arg0, - ); - } + late final ffi.Pointer + _kCFLocaleCurrentLocaleDidChangeNotification = + _lookup( + 'kCFLocaleCurrentLocaleDidChangeNotification'); - late final _lrintfPtr = - _lookup>('lrintf'); - late final _lrintf = _lrintfPtr.asFunction(); + CFNotificationName get kCFLocaleCurrentLocaleDidChangeNotification => + _kCFLocaleCurrentLocaleDidChangeNotification.value; - int lrint( - double arg0, - ) { - return _lrint( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleIdentifier = + _lookup('kCFLocaleIdentifier'); - late final _lrintPtr = - _lookup>('lrint'); - late final _lrint = _lrintPtr.asFunction(); + CFLocaleKey get kCFLocaleIdentifier => _kCFLocaleIdentifier.value; - double roundf( - double arg0, - ) { - return _roundf( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleLanguageCode = + _lookup('kCFLocaleLanguageCode'); - late final _roundfPtr = - _lookup>('roundf'); - late final _roundf = _roundfPtr.asFunction(); + CFLocaleKey get kCFLocaleLanguageCode => _kCFLocaleLanguageCode.value; - double round( - double arg0, - ) { - return _round( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleCountryCode = + _lookup('kCFLocaleCountryCode'); - late final _roundPtr = - _lookup>('round'); - late final _round = _roundPtr.asFunction(); + CFLocaleKey get kCFLocaleCountryCode => _kCFLocaleCountryCode.value; - int lroundf( - double arg0, - ) { - return _lroundf( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleScriptCode = + _lookup('kCFLocaleScriptCode'); - late final _lroundfPtr = - _lookup>('lroundf'); - late final _lroundf = _lroundfPtr.asFunction(); + CFLocaleKey get kCFLocaleScriptCode => _kCFLocaleScriptCode.value; - int lround( - double arg0, - ) { - return _lround( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleVariantCode = + _lookup('kCFLocaleVariantCode'); - late final _lroundPtr = - _lookup>('lround'); - late final _lround = _lroundPtr.asFunction(); + CFLocaleKey get kCFLocaleVariantCode => _kCFLocaleVariantCode.value; - int llrintf( - double arg0, - ) { - return _llrintf( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleExemplarCharacterSet = + _lookup('kCFLocaleExemplarCharacterSet'); - late final _llrintfPtr = - _lookup>('llrintf'); - late final _llrintf = _llrintfPtr.asFunction(); + CFLocaleKey get kCFLocaleExemplarCharacterSet => + _kCFLocaleExemplarCharacterSet.value; - int llrint( - double arg0, - ) { - return _llrint( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleCalendarIdentifier = + _lookup('kCFLocaleCalendarIdentifier'); - late final _llrintPtr = - _lookup>('llrint'); - late final _llrint = _llrintPtr.asFunction(); + CFLocaleKey get kCFLocaleCalendarIdentifier => + _kCFLocaleCalendarIdentifier.value; - int llroundf( - double arg0, - ) { - return _llroundf( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleCalendar = + _lookup('kCFLocaleCalendar'); - late final _llroundfPtr = - _lookup>('llroundf'); - late final _llroundf = _llroundfPtr.asFunction(); + CFLocaleKey get kCFLocaleCalendar => _kCFLocaleCalendar.value; - int llround( - double arg0, - ) { - return _llround( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleCollationIdentifier = + _lookup('kCFLocaleCollationIdentifier'); - late final _llroundPtr = - _lookup>('llround'); - late final _llround = _llroundPtr.asFunction(); + CFLocaleKey get kCFLocaleCollationIdentifier => + _kCFLocaleCollationIdentifier.value; - double truncf( - double arg0, - ) { - return _truncf( - arg0, - ); - } + late final ffi.Pointer _kCFLocaleUsesMetricSystem = + _lookup('kCFLocaleUsesMetricSystem'); - late final _truncfPtr = - _lookup>('truncf'); - late final _truncf = _truncfPtr.asFunction(); + CFLocaleKey get kCFLocaleUsesMetricSystem => _kCFLocaleUsesMetricSystem.value; - double trunc( - double arg0, - ) { - return _trunc( - arg0, - ); + late final ffi.Pointer _kCFLocaleMeasurementSystem = + _lookup('kCFLocaleMeasurementSystem'); + + CFLocaleKey get kCFLocaleMeasurementSystem => + _kCFLocaleMeasurementSystem.value; + + late final ffi.Pointer _kCFLocaleDecimalSeparator = + _lookup('kCFLocaleDecimalSeparator'); + + CFLocaleKey get kCFLocaleDecimalSeparator => _kCFLocaleDecimalSeparator.value; + + late final ffi.Pointer _kCFLocaleGroupingSeparator = + _lookup('kCFLocaleGroupingSeparator'); + + CFLocaleKey get kCFLocaleGroupingSeparator => + _kCFLocaleGroupingSeparator.value; + + late final ffi.Pointer _kCFLocaleCurrencySymbol = + _lookup('kCFLocaleCurrencySymbol'); + + CFLocaleKey get kCFLocaleCurrencySymbol => _kCFLocaleCurrencySymbol.value; + + late final ffi.Pointer _kCFLocaleCurrencyCode = + _lookup('kCFLocaleCurrencyCode'); + + CFLocaleKey get kCFLocaleCurrencyCode => _kCFLocaleCurrencyCode.value; + + late final ffi.Pointer _kCFLocaleCollatorIdentifier = + _lookup('kCFLocaleCollatorIdentifier'); + + CFLocaleKey get kCFLocaleCollatorIdentifier => + _kCFLocaleCollatorIdentifier.value; + + late final ffi.Pointer _kCFLocaleQuotationBeginDelimiterKey = + _lookup('kCFLocaleQuotationBeginDelimiterKey'); + + CFLocaleKey get kCFLocaleQuotationBeginDelimiterKey => + _kCFLocaleQuotationBeginDelimiterKey.value; + + late final ffi.Pointer _kCFLocaleQuotationEndDelimiterKey = + _lookup('kCFLocaleQuotationEndDelimiterKey'); + + CFLocaleKey get kCFLocaleQuotationEndDelimiterKey => + _kCFLocaleQuotationEndDelimiterKey.value; + + late final ffi.Pointer + _kCFLocaleAlternateQuotationBeginDelimiterKey = + _lookup('kCFLocaleAlternateQuotationBeginDelimiterKey'); + + CFLocaleKey get kCFLocaleAlternateQuotationBeginDelimiterKey => + _kCFLocaleAlternateQuotationBeginDelimiterKey.value; + + late final ffi.Pointer + _kCFLocaleAlternateQuotationEndDelimiterKey = + _lookup('kCFLocaleAlternateQuotationEndDelimiterKey'); + + CFLocaleKey get kCFLocaleAlternateQuotationEndDelimiterKey => + _kCFLocaleAlternateQuotationEndDelimiterKey.value; + + late final ffi.Pointer _kCFGregorianCalendar = + _lookup('kCFGregorianCalendar'); + + CFCalendarIdentifier get kCFGregorianCalendar => _kCFGregorianCalendar.value; + + late final ffi.Pointer _kCFBuddhistCalendar = + _lookup('kCFBuddhistCalendar'); + + CFCalendarIdentifier get kCFBuddhistCalendar => _kCFBuddhistCalendar.value; + + late final ffi.Pointer _kCFChineseCalendar = + _lookup('kCFChineseCalendar'); + + CFCalendarIdentifier get kCFChineseCalendar => _kCFChineseCalendar.value; + + late final ffi.Pointer _kCFHebrewCalendar = + _lookup('kCFHebrewCalendar'); + + CFCalendarIdentifier get kCFHebrewCalendar => _kCFHebrewCalendar.value; + + late final ffi.Pointer _kCFIslamicCalendar = + _lookup('kCFIslamicCalendar'); + + CFCalendarIdentifier get kCFIslamicCalendar => _kCFIslamicCalendar.value; + + late final ffi.Pointer _kCFIslamicCivilCalendar = + _lookup('kCFIslamicCivilCalendar'); + + CFCalendarIdentifier get kCFIslamicCivilCalendar => + _kCFIslamicCivilCalendar.value; + + late final ffi.Pointer _kCFJapaneseCalendar = + _lookup('kCFJapaneseCalendar'); + + CFCalendarIdentifier get kCFJapaneseCalendar => _kCFJapaneseCalendar.value; + + late final ffi.Pointer _kCFRepublicOfChinaCalendar = + _lookup('kCFRepublicOfChinaCalendar'); + + CFCalendarIdentifier get kCFRepublicOfChinaCalendar => + _kCFRepublicOfChinaCalendar.value; + + late final ffi.Pointer _kCFPersianCalendar = + _lookup('kCFPersianCalendar'); + + CFCalendarIdentifier get kCFPersianCalendar => _kCFPersianCalendar.value; + + late final ffi.Pointer _kCFIndianCalendar = + _lookup('kCFIndianCalendar'); + + CFCalendarIdentifier get kCFIndianCalendar => _kCFIndianCalendar.value; + + late final ffi.Pointer _kCFISO8601Calendar = + _lookup('kCFISO8601Calendar'); + + CFCalendarIdentifier get kCFISO8601Calendar => _kCFISO8601Calendar.value; + + late final ffi.Pointer _kCFIslamicTabularCalendar = + _lookup('kCFIslamicTabularCalendar'); + + CFCalendarIdentifier get kCFIslamicTabularCalendar => + _kCFIslamicTabularCalendar.value; + + late final ffi.Pointer _kCFIslamicUmmAlQuraCalendar = + _lookup('kCFIslamicUmmAlQuraCalendar'); + + CFCalendarIdentifier get kCFIslamicUmmAlQuraCalendar => + _kCFIslamicUmmAlQuraCalendar.value; + + double CFAbsoluteTimeGetCurrent() { + return _CFAbsoluteTimeGetCurrent(); } - late final _truncPtr = - _lookup>('trunc'); - late final _trunc = _truncPtr.asFunction(); + late final _CFAbsoluteTimeGetCurrentPtr = + _lookup>( + 'CFAbsoluteTimeGetCurrent'); + late final _CFAbsoluteTimeGetCurrent = + _CFAbsoluteTimeGetCurrentPtr.asFunction(); - double fmodf( - double arg0, - double arg1, - ) { - return _fmodf( - arg0, - arg1, - ); + late final ffi.Pointer _kCFAbsoluteTimeIntervalSince1970 = + _lookup('kCFAbsoluteTimeIntervalSince1970'); + + DartCFTimeInterval get kCFAbsoluteTimeIntervalSince1970 => + _kCFAbsoluteTimeIntervalSince1970.value; + + late final ffi.Pointer _kCFAbsoluteTimeIntervalSince1904 = + _lookup('kCFAbsoluteTimeIntervalSince1904'); + + DartCFTimeInterval get kCFAbsoluteTimeIntervalSince1904 => + _kCFAbsoluteTimeIntervalSince1904.value; + + int CFDateGetTypeID() { + return _CFDateGetTypeID(); } - late final _fmodfPtr = - _lookup>( - 'fmodf'); - late final _fmodf = _fmodfPtr.asFunction(); + late final _CFDateGetTypeIDPtr = + _lookup>('CFDateGetTypeID'); + late final _CFDateGetTypeID = + _CFDateGetTypeIDPtr.asFunction(); - double fmod( - double arg0, - double arg1, + CFDateRef CFDateCreate( + CFAllocatorRef allocator, + double at, ) { - return _fmod( - arg0, - arg1, + return _CFDateCreate( + allocator, + at, ); } - late final _fmodPtr = - _lookup>( - 'fmod'); - late final _fmod = _fmodPtr.asFunction(); + late final _CFDateCreatePtr = _lookup< + ffi.NativeFunction< + CFDateRef Function(CFAllocatorRef, CFAbsoluteTime)>>('CFDateCreate'); + late final _CFDateCreate = + _CFDateCreatePtr.asFunction(); - double remainderf( - double arg0, - double arg1, + double CFDateGetAbsoluteTime( + CFDateRef theDate, ) { - return _remainderf( - arg0, - arg1, + return _CFDateGetAbsoluteTime( + theDate, ); } - late final _remainderfPtr = - _lookup>( - 'remainderf'); - late final _remainderf = - _remainderfPtr.asFunction(); + late final _CFDateGetAbsoluteTimePtr = + _lookup>( + 'CFDateGetAbsoluteTime'); + late final _CFDateGetAbsoluteTime = + _CFDateGetAbsoluteTimePtr.asFunction(); - double remainder( - double arg0, - double arg1, + double CFDateGetTimeIntervalSinceDate( + CFDateRef theDate, + CFDateRef otherDate, ) { - return _remainder( - arg0, - arg1, + return _CFDateGetTimeIntervalSinceDate( + theDate, + otherDate, ); } - late final _remainderPtr = - _lookup>( - 'remainder'); - late final _remainder = - _remainderPtr.asFunction(); + late final _CFDateGetTimeIntervalSinceDatePtr = _lookup< + ffi.NativeFunction>( + 'CFDateGetTimeIntervalSinceDate'); + late final _CFDateGetTimeIntervalSinceDate = + _CFDateGetTimeIntervalSinceDatePtr.asFunction< + double Function(CFDateRef, CFDateRef)>(); - double remquof( - double arg0, - double arg1, - ffi.Pointer arg2, + CFComparisonResult CFDateCompare( + CFDateRef theDate, + CFDateRef otherDate, + ffi.Pointer context, ) { - return _remquof( - arg0, - arg1, - arg2, - ); + return CFComparisonResult.fromValue(_CFDateCompare( + theDate, + otherDate, + context, + )); } - late final _remquofPtr = _lookup< + late final _CFDateComparePtr = _lookup< ffi.NativeFunction< - ffi.Float Function( - ffi.Float, ffi.Float, ffi.Pointer)>>('remquof'); - late final _remquof = _remquofPtr - .asFunction)>(); + CFIndex Function( + CFDateRef, CFDateRef, ffi.Pointer)>>('CFDateCompare'); + late final _CFDateCompare = _CFDateComparePtr.asFunction< + int Function(CFDateRef, CFDateRef, ffi.Pointer)>(); - double remquo( - double arg0, - double arg1, - ffi.Pointer arg2, + int CFGregorianDateIsValid( + CFGregorianDate gdate, + int unitFlags, ) { - return _remquo( - arg0, - arg1, - arg2, + return _CFGregorianDateIsValid( + gdate, + unitFlags, ); } - late final _remquoPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function( - ffi.Double, ffi.Double, ffi.Pointer)>>('remquo'); - late final _remquo = _remquoPtr - .asFunction)>(); + late final _CFGregorianDateIsValidPtr = _lookup< + ffi.NativeFunction>( + 'CFGregorianDateIsValid'); + late final _CFGregorianDateIsValid = _CFGregorianDateIsValidPtr.asFunction< + int Function(CFGregorianDate, int)>(); - double copysignf( - double arg0, - double arg1, + double CFGregorianDateGetAbsoluteTime( + CFGregorianDate gdate, + CFTimeZoneRef tz, ) { - return _copysignf( - arg0, - arg1, + return _CFGregorianDateGetAbsoluteTime( + gdate, + tz, ); } - late final _copysignfPtr = - _lookup>( - 'copysignf'); - late final _copysignf = - _copysignfPtr.asFunction(); + late final _CFGregorianDateGetAbsoluteTimePtr = _lookup< + ffi.NativeFunction< + CFAbsoluteTime Function(CFGregorianDate, + CFTimeZoneRef)>>('CFGregorianDateGetAbsoluteTime'); + late final _CFGregorianDateGetAbsoluteTime = + _CFGregorianDateGetAbsoluteTimePtr.asFunction< + double Function(CFGregorianDate, CFTimeZoneRef)>(); - double copysign( - double arg0, - double arg1, + CFGregorianDate CFAbsoluteTimeGetGregorianDate( + double at, + CFTimeZoneRef tz, ) { - return _copysign( - arg0, - arg1, + return _CFAbsoluteTimeGetGregorianDate( + at, + tz, ); } - late final _copysignPtr = - _lookup>( - 'copysign'); - late final _copysign = - _copysignPtr.asFunction(); + late final _CFAbsoluteTimeGetGregorianDatePtr = _lookup< + ffi.NativeFunction< + CFGregorianDate Function(CFAbsoluteTime, + CFTimeZoneRef)>>('CFAbsoluteTimeGetGregorianDate'); + late final _CFAbsoluteTimeGetGregorianDate = + _CFAbsoluteTimeGetGregorianDatePtr.asFunction< + CFGregorianDate Function(double, CFTimeZoneRef)>(); - double nanf( - ffi.Pointer arg0, + double CFAbsoluteTimeAddGregorianUnits( + double at, + CFTimeZoneRef tz, + CFGregorianUnits units, ) { - return _nanf( - arg0, + return _CFAbsoluteTimeAddGregorianUnits( + at, + tz, + units, ); } - late final _nanfPtr = - _lookup)>>( - 'nanf'); - late final _nanf = - _nanfPtr.asFunction)>(); + late final _CFAbsoluteTimeAddGregorianUnitsPtr = _lookup< + ffi.NativeFunction< + CFAbsoluteTime Function(CFAbsoluteTime, CFTimeZoneRef, + CFGregorianUnits)>>('CFAbsoluteTimeAddGregorianUnits'); + late final _CFAbsoluteTimeAddGregorianUnits = + _CFAbsoluteTimeAddGregorianUnitsPtr.asFunction< + double Function(double, CFTimeZoneRef, CFGregorianUnits)>(); - double nan( - ffi.Pointer arg0, + CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits( + double at1, + double at2, + CFTimeZoneRef tz, + int unitFlags, ) { - return _nan( - arg0, + return _CFAbsoluteTimeGetDifferenceAsGregorianUnits( + at1, + at2, + tz, + unitFlags, ); } - late final _nanPtr = - _lookup)>>( - 'nan'); - late final _nan = - _nanPtr.asFunction)>(); + late final _CFAbsoluteTimeGetDifferenceAsGregorianUnitsPtr = _lookup< + ffi.NativeFunction< + CFGregorianUnits Function( + CFAbsoluteTime, + CFAbsoluteTime, + CFTimeZoneRef, + CFOptionFlags)>>('CFAbsoluteTimeGetDifferenceAsGregorianUnits'); + late final _CFAbsoluteTimeGetDifferenceAsGregorianUnits = + _CFAbsoluteTimeGetDifferenceAsGregorianUnitsPtr.asFunction< + CFGregorianUnits Function(double, double, CFTimeZoneRef, int)>(); - double nextafterf( - double arg0, - double arg1, + int CFAbsoluteTimeGetDayOfWeek( + double at, + CFTimeZoneRef tz, ) { - return _nextafterf( - arg0, - arg1, + return _CFAbsoluteTimeGetDayOfWeek( + at, + tz, ); } - late final _nextafterfPtr = - _lookup>( - 'nextafterf'); - late final _nextafterf = - _nextafterfPtr.asFunction(); + late final _CFAbsoluteTimeGetDayOfWeekPtr = _lookup< + ffi.NativeFunction>( + 'CFAbsoluteTimeGetDayOfWeek'); + late final _CFAbsoluteTimeGetDayOfWeek = _CFAbsoluteTimeGetDayOfWeekPtr + .asFunction(); - double nextafter( - double arg0, - double arg1, + int CFAbsoluteTimeGetDayOfYear( + double at, + CFTimeZoneRef tz, ) { - return _nextafter( - arg0, - arg1, + return _CFAbsoluteTimeGetDayOfYear( + at, + tz, ); } - late final _nextafterPtr = - _lookup>( - 'nextafter'); - late final _nextafter = - _nextafterPtr.asFunction(); + late final _CFAbsoluteTimeGetDayOfYearPtr = _lookup< + ffi.NativeFunction>( + 'CFAbsoluteTimeGetDayOfYear'); + late final _CFAbsoluteTimeGetDayOfYear = _CFAbsoluteTimeGetDayOfYearPtr + .asFunction(); - double fdimf( - double arg0, - double arg1, + int CFAbsoluteTimeGetWeekOfYear( + double at, + CFTimeZoneRef tz, ) { - return _fdimf( - arg0, - arg1, + return _CFAbsoluteTimeGetWeekOfYear( + at, + tz, ); } - late final _fdimfPtr = - _lookup>( - 'fdimf'); - late final _fdimf = _fdimfPtr.asFunction(); + late final _CFAbsoluteTimeGetWeekOfYearPtr = _lookup< + ffi.NativeFunction>( + 'CFAbsoluteTimeGetWeekOfYear'); + late final _CFAbsoluteTimeGetWeekOfYear = _CFAbsoluteTimeGetWeekOfYearPtr + .asFunction(); - double fdim( - double arg0, - double arg1, - ) { - return _fdim( - arg0, - arg1, - ); + int CFDataGetTypeID() { + return _CFDataGetTypeID(); } - late final _fdimPtr = - _lookup>( - 'fdim'); - late final _fdim = _fdimPtr.asFunction(); + late final _CFDataGetTypeIDPtr = + _lookup>('CFDataGetTypeID'); + late final _CFDataGetTypeID = + _CFDataGetTypeIDPtr.asFunction(); - double fmaxf( - double arg0, - double arg1, + CFDataRef CFDataCreate( + CFAllocatorRef allocator, + ffi.Pointer bytes, + int length, ) { - return _fmaxf( - arg0, - arg1, + return _CFDataCreate( + allocator, + bytes, + length, ); } - late final _fmaxfPtr = - _lookup>( - 'fmaxf'); - late final _fmaxf = _fmaxfPtr.asFunction(); + late final _CFDataCreatePtr = _lookup< + ffi.NativeFunction< + CFDataRef Function( + CFAllocatorRef, ffi.Pointer, CFIndex)>>('CFDataCreate'); + late final _CFDataCreate = _CFDataCreatePtr.asFunction< + CFDataRef Function(CFAllocatorRef, ffi.Pointer, int)>(); - double fmax( - double arg0, - double arg1, + CFDataRef CFDataCreateWithBytesNoCopy( + CFAllocatorRef allocator, + ffi.Pointer bytes, + int length, + CFAllocatorRef bytesDeallocator, ) { - return _fmax( - arg0, - arg1, + return _CFDataCreateWithBytesNoCopy( + allocator, + bytes, + length, + bytesDeallocator, ); } - late final _fmaxPtr = - _lookup>( - 'fmax'); - late final _fmax = _fmaxPtr.asFunction(); + late final _CFDataCreateWithBytesNoCopyPtr = _lookup< + ffi.NativeFunction< + CFDataRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, + CFAllocatorRef)>>('CFDataCreateWithBytesNoCopy'); + late final _CFDataCreateWithBytesNoCopy = + _CFDataCreateWithBytesNoCopyPtr.asFunction< + CFDataRef Function( + CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); - double fminf( - double arg0, - double arg1, + CFDataRef CFDataCreateCopy( + CFAllocatorRef allocator, + CFDataRef theData, ) { - return _fminf( - arg0, - arg1, + return _CFDataCreateCopy( + allocator, + theData, ); } - late final _fminfPtr = - _lookup>( - 'fminf'); - late final _fminf = _fminfPtr.asFunction(); + late final _CFDataCreateCopyPtr = _lookup< + ffi.NativeFunction>( + 'CFDataCreateCopy'); + late final _CFDataCreateCopy = _CFDataCreateCopyPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFDataRef)>(); - double fmin( - double arg0, - double arg1, + CFMutableDataRef CFDataCreateMutable( + CFAllocatorRef allocator, + int capacity, ) { - return _fmin( - arg0, - arg1, + return _CFDataCreateMutable( + allocator, + capacity, ); } - late final _fminPtr = - _lookup>( - 'fmin'); - late final _fmin = _fminPtr.asFunction(); + late final _CFDataCreateMutablePtr = _lookup< + ffi + .NativeFunction>( + 'CFDataCreateMutable'); + late final _CFDataCreateMutable = _CFDataCreateMutablePtr.asFunction< + CFMutableDataRef Function(CFAllocatorRef, int)>(); - double fmaf( - double arg0, - double arg1, - double arg2, + CFMutableDataRef CFDataCreateMutableCopy( + CFAllocatorRef allocator, + int capacity, + CFDataRef theData, ) { - return _fmaf( - arg0, - arg1, - arg2, + return _CFDataCreateMutableCopy( + allocator, + capacity, + theData, ); } - late final _fmafPtr = _lookup< + late final _CFDataCreateMutableCopyPtr = _lookup< ffi.NativeFunction< - ffi.Float Function(ffi.Float, ffi.Float, ffi.Float)>>('fmaf'); - late final _fmaf = - _fmafPtr.asFunction(); + CFMutableDataRef Function( + CFAllocatorRef, CFIndex, CFDataRef)>>('CFDataCreateMutableCopy'); + late final _CFDataCreateMutableCopy = _CFDataCreateMutableCopyPtr.asFunction< + CFMutableDataRef Function(CFAllocatorRef, int, CFDataRef)>(); - double fma( - double arg0, - double arg1, - double arg2, + int CFDataGetLength( + CFDataRef theData, ) { - return _fma( - arg0, - arg1, - arg2, + return _CFDataGetLength( + theData, ); } - late final _fmaPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Double, ffi.Double, ffi.Double)>>('fma'); - late final _fma = - _fmaPtr.asFunction(); + late final _CFDataGetLengthPtr = + _lookup>( + 'CFDataGetLength'); + late final _CFDataGetLength = + _CFDataGetLengthPtr.asFunction(); - double __exp10f( - double arg0, + ffi.Pointer CFDataGetBytePtr( + CFDataRef theData, ) { - return ___exp10f( - arg0, + return _CFDataGetBytePtr( + theData, ); } - late final ___exp10fPtr = - _lookup>('__exp10f'); - late final ___exp10f = ___exp10fPtr.asFunction(); + late final _CFDataGetBytePtrPtr = + _lookup Function(CFDataRef)>>( + 'CFDataGetBytePtr'); + late final _CFDataGetBytePtr = + _CFDataGetBytePtrPtr.asFunction Function(CFDataRef)>(); - double __exp10( - double arg0, + ffi.Pointer CFDataGetMutableBytePtr( + CFMutableDataRef theData, ) { - return ___exp10( - arg0, + return _CFDataGetMutableBytePtr( + theData, ); } - late final ___exp10Ptr = - _lookup>('__exp10'); - late final ___exp10 = ___exp10Ptr.asFunction(); + late final _CFDataGetMutableBytePtrPtr = _lookup< + ffi.NativeFunction Function(CFMutableDataRef)>>( + 'CFDataGetMutableBytePtr'); + late final _CFDataGetMutableBytePtr = _CFDataGetMutableBytePtrPtr.asFunction< + ffi.Pointer Function(CFMutableDataRef)>(); - double __cospif( - double arg0, + void CFDataGetBytes( + CFDataRef theData, + CFRange range, + ffi.Pointer buffer, ) { - return ___cospif( - arg0, + return _CFDataGetBytes( + theData, + range, + buffer, ); } - late final ___cospifPtr = - _lookup>('__cospif'); - late final ___cospif = ___cospifPtr.asFunction(); + late final _CFDataGetBytesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFDataRef, CFRange, ffi.Pointer)>>('CFDataGetBytes'); + late final _CFDataGetBytes = _CFDataGetBytesPtr.asFunction< + void Function(CFDataRef, CFRange, ffi.Pointer)>(); - double __cospi( - double arg0, + void CFDataSetLength( + CFMutableDataRef theData, + int length, ) { - return ___cospi( - arg0, + return _CFDataSetLength( + theData, + length, ); } - late final ___cospiPtr = - _lookup>('__cospi'); - late final ___cospi = ___cospiPtr.asFunction(); + late final _CFDataSetLengthPtr = + _lookup>( + 'CFDataSetLength'); + late final _CFDataSetLength = + _CFDataSetLengthPtr.asFunction(); - double __sinpif( - double arg0, + void CFDataIncreaseLength( + CFMutableDataRef theData, + int extraLength, ) { - return ___sinpif( - arg0, + return _CFDataIncreaseLength( + theData, + extraLength, ); } - late final ___sinpifPtr = - _lookup>('__sinpif'); - late final ___sinpif = ___sinpifPtr.asFunction(); + late final _CFDataIncreaseLengthPtr = + _lookup>( + 'CFDataIncreaseLength'); + late final _CFDataIncreaseLength = _CFDataIncreaseLengthPtr.asFunction< + void Function(CFMutableDataRef, int)>(); - double __sinpi( - double arg0, + void CFDataAppendBytes( + CFMutableDataRef theData, + ffi.Pointer bytes, + int length, ) { - return ___sinpi( - arg0, + return _CFDataAppendBytes( + theData, + bytes, + length, ); } - late final ___sinpiPtr = - _lookup>('__sinpi'); - late final ___sinpi = ___sinpiPtr.asFunction(); + late final _CFDataAppendBytesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableDataRef, ffi.Pointer, + CFIndex)>>('CFDataAppendBytes'); + late final _CFDataAppendBytes = _CFDataAppendBytesPtr.asFunction< + void Function(CFMutableDataRef, ffi.Pointer, int)>(); - double __tanpif( - double arg0, + void CFDataReplaceBytes( + CFMutableDataRef theData, + CFRange range, + ffi.Pointer newBytes, + int newLength, ) { - return ___tanpif( - arg0, + return _CFDataReplaceBytes( + theData, + range, + newBytes, + newLength, ); } - late final ___tanpifPtr = - _lookup>('__tanpif'); - late final ___tanpif = ___tanpifPtr.asFunction(); + late final _CFDataReplaceBytesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableDataRef, CFRange, ffi.Pointer, + CFIndex)>>('CFDataReplaceBytes'); + late final _CFDataReplaceBytes = _CFDataReplaceBytesPtr.asFunction< + void Function(CFMutableDataRef, CFRange, ffi.Pointer, int)>(); - double __tanpi( - double arg0, + void CFDataDeleteBytes( + CFMutableDataRef theData, + CFRange range, ) { - return ___tanpi( - arg0, + return _CFDataDeleteBytes( + theData, + range, ); } - late final ___tanpiPtr = - _lookup>('__tanpi'); - late final ___tanpi = ___tanpiPtr.asFunction(); + late final _CFDataDeleteBytesPtr = + _lookup>( + 'CFDataDeleteBytes'); + late final _CFDataDeleteBytes = _CFDataDeleteBytesPtr.asFunction< + void Function(CFMutableDataRef, CFRange)>(); - double j0( - double arg0, + CFRange CFDataFind( + CFDataRef theData, + CFDataRef dataToFind, + CFRange searchRange, + CFDataSearchFlags compareOptions, ) { - return _j0( - arg0, + return _CFDataFind( + theData, + dataToFind, + searchRange, + compareOptions.value, ); } - late final _j0Ptr = - _lookup>('j0'); - late final _j0 = _j0Ptr.asFunction(); + late final _CFDataFindPtr = _lookup< + ffi.NativeFunction< + CFRange Function( + CFDataRef, CFDataRef, CFRange, CFOptionFlags)>>('CFDataFind'); + late final _CFDataFind = _CFDataFindPtr.asFunction< + CFRange Function(CFDataRef, CFDataRef, CFRange, int)>(); - double j1( - double arg0, - ) { - return _j1( - arg0, - ); + int CFCharacterSetGetTypeID() { + return _CFCharacterSetGetTypeID(); } - late final _j1Ptr = - _lookup>('j1'); - late final _j1 = _j1Ptr.asFunction(); + late final _CFCharacterSetGetTypeIDPtr = + _lookup>( + 'CFCharacterSetGetTypeID'); + late final _CFCharacterSetGetTypeID = + _CFCharacterSetGetTypeIDPtr.asFunction(); - double jn( - int arg0, - double arg1, + CFCharacterSetRef CFCharacterSetGetPredefined( + CFCharacterSetPredefinedSet theSetIdentifier, ) { - return _jn( - arg0, - arg1, + return _CFCharacterSetGetPredefined( + theSetIdentifier.value, ); } - late final _jnPtr = - _lookup>( - 'jn'); - late final _jn = _jnPtr.asFunction(); + late final _CFCharacterSetGetPredefinedPtr = + _lookup>( + 'CFCharacterSetGetPredefined'); + late final _CFCharacterSetGetPredefined = _CFCharacterSetGetPredefinedPtr + .asFunction(); - double y0( - double arg0, + CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange( + CFAllocatorRef alloc, + CFRange theRange, ) { - return _y0( - arg0, + return _CFCharacterSetCreateWithCharactersInRange( + alloc, + theRange, ); } - late final _y0Ptr = - _lookup>('y0'); - late final _y0 = _y0Ptr.asFunction(); + late final _CFCharacterSetCreateWithCharactersInRangePtr = _lookup< + ffi + .NativeFunction>( + 'CFCharacterSetCreateWithCharactersInRange'); + late final _CFCharacterSetCreateWithCharactersInRange = + _CFCharacterSetCreateWithCharactersInRangePtr.asFunction< + CFCharacterSetRef Function(CFAllocatorRef, CFRange)>(); - double y1( - double arg0, + CFCharacterSetRef CFCharacterSetCreateWithCharactersInString( + CFAllocatorRef alloc, + CFStringRef theString, ) { - return _y1( - arg0, + return _CFCharacterSetCreateWithCharactersInString( + alloc, + theString, ); } - late final _y1Ptr = - _lookup>('y1'); - late final _y1 = _y1Ptr.asFunction(); + late final _CFCharacterSetCreateWithCharactersInStringPtr = _lookup< + ffi.NativeFunction< + CFCharacterSetRef Function(CFAllocatorRef, + CFStringRef)>>('CFCharacterSetCreateWithCharactersInString'); + late final _CFCharacterSetCreateWithCharactersInString = + _CFCharacterSetCreateWithCharactersInStringPtr.asFunction< + CFCharacterSetRef Function(CFAllocatorRef, CFStringRef)>(); - double yn( - int arg0, - double arg1, + CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation( + CFAllocatorRef alloc, + CFDataRef theData, ) { - return _yn( - arg0, - arg1, + return _CFCharacterSetCreateWithBitmapRepresentation( + alloc, + theData, ); } - late final _ynPtr = - _lookup>( - 'yn'); - late final _yn = _ynPtr.asFunction(); + late final _CFCharacterSetCreateWithBitmapRepresentationPtr = _lookup< + ffi.NativeFunction< + CFCharacterSetRef Function(CFAllocatorRef, + CFDataRef)>>('CFCharacterSetCreateWithBitmapRepresentation'); + late final _CFCharacterSetCreateWithBitmapRepresentation = + _CFCharacterSetCreateWithBitmapRepresentationPtr.asFunction< + CFCharacterSetRef Function(CFAllocatorRef, CFDataRef)>(); - double scalb( - double arg0, - double arg1, + CFCharacterSetRef CFCharacterSetCreateInvertedSet( + CFAllocatorRef alloc, + CFCharacterSetRef theSet, ) { - return _scalb( - arg0, - arg1, + return _CFCharacterSetCreateInvertedSet( + alloc, + theSet, ); } - late final _scalbPtr = - _lookup>( - 'scalb'); - late final _scalb = _scalbPtr.asFunction(); - - late final ffi.Pointer _signgam = _lookup('signgam'); + late final _CFCharacterSetCreateInvertedSetPtr = _lookup< + ffi.NativeFunction< + CFCharacterSetRef Function(CFAllocatorRef, + CFCharacterSetRef)>>('CFCharacterSetCreateInvertedSet'); + late final _CFCharacterSetCreateInvertedSet = + _CFCharacterSetCreateInvertedSetPtr.asFunction< + CFCharacterSetRef Function(CFAllocatorRef, CFCharacterSetRef)>(); - int get signgam => _signgam.value; + int CFCharacterSetIsSupersetOfSet( + CFCharacterSetRef theSet, + CFCharacterSetRef theOtherset, + ) { + return _CFCharacterSetIsSupersetOfSet( + theSet, + theOtherset, + ); + } - set signgam(int value) => _signgam.value = value; + late final _CFCharacterSetIsSupersetOfSetPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFCharacterSetRef, + CFCharacterSetRef)>>('CFCharacterSetIsSupersetOfSet'); + late final _CFCharacterSetIsSupersetOfSet = _CFCharacterSetIsSupersetOfSetPtr + .asFunction(); - int setjmp( - ffi.Pointer arg0, + int CFCharacterSetHasMemberInPlane( + CFCharacterSetRef theSet, + int thePlane, ) { - return _setjmp1( - arg0, + return _CFCharacterSetHasMemberInPlane( + theSet, + thePlane, ); } - late final _setjmpPtr = - _lookup)>>( - 'setjmp'); - late final _setjmp1 = - _setjmpPtr.asFunction)>(); + late final _CFCharacterSetHasMemberInPlanePtr = + _lookup>( + 'CFCharacterSetHasMemberInPlane'); + late final _CFCharacterSetHasMemberInPlane = + _CFCharacterSetHasMemberInPlanePtr.asFunction< + int Function(CFCharacterSetRef, int)>(); - void longjmp( - ffi.Pointer arg0, - int arg1, + CFMutableCharacterSetRef CFCharacterSetCreateMutable( + CFAllocatorRef alloc, ) { - return _longjmp1( - arg0, - arg1, + return _CFCharacterSetCreateMutable( + alloc, ); } - late final _longjmpPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'longjmp'); - late final _longjmp1 = - _longjmpPtr.asFunction, int)>(); + late final _CFCharacterSetCreateMutablePtr = _lookup< + ffi + .NativeFunction>( + 'CFCharacterSetCreateMutable'); + late final _CFCharacterSetCreateMutable = _CFCharacterSetCreateMutablePtr + .asFunction(); - int _setjmp( - ffi.Pointer arg0, + CFCharacterSetRef CFCharacterSetCreateCopy( + CFAllocatorRef alloc, + CFCharacterSetRef theSet, ) { - return __setjmp( - arg0, + return _CFCharacterSetCreateCopy( + alloc, + theSet, ); } - late final __setjmpPtr = - _lookup)>>( - '_setjmp'); - late final __setjmp = - __setjmpPtr.asFunction)>(); + late final _CFCharacterSetCreateCopyPtr = _lookup< + ffi.NativeFunction< + CFCharacterSetRef Function( + CFAllocatorRef, CFCharacterSetRef)>>('CFCharacterSetCreateCopy'); + late final _CFCharacterSetCreateCopy = + _CFCharacterSetCreateCopyPtr.asFunction< + CFCharacterSetRef Function(CFAllocatorRef, CFCharacterSetRef)>(); - void _longjmp( - ffi.Pointer arg0, - int arg1, + CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy( + CFAllocatorRef alloc, + CFCharacterSetRef theSet, ) { - return __longjmp( - arg0, - arg1, + return _CFCharacterSetCreateMutableCopy( + alloc, + theSet, ); } - late final __longjmpPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - '_longjmp'); - late final __longjmp = - __longjmpPtr.asFunction, int)>(); + late final _CFCharacterSetCreateMutableCopyPtr = _lookup< + ffi.NativeFunction< + CFMutableCharacterSetRef Function(CFAllocatorRef, + CFCharacterSetRef)>>('CFCharacterSetCreateMutableCopy'); + late final _CFCharacterSetCreateMutableCopy = + _CFCharacterSetCreateMutableCopyPtr.asFunction< + CFMutableCharacterSetRef Function( + CFAllocatorRef, CFCharacterSetRef)>(); - int sigsetjmp( - ffi.Pointer arg0, - int arg1, + int CFCharacterSetIsCharacterMember( + CFCharacterSetRef theSet, + int theChar, ) { - return _sigsetjmp( - arg0, - arg1, + return _CFCharacterSetIsCharacterMember( + theSet, + theChar, ); } - late final _sigsetjmpPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'sigsetjmp'); - late final _sigsetjmp = - _sigsetjmpPtr.asFunction, int)>(); + late final _CFCharacterSetIsCharacterMemberPtr = + _lookup>( + 'CFCharacterSetIsCharacterMember'); + late final _CFCharacterSetIsCharacterMember = + _CFCharacterSetIsCharacterMemberPtr.asFunction< + int Function(CFCharacterSetRef, int)>(); - void siglongjmp( - ffi.Pointer arg0, - int arg1, + int CFCharacterSetIsLongCharacterMember( + CFCharacterSetRef theSet, + int theChar, ) { - return _siglongjmp( - arg0, - arg1, + return _CFCharacterSetIsLongCharacterMember( + theSet, + theChar, ); } - late final _siglongjmpPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'siglongjmp'); - late final _siglongjmp = - _siglongjmpPtr.asFunction, int)>(); - - void longjmperror() { - return _longjmperror(); - } - - late final _longjmperrorPtr = - _lookup>('longjmperror'); - late final _longjmperror = _longjmperrorPtr.asFunction(); - - late final ffi.Pointer>> _sys_signame = - _lookup>>('sys_signame'); - - ffi.Pointer> get sys_signame => _sys_signame.value; - - set sys_signame(ffi.Pointer> value) => - _sys_signame.value = value; - - late final ffi.Pointer>> _sys_siglist = - _lookup>>('sys_siglist'); - - ffi.Pointer> get sys_siglist => _sys_siglist.value; - - set sys_siglist(ffi.Pointer> value) => - _sys_siglist.value = value; + late final _CFCharacterSetIsLongCharacterMemberPtr = _lookup< + ffi.NativeFunction>( + 'CFCharacterSetIsLongCharacterMember'); + late final _CFCharacterSetIsLongCharacterMember = + _CFCharacterSetIsLongCharacterMemberPtr.asFunction< + int Function(CFCharacterSetRef, int)>(); - int raise( - int arg0, + CFDataRef CFCharacterSetCreateBitmapRepresentation( + CFAllocatorRef alloc, + CFCharacterSetRef theSet, ) { - return _raise( - arg0, + return _CFCharacterSetCreateBitmapRepresentation( + alloc, + theSet, ); } - late final _raisePtr = - _lookup>('raise'); - late final _raise = _raisePtr.asFunction(); + late final _CFCharacterSetCreateBitmapRepresentationPtr = _lookup< + ffi.NativeFunction< + CFDataRef Function(CFAllocatorRef, + CFCharacterSetRef)>>('CFCharacterSetCreateBitmapRepresentation'); + late final _CFCharacterSetCreateBitmapRepresentation = + _CFCharacterSetCreateBitmapRepresentationPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFCharacterSetRef)>(); - ffi.Pointer> bsd_signal( - int arg0, - ffi.Pointer> arg1, + void CFCharacterSetAddCharactersInRange( + CFMutableCharacterSetRef theSet, + CFRange theRange, ) { - return _bsd_signal( - arg0, - arg1, + return _CFCharacterSetAddCharactersInRange( + theSet, + theRange, ); } - late final _bsd_signalPtr = _lookup< + late final _CFCharacterSetAddCharactersInRangePtr = _lookup< ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Int, - ffi.Pointer< - ffi - .NativeFunction>)>>('bsd_signal'); - late final _bsd_signal = _bsd_signalPtr.asFunction< - ffi.Pointer> Function( - int, ffi.Pointer>)>(); + ffi.Void Function(CFMutableCharacterSetRef, + CFRange)>>('CFCharacterSetAddCharactersInRange'); + late final _CFCharacterSetAddCharactersInRange = + _CFCharacterSetAddCharactersInRangePtr.asFunction< + void Function(CFMutableCharacterSetRef, CFRange)>(); - int kill( - int arg0, - int arg1, + void CFCharacterSetRemoveCharactersInRange( + CFMutableCharacterSetRef theSet, + CFRange theRange, ) { - return _kill( - arg0, - arg1, + return _CFCharacterSetRemoveCharactersInRange( + theSet, + theRange, ); } - late final _killPtr = - _lookup>('kill'); - late final _kill = _killPtr.asFunction(); + late final _CFCharacterSetRemoveCharactersInRangePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableCharacterSetRef, + CFRange)>>('CFCharacterSetRemoveCharactersInRange'); + late final _CFCharacterSetRemoveCharactersInRange = + _CFCharacterSetRemoveCharactersInRangePtr.asFunction< + void Function(CFMutableCharacterSetRef, CFRange)>(); - int killpg( - int arg0, - int arg1, + void CFCharacterSetAddCharactersInString( + CFMutableCharacterSetRef theSet, + CFStringRef theString, ) { - return _killpg( - arg0, - arg1, + return _CFCharacterSetAddCharactersInString( + theSet, + theString, ); } - late final _killpgPtr = - _lookup>('killpg'); - late final _killpg = _killpgPtr.asFunction(); + late final _CFCharacterSetAddCharactersInStringPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableCharacterSetRef, + CFStringRef)>>('CFCharacterSetAddCharactersInString'); + late final _CFCharacterSetAddCharactersInString = + _CFCharacterSetAddCharactersInStringPtr.asFunction< + void Function(CFMutableCharacterSetRef, CFStringRef)>(); - int pthread_kill( - pthread_t arg0, - int arg1, + void CFCharacterSetRemoveCharactersInString( + CFMutableCharacterSetRef theSet, + CFStringRef theString, ) { - return _pthread_kill( - arg0, - arg1, + return _CFCharacterSetRemoveCharactersInString( + theSet, + theString, ); } - late final _pthread_killPtr = - _lookup>( - 'pthread_kill'); - late final _pthread_kill = - _pthread_killPtr.asFunction(); + late final _CFCharacterSetRemoveCharactersInStringPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableCharacterSetRef, + CFStringRef)>>('CFCharacterSetRemoveCharactersInString'); + late final _CFCharacterSetRemoveCharactersInString = + _CFCharacterSetRemoveCharactersInStringPtr.asFunction< + void Function(CFMutableCharacterSetRef, CFStringRef)>(); - int pthread_sigmask( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + void CFCharacterSetUnion( + CFMutableCharacterSetRef theSet, + CFCharacterSetRef theOtherSet, ) { - return _pthread_sigmask( - arg0, - arg1, - arg2, + return _CFCharacterSetUnion( + theSet, + theOtherSet, ); } - late final _pthread_sigmaskPtr = _lookup< + late final _CFCharacterSetUnionPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, - ffi.Pointer)>>('pthread_sigmask'); - late final _pthread_sigmask = _pthread_sigmaskPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function(CFMutableCharacterSetRef, + CFCharacterSetRef)>>('CFCharacterSetUnion'); + late final _CFCharacterSetUnion = _CFCharacterSetUnionPtr.asFunction< + void Function(CFMutableCharacterSetRef, CFCharacterSetRef)>(); - int sigaction1( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + void CFCharacterSetIntersect( + CFMutableCharacterSetRef theSet, + CFCharacterSetRef theOtherSet, ) { - return _sigaction1( - arg0, - arg1, - arg2, + return _CFCharacterSetIntersect( + theSet, + theOtherSet, ); } - late final _sigaction1Ptr = _lookup< + late final _CFCharacterSetIntersectPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, - ffi.Pointer)>>('sigaction'); - late final _sigaction1 = _sigaction1Ptr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function(CFMutableCharacterSetRef, + CFCharacterSetRef)>>('CFCharacterSetIntersect'); + late final _CFCharacterSetIntersect = _CFCharacterSetIntersectPtr.asFunction< + void Function(CFMutableCharacterSetRef, CFCharacterSetRef)>(); - int sigaddset( - ffi.Pointer arg0, - int arg1, + void CFCharacterSetInvert( + CFMutableCharacterSetRef theSet, ) { - return _sigaddset( - arg0, - arg1, + return _CFCharacterSetInvert( + theSet, ); } - late final _sigaddsetPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'sigaddset'); - late final _sigaddset = - _sigaddsetPtr.asFunction, int)>(); + late final _CFCharacterSetInvertPtr = + _lookup>( + 'CFCharacterSetInvert'); + late final _CFCharacterSetInvert = _CFCharacterSetInvertPtr.asFunction< + void Function(CFMutableCharacterSetRef)>(); - int sigaltstack( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFErrorGetTypeID() { + return _CFErrorGetTypeID(); + } + + late final _CFErrorGetTypeIDPtr = + _lookup>('CFErrorGetTypeID'); + late final _CFErrorGetTypeID = + _CFErrorGetTypeIDPtr.asFunction(); + + late final ffi.Pointer _kCFErrorDomainPOSIX = + _lookup('kCFErrorDomainPOSIX'); + + CFErrorDomain get kCFErrorDomainPOSIX => _kCFErrorDomainPOSIX.value; + + late final ffi.Pointer _kCFErrorDomainOSStatus = + _lookup('kCFErrorDomainOSStatus'); + + CFErrorDomain get kCFErrorDomainOSStatus => _kCFErrorDomainOSStatus.value; + + late final ffi.Pointer _kCFErrorDomainMach = + _lookup('kCFErrorDomainMach'); + + CFErrorDomain get kCFErrorDomainMach => _kCFErrorDomainMach.value; + + late final ffi.Pointer _kCFErrorDomainCocoa = + _lookup('kCFErrorDomainCocoa'); + + CFErrorDomain get kCFErrorDomainCocoa => _kCFErrorDomainCocoa.value; + + late final ffi.Pointer _kCFErrorLocalizedDescriptionKey = + _lookup('kCFErrorLocalizedDescriptionKey'); + + CFStringRef get kCFErrorLocalizedDescriptionKey => + _kCFErrorLocalizedDescriptionKey.value; + + late final ffi.Pointer _kCFErrorLocalizedFailureKey = + _lookup('kCFErrorLocalizedFailureKey'); + + CFStringRef get kCFErrorLocalizedFailureKey => + _kCFErrorLocalizedFailureKey.value; + + late final ffi.Pointer _kCFErrorLocalizedFailureReasonKey = + _lookup('kCFErrorLocalizedFailureReasonKey'); + + CFStringRef get kCFErrorLocalizedFailureReasonKey => + _kCFErrorLocalizedFailureReasonKey.value; + + late final ffi.Pointer _kCFErrorLocalizedRecoverySuggestionKey = + _lookup('kCFErrorLocalizedRecoverySuggestionKey'); + + CFStringRef get kCFErrorLocalizedRecoverySuggestionKey => + _kCFErrorLocalizedRecoverySuggestionKey.value; + + late final ffi.Pointer _kCFErrorDescriptionKey = + _lookup('kCFErrorDescriptionKey'); + + CFStringRef get kCFErrorDescriptionKey => _kCFErrorDescriptionKey.value; + + late final ffi.Pointer _kCFErrorUnderlyingErrorKey = + _lookup('kCFErrorUnderlyingErrorKey'); + + CFStringRef get kCFErrorUnderlyingErrorKey => + _kCFErrorUnderlyingErrorKey.value; + + late final ffi.Pointer _kCFErrorURLKey = + _lookup('kCFErrorURLKey'); + + CFStringRef get kCFErrorURLKey => _kCFErrorURLKey.value; + + late final ffi.Pointer _kCFErrorFilePathKey = + _lookup('kCFErrorFilePathKey'); + + CFStringRef get kCFErrorFilePathKey => _kCFErrorFilePathKey.value; + + CFErrorRef CFErrorCreate( + CFAllocatorRef allocator, + CFErrorDomain domain, + int code, + CFDictionaryRef userInfo, ) { - return _sigaltstack( - arg0, - arg1, + return _CFErrorCreate( + allocator, + domain, + code, + userInfo, ); } - late final _sigaltstackPtr = _lookup< + late final _CFErrorCreatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('sigaltstack'); - late final _sigaltstack = _sigaltstackPtr - .asFunction, ffi.Pointer)>(); + CFErrorRef Function(CFAllocatorRef, CFErrorDomain, CFIndex, + CFDictionaryRef)>>('CFErrorCreate'); + late final _CFErrorCreate = _CFErrorCreatePtr.asFunction< + CFErrorRef Function( + CFAllocatorRef, CFErrorDomain, int, CFDictionaryRef)>(); - int sigdelset( - ffi.Pointer arg0, - int arg1, + CFErrorRef CFErrorCreateWithUserInfoKeysAndValues( + CFAllocatorRef allocator, + CFErrorDomain domain, + int code, + ffi.Pointer> userInfoKeys, + ffi.Pointer> userInfoValues, + int numUserInfoValues, ) { - return _sigdelset( - arg0, - arg1, + return _CFErrorCreateWithUserInfoKeysAndValues( + allocator, + domain, + code, + userInfoKeys, + userInfoValues, + numUserInfoValues, ); } - late final _sigdelsetPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'sigdelset'); - late final _sigdelset = - _sigdelsetPtr.asFunction, int)>(); + late final _CFErrorCreateWithUserInfoKeysAndValuesPtr = _lookup< + ffi.NativeFunction< + CFErrorRef Function( + CFAllocatorRef, + CFErrorDomain, + CFIndex, + ffi.Pointer>, + ffi.Pointer>, + CFIndex)>>('CFErrorCreateWithUserInfoKeysAndValues'); + late final _CFErrorCreateWithUserInfoKeysAndValues = + _CFErrorCreateWithUserInfoKeysAndValuesPtr.asFunction< + CFErrorRef Function( + CFAllocatorRef, + CFErrorDomain, + int, + ffi.Pointer>, + ffi.Pointer>, + int)>(); - int sigemptyset( - ffi.Pointer arg0, + CFErrorDomain CFErrorGetDomain( + CFErrorRef err, ) { - return _sigemptyset( - arg0, + return _CFErrorGetDomain( + err, ); } - late final _sigemptysetPtr = - _lookup)>>( - 'sigemptyset'); - late final _sigemptyset = - _sigemptysetPtr.asFunction)>(); + late final _CFErrorGetDomainPtr = + _lookup>( + 'CFErrorGetDomain'); + late final _CFErrorGetDomain = + _CFErrorGetDomainPtr.asFunction(); - int sigfillset( - ffi.Pointer arg0, + int CFErrorGetCode( + CFErrorRef err, ) { - return _sigfillset( - arg0, + return _CFErrorGetCode( + err, ); } - late final _sigfillsetPtr = - _lookup)>>( - 'sigfillset'); - late final _sigfillset = - _sigfillsetPtr.asFunction)>(); + late final _CFErrorGetCodePtr = + _lookup>( + 'CFErrorGetCode'); + late final _CFErrorGetCode = + _CFErrorGetCodePtr.asFunction(); - int sighold( - int arg0, + CFDictionaryRef CFErrorCopyUserInfo( + CFErrorRef err, ) { - return _sighold( - arg0, + return _CFErrorCopyUserInfo( + err, ); } - late final _sigholdPtr = - _lookup>('sighold'); - late final _sighold = _sigholdPtr.asFunction(); + late final _CFErrorCopyUserInfoPtr = + _lookup>( + 'CFErrorCopyUserInfo'); + late final _CFErrorCopyUserInfo = _CFErrorCopyUserInfoPtr.asFunction< + CFDictionaryRef Function(CFErrorRef)>(); - int sigignore( - int arg0, + CFStringRef CFErrorCopyDescription( + CFErrorRef err, ) { - return _sigignore( - arg0, + return _CFErrorCopyDescription( + err, ); } - late final _sigignorePtr = - _lookup>('sigignore'); - late final _sigignore = _sigignorePtr.asFunction(); + late final _CFErrorCopyDescriptionPtr = + _lookup>( + 'CFErrorCopyDescription'); + late final _CFErrorCopyDescription = + _CFErrorCopyDescriptionPtr.asFunction(); - int siginterrupt( - int arg0, - int arg1, + CFStringRef CFErrorCopyFailureReason( + CFErrorRef err, ) { - return _siginterrupt( - arg0, - arg1, + return _CFErrorCopyFailureReason( + err, ); } - late final _siginterruptPtr = - _lookup>( - 'siginterrupt'); - late final _siginterrupt = - _siginterruptPtr.asFunction(); + late final _CFErrorCopyFailureReasonPtr = + _lookup>( + 'CFErrorCopyFailureReason'); + late final _CFErrorCopyFailureReason = _CFErrorCopyFailureReasonPtr + .asFunction(); - int sigismember( - ffi.Pointer arg0, - int arg1, + CFStringRef CFErrorCopyRecoverySuggestion( + CFErrorRef err, ) { - return _sigismember( - arg0, - arg1, + return _CFErrorCopyRecoverySuggestion( + err, ); } - late final _sigismemberPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'sigismember'); - late final _sigismember = - _sigismemberPtr.asFunction, int)>(); + late final _CFErrorCopyRecoverySuggestionPtr = + _lookup>( + 'CFErrorCopyRecoverySuggestion'); + late final _CFErrorCopyRecoverySuggestion = _CFErrorCopyRecoverySuggestionPtr + .asFunction(); - int sigpause( - int arg0, - ) { - return _sigpause( - arg0, - ); + int CFStringGetTypeID() { + return _CFStringGetTypeID(); } - late final _sigpausePtr = - _lookup>('sigpause'); - late final _sigpause = _sigpausePtr.asFunction(); + late final _CFStringGetTypeIDPtr = + _lookup>('CFStringGetTypeID'); + late final _CFStringGetTypeID = + _CFStringGetTypeIDPtr.asFunction(); - int sigpending( - ffi.Pointer arg0, + CFStringRef CFStringCreateWithPascalString( + CFAllocatorRef alloc, + ConstStr255Param pStr, + int encoding, ) { - return _sigpending( - arg0, + return _CFStringCreateWithPascalString( + alloc, + pStr, + encoding, ); } - late final _sigpendingPtr = - _lookup)>>( - 'sigpending'); - late final _sigpending = - _sigpendingPtr.asFunction)>(); + late final _CFStringCreateWithPascalStringPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, ConstStr255Param, + CFStringEncoding)>>('CFStringCreateWithPascalString'); + late final _CFStringCreateWithPascalString = + _CFStringCreateWithPascalStringPtr.asFunction< + CFStringRef Function(CFAllocatorRef, ConstStr255Param, int)>(); - int sigprocmask( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + CFStringRef CFStringCreateWithCString( + CFAllocatorRef alloc, + ffi.Pointer cStr, + int encoding, ) { - return _sigprocmask( - arg0, - arg1, - arg2, + return _CFStringCreateWithCString( + alloc, + cStr, + encoding, ); } - late final _sigprocmaskPtr = _lookup< + late final _CFStringCreateWithCStringPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, - ffi.Pointer)>>('sigprocmask'); - late final _sigprocmask = _sigprocmaskPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer)>(); + CFStringRef Function(CFAllocatorRef, ffi.Pointer, + CFStringEncoding)>>('CFStringCreateWithCString'); + late final _CFStringCreateWithCString = + _CFStringCreateWithCStringPtr.asFunction< + CFStringRef Function(CFAllocatorRef, ffi.Pointer, int)>(); - int sigrelse( - int arg0, + CFStringRef CFStringCreateWithBytes( + CFAllocatorRef alloc, + ffi.Pointer bytes, + int numBytes, + int encoding, + int isExternalRepresentation, ) { - return _sigrelse( - arg0, + return _CFStringCreateWithBytes( + alloc, + bytes, + numBytes, + encoding, + isExternalRepresentation, ); } - late final _sigrelsePtr = - _lookup>('sigrelse'); - late final _sigrelse = _sigrelsePtr.asFunction(); + late final _CFStringCreateWithBytesPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, + CFStringEncoding, Boolean)>>('CFStringCreateWithBytes'); + late final _CFStringCreateWithBytes = _CFStringCreateWithBytesPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, ffi.Pointer, int, int, int)>(); - ffi.Pointer> sigset( - int arg0, - ffi.Pointer> arg1, + CFStringRef CFStringCreateWithCharacters( + CFAllocatorRef alloc, + ffi.Pointer chars, + int numChars, ) { - return _sigset( - arg0, - arg1, + return _CFStringCreateWithCharacters( + alloc, + chars, + numChars, ); } - late final _sigsetPtr = _lookup< + late final _CFStringCreateWithCharactersPtr = _lookup< ffi.NativeFunction< - ffi.Pointer> Function( - ffi.Int, - ffi.Pointer< - ffi.NativeFunction>)>>('sigset'); - late final _sigset = _sigsetPtr.asFunction< - ffi.Pointer> Function( - int, ffi.Pointer>)>(); + CFStringRef Function(CFAllocatorRef, ffi.Pointer, + CFIndex)>>('CFStringCreateWithCharacters'); + late final _CFStringCreateWithCharacters = + _CFStringCreateWithCharactersPtr.asFunction< + CFStringRef Function(CFAllocatorRef, ffi.Pointer, int)>(); - int sigsuspend( - ffi.Pointer arg0, + CFStringRef CFStringCreateWithPascalStringNoCopy( + CFAllocatorRef alloc, + ConstStr255Param pStr, + int encoding, + CFAllocatorRef contentsDeallocator, ) { - return _sigsuspend( - arg0, + return _CFStringCreateWithPascalStringNoCopy( + alloc, + pStr, + encoding, + contentsDeallocator, ); } - late final _sigsuspendPtr = - _lookup)>>( - 'sigsuspend'); - late final _sigsuspend = - _sigsuspendPtr.asFunction)>(); + late final _CFStringCreateWithPascalStringNoCopyPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function( + CFAllocatorRef, + ConstStr255Param, + CFStringEncoding, + CFAllocatorRef)>>('CFStringCreateWithPascalStringNoCopy'); + late final _CFStringCreateWithPascalStringNoCopy = + _CFStringCreateWithPascalStringNoCopyPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, ConstStr255Param, int, CFAllocatorRef)>(); - int sigwait( - ffi.Pointer arg0, - ffi.Pointer arg1, + CFStringRef CFStringCreateWithCStringNoCopy( + CFAllocatorRef alloc, + ffi.Pointer cStr, + int encoding, + CFAllocatorRef contentsDeallocator, ) { - return _sigwait( - arg0, - arg1, + return _CFStringCreateWithCStringNoCopy( + alloc, + cStr, + encoding, + contentsDeallocator, ); } - late final _sigwaitPtr = _lookup< + late final _CFStringCreateWithCStringNoCopyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('sigwait'); - late final _sigwait = _sigwaitPtr - .asFunction, ffi.Pointer)>(); + CFStringRef Function( + CFAllocatorRef, + ffi.Pointer, + CFStringEncoding, + CFAllocatorRef)>>('CFStringCreateWithCStringNoCopy'); + late final _CFStringCreateWithCStringNoCopy = + _CFStringCreateWithCStringNoCopyPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); - void psignal( - int arg0, - ffi.Pointer arg1, + CFStringRef CFStringCreateWithBytesNoCopy( + CFAllocatorRef alloc, + ffi.Pointer bytes, + int numBytes, + int encoding, + int isExternalRepresentation, + CFAllocatorRef contentsDeallocator, ) { - return _psignal( - arg0, - arg1, + return _CFStringCreateWithBytesNoCopy( + alloc, + bytes, + numBytes, + encoding, + isExternalRepresentation, + contentsDeallocator, ); } - late final _psignalPtr = _lookup< + late final _CFStringCreateWithBytesNoCopyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>>('psignal'); - late final _psignal = - _psignalPtr.asFunction)>(); + CFStringRef Function( + CFAllocatorRef, + ffi.Pointer, + CFIndex, + CFStringEncoding, + Boolean, + CFAllocatorRef)>>('CFStringCreateWithBytesNoCopy'); + late final _CFStringCreateWithBytesNoCopy = + _CFStringCreateWithBytesNoCopyPtr.asFunction< + CFStringRef Function(CFAllocatorRef, ffi.Pointer, int, int, + int, CFAllocatorRef)>(); - int sigblock( - int arg0, + CFStringRef CFStringCreateWithCharactersNoCopy( + CFAllocatorRef alloc, + ffi.Pointer chars, + int numChars, + CFAllocatorRef contentsDeallocator, ) { - return _sigblock( - arg0, + return _CFStringCreateWithCharactersNoCopy( + alloc, + chars, + numChars, + contentsDeallocator, ); } - late final _sigblockPtr = - _lookup>('sigblock'); - late final _sigblock = _sigblockPtr.asFunction(); + late final _CFStringCreateWithCharactersNoCopyPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, + CFAllocatorRef)>>('CFStringCreateWithCharactersNoCopy'); + late final _CFStringCreateWithCharactersNoCopy = + _CFStringCreateWithCharactersNoCopyPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); - int sigsetmask( - int arg0, + CFStringRef CFStringCreateWithSubstring( + CFAllocatorRef alloc, + CFStringRef str, + CFRange range, ) { - return _sigsetmask( - arg0, + return _CFStringCreateWithSubstring( + alloc, + str, + range, ); } - late final _sigsetmaskPtr = - _lookup>('sigsetmask'); - late final _sigsetmask = _sigsetmaskPtr.asFunction(); + late final _CFStringCreateWithSubstringPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, + CFRange)>>('CFStringCreateWithSubstring'); + late final _CFStringCreateWithSubstring = _CFStringCreateWithSubstringPtr + .asFunction(); - int sigvec1( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + CFStringRef CFStringCreateCopy( + CFAllocatorRef alloc, + CFStringRef theString, ) { - return _sigvec1( - arg0, - arg1, - arg2, + return _CFStringCreateCopy( + alloc, + theString, ); } - late final _sigvec1Ptr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Pointer)>>('sigvec'); - late final _sigvec1 = _sigvec1Ptr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer)>(); + late final _CFStringCreateCopyPtr = _lookup< + ffi + .NativeFunction>( + 'CFStringCreateCopy'); + late final _CFStringCreateCopy = _CFStringCreateCopyPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef)>(); - int renameat( - int arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer arg3, + CFStringRef CFStringCreateWithFormat( + CFAllocatorRef alloc, + CFDictionaryRef formatOptions, + CFStringRef format, ) { - return _renameat( - arg0, - arg1, - arg2, - arg3, + return _CFStringCreateWithFormat( + alloc, + formatOptions, + format, ); } - late final _renameatPtr = _lookup< + late final _CFStringCreateWithFormatPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, - ffi.Pointer)>>('renameat'); - late final _renameat = _renameatPtr.asFunction< - int Function(int, ffi.Pointer, int, ffi.Pointer)>(); + CFStringRef Function(CFAllocatorRef, CFDictionaryRef, + CFStringRef)>>('CFStringCreateWithFormat'); + late final _CFStringCreateWithFormat = + _CFStringCreateWithFormatPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef)>(); - int renamex_np( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + CFStringRef CFStringCreateWithFormatAndArguments( + CFAllocatorRef alloc, + CFDictionaryRef formatOptions, + CFStringRef format, + va_list arguments, ) { - return _renamex_np( - arg0, - arg1, - arg2, + return _CFStringCreateWithFormatAndArguments( + alloc, + formatOptions, + format, + arguments, ); } - late final _renamex_npPtr = _lookup< + late final _CFStringCreateWithFormatAndArgumentsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt)>>('renamex_np'); - late final _renamex_np = _renamex_npPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, + va_list)>>('CFStringCreateWithFormatAndArguments'); + late final _CFStringCreateWithFormatAndArguments = + _CFStringCreateWithFormatAndArgumentsPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, CFDictionaryRef, CFStringRef, va_list)>(); - int renameatx_np( - int arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer arg3, - int arg4, + CFStringRef CFStringCreateStringWithValidatedFormat( + CFAllocatorRef alloc, + CFDictionaryRef formatOptions, + CFStringRef validFormatSpecifiers, + CFStringRef format, + ffi.Pointer errorPtr, ) { - return _renameatx_np( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFStringCreateStringWithValidatedFormat( + alloc, + formatOptions, + validFormatSpecifiers, + format, + errorPtr, ); } - late final _renameatx_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, - ffi.Pointer, ffi.UnsignedInt)>>('renameatx_np'); - late final _renameatx_np = _renameatx_npPtr.asFunction< - int Function( - int, ffi.Pointer, int, ffi.Pointer, int)>(); - - late final ffi.Pointer> ___stdinp = - _lookup>('__stdinp'); - - ffi.Pointer get __stdinp => ___stdinp.value; - - set __stdinp(ffi.Pointer value) => ___stdinp.value = value; - - late final ffi.Pointer> ___stdoutp = - _lookup>('__stdoutp'); - - ffi.Pointer get __stdoutp => ___stdoutp.value; - - set __stdoutp(ffi.Pointer value) => ___stdoutp.value = value; - - late final ffi.Pointer> ___stderrp = - _lookup>('__stderrp'); - - ffi.Pointer get __stderrp => ___stderrp.value; - - set __stderrp(ffi.Pointer value) => ___stderrp.value = value; + late final _CFStringCreateStringWithValidatedFormatPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, + CFStringRef, ffi.Pointer)>>( + 'CFStringCreateStringWithValidatedFormat'); + late final _CFStringCreateStringWithValidatedFormat = + _CFStringCreateStringWithValidatedFormatPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, + CFStringRef, ffi.Pointer)>(); - void clearerr( - ffi.Pointer arg0, + CFStringRef CFStringCreateStringWithValidatedFormatAndArguments( + CFAllocatorRef alloc, + CFDictionaryRef formatOptions, + CFStringRef validFormatSpecifiers, + CFStringRef format, + va_list arguments, + ffi.Pointer errorPtr, ) { - return _clearerr( - arg0, + return _CFStringCreateStringWithValidatedFormatAndArguments( + alloc, + formatOptions, + validFormatSpecifiers, + format, + arguments, + errorPtr, ); } - late final _clearerrPtr = - _lookup)>>( - 'clearerr'); - late final _clearerr = - _clearerrPtr.asFunction)>(); + late final _CFStringCreateStringWithValidatedFormatAndArgumentsPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, + CFStringRef, va_list, ffi.Pointer)>>( + 'CFStringCreateStringWithValidatedFormatAndArguments'); + late final _CFStringCreateStringWithValidatedFormatAndArguments = + _CFStringCreateStringWithValidatedFormatAndArgumentsPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, + CFStringRef, va_list, ffi.Pointer)>(); - int fclose( - ffi.Pointer arg0, + CFMutableStringRef CFStringCreateMutable( + CFAllocatorRef alloc, + int maxLength, ) { - return _fclose( - arg0, + return _CFStringCreateMutable( + alloc, + maxLength, ); } - late final _fclosePtr = - _lookup)>>( - 'fclose'); - late final _fclose = _fclosePtr.asFunction)>(); + late final _CFStringCreateMutablePtr = _lookup< + ffi.NativeFunction< + CFMutableStringRef Function( + CFAllocatorRef, CFIndex)>>('CFStringCreateMutable'); + late final _CFStringCreateMutable = _CFStringCreateMutablePtr.asFunction< + CFMutableStringRef Function(CFAllocatorRef, int)>(); - int feof( - ffi.Pointer arg0, + CFMutableStringRef CFStringCreateMutableCopy( + CFAllocatorRef alloc, + int maxLength, + CFStringRef theString, ) { - return _feof( - arg0, + return _CFStringCreateMutableCopy( + alloc, + maxLength, + theString, ); } - late final _feofPtr = - _lookup)>>('feof'); - late final _feof = _feofPtr.asFunction)>(); + late final _CFStringCreateMutableCopyPtr = _lookup< + ffi.NativeFunction< + CFMutableStringRef Function(CFAllocatorRef, CFIndex, + CFStringRef)>>('CFStringCreateMutableCopy'); + late final _CFStringCreateMutableCopy = + _CFStringCreateMutableCopyPtr.asFunction< + CFMutableStringRef Function(CFAllocatorRef, int, CFStringRef)>(); - int ferror( - ffi.Pointer arg0, + CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy( + CFAllocatorRef alloc, + ffi.Pointer chars, + int numChars, + int capacity, + CFAllocatorRef externalCharactersAllocator, ) { - return _ferror( - arg0, + return _CFStringCreateMutableWithExternalCharactersNoCopy( + alloc, + chars, + numChars, + capacity, + externalCharactersAllocator, ); } - late final _ferrorPtr = - _lookup)>>( - 'ferror'); - late final _ferror = _ferrorPtr.asFunction)>(); - - int fflush( - ffi.Pointer arg0, - ) { - return _fflush( - arg0, - ); - } - - late final _fflushPtr = - _lookup)>>( - 'fflush'); - late final _fflush = _fflushPtr.asFunction)>(); + late final _CFStringCreateMutableWithExternalCharactersNoCopyPtr = _lookup< + ffi.NativeFunction< + CFMutableStringRef Function(CFAllocatorRef, ffi.Pointer, + CFIndex, CFIndex, CFAllocatorRef)>>( + 'CFStringCreateMutableWithExternalCharactersNoCopy'); + late final _CFStringCreateMutableWithExternalCharactersNoCopy = + _CFStringCreateMutableWithExternalCharactersNoCopyPtr.asFunction< + CFMutableStringRef Function(CFAllocatorRef, ffi.Pointer, int, + int, CFAllocatorRef)>(); - int fgetc( - ffi.Pointer arg0, + int CFStringGetLength( + CFStringRef theString, ) { - return _fgetc( - arg0, + return _CFStringGetLength( + theString, ); } - late final _fgetcPtr = - _lookup)>>('fgetc'); - late final _fgetc = _fgetcPtr.asFunction)>(); + late final _CFStringGetLengthPtr = + _lookup>( + 'CFStringGetLength'); + late final _CFStringGetLength = + _CFStringGetLengthPtr.asFunction(); - int fgetpos( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFStringGetCharacterAtIndex( + CFStringRef theString, + int idx, ) { - return _fgetpos( - arg0, - arg1, + return _CFStringGetCharacterAtIndex( + theString, + idx, ); } - late final _fgetposPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('fgetpos'); - late final _fgetpos = _fgetposPtr - .asFunction, ffi.Pointer)>(); + late final _CFStringGetCharacterAtIndexPtr = + _lookup>( + 'CFStringGetCharacterAtIndex'); + late final _CFStringGetCharacterAtIndex = _CFStringGetCharacterAtIndexPtr + .asFunction(); - ffi.Pointer fgets( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, + void CFStringGetCharacters( + CFStringRef theString, + CFRange range, + ffi.Pointer buffer, ) { - return _fgets( - arg0, - arg1, - arg2, + return _CFStringGetCharacters( + theString, + range, + buffer, ); } - late final _fgetsPtr = _lookup< + late final _CFStringGetCharactersPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int, ffi.Pointer)>>('fgets'); - late final _fgets = _fgetsPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); + ffi.Void Function(CFStringRef, CFRange, + ffi.Pointer)>>('CFStringGetCharacters'); + late final _CFStringGetCharacters = _CFStringGetCharactersPtr.asFunction< + void Function(CFStringRef, CFRange, ffi.Pointer)>(); - ffi.Pointer fopen( - ffi.Pointer __filename, - ffi.Pointer __mode, + int CFStringGetPascalString( + CFStringRef theString, + StringPtr buffer, + int bufferSize, + int encoding, ) { - return _fopen( - __filename, - __mode, + return _CFStringGetPascalString( + theString, + buffer, + bufferSize, + encoding, ); } - late final _fopenPtr = _lookup< + late final _CFStringGetPascalStringPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('fopen'); - late final _fopen = _fopenPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + Boolean Function(CFStringRef, StringPtr, CFIndex, + CFStringEncoding)>>('CFStringGetPascalString'); + late final _CFStringGetPascalString = _CFStringGetPascalStringPtr.asFunction< + int Function(CFStringRef, StringPtr, int, int)>(); - int fprintf( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFStringGetCString( + CFStringRef theString, + ffi.Pointer buffer, + int bufferSize, + int encoding, ) { - return _fprintf( - arg0, - arg1, + return _CFStringGetCString( + theString, + buffer, + bufferSize, + encoding, ); } - late final _fprintfPtr = _lookup< + late final _CFStringGetCStringPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('fprintf'); - late final _fprintf = _fprintfPtr - .asFunction, ffi.Pointer)>(); + Boolean Function(CFStringRef, ffi.Pointer, CFIndex, + CFStringEncoding)>>('CFStringGetCString'); + late final _CFStringGetCString = _CFStringGetCStringPtr.asFunction< + int Function(CFStringRef, ffi.Pointer, int, int)>(); - int fputc( - int arg0, - ffi.Pointer arg1, + ConstStringPtr CFStringGetPascalStringPtr( + CFStringRef theString, + int encoding, ) { - return _fputc( - arg0, - arg1, + return _CFStringGetPascalStringPtr1( + theString, + encoding, ); } - late final _fputcPtr = - _lookup)>>( - 'fputc'); - late final _fputc = - _fputcPtr.asFunction)>(); + late final _CFStringGetPascalStringPtrPtr = _lookup< + ffi.NativeFunction< + ConstStringPtr Function( + CFStringRef, CFStringEncoding)>>('CFStringGetPascalStringPtr'); + late final _CFStringGetPascalStringPtr1 = _CFStringGetPascalStringPtrPtr + .asFunction(); - int fputs( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer CFStringGetCStringPtr( + CFStringRef theString, + int encoding, ) { - return _fputs( - arg0, - arg1, + return _CFStringGetCStringPtr1( + theString, + encoding, ); } - late final _fputsPtr = _lookup< + late final _CFStringGetCStringPtrPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('fputs'); - late final _fputs = _fputsPtr - .asFunction, ffi.Pointer)>(); + ffi.Pointer Function( + CFStringRef, CFStringEncoding)>>('CFStringGetCStringPtr'); + late final _CFStringGetCStringPtr1 = _CFStringGetCStringPtrPtr.asFunction< + ffi.Pointer Function(CFStringRef, int)>(); - int fread( - ffi.Pointer __ptr, - int __size, - int __nitems, - ffi.Pointer __stream, + ffi.Pointer CFStringGetCharactersPtr( + CFStringRef theString, ) { - return _fread( - __ptr, - __size, - __nitems, - __stream, + return _CFStringGetCharactersPtr1( + theString, ); } - late final _freadPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, ffi.Size, ffi.Size, - ffi.Pointer)>>('fread'); - late final _fread = _freadPtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer)>(); + late final _CFStringGetCharactersPtrPtr = + _lookup Function(CFStringRef)>>( + 'CFStringGetCharactersPtr'); + late final _CFStringGetCharactersPtr1 = _CFStringGetCharactersPtrPtr + .asFunction Function(CFStringRef)>(); - ffi.Pointer freopen( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + int CFStringGetBytes( + CFStringRef theString, + CFRange range, + int encoding, + int lossByte, + int isExternalRepresentation, + ffi.Pointer buffer, + int maxBufLen, + ffi.Pointer usedBufLen, ) { - return _freopen( - arg0, - arg1, - arg2, + return _CFStringGetBytes( + theString, + range, + encoding, + lossByte, + isExternalRepresentation, + buffer, + maxBufLen, + usedBufLen, ); } - late final _freopenPtr = _lookup< + late final _CFStringGetBytesPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('freopen'); - late final _freopen = _freopenPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + CFIndex Function( + CFStringRef, + CFRange, + CFStringEncoding, + UInt8, + Boolean, + ffi.Pointer, + CFIndex, + ffi.Pointer)>>('CFStringGetBytes'); + late final _CFStringGetBytes = _CFStringGetBytesPtr.asFunction< + int Function(CFStringRef, CFRange, int, int, int, ffi.Pointer, int, + ffi.Pointer)>(); - int fscanf( - ffi.Pointer arg0, - ffi.Pointer arg1, + CFStringRef CFStringCreateFromExternalRepresentation( + CFAllocatorRef alloc, + CFDataRef data, + int encoding, ) { - return _fscanf( - arg0, - arg1, + return _CFStringCreateFromExternalRepresentation( + alloc, + data, + encoding, ); } - late final _fscanfPtr = _lookup< + late final _CFStringCreateFromExternalRepresentationPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('fscanf'); - late final _fscanf = _fscanfPtr - .asFunction, ffi.Pointer)>(); + CFStringRef Function(CFAllocatorRef, CFDataRef, + CFStringEncoding)>>('CFStringCreateFromExternalRepresentation'); + late final _CFStringCreateFromExternalRepresentation = + _CFStringCreateFromExternalRepresentationPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFDataRef, int)>(); - int fseek( - ffi.Pointer arg0, - int arg1, - int arg2, + CFDataRef CFStringCreateExternalRepresentation( + CFAllocatorRef alloc, + CFStringRef theString, + int encoding, + int lossByte, ) { - return _fseek( - arg0, - arg1, - arg2, + return _CFStringCreateExternalRepresentation( + alloc, + theString, + encoding, + lossByte, ); } - late final _fseekPtr = _lookup< + late final _CFStringCreateExternalRepresentationPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Long, ffi.Int)>>('fseek'); - late final _fseek = - _fseekPtr.asFunction, int, int)>(); + CFDataRef Function(CFAllocatorRef, CFStringRef, CFStringEncoding, + UInt8)>>('CFStringCreateExternalRepresentation'); + late final _CFStringCreateExternalRepresentation = + _CFStringCreateExternalRepresentationPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFStringRef, int, int)>(); - int fsetpos( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFStringGetSmallestEncoding( + CFStringRef theString, ) { - return _fsetpos( - arg0, - arg1, + return _CFStringGetSmallestEncoding( + theString, ); } - late final _fsetposPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer)>>('fsetpos'); - late final _fsetpos = _fsetposPtr - .asFunction, ffi.Pointer)>(); + late final _CFStringGetSmallestEncodingPtr = + _lookup>( + 'CFStringGetSmallestEncoding'); + late final _CFStringGetSmallestEncoding = + _CFStringGetSmallestEncodingPtr.asFunction(); - int ftell( - ffi.Pointer arg0, + int CFStringGetFastestEncoding( + CFStringRef theString, ) { - return _ftell( - arg0, + return _CFStringGetFastestEncoding( + theString, ); } - late final _ftellPtr = - _lookup)>>( - 'ftell'); - late final _ftell = _ftellPtr.asFunction)>(); + late final _CFStringGetFastestEncodingPtr = + _lookup>( + 'CFStringGetFastestEncoding'); + late final _CFStringGetFastestEncoding = + _CFStringGetFastestEncodingPtr.asFunction(); - int fwrite( - ffi.Pointer __ptr, - int __size, - int __nitems, - ffi.Pointer __stream, - ) { - return _fwrite( - __ptr, - __size, - __nitems, - __stream, - ); + int CFStringGetSystemEncoding() { + return _CFStringGetSystemEncoding(); } - late final _fwritePtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, ffi.Size, ffi.Size, - ffi.Pointer)>>('fwrite'); - late final _fwrite = _fwritePtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer)>(); + late final _CFStringGetSystemEncodingPtr = + _lookup>( + 'CFStringGetSystemEncoding'); + late final _CFStringGetSystemEncoding = + _CFStringGetSystemEncodingPtr.asFunction(); - int getc( - ffi.Pointer arg0, + int CFStringGetMaximumSizeForEncoding( + int length, + int encoding, ) { - return _getc( - arg0, + return _CFStringGetMaximumSizeForEncoding( + length, + encoding, ); } - late final _getcPtr = - _lookup)>>('getc'); - late final _getc = _getcPtr.asFunction)>(); - - int getchar() { - return _getchar(); - } - - late final _getcharPtr = - _lookup>('getchar'); - late final _getchar = _getcharPtr.asFunction(); + late final _CFStringGetMaximumSizeForEncodingPtr = + _lookup>( + 'CFStringGetMaximumSizeForEncoding'); + late final _CFStringGetMaximumSizeForEncoding = + _CFStringGetMaximumSizeForEncodingPtr.asFunction< + int Function(int, int)>(); - ffi.Pointer gets( - ffi.Pointer arg0, + int CFStringGetFileSystemRepresentation( + CFStringRef string, + ffi.Pointer buffer, + int maxBufLen, ) { - return _gets( - arg0, + return _CFStringGetFileSystemRepresentation( + string, + buffer, + maxBufLen, ); } - late final _getsPtr = _lookup< + late final _CFStringGetFileSystemRepresentationPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('gets'); - late final _gets = _getsPtr - .asFunction Function(ffi.Pointer)>(); + Boolean Function(CFStringRef, ffi.Pointer, + CFIndex)>>('CFStringGetFileSystemRepresentation'); + late final _CFStringGetFileSystemRepresentation = + _CFStringGetFileSystemRepresentationPtr.asFunction< + int Function(CFStringRef, ffi.Pointer, int)>(); - void perror( - ffi.Pointer arg0, + int CFStringGetMaximumSizeOfFileSystemRepresentation( + CFStringRef string, ) { - return _perror( - arg0, + return _CFStringGetMaximumSizeOfFileSystemRepresentation( + string, ); } - late final _perrorPtr = - _lookup)>>( - 'perror'); - late final _perror = - _perrorPtr.asFunction)>(); + late final _CFStringGetMaximumSizeOfFileSystemRepresentationPtr = + _lookup>( + 'CFStringGetMaximumSizeOfFileSystemRepresentation'); + late final _CFStringGetMaximumSizeOfFileSystemRepresentation = + _CFStringGetMaximumSizeOfFileSystemRepresentationPtr.asFunction< + int Function(CFStringRef)>(); - int printf( - ffi.Pointer arg0, + CFStringRef CFStringCreateWithFileSystemRepresentation( + CFAllocatorRef alloc, + ffi.Pointer buffer, ) { - return _printf( - arg0, + return _CFStringCreateWithFileSystemRepresentation( + alloc, + buffer, ); } - late final _printfPtr = - _lookup)>>( - 'printf'); - late final _printf = - _printfPtr.asFunction)>(); + late final _CFStringCreateWithFileSystemRepresentationPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, ffi.Pointer)>>( + 'CFStringCreateWithFileSystemRepresentation'); + late final _CFStringCreateWithFileSystemRepresentation = + _CFStringCreateWithFileSystemRepresentationPtr.asFunction< + CFStringRef Function(CFAllocatorRef, ffi.Pointer)>(); - int putc( - int arg0, - ffi.Pointer arg1, + CFComparisonResult CFStringCompareWithOptionsAndLocale( + CFStringRef theString1, + CFStringRef theString2, + CFRange rangeToCompare, + CFStringCompareFlags compareOptions, + CFLocaleRef locale, ) { - return _putc( - arg0, - arg1, - ); + return CFComparisonResult.fromValue(_CFStringCompareWithOptionsAndLocale( + theString1, + theString2, + rangeToCompare, + compareOptions.value, + locale, + )); } - late final _putcPtr = - _lookup)>>( - 'putc'); - late final _putc = - _putcPtr.asFunction)>(); + late final _CFStringCompareWithOptionsAndLocalePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFStringRef, CFStringRef, CFRange, CFOptionFlags, + CFLocaleRef)>>('CFStringCompareWithOptionsAndLocale'); + late final _CFStringCompareWithOptionsAndLocale = + _CFStringCompareWithOptionsAndLocalePtr.asFunction< + int Function(CFStringRef, CFStringRef, CFRange, int, CFLocaleRef)>(); - int putchar( - int arg0, + CFComparisonResult CFStringCompareWithOptions( + CFStringRef theString1, + CFStringRef theString2, + CFRange rangeToCompare, + CFStringCompareFlags compareOptions, ) { - return _putchar( - arg0, - ); + return CFComparisonResult.fromValue(_CFStringCompareWithOptions( + theString1, + theString2, + rangeToCompare, + compareOptions.value, + )); } - late final _putcharPtr = - _lookup>('putchar'); - late final _putchar = _putcharPtr.asFunction(); + late final _CFStringCompareWithOptionsPtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFStringRef, CFStringRef, CFRange, + CFOptionFlags)>>('CFStringCompareWithOptions'); + late final _CFStringCompareWithOptions = _CFStringCompareWithOptionsPtr + .asFunction(); - int puts( - ffi.Pointer arg0, + CFComparisonResult CFStringCompare( + CFStringRef theString1, + CFStringRef theString2, + CFStringCompareFlags compareOptions, ) { - return _puts( - arg0, - ); + return CFComparisonResult.fromValue(_CFStringCompare( + theString1, + theString2, + compareOptions.value, + )); } - late final _putsPtr = - _lookup)>>( - 'puts'); - late final _puts = _putsPtr.asFunction)>(); + late final _CFStringComparePtr = _lookup< + ffi.NativeFunction< + CFIndex Function( + CFStringRef, CFStringRef, CFOptionFlags)>>('CFStringCompare'); + late final _CFStringCompare = _CFStringComparePtr.asFunction< + int Function(CFStringRef, CFStringRef, int)>(); - int remove( - ffi.Pointer arg0, + DartBoolean CFStringFindWithOptionsAndLocale( + CFStringRef theString, + CFStringRef stringToFind, + CFRange rangeToSearch, + CFStringCompareFlags searchOptions, + CFLocaleRef locale, + ffi.Pointer result, ) { - return _remove( - arg0, + return _CFStringFindWithOptionsAndLocale( + theString, + stringToFind, + rangeToSearch, + searchOptions.value, + locale, + result, ); } - late final _removePtr = - _lookup)>>( - 'remove'); - late final _remove = - _removePtr.asFunction)>(); + late final _CFStringFindWithOptionsAndLocalePtr = _lookup< + ffi.NativeFunction< + Boolean Function( + CFStringRef, + CFStringRef, + CFRange, + CFOptionFlags, + CFLocaleRef, + ffi.Pointer)>>('CFStringFindWithOptionsAndLocale'); + late final _CFStringFindWithOptionsAndLocale = + _CFStringFindWithOptionsAndLocalePtr.asFunction< + int Function(CFStringRef, CFStringRef, CFRange, int, CFLocaleRef, + ffi.Pointer)>(); - int rename( - ffi.Pointer __old, - ffi.Pointer __new, + DartBoolean CFStringFindWithOptions( + CFStringRef theString, + CFStringRef stringToFind, + CFRange rangeToSearch, + CFStringCompareFlags searchOptions, + ffi.Pointer result, ) { - return _rename( - __old, - __new, + return _CFStringFindWithOptions( + theString, + stringToFind, + rangeToSearch, + searchOptions.value, + result, ); } - late final _renamePtr = _lookup< + late final _CFStringFindWithOptionsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('rename'); - late final _rename = _renamePtr - .asFunction, ffi.Pointer)>(); + Boolean Function(CFStringRef, CFStringRef, CFRange, CFOptionFlags, + ffi.Pointer)>>('CFStringFindWithOptions'); + late final _CFStringFindWithOptions = _CFStringFindWithOptionsPtr.asFunction< + int Function( + CFStringRef, CFStringRef, CFRange, int, ffi.Pointer)>(); - void rewind( - ffi.Pointer arg0, + CFArrayRef CFStringCreateArrayWithFindResults( + CFAllocatorRef alloc, + CFStringRef theString, + CFStringRef stringToFind, + CFRange rangeToSearch, + CFStringCompareFlags compareOptions, ) { - return _rewind( - arg0, + return _CFStringCreateArrayWithFindResults( + alloc, + theString, + stringToFind, + rangeToSearch, + compareOptions.value, ); } - late final _rewindPtr = - _lookup)>>( - 'rewind'); - late final _rewind = - _rewindPtr.asFunction)>(); + late final _CFStringCreateArrayWithFindResultsPtr = _lookup< + ffi.NativeFunction< + CFArrayRef Function(CFAllocatorRef, CFStringRef, CFStringRef, CFRange, + CFOptionFlags)>>('CFStringCreateArrayWithFindResults'); + late final _CFStringCreateArrayWithFindResults = + _CFStringCreateArrayWithFindResultsPtr.asFunction< + CFArrayRef Function( + CFAllocatorRef, CFStringRef, CFStringRef, CFRange, int)>(); - int scanf( - ffi.Pointer arg0, + CFRange CFStringFind( + CFStringRef theString, + CFStringRef stringToFind, + CFStringCompareFlags compareOptions, ) { - return _scanf( - arg0, + return _CFStringFind( + theString, + stringToFind, + compareOptions.value, ); } - late final _scanfPtr = - _lookup)>>( - 'scanf'); - late final _scanf = - _scanfPtr.asFunction)>(); + late final _CFStringFindPtr = _lookup< + ffi.NativeFunction< + CFRange Function( + CFStringRef, CFStringRef, CFOptionFlags)>>('CFStringFind'); + late final _CFStringFind = _CFStringFindPtr.asFunction< + CFRange Function(CFStringRef, CFStringRef, int)>(); - void setbuf( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFStringHasPrefix( + CFStringRef theString, + CFStringRef prefix, ) { - return _setbuf( - arg0, - arg1, + return _CFStringHasPrefix( + theString, + prefix, ); } - late final _setbufPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer)>>('setbuf'); - late final _setbuf = _setbufPtr - .asFunction, ffi.Pointer)>(); + late final _CFStringHasPrefixPtr = + _lookup>( + 'CFStringHasPrefix'); + late final _CFStringHasPrefix = _CFStringHasPrefixPtr.asFunction< + int Function(CFStringRef, CFStringRef)>(); - int setvbuf( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - int arg3, + int CFStringHasSuffix( + CFStringRef theString, + CFStringRef suffix, ) { - return _setvbuf( - arg0, - arg1, - arg2, - arg3, + return _CFStringHasSuffix( + theString, + suffix, ); } - late final _setvbufPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, ffi.Int, - ffi.Size)>>('setvbuf'); - late final _setvbuf = _setvbufPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); + late final _CFStringHasSuffixPtr = + _lookup>( + 'CFStringHasSuffix'); + late final _CFStringHasSuffix = _CFStringHasSuffixPtr.asFunction< + int Function(CFStringRef, CFStringRef)>(); - int sprintf( - ffi.Pointer arg0, - ffi.Pointer arg1, + CFRange CFStringGetRangeOfComposedCharactersAtIndex( + CFStringRef theString, + int theIndex, ) { - return _sprintf( - arg0, - arg1, + return _CFStringGetRangeOfComposedCharactersAtIndex( + theString, + theIndex, ); } - late final _sprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('sprintf'); - late final _sprintf = _sprintfPtr - .asFunction, ffi.Pointer)>(); + late final _CFStringGetRangeOfComposedCharactersAtIndexPtr = + _lookup>( + 'CFStringGetRangeOfComposedCharactersAtIndex'); + late final _CFStringGetRangeOfComposedCharactersAtIndex = + _CFStringGetRangeOfComposedCharactersAtIndexPtr.asFunction< + CFRange Function(CFStringRef, int)>(); - int sscanf( - ffi.Pointer arg0, - ffi.Pointer arg1, + DartBoolean CFStringFindCharacterFromSet( + CFStringRef theString, + CFCharacterSetRef theSet, + CFRange rangeToSearch, + CFStringCompareFlags searchOptions, + ffi.Pointer result, ) { - return _sscanf( - arg0, - arg1, + return _CFStringFindCharacterFromSet( + theString, + theSet, + rangeToSearch, + searchOptions.value, + result, ); } - late final _sscanfPtr = _lookup< + late final _CFStringFindCharacterFromSetPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('sscanf'); - late final _sscanf = _sscanfPtr - .asFunction, ffi.Pointer)>(); - - ffi.Pointer tmpfile() { - return _tmpfile(); - } - - late final _tmpfilePtr = - _lookup Function()>>('tmpfile'); - late final _tmpfile = _tmpfilePtr.asFunction Function()>(); + Boolean Function( + CFStringRef, + CFCharacterSetRef, + CFRange, + CFOptionFlags, + ffi.Pointer)>>('CFStringFindCharacterFromSet'); + late final _CFStringFindCharacterFromSet = + _CFStringFindCharacterFromSetPtr.asFunction< + int Function(CFStringRef, CFCharacterSetRef, CFRange, int, + ffi.Pointer)>(); - ffi.Pointer tmpnam( - ffi.Pointer arg0, + void CFStringGetLineBounds( + CFStringRef theString, + CFRange range, + ffi.Pointer lineBeginIndex, + ffi.Pointer lineEndIndex, + ffi.Pointer contentsEndIndex, ) { - return _tmpnam( - arg0, + return _CFStringGetLineBounds( + theString, + range, + lineBeginIndex, + lineEndIndex, + contentsEndIndex, ); } - late final _tmpnamPtr = _lookup< + late final _CFStringGetLineBoundsPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('tmpnam'); - late final _tmpnam = _tmpnamPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Void Function( + CFStringRef, + CFRange, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('CFStringGetLineBounds'); + late final _CFStringGetLineBounds = _CFStringGetLineBoundsPtr.asFunction< + void Function(CFStringRef, CFRange, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - int ungetc( - int arg0, - ffi.Pointer arg1, + void CFStringGetParagraphBounds( + CFStringRef string, + CFRange range, + ffi.Pointer parBeginIndex, + ffi.Pointer parEndIndex, + ffi.Pointer contentsEndIndex, ) { - return _ungetc( - arg0, - arg1, + return _CFStringGetParagraphBounds( + string, + range, + parBeginIndex, + parEndIndex, + contentsEndIndex, ); } - late final _ungetcPtr = - _lookup)>>( - 'ungetc'); - late final _ungetc = - _ungetcPtr.asFunction)>(); + late final _CFStringGetParagraphBoundsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFStringRef, + CFRange, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('CFStringGetParagraphBounds'); + late final _CFStringGetParagraphBounds = + _CFStringGetParagraphBoundsPtr.asFunction< + void Function(CFStringRef, CFRange, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - int vfprintf( - ffi.Pointer arg0, - ffi.Pointer arg1, - va_list arg2, + int CFStringGetHyphenationLocationBeforeIndex( + CFStringRef string, + int location, + CFRange limitRange, + int options, + CFLocaleRef locale, + ffi.Pointer character, ) { - return _vfprintf( - arg0, - arg1, - arg2, + return _CFStringGetHyphenationLocationBeforeIndex( + string, + location, + limitRange, + options, + locale, + character, ); } - late final _vfprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, va_list)>>('vfprintf'); - late final _vfprintf = _vfprintfPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, va_list)>(); + late final _CFStringGetHyphenationLocationBeforeIndexPtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFStringRef, CFIndex, CFRange, CFOptionFlags, + CFLocaleRef, ffi.Pointer)>>( + 'CFStringGetHyphenationLocationBeforeIndex'); + late final _CFStringGetHyphenationLocationBeforeIndex = + _CFStringGetHyphenationLocationBeforeIndexPtr.asFunction< + int Function(CFStringRef, int, CFRange, int, CFLocaleRef, + ffi.Pointer)>(); - int vprintf( - ffi.Pointer arg0, - va_list arg1, + int CFStringIsHyphenationAvailableForLocale( + CFLocaleRef locale, ) { - return _vprintf( - arg0, - arg1, + return _CFStringIsHyphenationAvailableForLocale( + locale, ); } - late final _vprintfPtr = _lookup< - ffi.NativeFunction, va_list)>>( - 'vprintf'); - late final _vprintf = - _vprintfPtr.asFunction, va_list)>(); + late final _CFStringIsHyphenationAvailableForLocalePtr = + _lookup>( + 'CFStringIsHyphenationAvailableForLocale'); + late final _CFStringIsHyphenationAvailableForLocale = + _CFStringIsHyphenationAvailableForLocalePtr.asFunction< + int Function(CFLocaleRef)>(); - int vsprintf( - ffi.Pointer arg0, - ffi.Pointer arg1, - va_list arg2, + CFStringRef CFStringCreateByCombiningStrings( + CFAllocatorRef alloc, + CFArrayRef theArray, + CFStringRef separatorString, ) { - return _vsprintf( - arg0, - arg1, - arg2, + return _CFStringCreateByCombiningStrings( + alloc, + theArray, + separatorString, ); } - late final _vsprintfPtr = _lookup< + late final _CFStringCreateByCombiningStringsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - va_list)>>('vsprintf'); - late final _vsprintf = _vsprintfPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, va_list)>(); + CFStringRef Function(CFAllocatorRef, CFArrayRef, + CFStringRef)>>('CFStringCreateByCombiningStrings'); + late final _CFStringCreateByCombiningStrings = + _CFStringCreateByCombiningStringsPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFArrayRef, CFStringRef)>(); - ffi.Pointer ctermid( - ffi.Pointer arg0, + CFArrayRef CFStringCreateArrayBySeparatingStrings( + CFAllocatorRef alloc, + CFStringRef theString, + CFStringRef separatorString, ) { - return _ctermid( - arg0, + return _CFStringCreateArrayBySeparatingStrings( + alloc, + theString, + separatorString, ); } - late final _ctermidPtr = _lookup< + late final _CFStringCreateArrayBySeparatingStringsPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('ctermid'); - late final _ctermid = _ctermidPtr - .asFunction Function(ffi.Pointer)>(); + CFArrayRef Function(CFAllocatorRef, CFStringRef, + CFStringRef)>>('CFStringCreateArrayBySeparatingStrings'); + late final _CFStringCreateArrayBySeparatingStrings = + _CFStringCreateArrayBySeparatingStringsPtr.asFunction< + CFArrayRef Function(CFAllocatorRef, CFStringRef, CFStringRef)>(); - ffi.Pointer fdopen( - int arg0, - ffi.Pointer arg1, + int CFStringGetIntValue( + CFStringRef str, ) { - return _fdopen( - arg0, - arg1, + return _CFStringGetIntValue( + str, ); } - late final _fdopenPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, ffi.Pointer)>>('fdopen'); - late final _fdopen = _fdopenPtr - .asFunction Function(int, ffi.Pointer)>(); + late final _CFStringGetIntValuePtr = + _lookup>( + 'CFStringGetIntValue'); + late final _CFStringGetIntValue = + _CFStringGetIntValuePtr.asFunction(); - int fileno( - ffi.Pointer arg0, + double CFStringGetDoubleValue( + CFStringRef str, ) { - return _fileno( - arg0, + return _CFStringGetDoubleValue( + str, ); } - late final _filenoPtr = - _lookup)>>( - 'fileno'); - late final _fileno = _filenoPtr.asFunction)>(); + late final _CFStringGetDoubleValuePtr = + _lookup>( + 'CFStringGetDoubleValue'); + late final _CFStringGetDoubleValue = + _CFStringGetDoubleValuePtr.asFunction(); - int pclose( - ffi.Pointer arg0, + void CFStringAppend( + CFMutableStringRef theString, + CFStringRef appendedString, ) { - return _pclose( - arg0, + return _CFStringAppend( + theString, + appendedString, ); } - late final _pclosePtr = - _lookup)>>( - 'pclose'); - late final _pclose = _pclosePtr.asFunction)>(); + late final _CFStringAppendPtr = _lookup< + ffi + .NativeFunction>( + 'CFStringAppend'); + late final _CFStringAppend = _CFStringAppendPtr.asFunction< + void Function(CFMutableStringRef, CFStringRef)>(); - ffi.Pointer popen( - ffi.Pointer arg0, - ffi.Pointer arg1, + void CFStringAppendCharacters( + CFMutableStringRef theString, + ffi.Pointer chars, + int numChars, ) { - return _popen( - arg0, - arg1, + return _CFStringAppendCharacters( + theString, + chars, + numChars, ); } - late final _popenPtr = _lookup< + late final _CFStringAppendCharactersPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('popen'); - late final _popen = _popenPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function(CFMutableStringRef, ffi.Pointer, + CFIndex)>>('CFStringAppendCharacters'); + late final _CFStringAppendCharacters = + _CFStringAppendCharactersPtr.asFunction< + void Function(CFMutableStringRef, ffi.Pointer, int)>(); - int __srget( - ffi.Pointer arg0, + void CFStringAppendPascalString( + CFMutableStringRef theString, + ConstStr255Param pStr, + int encoding, ) { - return ___srget( - arg0, + return _CFStringAppendPascalString( + theString, + pStr, + encoding, ); } - late final ___srgetPtr = - _lookup)>>( - '__srget'); - late final ___srget = - ___srgetPtr.asFunction)>(); + late final _CFStringAppendPascalStringPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableStringRef, ConstStr255Param, + CFStringEncoding)>>('CFStringAppendPascalString'); + late final _CFStringAppendPascalString = _CFStringAppendPascalStringPtr + .asFunction(); - int __svfscanf( - ffi.Pointer arg0, - ffi.Pointer arg1, - va_list arg2, + void CFStringAppendCString( + CFMutableStringRef theString, + ffi.Pointer cStr, + int encoding, ) { - return ___svfscanf( - arg0, - arg1, - arg2, + return _CFStringAppendCString( + theString, + cStr, + encoding, ); } - late final ___svfscanfPtr = _lookup< + late final _CFStringAppendCStringPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - va_list)>>('__svfscanf'); - late final ___svfscanf = ___svfscanfPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, va_list)>(); + ffi.Void Function(CFMutableStringRef, ffi.Pointer, + CFStringEncoding)>>('CFStringAppendCString'); + late final _CFStringAppendCString = _CFStringAppendCStringPtr.asFunction< + void Function(CFMutableStringRef, ffi.Pointer, int)>(); - int __swbuf( - int arg0, - ffi.Pointer arg1, + void CFStringAppendFormat( + CFMutableStringRef theString, + CFDictionaryRef formatOptions, + CFStringRef format, ) { - return ___swbuf( - arg0, - arg1, + return _CFStringAppendFormat( + theString, + formatOptions, + format, ); } - late final ___swbufPtr = - _lookup)>>( - '__swbuf'); - late final ___swbuf = - ___swbufPtr.asFunction)>(); + late final _CFStringAppendFormatPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableStringRef, CFDictionaryRef, + CFStringRef)>>('CFStringAppendFormat'); + late final _CFStringAppendFormat = _CFStringAppendFormatPtr.asFunction< + void Function(CFMutableStringRef, CFDictionaryRef, CFStringRef)>(); - void flockfile( - ffi.Pointer arg0, + void CFStringAppendFormatAndArguments( + CFMutableStringRef theString, + CFDictionaryRef formatOptions, + CFStringRef format, + va_list arguments, ) { - return _flockfile( - arg0, + return _CFStringAppendFormatAndArguments( + theString, + formatOptions, + format, + arguments, ); } - late final _flockfilePtr = - _lookup)>>( - 'flockfile'); - late final _flockfile = - _flockfilePtr.asFunction)>(); + late final _CFStringAppendFormatAndArgumentsPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableStringRef, CFDictionaryRef, CFStringRef, + va_list)>>('CFStringAppendFormatAndArguments'); + late final _CFStringAppendFormatAndArguments = + _CFStringAppendFormatAndArgumentsPtr.asFunction< + void Function( + CFMutableStringRef, CFDictionaryRef, CFStringRef, va_list)>(); - int ftrylockfile( - ffi.Pointer arg0, + void CFStringInsert( + CFMutableStringRef str, + int idx, + CFStringRef insertedStr, ) { - return _ftrylockfile( - arg0, + return _CFStringInsert( + str, + idx, + insertedStr, ); } - late final _ftrylockfilePtr = - _lookup)>>( - 'ftrylockfile'); - late final _ftrylockfile = - _ftrylockfilePtr.asFunction)>(); + late final _CFStringInsertPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFMutableStringRef, CFIndex, CFStringRef)>>('CFStringInsert'); + late final _CFStringInsert = _CFStringInsertPtr.asFunction< + void Function(CFMutableStringRef, int, CFStringRef)>(); - void funlockfile( - ffi.Pointer arg0, + void CFStringDelete( + CFMutableStringRef theString, + CFRange range, ) { - return _funlockfile( - arg0, + return _CFStringDelete( + theString, + range, ); } - late final _funlockfilePtr = - _lookup)>>( - 'funlockfile'); - late final _funlockfile = - _funlockfilePtr.asFunction)>(); + late final _CFStringDeletePtr = _lookup< + ffi.NativeFunction>( + 'CFStringDelete'); + late final _CFStringDelete = _CFStringDeletePtr.asFunction< + void Function(CFMutableStringRef, CFRange)>(); - int getc_unlocked( - ffi.Pointer arg0, + void CFStringReplace( + CFMutableStringRef theString, + CFRange range, + CFStringRef replacement, ) { - return _getc_unlocked( - arg0, + return _CFStringReplace( + theString, + range, + replacement, ); } - late final _getc_unlockedPtr = - _lookup)>>( - 'getc_unlocked'); - late final _getc_unlocked = - _getc_unlockedPtr.asFunction)>(); - - int getchar_unlocked() { - return _getchar_unlocked(); - } - - late final _getchar_unlockedPtr = - _lookup>('getchar_unlocked'); - late final _getchar_unlocked = - _getchar_unlockedPtr.asFunction(); + late final _CFStringReplacePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFMutableStringRef, CFRange, CFStringRef)>>('CFStringReplace'); + late final _CFStringReplace = _CFStringReplacePtr.asFunction< + void Function(CFMutableStringRef, CFRange, CFStringRef)>(); - int putc_unlocked( - int arg0, - ffi.Pointer arg1, + void CFStringReplaceAll( + CFMutableStringRef theString, + CFStringRef replacement, ) { - return _putc_unlocked( - arg0, - arg1, + return _CFStringReplaceAll( + theString, + replacement, ); } - late final _putc_unlockedPtr = - _lookup)>>( - 'putc_unlocked'); - late final _putc_unlocked = - _putc_unlockedPtr.asFunction)>(); + late final _CFStringReplaceAllPtr = _lookup< + ffi + .NativeFunction>( + 'CFStringReplaceAll'); + late final _CFStringReplaceAll = _CFStringReplaceAllPtr.asFunction< + void Function(CFMutableStringRef, CFStringRef)>(); - int putchar_unlocked( - int arg0, + DartCFIndex CFStringFindAndReplace( + CFMutableStringRef theString, + CFStringRef stringToFind, + CFStringRef replacementString, + CFRange rangeToSearch, + CFStringCompareFlags compareOptions, ) { - return _putchar_unlocked( - arg0, + return _CFStringFindAndReplace( + theString, + stringToFind, + replacementString, + rangeToSearch, + compareOptions.value, ); } - late final _putchar_unlockedPtr = - _lookup>( - 'putchar_unlocked'); - late final _putchar_unlocked = - _putchar_unlockedPtr.asFunction(); + late final _CFStringFindAndReplacePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFMutableStringRef, CFStringRef, CFStringRef, + CFRange, CFOptionFlags)>>('CFStringFindAndReplace'); + late final _CFStringFindAndReplace = _CFStringFindAndReplacePtr.asFunction< + int Function( + CFMutableStringRef, CFStringRef, CFStringRef, CFRange, int)>(); - int getw( - ffi.Pointer arg0, + void CFStringSetExternalCharactersNoCopy( + CFMutableStringRef theString, + ffi.Pointer chars, + int length, + int capacity, ) { - return _getw( - arg0, + return _CFStringSetExternalCharactersNoCopy( + theString, + chars, + length, + capacity, ); } - late final _getwPtr = - _lookup)>>('getw'); - late final _getw = _getwPtr.asFunction)>(); + late final _CFStringSetExternalCharactersNoCopyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableStringRef, ffi.Pointer, CFIndex, + CFIndex)>>('CFStringSetExternalCharactersNoCopy'); + late final _CFStringSetExternalCharactersNoCopy = + _CFStringSetExternalCharactersNoCopyPtr.asFunction< + void Function(CFMutableStringRef, ffi.Pointer, int, int)>(); - int putw( - int arg0, - ffi.Pointer arg1, + void CFStringPad( + CFMutableStringRef theString, + CFStringRef padString, + int length, + int indexIntoPad, ) { - return _putw( - arg0, - arg1, + return _CFStringPad( + theString, + padString, + length, + indexIntoPad, ); } - late final _putwPtr = - _lookup)>>( - 'putw'); - late final _putw = - _putwPtr.asFunction)>(); + late final _CFStringPadPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableStringRef, CFStringRef, CFIndex, + CFIndex)>>('CFStringPad'); + late final _CFStringPad = _CFStringPadPtr.asFunction< + void Function(CFMutableStringRef, CFStringRef, int, int)>(); - ffi.Pointer tempnam( - ffi.Pointer __dir, - ffi.Pointer __prefix, + void CFStringTrim( + CFMutableStringRef theString, + CFStringRef trimString, ) { - return _tempnam( - __dir, - __prefix, + return _CFStringTrim( + theString, + trimString, ); } - late final _tempnamPtr = _lookup< + late final _CFStringTrimPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('tempnam'); - late final _tempnam = _tempnamPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + ffi.Void Function(CFMutableStringRef, CFStringRef)>>('CFStringTrim'); + late final _CFStringTrim = _CFStringTrimPtr.asFunction< + void Function(CFMutableStringRef, CFStringRef)>(); - int fseeko( - ffi.Pointer __stream, - int __offset, - int __whence, + void CFStringTrimWhitespace( + CFMutableStringRef theString, ) { - return _fseeko( - __stream, - __offset, - __whence, + return _CFStringTrimWhitespace( + theString, ); } - late final _fseekoPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, off_t, ffi.Int)>>('fseeko'); - late final _fseeko = - _fseekoPtr.asFunction, int, int)>(); + late final _CFStringTrimWhitespacePtr = + _lookup>( + 'CFStringTrimWhitespace'); + late final _CFStringTrimWhitespace = _CFStringTrimWhitespacePtr.asFunction< + void Function(CFMutableStringRef)>(); - int ftello( - ffi.Pointer __stream, + void CFStringLowercase( + CFMutableStringRef theString, + CFLocaleRef locale, ) { - return _ftello( - __stream, + return _CFStringLowercase( + theString, + locale, ); } - late final _ftelloPtr = - _lookup)>>('ftello'); - late final _ftello = _ftelloPtr.asFunction)>(); + late final _CFStringLowercasePtr = _lookup< + ffi + .NativeFunction>( + 'CFStringLowercase'); + late final _CFStringLowercase = _CFStringLowercasePtr.asFunction< + void Function(CFMutableStringRef, CFLocaleRef)>(); - int snprintf( - ffi.Pointer __str, - int __size, - ffi.Pointer __format, + void CFStringUppercase( + CFMutableStringRef theString, + CFLocaleRef locale, ) { - return _snprintf( - __str, - __size, - __format, + return _CFStringUppercase( + theString, + locale, ); } - late final _snprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, - ffi.Pointer)>>('snprintf'); - late final _snprintf = _snprintfPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); + late final _CFStringUppercasePtr = _lookup< + ffi + .NativeFunction>( + 'CFStringUppercase'); + late final _CFStringUppercase = _CFStringUppercasePtr.asFunction< + void Function(CFMutableStringRef, CFLocaleRef)>(); - int vfscanf( - ffi.Pointer __stream, - ffi.Pointer __format, - va_list arg2, + void CFStringCapitalize( + CFMutableStringRef theString, + CFLocaleRef locale, ) { - return _vfscanf( - __stream, - __format, - arg2, + return _CFStringCapitalize( + theString, + locale, ); } - late final _vfscanfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, va_list)>>('vfscanf'); - late final _vfscanf = _vfscanfPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, va_list)>(); + late final _CFStringCapitalizePtr = _lookup< + ffi + .NativeFunction>( + 'CFStringCapitalize'); + late final _CFStringCapitalize = _CFStringCapitalizePtr.asFunction< + void Function(CFMutableStringRef, CFLocaleRef)>(); - int vscanf( - ffi.Pointer __format, - va_list arg1, + void CFStringNormalize( + CFMutableStringRef theString, + CFStringNormalizationForm theForm, ) { - return _vscanf( - __format, - arg1, + return _CFStringNormalize( + theString, + theForm.value, ); } - late final _vscanfPtr = _lookup< - ffi.NativeFunction, va_list)>>( - 'vscanf'); - late final _vscanf = - _vscanfPtr.asFunction, va_list)>(); + late final _CFStringNormalizePtr = _lookup< + ffi.NativeFunction>( + 'CFStringNormalize'); + late final _CFStringNormalize = _CFStringNormalizePtr.asFunction< + void Function(CFMutableStringRef, int)>(); - int vsnprintf( - ffi.Pointer __str, - int __size, - ffi.Pointer __format, - va_list arg3, + void CFStringFold( + CFMutableStringRef theString, + CFStringCompareFlags theFlags, + CFLocaleRef theLocale, ) { - return _vsnprintf( - __str, - __size, - __format, - arg3, + return _CFStringFold( + theString, + theFlags.value, + theLocale, ); } - late final _vsnprintfPtr = _lookup< + late final _CFStringFoldPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, - ffi.Pointer, va_list)>>('vsnprintf'); - late final _vsnprintf = _vsnprintfPtr.asFunction< - int Function( - ffi.Pointer, int, ffi.Pointer, va_list)>(); + ffi.Void Function( + CFMutableStringRef, CFOptionFlags, CFLocaleRef)>>('CFStringFold'); + late final _CFStringFold = _CFStringFoldPtr.asFunction< + void Function(CFMutableStringRef, int, CFLocaleRef)>(); - int vsscanf( - ffi.Pointer __str, - ffi.Pointer __format, - va_list arg2, + int CFStringTransform( + CFMutableStringRef string, + ffi.Pointer range, + CFStringRef transform, + int reverse, ) { - return _vsscanf( - __str, - __format, - arg2, + return _CFStringTransform( + string, + range, + transform, + reverse, ); } - late final _vsscanfPtr = _lookup< + late final _CFStringTransformPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - va_list)>>('vsscanf'); - late final _vsscanf = _vsscanfPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, va_list)>(); - - int dprintf( - int arg0, - ffi.Pointer arg1, - ) { - return _dprintf( - arg0, - arg1, - ); - } + Boolean Function(CFMutableStringRef, ffi.Pointer, + CFStringRef, Boolean)>>('CFStringTransform'); + late final _CFStringTransform = _CFStringTransformPtr.asFunction< + int Function( + CFMutableStringRef, ffi.Pointer, CFStringRef, int)>(); - late final _dprintfPtr = _lookup< - ffi.NativeFunction)>>( - 'dprintf'); - late final _dprintf = - _dprintfPtr.asFunction)>(); + late final ffi.Pointer _kCFStringTransformStripCombiningMarks = + _lookup('kCFStringTransformStripCombiningMarks'); - int vdprintf( - int arg0, - ffi.Pointer arg1, - va_list arg2, - ) { - return _vdprintf( - arg0, - arg1, - arg2, - ); - } + CFStringRef get kCFStringTransformStripCombiningMarks => + _kCFStringTransformStripCombiningMarks.value; - late final _vdprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, va_list)>>('vdprintf'); - late final _vdprintf = _vdprintfPtr - .asFunction, va_list)>(); + late final ffi.Pointer _kCFStringTransformToLatin = + _lookup('kCFStringTransformToLatin'); - int getdelim( - ffi.Pointer> __linep, - ffi.Pointer __linecapp, - int __delimiter, - ffi.Pointer __stream, - ) { - return _getdelim( - __linep, - __linecapp, - __delimiter, - __stream, - ); - } + CFStringRef get kCFStringTransformToLatin => _kCFStringTransformToLatin.value; - late final _getdelimPtr = _lookup< - ffi.NativeFunction< - ssize_t Function(ffi.Pointer>, - ffi.Pointer, ffi.Int, ffi.Pointer)>>('getdelim'); - late final _getdelim = _getdelimPtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer, - int, ffi.Pointer)>(); + late final ffi.Pointer _kCFStringTransformFullwidthHalfwidth = + _lookup('kCFStringTransformFullwidthHalfwidth'); - int getline( - ffi.Pointer> __linep, - ffi.Pointer __linecapp, - ffi.Pointer __stream, - ) { - return _getline( - __linep, - __linecapp, - __stream, - ); - } + CFStringRef get kCFStringTransformFullwidthHalfwidth => + _kCFStringTransformFullwidthHalfwidth.value; - late final _getlinePtr = _lookup< - ffi.NativeFunction< - ssize_t Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>>('getline'); - late final _getline = _getlinePtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>(); + late final ffi.Pointer _kCFStringTransformLatinKatakana = + _lookup('kCFStringTransformLatinKatakana'); - ffi.Pointer fmemopen( - ffi.Pointer __buf, - int __size, - ffi.Pointer __mode, - ) { - return _fmemopen( - __buf, - __size, - __mode, - ); - } + CFStringRef get kCFStringTransformLatinKatakana => + _kCFStringTransformLatinKatakana.value; - late final _fmemopenPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Size, - ffi.Pointer)>>('fmemopen'); - late final _fmemopen = _fmemopenPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer)>(); + late final ffi.Pointer _kCFStringTransformLatinHiragana = + _lookup('kCFStringTransformLatinHiragana'); - ffi.Pointer open_memstream( - ffi.Pointer> __bufp, - ffi.Pointer __sizep, - ) { - return _open_memstream( - __bufp, - __sizep, - ); - } + CFStringRef get kCFStringTransformLatinHiragana => + _kCFStringTransformLatinHiragana.value; - late final _open_memstreamPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer>, - ffi.Pointer)>>('open_memstream'); - late final _open_memstream = _open_memstreamPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer>, ffi.Pointer)>(); + late final ffi.Pointer _kCFStringTransformHiraganaKatakana = + _lookup('kCFStringTransformHiraganaKatakana'); - late final ffi.Pointer _sys_nerr = _lookup('sys_nerr'); + CFStringRef get kCFStringTransformHiraganaKatakana => + _kCFStringTransformHiraganaKatakana.value; - int get sys_nerr => _sys_nerr.value; + late final ffi.Pointer _kCFStringTransformMandarinLatin = + _lookup('kCFStringTransformMandarinLatin'); - late final ffi.Pointer>> _sys_errlist = - _lookup>>('sys_errlist'); + CFStringRef get kCFStringTransformMandarinLatin => + _kCFStringTransformMandarinLatin.value; - ffi.Pointer> get sys_errlist => _sys_errlist.value; + late final ffi.Pointer _kCFStringTransformLatinHangul = + _lookup('kCFStringTransformLatinHangul'); - set sys_errlist(ffi.Pointer> value) => - _sys_errlist.value = value; + CFStringRef get kCFStringTransformLatinHangul => + _kCFStringTransformLatinHangul.value; - int asprintf( - ffi.Pointer> arg0, - ffi.Pointer arg1, - ) { - return _asprintf( - arg0, - arg1, - ); - } + late final ffi.Pointer _kCFStringTransformLatinArabic = + _lookup('kCFStringTransformLatinArabic'); - late final _asprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer)>>('asprintf'); - late final _asprintf = _asprintfPtr.asFunction< - int Function( - ffi.Pointer>, ffi.Pointer)>(); + CFStringRef get kCFStringTransformLatinArabic => + _kCFStringTransformLatinArabic.value; - ffi.Pointer ctermid_r( - ffi.Pointer arg0, - ) { - return _ctermid_r( - arg0, - ); - } + late final ffi.Pointer _kCFStringTransformLatinHebrew = + _lookup('kCFStringTransformLatinHebrew'); - late final _ctermid_rPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('ctermid_r'); - late final _ctermid_r = _ctermid_rPtr - .asFunction Function(ffi.Pointer)>(); + CFStringRef get kCFStringTransformLatinHebrew => + _kCFStringTransformLatinHebrew.value; - ffi.Pointer fgetln( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _fgetln( - arg0, - arg1, - ); - } + late final ffi.Pointer _kCFStringTransformLatinThai = + _lookup('kCFStringTransformLatinThai'); - late final _fgetlnPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('fgetln'); - late final _fgetln = _fgetlnPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + CFStringRef get kCFStringTransformLatinThai => + _kCFStringTransformLatinThai.value; - ffi.Pointer fmtcheck( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _fmtcheck( - arg0, - arg1, - ); - } + late final ffi.Pointer _kCFStringTransformLatinCyrillic = + _lookup('kCFStringTransformLatinCyrillic'); - late final _fmtcheckPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('fmtcheck'); - late final _fmtcheck = _fmtcheckPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + CFStringRef get kCFStringTransformLatinCyrillic => + _kCFStringTransformLatinCyrillic.value; - int fpurge( - ffi.Pointer arg0, + late final ffi.Pointer _kCFStringTransformLatinGreek = + _lookup('kCFStringTransformLatinGreek'); + + CFStringRef get kCFStringTransformLatinGreek => + _kCFStringTransformLatinGreek.value; + + late final ffi.Pointer _kCFStringTransformToXMLHex = + _lookup('kCFStringTransformToXMLHex'); + + CFStringRef get kCFStringTransformToXMLHex => + _kCFStringTransformToXMLHex.value; + + late final ffi.Pointer _kCFStringTransformToUnicodeName = + _lookup('kCFStringTransformToUnicodeName'); + + CFStringRef get kCFStringTransformToUnicodeName => + _kCFStringTransformToUnicodeName.value; + + late final ffi.Pointer _kCFStringTransformStripDiacritics = + _lookup('kCFStringTransformStripDiacritics'); + + CFStringRef get kCFStringTransformStripDiacritics => + _kCFStringTransformStripDiacritics.value; + + int CFStringIsEncodingAvailable( + int encoding, ) { - return _fpurge( - arg0, + return _CFStringIsEncodingAvailable( + encoding, ); } - late final _fpurgePtr = - _lookup)>>( - 'fpurge'); - late final _fpurge = _fpurgePtr.asFunction)>(); + late final _CFStringIsEncodingAvailablePtr = + _lookup>( + 'CFStringIsEncodingAvailable'); + late final _CFStringIsEncodingAvailable = + _CFStringIsEncodingAvailablePtr.asFunction(); - void setbuffer( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, - ) { - return _setbuffer( - arg0, - arg1, - arg2, - ); + ffi.Pointer CFStringGetListOfAvailableEncodings() { + return _CFStringGetListOfAvailableEncodings(); } - late final _setbufferPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>>('setbuffer'); - late final _setbuffer = _setbufferPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _CFStringGetListOfAvailableEncodingsPtr = + _lookup Function()>>( + 'CFStringGetListOfAvailableEncodings'); + late final _CFStringGetListOfAvailableEncodings = + _CFStringGetListOfAvailableEncodingsPtr.asFunction< + ffi.Pointer Function()>(); - int setlinebuf( - ffi.Pointer arg0, + CFStringRef CFStringGetNameOfEncoding( + int encoding, ) { - return _setlinebuf( - arg0, + return _CFStringGetNameOfEncoding( + encoding, ); } - late final _setlinebufPtr = - _lookup)>>( - 'setlinebuf'); - late final _setlinebuf = - _setlinebufPtr.asFunction)>(); + late final _CFStringGetNameOfEncodingPtr = + _lookup>( + 'CFStringGetNameOfEncoding'); + late final _CFStringGetNameOfEncoding = + _CFStringGetNameOfEncodingPtr.asFunction(); - int vasprintf( - ffi.Pointer> arg0, - ffi.Pointer arg1, - va_list arg2, + int CFStringConvertEncodingToNSStringEncoding( + int encoding, ) { - return _vasprintf( - arg0, - arg1, - arg2, + return _CFStringConvertEncodingToNSStringEncoding( + encoding, ); } - late final _vasprintfPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer>, - ffi.Pointer, va_list)>>('vasprintf'); - late final _vasprintf = _vasprintfPtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer, - va_list)>(); + late final _CFStringConvertEncodingToNSStringEncodingPtr = + _lookup>( + 'CFStringConvertEncodingToNSStringEncoding'); + late final _CFStringConvertEncodingToNSStringEncoding = + _CFStringConvertEncodingToNSStringEncodingPtr.asFunction< + int Function(int)>(); - ffi.Pointer funopen( - ffi.Pointer arg0, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> - arg1, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> - arg2, - ffi.Pointer< - ffi.NativeFunction< - fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>> - arg3, - ffi.Pointer)>> - arg4, + int CFStringConvertNSStringEncodingToEncoding( + int encoding, ) { - return _funopen( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFStringConvertNSStringEncodingToEncoding( + encoding, ); } - late final _funopenPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer, ffi.Int)>>, - ffi.Pointer< - ffi.NativeFunction< - fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer)>>)>>('funopen'); - late final _funopen = _funopenPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>>, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>>, - ffi.Pointer< - ffi.NativeFunction< - fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>>, - ffi.Pointer< - ffi.NativeFunction)>>)>(); + late final _CFStringConvertNSStringEncodingToEncodingPtr = + _lookup>( + 'CFStringConvertNSStringEncodingToEncoding'); + late final _CFStringConvertNSStringEncodingToEncoding = + _CFStringConvertNSStringEncodingToEncodingPtr.asFunction< + int Function(int)>(); - int __sprintf_chk( - ffi.Pointer arg0, - int arg1, - int arg2, - ffi.Pointer arg3, + int CFStringConvertEncodingToWindowsCodepage( + int encoding, ) { - return ___sprintf_chk( - arg0, - arg1, - arg2, - arg3, + return _CFStringConvertEncodingToWindowsCodepage( + encoding, ); } - late final ___sprintf_chkPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Size, - ffi.Pointer)>>('__sprintf_chk'); - late final ___sprintf_chk = ___sprintf_chkPtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer)>(); + late final _CFStringConvertEncodingToWindowsCodepagePtr = + _lookup>( + 'CFStringConvertEncodingToWindowsCodepage'); + late final _CFStringConvertEncodingToWindowsCodepage = + _CFStringConvertEncodingToWindowsCodepagePtr.asFunction< + int Function(int)>(); - int __snprintf_chk( - ffi.Pointer arg0, - int arg1, - int arg2, - int arg3, - ffi.Pointer arg4, + int CFStringConvertWindowsCodepageToEncoding( + int codepage, ) { - return ___snprintf_chk( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFStringConvertWindowsCodepageToEncoding( + codepage, ); } - late final ___snprintf_chkPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, ffi.Int, ffi.Size, - ffi.Pointer)>>('__snprintf_chk'); - late final ___snprintf_chk = ___snprintf_chkPtr.asFunction< - int Function( - ffi.Pointer, int, int, int, ffi.Pointer)>(); + late final _CFStringConvertWindowsCodepageToEncodingPtr = + _lookup>( + 'CFStringConvertWindowsCodepageToEncoding'); + late final _CFStringConvertWindowsCodepageToEncoding = + _CFStringConvertWindowsCodepageToEncodingPtr.asFunction< + int Function(int)>(); - int __vsprintf_chk( - ffi.Pointer arg0, - int arg1, - int arg2, - ffi.Pointer arg3, - va_list arg4, + int CFStringConvertIANACharSetNameToEncoding( + CFStringRef theString, ) { - return ___vsprintf_chk( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFStringConvertIANACharSetNameToEncoding( + theString, ); } - late final ___vsprintf_chkPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Size, - ffi.Pointer, va_list)>>('__vsprintf_chk'); - late final ___vsprintf_chk = ___vsprintf_chkPtr.asFunction< - int Function( - ffi.Pointer, int, int, ffi.Pointer, va_list)>(); + late final _CFStringConvertIANACharSetNameToEncodingPtr = + _lookup>( + 'CFStringConvertIANACharSetNameToEncoding'); + late final _CFStringConvertIANACharSetNameToEncoding = + _CFStringConvertIANACharSetNameToEncodingPtr.asFunction< + int Function(CFStringRef)>(); - int __vsnprintf_chk( - ffi.Pointer arg0, - int arg1, - int arg2, - int arg3, - ffi.Pointer arg4, - va_list arg5, + CFStringRef CFStringConvertEncodingToIANACharSetName( + int encoding, ) { - return ___vsnprintf_chk( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, + return _CFStringConvertEncodingToIANACharSetName( + encoding, ); } - late final ___vsnprintf_chkPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, ffi.Int, ffi.Size, - ffi.Pointer, va_list)>>('__vsnprintf_chk'); - late final ___vsnprintf_chk = ___vsnprintf_chkPtr.asFunction< - int Function(ffi.Pointer, int, int, int, ffi.Pointer, - va_list)>(); + late final _CFStringConvertEncodingToIANACharSetNamePtr = + _lookup>( + 'CFStringConvertEncodingToIANACharSetName'); + late final _CFStringConvertEncodingToIANACharSetName = + _CFStringConvertEncodingToIANACharSetNamePtr.asFunction< + CFStringRef Function(int)>(); - ffi.Pointer memchr( - ffi.Pointer __s, - int __c, - int __n, + int CFStringGetMostCompatibleMacStringEncoding( + int encoding, ) { - return _memchr( - __s, - __c, - __n, + return _CFStringGetMostCompatibleMacStringEncoding( + encoding, ); } - late final _memchrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int, ffi.Size)>>('memchr'); - late final _memchr = _memchrPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + late final _CFStringGetMostCompatibleMacStringEncodingPtr = + _lookup>( + 'CFStringGetMostCompatibleMacStringEncoding'); + late final _CFStringGetMostCompatibleMacStringEncoding = + _CFStringGetMostCompatibleMacStringEncodingPtr.asFunction< + int Function(int)>(); - int memcmp( - ffi.Pointer __s1, - ffi.Pointer __s2, - int __n, + void CFShow( + CFTypeRef obj, ) { - return _memcmp( - __s1, - __s2, - __n, + return _CFShow( + obj, ); } - late final _memcmpPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('memcmp'); - late final _memcmp = _memcmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _CFShowPtr = + _lookup>('CFShow'); + late final _CFShow = _CFShowPtr.asFunction(); - ffi.Pointer memcpy( - ffi.Pointer __dst, - ffi.Pointer __src, - int __n, + void CFShowStr( + CFStringRef str, ) { - return _memcpy( - __dst, - __src, - __n, + return _CFShowStr( + str, ); } - late final _memcpyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('memcpy'); - late final _memcpy = _memcpyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _CFShowStrPtr = + _lookup>('CFShowStr'); + late final _CFShowStr = + _CFShowStrPtr.asFunction(); - ffi.Pointer memmove( - ffi.Pointer __dst, - ffi.Pointer __src, - int __len, + CFStringRef __CFStringMakeConstantString( + ffi.Pointer cStr, ) { - return _memmove( - __dst, - __src, - __len, + return ___CFStringMakeConstantString( + cStr, ); } - late final _memmovePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('memmove'); - late final _memmove = _memmovePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final ___CFStringMakeConstantStringPtr = + _lookup)>>( + '__CFStringMakeConstantString'); + late final ___CFStringMakeConstantString = ___CFStringMakeConstantStringPtr + .asFunction)>(); - ffi.Pointer memset( - ffi.Pointer __b, - int __c, - int __len, - ) { - return _memset( - __b, - __c, - __len, - ); + int CFTimeZoneGetTypeID() { + return _CFTimeZoneGetTypeID(); } - late final _memsetPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int, ffi.Size)>>('memset'); - late final _memset = _memsetPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + late final _CFTimeZoneGetTypeIDPtr = + _lookup>('CFTimeZoneGetTypeID'); + late final _CFTimeZoneGetTypeID = + _CFTimeZoneGetTypeIDPtr.asFunction(); - ffi.Pointer strcat( - ffi.Pointer __s1, - ffi.Pointer __s2, - ) { - return _strcat( - __s1, - __s2, - ); + CFTimeZoneRef CFTimeZoneCopySystem() { + return _CFTimeZoneCopySystem(); } - late final _strcatPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('strcat'); - late final _strcat = _strcatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFTimeZoneCopySystemPtr = + _lookup>( + 'CFTimeZoneCopySystem'); + late final _CFTimeZoneCopySystem = + _CFTimeZoneCopySystemPtr.asFunction(); - ffi.Pointer strchr( - ffi.Pointer __s, - int __c, - ) { - return _strchr( - __s, - __c, - ); + void CFTimeZoneResetSystem() { + return _CFTimeZoneResetSystem(); } - late final _strchrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('strchr'); - late final _strchr = _strchrPtr - .asFunction Function(ffi.Pointer, int)>(); + late final _CFTimeZoneResetSystemPtr = + _lookup>('CFTimeZoneResetSystem'); + late final _CFTimeZoneResetSystem = + _CFTimeZoneResetSystemPtr.asFunction(); - int strcmp( - ffi.Pointer __s1, - ffi.Pointer __s2, - ) { - return _strcmp( - __s1, - __s2, - ); + CFTimeZoneRef CFTimeZoneCopyDefault() { + return _CFTimeZoneCopyDefault(); } - late final _strcmpPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('strcmp'); - late final _strcmp = _strcmpPtr - .asFunction, ffi.Pointer)>(); + late final _CFTimeZoneCopyDefaultPtr = + _lookup>( + 'CFTimeZoneCopyDefault'); + late final _CFTimeZoneCopyDefault = + _CFTimeZoneCopyDefaultPtr.asFunction(); - int strcoll( - ffi.Pointer __s1, - ffi.Pointer __s2, + void CFTimeZoneSetDefault( + CFTimeZoneRef tz, ) { - return _strcoll( - __s1, - __s2, + return _CFTimeZoneSetDefault( + tz, ); } - late final _strcollPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('strcoll'); - late final _strcoll = _strcollPtr - .asFunction, ffi.Pointer)>(); + late final _CFTimeZoneSetDefaultPtr = + _lookup>( + 'CFTimeZoneSetDefault'); + late final _CFTimeZoneSetDefault = + _CFTimeZoneSetDefaultPtr.asFunction(); - ffi.Pointer strcpy( - ffi.Pointer __dst, - ffi.Pointer __src, - ) { - return _strcpy( - __dst, - __src, - ); + CFArrayRef CFTimeZoneCopyKnownNames() { + return _CFTimeZoneCopyKnownNames(); } - late final _strcpyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('strcpy'); - late final _strcpy = _strcpyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFTimeZoneCopyKnownNamesPtr = + _lookup>( + 'CFTimeZoneCopyKnownNames'); + late final _CFTimeZoneCopyKnownNames = + _CFTimeZoneCopyKnownNamesPtr.asFunction(); - int strcspn( - ffi.Pointer __s, - ffi.Pointer __charset, - ) { - return _strcspn( - __s, - __charset, - ); + CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary() { + return _CFTimeZoneCopyAbbreviationDictionary(); } - late final _strcspnPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, ffi.Pointer)>>('strcspn'); - late final _strcspn = _strcspnPtr - .asFunction, ffi.Pointer)>(); + late final _CFTimeZoneCopyAbbreviationDictionaryPtr = + _lookup>( + 'CFTimeZoneCopyAbbreviationDictionary'); + late final _CFTimeZoneCopyAbbreviationDictionary = + _CFTimeZoneCopyAbbreviationDictionaryPtr.asFunction< + CFDictionaryRef Function()>(); - ffi.Pointer strerror( - int __errnum, + void CFTimeZoneSetAbbreviationDictionary( + CFDictionaryRef dict, ) { - return _strerror( - __errnum, + return _CFTimeZoneSetAbbreviationDictionary( + dict, ); } - late final _strerrorPtr = - _lookup Function(ffi.Int)>>( - 'strerror'); - late final _strerror = - _strerrorPtr.asFunction Function(int)>(); + late final _CFTimeZoneSetAbbreviationDictionaryPtr = + _lookup>( + 'CFTimeZoneSetAbbreviationDictionary'); + late final _CFTimeZoneSetAbbreviationDictionary = + _CFTimeZoneSetAbbreviationDictionaryPtr.asFunction< + void Function(CFDictionaryRef)>(); - int strlen( - ffi.Pointer __s, + CFTimeZoneRef CFTimeZoneCreate( + CFAllocatorRef allocator, + CFStringRef name, + CFDataRef data, ) { - return _strlen( - __s, + return _CFTimeZoneCreate( + allocator, + name, + data, ); } - late final _strlenPtr = _lookup< - ffi.NativeFunction)>>( - 'strlen'); - late final _strlen = - _strlenPtr.asFunction)>(); + late final _CFTimeZoneCreatePtr = _lookup< + ffi.NativeFunction< + CFTimeZoneRef Function( + CFAllocatorRef, CFStringRef, CFDataRef)>>('CFTimeZoneCreate'); + late final _CFTimeZoneCreate = _CFTimeZoneCreatePtr.asFunction< + CFTimeZoneRef Function(CFAllocatorRef, CFStringRef, CFDataRef)>(); - ffi.Pointer strncat( - ffi.Pointer __s1, - ffi.Pointer __s2, - int __n, + CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT( + CFAllocatorRef allocator, + double ti, ) { - return _strncat( - __s1, - __s2, - __n, + return _CFTimeZoneCreateWithTimeIntervalFromGMT( + allocator, + ti, ); } - late final _strncatPtr = _lookup< + late final _CFTimeZoneCreateWithTimeIntervalFromGMTPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('strncat'); - late final _strncat = _strncatPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + CFTimeZoneRef Function(CFAllocatorRef, + CFTimeInterval)>>('CFTimeZoneCreateWithTimeIntervalFromGMT'); + late final _CFTimeZoneCreateWithTimeIntervalFromGMT = + _CFTimeZoneCreateWithTimeIntervalFromGMTPtr.asFunction< + CFTimeZoneRef Function(CFAllocatorRef, double)>(); - int strncmp( - ffi.Pointer __s1, - ffi.Pointer __s2, - int __n, + CFTimeZoneRef CFTimeZoneCreateWithName( + CFAllocatorRef allocator, + CFStringRef name, + int tryAbbrev, ) { - return _strncmp( - __s1, - __s2, - __n, + return _CFTimeZoneCreateWithName( + allocator, + name, + tryAbbrev, ); } - late final _strncmpPtr = _lookup< + late final _CFTimeZoneCreateWithNamePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('strncmp'); - late final _strncmp = _strncmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + CFTimeZoneRef Function(CFAllocatorRef, CFStringRef, + Boolean)>>('CFTimeZoneCreateWithName'); + late final _CFTimeZoneCreateWithName = _CFTimeZoneCreateWithNamePtr + .asFunction(); - ffi.Pointer strncpy( - ffi.Pointer __dst, - ffi.Pointer __src, - int __n, + CFStringRef CFTimeZoneGetName( + CFTimeZoneRef tz, ) { - return _strncpy( - __dst, - __src, - __n, + return _CFTimeZoneGetName( + tz, ); } - late final _strncpyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('strncpy'); - late final _strncpy = _strncpyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _CFTimeZoneGetNamePtr = + _lookup>( + 'CFTimeZoneGetName'); + late final _CFTimeZoneGetName = + _CFTimeZoneGetNamePtr.asFunction(); - ffi.Pointer strpbrk( - ffi.Pointer __s, - ffi.Pointer __charset, + CFDataRef CFTimeZoneGetData( + CFTimeZoneRef tz, ) { - return _strpbrk( - __s, - __charset, + return _CFTimeZoneGetData( + tz, ); } - late final _strpbrkPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('strpbrk'); - late final _strpbrk = _strpbrkPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFTimeZoneGetDataPtr = + _lookup>( + 'CFTimeZoneGetData'); + late final _CFTimeZoneGetData = + _CFTimeZoneGetDataPtr.asFunction(); - ffi.Pointer strrchr( - ffi.Pointer __s, - int __c, + double CFTimeZoneGetSecondsFromGMT( + CFTimeZoneRef tz, + double at, ) { - return _strrchr( - __s, - __c, + return _CFTimeZoneGetSecondsFromGMT( + tz, + at, ); } - late final _strrchrPtr = _lookup< + late final _CFTimeZoneGetSecondsFromGMTPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('strrchr'); - late final _strrchr = _strrchrPtr - .asFunction Function(ffi.Pointer, int)>(); + CFTimeInterval Function( + CFTimeZoneRef, CFAbsoluteTime)>>('CFTimeZoneGetSecondsFromGMT'); + late final _CFTimeZoneGetSecondsFromGMT = _CFTimeZoneGetSecondsFromGMTPtr + .asFunction(); - int strspn( - ffi.Pointer __s, - ffi.Pointer __charset, + CFStringRef CFTimeZoneCopyAbbreviation( + CFTimeZoneRef tz, + double at, ) { - return _strspn( - __s, - __charset, + return _CFTimeZoneCopyAbbreviation( + tz, + at, ); } - late final _strspnPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, ffi.Pointer)>>('strspn'); - late final _strspn = _strspnPtr - .asFunction, ffi.Pointer)>(); + late final _CFTimeZoneCopyAbbreviationPtr = _lookup< + ffi + .NativeFunction>( + 'CFTimeZoneCopyAbbreviation'); + late final _CFTimeZoneCopyAbbreviation = _CFTimeZoneCopyAbbreviationPtr + .asFunction(); - ffi.Pointer strstr( - ffi.Pointer __big, - ffi.Pointer __little, + int CFTimeZoneIsDaylightSavingTime( + CFTimeZoneRef tz, + double at, ) { - return _strstr( - __big, - __little, + return _CFTimeZoneIsDaylightSavingTime( + tz, + at, ); } - late final _strstrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('strstr'); - late final _strstr = _strstrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFTimeZoneIsDaylightSavingTimePtr = _lookup< + ffi.NativeFunction>( + 'CFTimeZoneIsDaylightSavingTime'); + late final _CFTimeZoneIsDaylightSavingTime = + _CFTimeZoneIsDaylightSavingTimePtr.asFunction< + int Function(CFTimeZoneRef, double)>(); - ffi.Pointer strtok( - ffi.Pointer __str, - ffi.Pointer __sep, + double CFTimeZoneGetDaylightSavingTimeOffset( + CFTimeZoneRef tz, + double at, ) { - return _strtok( - __str, - __sep, + return _CFTimeZoneGetDaylightSavingTimeOffset( + tz, + at, ); } - late final _strtokPtr = _lookup< + late final _CFTimeZoneGetDaylightSavingTimeOffsetPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('strtok'); - late final _strtok = _strtokPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + CFTimeInterval Function(CFTimeZoneRef, + CFAbsoluteTime)>>('CFTimeZoneGetDaylightSavingTimeOffset'); + late final _CFTimeZoneGetDaylightSavingTimeOffset = + _CFTimeZoneGetDaylightSavingTimeOffsetPtr.asFunction< + double Function(CFTimeZoneRef, double)>(); - int strxfrm( - ffi.Pointer __s1, - ffi.Pointer __s2, - int __n, + double CFTimeZoneGetNextDaylightSavingTimeTransition( + CFTimeZoneRef tz, + double at, ) { - return _strxfrm( - __s1, - __s2, - __n, + return _CFTimeZoneGetNextDaylightSavingTimeTransition( + tz, + at, ); } - late final _strxfrmPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('strxfrm'); - late final _strxfrm = _strxfrmPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _CFTimeZoneGetNextDaylightSavingTimeTransitionPtr = _lookup< + ffi.NativeFunction< + CFAbsoluteTime Function(CFTimeZoneRef, CFAbsoluteTime)>>( + 'CFTimeZoneGetNextDaylightSavingTimeTransition'); + late final _CFTimeZoneGetNextDaylightSavingTimeTransition = + _CFTimeZoneGetNextDaylightSavingTimeTransitionPtr.asFunction< + double Function(CFTimeZoneRef, double)>(); - ffi.Pointer strtok_r( - ffi.Pointer __str, - ffi.Pointer __sep, - ffi.Pointer> __lasts, + CFStringRef CFTimeZoneCopyLocalizedName( + CFTimeZoneRef tz, + CFTimeZoneNameStyle style, + CFLocaleRef locale, ) { - return _strtok_r( - __str, - __sep, - __lasts, + return _CFTimeZoneCopyLocalizedName( + tz, + style.value, + locale, ); } - late final _strtok_rPtr = _lookup< + late final _CFTimeZoneCopyLocalizedNamePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('strtok_r'); - late final _strtok_r = _strtok_rPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); + CFStringRef Function(CFTimeZoneRef, CFIndex, + CFLocaleRef)>>('CFTimeZoneCopyLocalizedName'); + late final _CFTimeZoneCopyLocalizedName = _CFTimeZoneCopyLocalizedNamePtr + .asFunction(); - int strerror_r( - int __errnum, - ffi.Pointer __strerrbuf, - int __buflen, - ) { - return _strerror_r( - __errnum, - __strerrbuf, - __buflen, - ); + late final ffi.Pointer + _kCFTimeZoneSystemTimeZoneDidChangeNotification = + _lookup( + 'kCFTimeZoneSystemTimeZoneDidChangeNotification'); + + CFNotificationName get kCFTimeZoneSystemTimeZoneDidChangeNotification => + _kCFTimeZoneSystemTimeZoneDidChangeNotification.value; + + int CFCalendarGetTypeID() { + return _CFCalendarGetTypeID(); } - late final _strerror_rPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Size)>>('strerror_r'); - late final _strerror_r = _strerror_rPtr - .asFunction, int)>(); + late final _CFCalendarGetTypeIDPtr = + _lookup>('CFCalendarGetTypeID'); + late final _CFCalendarGetTypeID = + _CFCalendarGetTypeIDPtr.asFunction(); - ffi.Pointer strdup( - ffi.Pointer __s1, - ) { - return _strdup( - __s1, - ); + CFCalendarRef CFCalendarCopyCurrent() { + return _CFCalendarCopyCurrent(); } - late final _strdupPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('strdup'); - late final _strdup = _strdupPtr - .asFunction Function(ffi.Pointer)>(); + late final _CFCalendarCopyCurrentPtr = + _lookup>( + 'CFCalendarCopyCurrent'); + late final _CFCalendarCopyCurrent = + _CFCalendarCopyCurrentPtr.asFunction(); - ffi.Pointer memccpy( - ffi.Pointer __dst, - ffi.Pointer __src, - int __c, - int __n, + CFCalendarRef CFCalendarCreateWithIdentifier( + CFAllocatorRef allocator, + CFCalendarIdentifier identifier, ) { - return _memccpy( - __dst, - __src, - __c, - __n, + return _CFCalendarCreateWithIdentifier( + allocator, + identifier, ); } - late final _memccpyPtr = _lookup< + late final _CFCalendarCreateWithIdentifierPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int, ffi.Size)>>('memccpy'); - late final _memccpy = _memccpyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int, int)>(); + CFCalendarRef Function(CFAllocatorRef, + CFCalendarIdentifier)>>('CFCalendarCreateWithIdentifier'); + late final _CFCalendarCreateWithIdentifier = + _CFCalendarCreateWithIdentifierPtr.asFunction< + CFCalendarRef Function(CFAllocatorRef, CFCalendarIdentifier)>(); - ffi.Pointer stpcpy( - ffi.Pointer __dst, - ffi.Pointer __src, + CFCalendarIdentifier CFCalendarGetIdentifier( + CFCalendarRef calendar, ) { - return _stpcpy( - __dst, - __src, + return _CFCalendarGetIdentifier( + calendar, ); } - late final _stpcpyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('stpcpy'); - late final _stpcpy = _stpcpyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFCalendarGetIdentifierPtr = + _lookup>( + 'CFCalendarGetIdentifier'); + late final _CFCalendarGetIdentifier = _CFCalendarGetIdentifierPtr.asFunction< + CFCalendarIdentifier Function(CFCalendarRef)>(); - ffi.Pointer stpncpy( - ffi.Pointer __dst, - ffi.Pointer __src, - int __n, + CFLocaleRef CFCalendarCopyLocale( + CFCalendarRef calendar, ) { - return _stpncpy( - __dst, - __src, - __n, + return _CFCalendarCopyLocale( + calendar, ); } - late final _stpncpyPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('stpncpy'); - late final _stpncpy = _stpncpyPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _CFCalendarCopyLocalePtr = + _lookup>( + 'CFCalendarCopyLocale'); + late final _CFCalendarCopyLocale = _CFCalendarCopyLocalePtr.asFunction< + CFLocaleRef Function(CFCalendarRef)>(); - ffi.Pointer strndup( - ffi.Pointer __s1, - int __n, + void CFCalendarSetLocale( + CFCalendarRef calendar, + CFLocaleRef locale, ) { - return _strndup( - __s1, - __n, + return _CFCalendarSetLocale( + calendar, + locale, ); } - late final _strndupPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('strndup'); - late final _strndup = _strndupPtr - .asFunction Function(ffi.Pointer, int)>(); + late final _CFCalendarSetLocalePtr = _lookup< + ffi.NativeFunction>( + 'CFCalendarSetLocale'); + late final _CFCalendarSetLocale = _CFCalendarSetLocalePtr.asFunction< + void Function(CFCalendarRef, CFLocaleRef)>(); - int strnlen( - ffi.Pointer __s1, - int __n, + CFTimeZoneRef CFCalendarCopyTimeZone( + CFCalendarRef calendar, ) { - return _strnlen( - __s1, - __n, + return _CFCalendarCopyTimeZone( + calendar, ); } - late final _strnlenPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Size)>>('strnlen'); - late final _strnlen = - _strnlenPtr.asFunction, int)>(); + late final _CFCalendarCopyTimeZonePtr = + _lookup>( + 'CFCalendarCopyTimeZone'); + late final _CFCalendarCopyTimeZone = _CFCalendarCopyTimeZonePtr.asFunction< + CFTimeZoneRef Function(CFCalendarRef)>(); - ffi.Pointer strsignal( - int __sig, + void CFCalendarSetTimeZone( + CFCalendarRef calendar, + CFTimeZoneRef tz, ) { - return _strsignal( - __sig, + return _CFCalendarSetTimeZone( + calendar, + tz, ); } - late final _strsignalPtr = - _lookup Function(ffi.Int)>>( - 'strsignal'); - late final _strsignal = - _strsignalPtr.asFunction Function(int)>(); + late final _CFCalendarSetTimeZonePtr = _lookup< + ffi.NativeFunction>( + 'CFCalendarSetTimeZone'); + late final _CFCalendarSetTimeZone = _CFCalendarSetTimeZonePtr.asFunction< + void Function(CFCalendarRef, CFTimeZoneRef)>(); - int memset_s( - ffi.Pointer __s, - int __smax, - int __c, - int __n, + int CFCalendarGetFirstWeekday( + CFCalendarRef calendar, ) { - return _memset_s( - __s, - __smax, - __c, - __n, + return _CFCalendarGetFirstWeekday( + calendar, ); } - late final _memset_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, rsize_t, ffi.Int, rsize_t)>>('memset_s'); - late final _memset_s = _memset_sPtr - .asFunction, int, int, int)>(); + late final _CFCalendarGetFirstWeekdayPtr = + _lookup>( + 'CFCalendarGetFirstWeekday'); + late final _CFCalendarGetFirstWeekday = + _CFCalendarGetFirstWeekdayPtr.asFunction(); - ffi.Pointer memmem( - ffi.Pointer __big, - int __big_len, - ffi.Pointer __little, - int __little_len, + void CFCalendarSetFirstWeekday( + CFCalendarRef calendar, + int wkdy, ) { - return _memmem( - __big, - __big_len, - __little, - __little_len, + return _CFCalendarSetFirstWeekday( + calendar, + wkdy, ); } - late final _memmemPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Size, - ffi.Pointer, ffi.Size)>>('memmem'); - late final _memmem = _memmemPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, ffi.Pointer, int)>(); + late final _CFCalendarSetFirstWeekdayPtr = + _lookup>( + 'CFCalendarSetFirstWeekday'); + late final _CFCalendarSetFirstWeekday = _CFCalendarSetFirstWeekdayPtr + .asFunction(); - void memset_pattern4( - ffi.Pointer __b, - ffi.Pointer __pattern4, - int __len, + int CFCalendarGetMinimumDaysInFirstWeek( + CFCalendarRef calendar, ) { - return _memset_pattern4( - __b, - __pattern4, - __len, + return _CFCalendarGetMinimumDaysInFirstWeek( + calendar, ); } - late final _memset_pattern4Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('memset_pattern4'); - late final _memset_pattern4 = _memset_pattern4Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _CFCalendarGetMinimumDaysInFirstWeekPtr = + _lookup>( + 'CFCalendarGetMinimumDaysInFirstWeek'); + late final _CFCalendarGetMinimumDaysInFirstWeek = + _CFCalendarGetMinimumDaysInFirstWeekPtr.asFunction< + int Function(CFCalendarRef)>(); - void memset_pattern8( - ffi.Pointer __b, - ffi.Pointer __pattern8, - int __len, + void CFCalendarSetMinimumDaysInFirstWeek( + CFCalendarRef calendar, + int mwd, ) { - return _memset_pattern8( - __b, - __pattern8, - __len, + return _CFCalendarSetMinimumDaysInFirstWeek( + calendar, + mwd, ); } - late final _memset_pattern8Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('memset_pattern8'); - late final _memset_pattern8 = _memset_pattern8Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _CFCalendarSetMinimumDaysInFirstWeekPtr = + _lookup>( + 'CFCalendarSetMinimumDaysInFirstWeek'); + late final _CFCalendarSetMinimumDaysInFirstWeek = + _CFCalendarSetMinimumDaysInFirstWeekPtr.asFunction< + void Function(CFCalendarRef, int)>(); - void memset_pattern16( - ffi.Pointer __b, - ffi.Pointer __pattern16, - int __len, + CFRange CFCalendarGetMinimumRangeOfUnit( + CFCalendarRef calendar, + CFCalendarUnit unit, ) { - return _memset_pattern16( - __b, - __pattern16, - __len, + return _CFCalendarGetMinimumRangeOfUnit( + calendar, + unit.value, ); } - late final _memset_pattern16Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('memset_pattern16'); - late final _memset_pattern16 = _memset_pattern16Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _CFCalendarGetMinimumRangeOfUnitPtr = _lookup< + ffi.NativeFunction>( + 'CFCalendarGetMinimumRangeOfUnit'); + late final _CFCalendarGetMinimumRangeOfUnit = + _CFCalendarGetMinimumRangeOfUnitPtr.asFunction< + CFRange Function(CFCalendarRef, int)>(); - ffi.Pointer strcasestr( - ffi.Pointer __big, - ffi.Pointer __little, + CFRange CFCalendarGetMaximumRangeOfUnit( + CFCalendarRef calendar, + CFCalendarUnit unit, ) { - return _strcasestr( - __big, - __little, + return _CFCalendarGetMaximumRangeOfUnit( + calendar, + unit.value, ); } - late final _strcasestrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('strcasestr'); - late final _strcasestr = _strcasestrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFCalendarGetMaximumRangeOfUnitPtr = _lookup< + ffi.NativeFunction>( + 'CFCalendarGetMaximumRangeOfUnit'); + late final _CFCalendarGetMaximumRangeOfUnit = + _CFCalendarGetMaximumRangeOfUnitPtr.asFunction< + CFRange Function(CFCalendarRef, int)>(); - ffi.Pointer strnstr( - ffi.Pointer __big, - ffi.Pointer __little, - int __len, + CFRange CFCalendarGetRangeOfUnit( + CFCalendarRef calendar, + CFCalendarUnit smallerUnit, + CFCalendarUnit biggerUnit, + DartCFTimeInterval at, ) { - return _strnstr( - __big, - __little, - __len, + return _CFCalendarGetRangeOfUnit( + calendar, + smallerUnit.value, + biggerUnit.value, + at, ); } - late final _strnstrPtr = _lookup< + late final _CFCalendarGetRangeOfUnitPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('strnstr'); - late final _strnstr = _strnstrPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + CFRange Function(CFCalendarRef, CFOptionFlags, CFOptionFlags, + CFAbsoluteTime)>>('CFCalendarGetRangeOfUnit'); + late final _CFCalendarGetRangeOfUnit = _CFCalendarGetRangeOfUnitPtr + .asFunction(); - int strlcat( - ffi.Pointer __dst, - ffi.Pointer __source, - int __size, + DartCFIndex CFCalendarGetOrdinalityOfUnit( + CFCalendarRef calendar, + CFCalendarUnit smallerUnit, + CFCalendarUnit biggerUnit, + DartCFTimeInterval at, ) { - return _strlcat( - __dst, - __source, - __size, + return _CFCalendarGetOrdinalityOfUnit( + calendar, + smallerUnit.value, + biggerUnit.value, + at, ); } - late final _strlcatPtr = _lookup< + late final _CFCalendarGetOrdinalityOfUnitPtr = _lookup< ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('strlcat'); - late final _strlcat = _strlcatPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + CFIndex Function(CFCalendarRef, CFOptionFlags, CFOptionFlags, + CFAbsoluteTime)>>('CFCalendarGetOrdinalityOfUnit'); + late final _CFCalendarGetOrdinalityOfUnit = _CFCalendarGetOrdinalityOfUnitPtr + .asFunction(); - int strlcpy( - ffi.Pointer __dst, - ffi.Pointer __source, - int __size, + DartBoolean CFCalendarGetTimeRangeOfUnit( + CFCalendarRef calendar, + CFCalendarUnit unit, + DartCFTimeInterval at, + ffi.Pointer startp, + ffi.Pointer tip, ) { - return _strlcpy( - __dst, - __source, - __size, + return _CFCalendarGetTimeRangeOfUnit( + calendar, + unit.value, + at, + startp, + tip, ); } - late final _strlcpyPtr = _lookup< + late final _CFCalendarGetTimeRangeOfUnitPtr = _lookup< ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('strlcpy'); - late final _strlcpy = _strlcpyPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + Boolean Function( + CFCalendarRef, + CFOptionFlags, + CFAbsoluteTime, + ffi.Pointer, + ffi.Pointer)>>('CFCalendarGetTimeRangeOfUnit'); + late final _CFCalendarGetTimeRangeOfUnit = + _CFCalendarGetTimeRangeOfUnitPtr.asFunction< + int Function(CFCalendarRef, int, double, ffi.Pointer, + ffi.Pointer)>(); - void strmode( - int __mode, - ffi.Pointer __bp, + int CFCalendarComposeAbsoluteTime( + CFCalendarRef calendar, + ffi.Pointer at, + ffi.Pointer componentDesc, ) { - return _strmode( - __mode, - __bp, + return _CFCalendarComposeAbsoluteTime( + calendar, + at, + componentDesc, ); } - late final _strmodePtr = _lookup< + late final _CFCalendarComposeAbsoluteTimePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Int, ffi.Pointer)>>('strmode'); - late final _strmode = - _strmodePtr.asFunction)>(); + Boolean Function(CFCalendarRef, ffi.Pointer, + ffi.Pointer)>>('CFCalendarComposeAbsoluteTime'); + late final _CFCalendarComposeAbsoluteTime = + _CFCalendarComposeAbsoluteTimePtr.asFunction< + int Function(CFCalendarRef, ffi.Pointer, + ffi.Pointer)>(); - ffi.Pointer strsep( - ffi.Pointer> __stringp, - ffi.Pointer __delim, + int CFCalendarDecomposeAbsoluteTime( + CFCalendarRef calendar, + double at, + ffi.Pointer componentDesc, ) { - return _strsep( - __stringp, - __delim, + return _CFCalendarDecomposeAbsoluteTime( + calendar, + at, + componentDesc, ); } - late final _strsepPtr = _lookup< + late final _CFCalendarDecomposeAbsoluteTimePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer>, - ffi.Pointer)>>('strsep'); - late final _strsep = _strsepPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer>, ffi.Pointer)>(); + Boolean Function(CFCalendarRef, CFAbsoluteTime, + ffi.Pointer)>>('CFCalendarDecomposeAbsoluteTime'); + late final _CFCalendarDecomposeAbsoluteTime = + _CFCalendarDecomposeAbsoluteTimePtr.asFunction< + int Function(CFCalendarRef, double, ffi.Pointer)>(); - void swab( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + int CFCalendarAddComponents( + CFCalendarRef calendar, + ffi.Pointer at, + int options, + ffi.Pointer componentDesc, ) { - return _swab( - arg0, - arg1, - arg2, + return _CFCalendarAddComponents( + calendar, + at, + options, + componentDesc, ); } - late final _swabPtr = _lookup< + late final _CFCalendarAddComponentsPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer, ssize_t)>>('swab'); - late final _swab = _swabPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + Boolean Function( + CFCalendarRef, + ffi.Pointer, + CFOptionFlags, + ffi.Pointer)>>('CFCalendarAddComponents'); + late final _CFCalendarAddComponents = _CFCalendarAddComponentsPtr.asFunction< + int Function(CFCalendarRef, ffi.Pointer, int, + ffi.Pointer)>(); - int timingsafe_bcmp( - ffi.Pointer __b1, - ffi.Pointer __b2, - int __len, + int CFCalendarGetComponentDifference( + CFCalendarRef calendar, + double startingAT, + double resultAT, + int options, + ffi.Pointer componentDesc, ) { - return _timingsafe_bcmp( - __b1, - __b2, - __len, + return _CFCalendarGetComponentDifference( + calendar, + startingAT, + resultAT, + options, + componentDesc, ); } - late final _timingsafe_bcmpPtr = _lookup< + late final _CFCalendarGetComponentDifferencePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('timingsafe_bcmp'); - late final _timingsafe_bcmp = _timingsafe_bcmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + Boolean Function( + CFCalendarRef, + CFAbsoluteTime, + CFAbsoluteTime, + CFOptionFlags, + ffi.Pointer)>>('CFCalendarGetComponentDifference'); + late final _CFCalendarGetComponentDifference = + _CFCalendarGetComponentDifferencePtr.asFunction< + int Function( + CFCalendarRef, double, double, int, ffi.Pointer)>(); - int strsignal_r( - int __sig, - ffi.Pointer __strsignalbuf, - int __buflen, + CFStringRef CFDateFormatterCreateDateFormatFromTemplate( + CFAllocatorRef allocator, + CFStringRef tmplate, + int options, + CFLocaleRef locale, ) { - return _strsignal_r( - __sig, - __strsignalbuf, - __buflen, + return _CFDateFormatterCreateDateFormatFromTemplate( + allocator, + tmplate, + options, + locale, ); } - late final _strsignal_rPtr = _lookup< + late final _CFDateFormatterCreateDateFormatFromTemplatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Size)>>('strsignal_r'); - late final _strsignal_r = _strsignal_rPtr - .asFunction, int)>(); + CFStringRef Function(CFAllocatorRef, CFStringRef, CFOptionFlags, + CFLocaleRef)>>('CFDateFormatterCreateDateFormatFromTemplate'); + late final _CFDateFormatterCreateDateFormatFromTemplate = + _CFDateFormatterCreateDateFormatFromTemplatePtr.asFunction< + CFStringRef Function( + CFAllocatorRef, CFStringRef, int, CFLocaleRef)>(); - int bcmp( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + int CFDateFormatterGetTypeID() { + return _CFDateFormatterGetTypeID(); + } + + late final _CFDateFormatterGetTypeIDPtr = + _lookup>( + 'CFDateFormatterGetTypeID'); + late final _CFDateFormatterGetTypeID = + _CFDateFormatterGetTypeIDPtr.asFunction(); + + CFDateFormatterRef CFDateFormatterCreateISO8601Formatter( + CFAllocatorRef allocator, + CFISO8601DateFormatOptions formatOptions, ) { - return _bcmp( - arg0, - arg1, - arg2, + return _CFDateFormatterCreateISO8601Formatter( + allocator, + formatOptions.value, ); } - late final _bcmpPtr = _lookup< + late final _CFDateFormatterCreateISO8601FormatterPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Size)>>('bcmp'); - late final _bcmp = _bcmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + CFDateFormatterRef Function(CFAllocatorRef, + CFOptionFlags)>>('CFDateFormatterCreateISO8601Formatter'); + late final _CFDateFormatterCreateISO8601Formatter = + _CFDateFormatterCreateISO8601FormatterPtr.asFunction< + CFDateFormatterRef Function(CFAllocatorRef, int)>(); - void bcopy( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + CFDateFormatterRef CFDateFormatterCreate( + CFAllocatorRef allocator, + CFLocaleRef locale, + CFDateFormatterStyle dateStyle, + CFDateFormatterStyle timeStyle, ) { - return _bcopy( - arg0, - arg1, - arg2, + return _CFDateFormatterCreate( + allocator, + locale, + dateStyle.value, + timeStyle.value, ); } - late final _bcopyPtr = _lookup< + late final _CFDateFormatterCreatePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('bcopy'); - late final _bcopy = _bcopyPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + CFDateFormatterRef Function(CFAllocatorRef, CFLocaleRef, CFIndex, + CFIndex)>>('CFDateFormatterCreate'); + late final _CFDateFormatterCreate = _CFDateFormatterCreatePtr.asFunction< + CFDateFormatterRef Function(CFAllocatorRef, CFLocaleRef, int, int)>(); - void bzero( - ffi.Pointer arg0, - int arg1, + CFLocaleRef CFDateFormatterGetLocale( + CFDateFormatterRef formatter, ) { - return _bzero( - arg0, - arg1, + return _CFDateFormatterGetLocale( + formatter, ); } - late final _bzeroPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Size)>>('bzero'); - late final _bzero = - _bzeroPtr.asFunction, int)>(); + late final _CFDateFormatterGetLocalePtr = + _lookup>( + 'CFDateFormatterGetLocale'); + late final _CFDateFormatterGetLocale = _CFDateFormatterGetLocalePtr + .asFunction(); - ffi.Pointer index( - ffi.Pointer arg0, - int arg1, + CFDateFormatterStyle CFDateFormatterGetDateStyle( + CFDateFormatterRef formatter, ) { - return _index( - arg0, - arg1, - ); + return CFDateFormatterStyle.fromValue(_CFDateFormatterGetDateStyle( + formatter, + )); } - late final _indexPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('index'); - late final _index = _indexPtr - .asFunction Function(ffi.Pointer, int)>(); + late final _CFDateFormatterGetDateStylePtr = + _lookup>( + 'CFDateFormatterGetDateStyle'); + late final _CFDateFormatterGetDateStyle = _CFDateFormatterGetDateStylePtr + .asFunction(); - ffi.Pointer rindex( - ffi.Pointer arg0, - int arg1, + CFDateFormatterStyle CFDateFormatterGetTimeStyle( + CFDateFormatterRef formatter, ) { - return _rindex( - arg0, - arg1, - ); + return CFDateFormatterStyle.fromValue(_CFDateFormatterGetTimeStyle( + formatter, + )); } - late final _rindexPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Int)>>('rindex'); - late final _rindex = _rindexPtr - .asFunction Function(ffi.Pointer, int)>(); + late final _CFDateFormatterGetTimeStylePtr = + _lookup>( + 'CFDateFormatterGetTimeStyle'); + late final _CFDateFormatterGetTimeStyle = _CFDateFormatterGetTimeStylePtr + .asFunction(); - int ffs( - int arg0, + CFStringRef CFDateFormatterGetFormat( + CFDateFormatterRef formatter, ) { - return _ffs( - arg0, + return _CFDateFormatterGetFormat( + formatter, ); } - late final _ffsPtr = - _lookup>('ffs'); - late final _ffs = _ffsPtr.asFunction(); + late final _CFDateFormatterGetFormatPtr = + _lookup>( + 'CFDateFormatterGetFormat'); + late final _CFDateFormatterGetFormat = _CFDateFormatterGetFormatPtr + .asFunction(); - int strcasecmp( - ffi.Pointer arg0, - ffi.Pointer arg1, + void CFDateFormatterSetFormat( + CFDateFormatterRef formatter, + CFStringRef formatString, ) { - return _strcasecmp( - arg0, - arg1, + return _CFDateFormatterSetFormat( + formatter, + formatString, ); } - late final _strcasecmpPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('strcasecmp'); - late final _strcasecmp = _strcasecmpPtr - .asFunction, ffi.Pointer)>(); + late final _CFDateFormatterSetFormatPtr = _lookup< + ffi + .NativeFunction>( + 'CFDateFormatterSetFormat'); + late final _CFDateFormatterSetFormat = _CFDateFormatterSetFormatPtr + .asFunction(); - int strncasecmp( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + CFStringRef CFDateFormatterCreateStringWithDate( + CFAllocatorRef allocator, + CFDateFormatterRef formatter, + CFDateRef date, ) { - return _strncasecmp( - arg0, - arg1, - arg2, + return _CFDateFormatterCreateStringWithDate( + allocator, + formatter, + date, ); } - late final _strncasecmpPtr = _lookup< + late final _CFDateFormatterCreateStringWithDatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('strncasecmp'); - late final _strncasecmp = _strncasecmpPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + CFStringRef Function(CFAllocatorRef, CFDateFormatterRef, + CFDateRef)>>('CFDateFormatterCreateStringWithDate'); + late final _CFDateFormatterCreateStringWithDate = + _CFDateFormatterCreateStringWithDatePtr.asFunction< + CFStringRef Function( + CFAllocatorRef, CFDateFormatterRef, CFDateRef)>(); - int ffsl( - int arg0, + CFStringRef CFDateFormatterCreateStringWithAbsoluteTime( + CFAllocatorRef allocator, + CFDateFormatterRef formatter, + double at, ) { - return _ffsl( - arg0, + return _CFDateFormatterCreateStringWithAbsoluteTime( + allocator, + formatter, + at, ); } - late final _ffslPtr = - _lookup>('ffsl'); - late final _ffsl = _ffslPtr.asFunction(); + late final _CFDateFormatterCreateStringWithAbsoluteTimePtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFDateFormatterRef, + CFAbsoluteTime)>>('CFDateFormatterCreateStringWithAbsoluteTime'); + late final _CFDateFormatterCreateStringWithAbsoluteTime = + _CFDateFormatterCreateStringWithAbsoluteTimePtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFDateFormatterRef, double)>(); - int ffsll( - int arg0, + CFDateRef CFDateFormatterCreateDateFromString( + CFAllocatorRef allocator, + CFDateFormatterRef formatter, + CFStringRef string, + ffi.Pointer rangep, ) { - return _ffsll( - arg0, + return _CFDateFormatterCreateDateFromString( + allocator, + formatter, + string, + rangep, ); } - late final _ffsllPtr = - _lookup>('ffsll'); - late final _ffsll = _ffsllPtr.asFunction(); + late final _CFDateFormatterCreateDateFromStringPtr = _lookup< + ffi.NativeFunction< + CFDateRef Function(CFAllocatorRef, CFDateFormatterRef, CFStringRef, + ffi.Pointer)>>('CFDateFormatterCreateDateFromString'); + late final _CFDateFormatterCreateDateFromString = + _CFDateFormatterCreateDateFromStringPtr.asFunction< + CFDateRef Function(CFAllocatorRef, CFDateFormatterRef, CFStringRef, + ffi.Pointer)>(); - int fls( - int arg0, + int CFDateFormatterGetAbsoluteTimeFromString( + CFDateFormatterRef formatter, + CFStringRef string, + ffi.Pointer rangep, + ffi.Pointer atp, ) { - return _fls( - arg0, + return _CFDateFormatterGetAbsoluteTimeFromString( + formatter, + string, + rangep, + atp, ); } - late final _flsPtr = - _lookup>('fls'); - late final _fls = _flsPtr.asFunction(); + late final _CFDateFormatterGetAbsoluteTimeFromStringPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFDateFormatterRef, CFStringRef, + ffi.Pointer, ffi.Pointer)>>( + 'CFDateFormatterGetAbsoluteTimeFromString'); + late final _CFDateFormatterGetAbsoluteTimeFromString = + _CFDateFormatterGetAbsoluteTimeFromStringPtr.asFunction< + int Function(CFDateFormatterRef, CFStringRef, ffi.Pointer, + ffi.Pointer)>(); - int flsl( - int arg0, + void CFDateFormatterSetProperty( + CFDateFormatterRef formatter, + CFStringRef key, + CFTypeRef value, ) { - return _flsl( - arg0, + return _CFDateFormatterSetProperty( + formatter, + key, + value, ); } - late final _flslPtr = - _lookup>('flsl'); - late final _flsl = _flslPtr.asFunction(); + late final _CFDateFormatterSetPropertyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFDateFormatterRef, CFStringRef, + CFTypeRef)>>('CFDateFormatterSetProperty'); + late final _CFDateFormatterSetProperty = _CFDateFormatterSetPropertyPtr + .asFunction(); - int flsll( - int arg0, + CFTypeRef CFDateFormatterCopyProperty( + CFDateFormatterRef formatter, + CFDateFormatterKey key, ) { - return _flsll( - arg0, + return _CFDateFormatterCopyProperty( + formatter, + key, ); } - late final _flsllPtr = - _lookup>('flsll'); - late final _flsll = _flsllPtr.asFunction(); + late final _CFDateFormatterCopyPropertyPtr = _lookup< + ffi.NativeFunction< + CFTypeRef Function(CFDateFormatterRef, + CFDateFormatterKey)>>('CFDateFormatterCopyProperty'); + late final _CFDateFormatterCopyProperty = _CFDateFormatterCopyPropertyPtr + .asFunction(); - late final ffi.Pointer>> _tzname = - _lookup>>('tzname'); + late final ffi.Pointer _kCFDateFormatterIsLenient = + _lookup('kCFDateFormatterIsLenient'); - ffi.Pointer> get tzname => _tzname.value; + CFDateFormatterKey get kCFDateFormatterIsLenient => + _kCFDateFormatterIsLenient.value; - set tzname(ffi.Pointer> value) => _tzname.value = value; + late final ffi.Pointer _kCFDateFormatterTimeZone = + _lookup('kCFDateFormatterTimeZone'); - late final ffi.Pointer _getdate_err = - _lookup('getdate_err'); + CFDateFormatterKey get kCFDateFormatterTimeZone => + _kCFDateFormatterTimeZone.value; - int get getdate_err => _getdate_err.value; + late final ffi.Pointer _kCFDateFormatterCalendarName = + _lookup('kCFDateFormatterCalendarName'); - set getdate_err(int value) => _getdate_err.value = value; + CFDateFormatterKey get kCFDateFormatterCalendarName => + _kCFDateFormatterCalendarName.value; - late final ffi.Pointer _timezone = _lookup('timezone'); + late final ffi.Pointer _kCFDateFormatterDefaultFormat = + _lookup('kCFDateFormatterDefaultFormat'); - int get timezone => _timezone.value; + CFDateFormatterKey get kCFDateFormatterDefaultFormat => + _kCFDateFormatterDefaultFormat.value; - set timezone(int value) => _timezone.value = value; + late final ffi.Pointer + _kCFDateFormatterTwoDigitStartDate = + _lookup('kCFDateFormatterTwoDigitStartDate'); - late final ffi.Pointer _daylight = _lookup('daylight'); + CFDateFormatterKey get kCFDateFormatterTwoDigitStartDate => + _kCFDateFormatterTwoDigitStartDate.value; - int get daylight => _daylight.value; + late final ffi.Pointer _kCFDateFormatterDefaultDate = + _lookup('kCFDateFormatterDefaultDate'); - set daylight(int value) => _daylight.value = value; + CFDateFormatterKey get kCFDateFormatterDefaultDate => + _kCFDateFormatterDefaultDate.value; - ffi.Pointer asctime( - ffi.Pointer arg0, - ) { - return _asctime( - arg0, - ); - } + late final ffi.Pointer _kCFDateFormatterCalendar = + _lookup('kCFDateFormatterCalendar'); - late final _asctimePtr = _lookup< - ffi.NativeFunction Function(ffi.Pointer)>>( - 'asctime'); - late final _asctime = - _asctimePtr.asFunction Function(ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterCalendar => + _kCFDateFormatterCalendar.value; - int clock() { - return _clock(); - } + late final ffi.Pointer _kCFDateFormatterEraSymbols = + _lookup('kCFDateFormatterEraSymbols'); - late final _clockPtr = - _lookup>('clock'); - late final _clock = _clockPtr.asFunction(); + CFDateFormatterKey get kCFDateFormatterEraSymbols => + _kCFDateFormatterEraSymbols.value; - ffi.Pointer ctime( - ffi.Pointer arg0, - ) { - return _ctime( - arg0, - ); - } + late final ffi.Pointer _kCFDateFormatterMonthSymbols = + _lookup('kCFDateFormatterMonthSymbols'); - late final _ctimePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('ctime'); - late final _ctime = _ctimePtr - .asFunction Function(ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterMonthSymbols => + _kCFDateFormatterMonthSymbols.value; - double difftime( - int arg0, - int arg1, - ) { - return _difftime( - arg0, - arg1, - ); - } + late final ffi.Pointer + _kCFDateFormatterShortMonthSymbols = + _lookup('kCFDateFormatterShortMonthSymbols'); - late final _difftimePtr = - _lookup>( - 'difftime'); - late final _difftime = _difftimePtr.asFunction(); + CFDateFormatterKey get kCFDateFormatterShortMonthSymbols => + _kCFDateFormatterShortMonthSymbols.value; - ffi.Pointer getdate( - ffi.Pointer arg0, - ) { - return _getdate( - arg0, - ); - } + late final ffi.Pointer _kCFDateFormatterWeekdaySymbols = + _lookup('kCFDateFormatterWeekdaySymbols'); - late final _getdatePtr = _lookup< - ffi.NativeFunction Function(ffi.Pointer)>>( - 'getdate'); - late final _getdate = - _getdatePtr.asFunction Function(ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterWeekdaySymbols => + _kCFDateFormatterWeekdaySymbols.value; - ffi.Pointer gmtime( - ffi.Pointer arg0, - ) { - return _gmtime( - arg0, - ); - } + late final ffi.Pointer + _kCFDateFormatterShortWeekdaySymbols = + _lookup('kCFDateFormatterShortWeekdaySymbols'); - late final _gmtimePtr = _lookup< - ffi - .NativeFunction Function(ffi.Pointer)>>('gmtime'); - late final _gmtime = - _gmtimePtr.asFunction Function(ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterShortWeekdaySymbols => + _kCFDateFormatterShortWeekdaySymbols.value; - ffi.Pointer localtime( - ffi.Pointer arg0, - ) { - return _localtime( - arg0, - ); - } + late final ffi.Pointer _kCFDateFormatterAMSymbol = + _lookup('kCFDateFormatterAMSymbol'); - late final _localtimePtr = _lookup< - ffi.NativeFunction Function(ffi.Pointer)>>( - 'localtime'); - late final _localtime = - _localtimePtr.asFunction Function(ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterAMSymbol => + _kCFDateFormatterAMSymbol.value; - int mktime( - ffi.Pointer arg0, - ) { - return _mktime( - arg0, - ); - } + late final ffi.Pointer _kCFDateFormatterPMSymbol = + _lookup('kCFDateFormatterPMSymbol'); - late final _mktimePtr = - _lookup)>>('mktime'); - late final _mktime = _mktimePtr.asFunction)>(); + CFDateFormatterKey get kCFDateFormatterPMSymbol => + _kCFDateFormatterPMSymbol.value; - int strftime( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ) { - return _strftime( - arg0, - arg1, - arg2, - arg3, - ); - } + late final ffi.Pointer _kCFDateFormatterLongEraSymbols = + _lookup('kCFDateFormatterLongEraSymbols'); - late final _strftimePtr = _lookup< - ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Size, - ffi.Pointer, ffi.Pointer)>>('strftime'); - late final _strftime = _strftimePtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, - ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterLongEraSymbols => + _kCFDateFormatterLongEraSymbols.value; - ffi.Pointer strptime( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ) { - return _strptime( - arg0, - arg1, - arg2, - ); - } + late final ffi.Pointer + _kCFDateFormatterVeryShortMonthSymbols = + _lookup('kCFDateFormatterVeryShortMonthSymbols'); - late final _strptimePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('strptime'); - late final _strptime = _strptimePtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterVeryShortMonthSymbols => + _kCFDateFormatterVeryShortMonthSymbols.value; - int time( - ffi.Pointer arg0, - ) { - return _time( - arg0, - ); - } + late final ffi.Pointer + _kCFDateFormatterStandaloneMonthSymbols = + _lookup('kCFDateFormatterStandaloneMonthSymbols'); - late final _timePtr = - _lookup)>>('time'); - late final _time = _timePtr.asFunction)>(); + CFDateFormatterKey get kCFDateFormatterStandaloneMonthSymbols => + _kCFDateFormatterStandaloneMonthSymbols.value; - void tzset() { - return _tzset(); - } + late final ffi.Pointer + _kCFDateFormatterShortStandaloneMonthSymbols = + _lookup( + 'kCFDateFormatterShortStandaloneMonthSymbols'); - late final _tzsetPtr = - _lookup>('tzset'); - late final _tzset = _tzsetPtr.asFunction(); + CFDateFormatterKey get kCFDateFormatterShortStandaloneMonthSymbols => + _kCFDateFormatterShortStandaloneMonthSymbols.value; - ffi.Pointer asctime_r( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _asctime_r( - arg0, - arg1, - ); - } + late final ffi.Pointer + _kCFDateFormatterVeryShortStandaloneMonthSymbols = + _lookup( + 'kCFDateFormatterVeryShortStandaloneMonthSymbols'); - late final _asctime_rPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('asctime_r'); - late final _asctime_r = _asctime_rPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterVeryShortStandaloneMonthSymbols => + _kCFDateFormatterVeryShortStandaloneMonthSymbols.value; - ffi.Pointer ctime_r( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _ctime_r( - arg0, - arg1, - ); - } + late final ffi.Pointer + _kCFDateFormatterVeryShortWeekdaySymbols = + _lookup('kCFDateFormatterVeryShortWeekdaySymbols'); - late final _ctime_rPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('ctime_r'); - late final _ctime_r = _ctime_rPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterVeryShortWeekdaySymbols => + _kCFDateFormatterVeryShortWeekdaySymbols.value; - ffi.Pointer gmtime_r( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _gmtime_r( - arg0, - arg1, - ); - } + late final ffi.Pointer + _kCFDateFormatterStandaloneWeekdaySymbols = + _lookup('kCFDateFormatterStandaloneWeekdaySymbols'); - late final _gmtime_rPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('gmtime_r'); - late final _gmtime_r = _gmtime_rPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterStandaloneWeekdaySymbols => + _kCFDateFormatterStandaloneWeekdaySymbols.value; - ffi.Pointer localtime_r( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _localtime_r( - arg0, - arg1, - ); - } + late final ffi.Pointer + _kCFDateFormatterShortStandaloneWeekdaySymbols = + _lookup( + 'kCFDateFormatterShortStandaloneWeekdaySymbols'); - late final _localtime_rPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('localtime_r'); - late final _localtime_r = _localtime_rPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Pointer)>(); + CFDateFormatterKey get kCFDateFormatterShortStandaloneWeekdaySymbols => + _kCFDateFormatterShortStandaloneWeekdaySymbols.value; - int posix2time( - int arg0, - ) { - return _posix2time( - arg0, - ); - } + late final ffi.Pointer + _kCFDateFormatterVeryShortStandaloneWeekdaySymbols = + _lookup( + 'kCFDateFormatterVeryShortStandaloneWeekdaySymbols'); - late final _posix2timePtr = - _lookup>('posix2time'); - late final _posix2time = _posix2timePtr.asFunction(); + CFDateFormatterKey get kCFDateFormatterVeryShortStandaloneWeekdaySymbols => + _kCFDateFormatterVeryShortStandaloneWeekdaySymbols.value; - void tzsetwall() { - return _tzsetwall(); - } + late final ffi.Pointer _kCFDateFormatterQuarterSymbols = + _lookup('kCFDateFormatterQuarterSymbols'); - late final _tzsetwallPtr = - _lookup>('tzsetwall'); - late final _tzsetwall = _tzsetwallPtr.asFunction(); + CFDateFormatterKey get kCFDateFormatterQuarterSymbols => + _kCFDateFormatterQuarterSymbols.value; - int time2posix( - int arg0, - ) { - return _time2posix( - arg0, - ); + late final ffi.Pointer + _kCFDateFormatterShortQuarterSymbols = + _lookup('kCFDateFormatterShortQuarterSymbols'); + + CFDateFormatterKey get kCFDateFormatterShortQuarterSymbols => + _kCFDateFormatterShortQuarterSymbols.value; + + late final ffi.Pointer + _kCFDateFormatterStandaloneQuarterSymbols = + _lookup('kCFDateFormatterStandaloneQuarterSymbols'); + + CFDateFormatterKey get kCFDateFormatterStandaloneQuarterSymbols => + _kCFDateFormatterStandaloneQuarterSymbols.value; + + late final ffi.Pointer + _kCFDateFormatterShortStandaloneQuarterSymbols = + _lookup( + 'kCFDateFormatterShortStandaloneQuarterSymbols'); + + CFDateFormatterKey get kCFDateFormatterShortStandaloneQuarterSymbols => + _kCFDateFormatterShortStandaloneQuarterSymbols.value; + + late final ffi.Pointer + _kCFDateFormatterGregorianStartDate = + _lookup('kCFDateFormatterGregorianStartDate'); + + CFDateFormatterKey get kCFDateFormatterGregorianStartDate => + _kCFDateFormatterGregorianStartDate.value; + + late final ffi.Pointer + _kCFDateFormatterDoesRelativeDateFormattingKey = + _lookup( + 'kCFDateFormatterDoesRelativeDateFormattingKey'); + + CFDateFormatterKey get kCFDateFormatterDoesRelativeDateFormattingKey => + _kCFDateFormatterDoesRelativeDateFormattingKey.value; + + late final ffi.Pointer _kCFBooleanTrue = + _lookup('kCFBooleanTrue'); + + CFBooleanRef get kCFBooleanTrue => _kCFBooleanTrue.value; + + late final ffi.Pointer _kCFBooleanFalse = + _lookup('kCFBooleanFalse'); + + CFBooleanRef get kCFBooleanFalse => _kCFBooleanFalse.value; + + int CFBooleanGetTypeID() { + return _CFBooleanGetTypeID(); } - late final _time2posixPtr = - _lookup>('time2posix'); - late final _time2posix = _time2posixPtr.asFunction(); + late final _CFBooleanGetTypeIDPtr = + _lookup>('CFBooleanGetTypeID'); + late final _CFBooleanGetTypeID = + _CFBooleanGetTypeIDPtr.asFunction(); - int timelocal( - ffi.Pointer arg0, + int CFBooleanGetValue( + CFBooleanRef boolean, ) { - return _timelocal( - arg0, + return _CFBooleanGetValue( + boolean, ); } - late final _timelocalPtr = - _lookup)>>( - 'timelocal'); - late final _timelocal = - _timelocalPtr.asFunction)>(); + late final _CFBooleanGetValuePtr = + _lookup>( + 'CFBooleanGetValue'); + late final _CFBooleanGetValue = + _CFBooleanGetValuePtr.asFunction(); - int timegm( - ffi.Pointer arg0, - ) { - return _timegm( - arg0, - ); + late final ffi.Pointer _kCFNumberPositiveInfinity = + _lookup('kCFNumberPositiveInfinity'); + + CFNumberRef get kCFNumberPositiveInfinity => _kCFNumberPositiveInfinity.value; + + late final ffi.Pointer _kCFNumberNegativeInfinity = + _lookup('kCFNumberNegativeInfinity'); + + CFNumberRef get kCFNumberNegativeInfinity => _kCFNumberNegativeInfinity.value; + + late final ffi.Pointer _kCFNumberNaN = + _lookup('kCFNumberNaN'); + + CFNumberRef get kCFNumberNaN => _kCFNumberNaN.value; + + int CFNumberGetTypeID() { + return _CFNumberGetTypeID(); } - late final _timegmPtr = - _lookup)>>('timegm'); - late final _timegm = _timegmPtr.asFunction)>(); + late final _CFNumberGetTypeIDPtr = + _lookup>('CFNumberGetTypeID'); + late final _CFNumberGetTypeID = + _CFNumberGetTypeIDPtr.asFunction(); - int nanosleep( - ffi.Pointer __rqtp, - ffi.Pointer __rmtp, + CFNumberRef CFNumberCreate( + CFAllocatorRef allocator, + CFNumberType theType, + ffi.Pointer valuePtr, ) { - return _nanosleep( - __rqtp, - __rmtp, + return _CFNumberCreate( + allocator, + theType.value, + valuePtr, ); } - late final _nanosleepPtr = _lookup< + late final _CFNumberCreatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('nanosleep'); - late final _nanosleep = _nanosleepPtr - .asFunction, ffi.Pointer)>(); + CFNumberRef Function(CFAllocatorRef, CFIndex, + ffi.Pointer)>>('CFNumberCreate'); + late final _CFNumberCreate = _CFNumberCreatePtr.asFunction< + CFNumberRef Function(CFAllocatorRef, int, ffi.Pointer)>(); - int clock_getres( - int __clock_id, - ffi.Pointer __res, + CFNumberType CFNumberGetType( + CFNumberRef number, ) { - return _clock_getres( - __clock_id, - __res, - ); + return CFNumberType.fromValue(_CFNumberGetType( + number, + )); } - late final _clock_getresPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int32, ffi.Pointer)>>('clock_getres'); - late final _clock_getres = - _clock_getresPtr.asFunction)>(); + late final _CFNumberGetTypePtr = + _lookup>( + 'CFNumberGetType'); + late final _CFNumberGetType = + _CFNumberGetTypePtr.asFunction(); - int clock_gettime( - int __clock_id, - ffi.Pointer __tp, + int CFNumberGetByteSize( + CFNumberRef number, ) { - return _clock_gettime( - __clock_id, - __tp, + return _CFNumberGetByteSize( + number, ); } - late final _clock_gettimePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int32, ffi.Pointer)>>('clock_gettime'); - late final _clock_gettime = - _clock_gettimePtr.asFunction)>(); + late final _CFNumberGetByteSizePtr = + _lookup>( + 'CFNumberGetByteSize'); + late final _CFNumberGetByteSize = + _CFNumberGetByteSizePtr.asFunction(); - int clock_gettime_nsec_np( - int __clock_id, + int CFNumberIsFloatType( + CFNumberRef number, ) { - return _clock_gettime_nsec_np( - __clock_id, + return _CFNumberIsFloatType( + number, ); } - late final _clock_gettime_nsec_npPtr = - _lookup>( - 'clock_gettime_nsec_np'); - late final _clock_gettime_nsec_np = - _clock_gettime_nsec_npPtr.asFunction(); + late final _CFNumberIsFloatTypePtr = + _lookup>( + 'CFNumberIsFloatType'); + late final _CFNumberIsFloatType = + _CFNumberIsFloatTypePtr.asFunction(); - int clock_settime( - int __clock_id, - ffi.Pointer __tp, + DartBoolean CFNumberGetValue( + CFNumberRef number, + CFNumberType theType, + ffi.Pointer valuePtr, ) { - return _clock_settime( - __clock_id, - __tp, + return _CFNumberGetValue( + number, + theType.value, + valuePtr, ); } - late final _clock_settimePtr = _lookup< + late final _CFNumberGetValuePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int32, ffi.Pointer)>>('clock_settime'); - late final _clock_settime = - _clock_settimePtr.asFunction)>(); + Boolean Function(CFNumberRef, CFIndex, + ffi.Pointer)>>('CFNumberGetValue'); + late final _CFNumberGetValue = _CFNumberGetValuePtr.asFunction< + int Function(CFNumberRef, int, ffi.Pointer)>(); - int timespec_get( - ffi.Pointer ts, - int base, + CFComparisonResult CFNumberCompare( + CFNumberRef number, + CFNumberRef otherNumber, + ffi.Pointer context, ) { - return _timespec_get( - ts, - base, - ); + return CFComparisonResult.fromValue(_CFNumberCompare( + number, + otherNumber, + context, + )); } - late final _timespec_getPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'timespec_get'); - late final _timespec_get = - _timespec_getPtr.asFunction, int)>(); + late final _CFNumberComparePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFNumberRef, CFNumberRef, + ffi.Pointer)>>('CFNumberCompare'); + late final _CFNumberCompare = _CFNumberComparePtr.asFunction< + int Function(CFNumberRef, CFNumberRef, ffi.Pointer)>(); - int imaxabs( - int j, - ) { - return _imaxabs( - j, - ); + int CFNumberFormatterGetTypeID() { + return _CFNumberFormatterGetTypeID(); } - late final _imaxabsPtr = - _lookup>('imaxabs'); - late final _imaxabs = _imaxabsPtr.asFunction(); + late final _CFNumberFormatterGetTypeIDPtr = + _lookup>( + 'CFNumberFormatterGetTypeID'); + late final _CFNumberFormatterGetTypeID = + _CFNumberFormatterGetTypeIDPtr.asFunction(); - imaxdiv_t imaxdiv( - int __numer, - int __denom, + CFNumberFormatterRef CFNumberFormatterCreate( + CFAllocatorRef allocator, + CFLocaleRef locale, + CFNumberFormatterStyle style, ) { - return _imaxdiv( - __numer, - __denom, + return _CFNumberFormatterCreate( + allocator, + locale, + style.value, ); } - late final _imaxdivPtr = - _lookup>( - 'imaxdiv'); - late final _imaxdiv = _imaxdivPtr.asFunction(); + late final _CFNumberFormatterCreatePtr = _lookup< + ffi.NativeFunction< + CFNumberFormatterRef Function(CFAllocatorRef, CFLocaleRef, + CFIndex)>>('CFNumberFormatterCreate'); + late final _CFNumberFormatterCreate = _CFNumberFormatterCreatePtr.asFunction< + CFNumberFormatterRef Function(CFAllocatorRef, CFLocaleRef, int)>(); - int strtoimax( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, - int __base, + CFLocaleRef CFNumberFormatterGetLocale( + CFNumberFormatterRef formatter, ) { - return _strtoimax( - __nptr, - __endptr, - __base, + return _CFNumberFormatterGetLocale( + formatter, ); } - late final _strtoimaxPtr = _lookup< - ffi.NativeFunction< - intmax_t Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoimax'); - late final _strtoimax = _strtoimaxPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + late final _CFNumberFormatterGetLocalePtr = + _lookup>( + 'CFNumberFormatterGetLocale'); + late final _CFNumberFormatterGetLocale = _CFNumberFormatterGetLocalePtr + .asFunction(); - int strtoumax( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, - int __base, + CFNumberFormatterStyle CFNumberFormatterGetStyle( + CFNumberFormatterRef formatter, ) { - return _strtoumax( - __nptr, - __endptr, - __base, - ); + return CFNumberFormatterStyle.fromValue(_CFNumberFormatterGetStyle( + formatter, + )); } - late final _strtoumaxPtr = _lookup< - ffi.NativeFunction< - uintmax_t Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('strtoumax'); - late final _strtoumax = _strtoumaxPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + late final _CFNumberFormatterGetStylePtr = + _lookup>( + 'CFNumberFormatterGetStyle'); + late final _CFNumberFormatterGetStyle = _CFNumberFormatterGetStylePtr + .asFunction(); - int wcstoimax( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, - int __base, + CFStringRef CFNumberFormatterGetFormat( + CFNumberFormatterRef formatter, ) { - return _wcstoimax( - __nptr, - __endptr, - __base, + return _CFNumberFormatterGetFormat( + formatter, ); } - late final _wcstoimaxPtr = _lookup< - ffi.NativeFunction< - intmax_t Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('wcstoimax'); - late final _wcstoimax = _wcstoimaxPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); + late final _CFNumberFormatterGetFormatPtr = + _lookup>( + 'CFNumberFormatterGetFormat'); + late final _CFNumberFormatterGetFormat = _CFNumberFormatterGetFormatPtr + .asFunction(); - int wcstoumax( - ffi.Pointer __nptr, - ffi.Pointer> __endptr, - int __base, + void CFNumberFormatterSetFormat( + CFNumberFormatterRef formatter, + CFStringRef formatString, ) { - return _wcstoumax( - __nptr, - __endptr, - __base, + return _CFNumberFormatterSetFormat( + formatter, + formatString, ); } - late final _wcstoumaxPtr = _lookup< + late final _CFNumberFormatterSetFormatPtr = _lookup< ffi.NativeFunction< - uintmax_t Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('wcstoumax'); - late final _wcstoumax = _wcstoumaxPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - late final ffi.Pointer _kCFTypeBagCallBacks = - _lookup('kCFTypeBagCallBacks'); - - CFBagCallBacks get kCFTypeBagCallBacks => _kCFTypeBagCallBacks.ref; - - late final ffi.Pointer _kCFCopyStringBagCallBacks = - _lookup('kCFCopyStringBagCallBacks'); - - CFBagCallBacks get kCFCopyStringBagCallBacks => - _kCFCopyStringBagCallBacks.ref; - - int CFBagGetTypeID() { - return _CFBagGetTypeID(); - } - - late final _CFBagGetTypeIDPtr = - _lookup>('CFBagGetTypeID'); - late final _CFBagGetTypeID = _CFBagGetTypeIDPtr.asFunction(); + ffi.Void Function(CFNumberFormatterRef, + CFStringRef)>>('CFNumberFormatterSetFormat'); + late final _CFNumberFormatterSetFormat = _CFNumberFormatterSetFormatPtr + .asFunction(); - CFBagRef CFBagCreate( + CFStringRef CFNumberFormatterCreateStringWithNumber( CFAllocatorRef allocator, - ffi.Pointer> values, - int numValues, - ffi.Pointer callBacks, + CFNumberFormatterRef formatter, + CFNumberRef number, ) { - return _CFBagCreate( + return _CFNumberFormatterCreateStringWithNumber( allocator, - values, - numValues, - callBacks, + formatter, + number, ); } - late final _CFBagCreatePtr = _lookup< + late final _CFNumberFormatterCreateStringWithNumberPtr = _lookup< ffi.NativeFunction< - CFBagRef Function(CFAllocatorRef, ffi.Pointer>, - CFIndex, ffi.Pointer)>>('CFBagCreate'); - late final _CFBagCreate = _CFBagCreatePtr.asFunction< - CFBagRef Function(CFAllocatorRef, ffi.Pointer>, int, - ffi.Pointer)>(); + CFStringRef Function(CFAllocatorRef, CFNumberFormatterRef, + CFNumberRef)>>('CFNumberFormatterCreateStringWithNumber'); + late final _CFNumberFormatterCreateStringWithNumber = + _CFNumberFormatterCreateStringWithNumberPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, CFNumberFormatterRef, CFNumberRef)>(); - CFBagRef CFBagCreateCopy( + CFStringRef CFNumberFormatterCreateStringWithValue( CFAllocatorRef allocator, - CFBagRef theBag, + CFNumberFormatterRef formatter, + CFNumberType numberType, + ffi.Pointer valuePtr, ) { - return _CFBagCreateCopy( + return _CFNumberFormatterCreateStringWithValue( allocator, - theBag, + formatter, + numberType.value, + valuePtr, ); } - late final _CFBagCreateCopyPtr = - _lookup>( - 'CFBagCreateCopy'); - late final _CFBagCreateCopy = _CFBagCreateCopyPtr.asFunction< - CFBagRef Function(CFAllocatorRef, CFBagRef)>(); - - CFMutableBagRef CFBagCreateMutable( + late final _CFNumberFormatterCreateStringWithValuePtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFNumberFormatterRef, + CFIndex, ffi.Pointer)>>( + 'CFNumberFormatterCreateStringWithValue'); + late final _CFNumberFormatterCreateStringWithValue = + _CFNumberFormatterCreateStringWithValuePtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFNumberFormatterRef, int, + ffi.Pointer)>(); + + CFNumberRef CFNumberFormatterCreateNumberFromString( CFAllocatorRef allocator, - int capacity, - ffi.Pointer callBacks, + CFNumberFormatterRef formatter, + CFStringRef string, + ffi.Pointer rangep, + int options, ) { - return _CFBagCreateMutable( + return _CFNumberFormatterCreateNumberFromString( allocator, - capacity, - callBacks, + formatter, + string, + rangep, + options, ); } - late final _CFBagCreateMutablePtr = _lookup< + late final _CFNumberFormatterCreateNumberFromStringPtr = _lookup< ffi.NativeFunction< - CFMutableBagRef Function(CFAllocatorRef, CFIndex, - ffi.Pointer)>>('CFBagCreateMutable'); - late final _CFBagCreateMutable = _CFBagCreateMutablePtr.asFunction< - CFMutableBagRef Function( - CFAllocatorRef, int, ffi.Pointer)>(); + CFNumberRef Function( + CFAllocatorRef, + CFNumberFormatterRef, + CFStringRef, + ffi.Pointer, + CFOptionFlags)>>('CFNumberFormatterCreateNumberFromString'); + late final _CFNumberFormatterCreateNumberFromString = + _CFNumberFormatterCreateNumberFromStringPtr.asFunction< + CFNumberRef Function(CFAllocatorRef, CFNumberFormatterRef, + CFStringRef, ffi.Pointer, int)>(); - CFMutableBagRef CFBagCreateMutableCopy( - CFAllocatorRef allocator, - int capacity, - CFBagRef theBag, + DartBoolean CFNumberFormatterGetValueFromString( + CFNumberFormatterRef formatter, + CFStringRef string, + ffi.Pointer rangep, + CFNumberType numberType, + ffi.Pointer valuePtr, ) { - return _CFBagCreateMutableCopy( - allocator, - capacity, - theBag, + return _CFNumberFormatterGetValueFromString( + formatter, + string, + rangep, + numberType.value, + valuePtr, ); } - late final _CFBagCreateMutableCopyPtr = _lookup< + late final _CFNumberFormatterGetValueFromStringPtr = _lookup< ffi.NativeFunction< - CFMutableBagRef Function( - CFAllocatorRef, CFIndex, CFBagRef)>>('CFBagCreateMutableCopy'); - late final _CFBagCreateMutableCopy = _CFBagCreateMutableCopyPtr.asFunction< - CFMutableBagRef Function(CFAllocatorRef, int, CFBagRef)>(); + Boolean Function( + CFNumberFormatterRef, + CFStringRef, + ffi.Pointer, + CFIndex, + ffi.Pointer)>>('CFNumberFormatterGetValueFromString'); + late final _CFNumberFormatterGetValueFromString = + _CFNumberFormatterGetValueFromStringPtr.asFunction< + int Function(CFNumberFormatterRef, CFStringRef, ffi.Pointer, + int, ffi.Pointer)>(); - int CFBagGetCount( - CFBagRef theBag, + void CFNumberFormatterSetProperty( + CFNumberFormatterRef formatter, + CFNumberFormatterKey key, + CFTypeRef value, ) { - return _CFBagGetCount( - theBag, + return _CFNumberFormatterSetProperty( + formatter, + key, + value, ); } - late final _CFBagGetCountPtr = - _lookup>('CFBagGetCount'); - late final _CFBagGetCount = - _CFBagGetCountPtr.asFunction(); + late final _CFNumberFormatterSetPropertyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFNumberFormatterRef, CFNumberFormatterKey, + CFTypeRef)>>('CFNumberFormatterSetProperty'); + late final _CFNumberFormatterSetProperty = + _CFNumberFormatterSetPropertyPtr.asFunction< + void Function( + CFNumberFormatterRef, CFNumberFormatterKey, CFTypeRef)>(); - int CFBagGetCountOfValue( - CFBagRef theBag, - ffi.Pointer value, + CFTypeRef CFNumberFormatterCopyProperty( + CFNumberFormatterRef formatter, + CFNumberFormatterKey key, ) { - return _CFBagGetCountOfValue( - theBag, - value, + return _CFNumberFormatterCopyProperty( + formatter, + key, ); } - late final _CFBagGetCountOfValuePtr = _lookup< - ffi - .NativeFunction)>>( - 'CFBagGetCountOfValue'); - late final _CFBagGetCountOfValue = _CFBagGetCountOfValuePtr.asFunction< - int Function(CFBagRef, ffi.Pointer)>(); + late final _CFNumberFormatterCopyPropertyPtr = _lookup< + ffi.NativeFunction< + CFTypeRef Function(CFNumberFormatterRef, + CFNumberFormatterKey)>>('CFNumberFormatterCopyProperty'); + late final _CFNumberFormatterCopyProperty = + _CFNumberFormatterCopyPropertyPtr.asFunction< + CFTypeRef Function(CFNumberFormatterRef, CFNumberFormatterKey)>(); - int CFBagContainsValue( - CFBagRef theBag, - ffi.Pointer value, - ) { - return _CFBagContainsValue( - theBag, - value, - ); - } + late final ffi.Pointer _kCFNumberFormatterCurrencyCode = + _lookup('kCFNumberFormatterCurrencyCode'); - late final _CFBagContainsValuePtr = _lookup< - ffi - .NativeFunction)>>( - 'CFBagContainsValue'); - late final _CFBagContainsValue = _CFBagContainsValuePtr.asFunction< - int Function(CFBagRef, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterCurrencyCode => + _kCFNumberFormatterCurrencyCode.value; - ffi.Pointer CFBagGetValue( - CFBagRef theBag, - ffi.Pointer value, - ) { - return _CFBagGetValue( - theBag, - value, - ); - } + late final ffi.Pointer + _kCFNumberFormatterDecimalSeparator = + _lookup('kCFNumberFormatterDecimalSeparator'); - late final _CFBagGetValuePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - CFBagRef, ffi.Pointer)>>('CFBagGetValue'); - late final _CFBagGetValue = _CFBagGetValuePtr.asFunction< - ffi.Pointer Function(CFBagRef, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterDecimalSeparator => + _kCFNumberFormatterDecimalSeparator.value; - int CFBagGetValueIfPresent( - CFBagRef theBag, - ffi.Pointer candidate, - ffi.Pointer> value, - ) { - return _CFBagGetValueIfPresent( - theBag, - candidate, - value, - ); - } + late final ffi.Pointer + _kCFNumberFormatterCurrencyDecimalSeparator = + _lookup( + 'kCFNumberFormatterCurrencyDecimalSeparator'); - late final _CFBagGetValueIfPresentPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFBagRef, ffi.Pointer, - ffi.Pointer>)>>('CFBagGetValueIfPresent'); - late final _CFBagGetValueIfPresent = _CFBagGetValueIfPresentPtr.asFunction< - int Function(CFBagRef, ffi.Pointer, - ffi.Pointer>)>(); + CFNumberFormatterKey get kCFNumberFormatterCurrencyDecimalSeparator => + _kCFNumberFormatterCurrencyDecimalSeparator.value; - void CFBagGetValues( - CFBagRef theBag, - ffi.Pointer> values, - ) { - return _CFBagGetValues( - theBag, - values, - ); - } + late final ffi.Pointer + _kCFNumberFormatterAlwaysShowDecimalSeparator = + _lookup( + 'kCFNumberFormatterAlwaysShowDecimalSeparator'); - late final _CFBagGetValuesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFBagRef, ffi.Pointer>)>>('CFBagGetValues'); - late final _CFBagGetValues = _CFBagGetValuesPtr.asFunction< - void Function(CFBagRef, ffi.Pointer>)>(); + CFNumberFormatterKey get kCFNumberFormatterAlwaysShowDecimalSeparator => + _kCFNumberFormatterAlwaysShowDecimalSeparator.value; - void CFBagApplyFunction( - CFBagRef theBag, - CFBagApplierFunction applier, - ffi.Pointer context, - ) { - return _CFBagApplyFunction( - theBag, - applier, - context, - ); - } + late final ffi.Pointer + _kCFNumberFormatterGroupingSeparator = + _lookup('kCFNumberFormatterGroupingSeparator'); - late final _CFBagApplyFunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFBagRef, CFBagApplierFunction, - ffi.Pointer)>>('CFBagApplyFunction'); - late final _CFBagApplyFunction = _CFBagApplyFunctionPtr.asFunction< - void Function(CFBagRef, CFBagApplierFunction, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterGroupingSeparator => + _kCFNumberFormatterGroupingSeparator.value; - void CFBagAddValue( - CFMutableBagRef theBag, - ffi.Pointer value, - ) { - return _CFBagAddValue( - theBag, - value, - ); - } + late final ffi.Pointer + _kCFNumberFormatterUseGroupingSeparator = + _lookup('kCFNumberFormatterUseGroupingSeparator'); - late final _CFBagAddValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableBagRef, ffi.Pointer)>>('CFBagAddValue'); - late final _CFBagAddValue = _CFBagAddValuePtr.asFunction< - void Function(CFMutableBagRef, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterUseGroupingSeparator => + _kCFNumberFormatterUseGroupingSeparator.value; - void CFBagReplaceValue( - CFMutableBagRef theBag, - ffi.Pointer value, - ) { - return _CFBagReplaceValue( - theBag, - value, - ); - } + late final ffi.Pointer + _kCFNumberFormatterPercentSymbol = + _lookup('kCFNumberFormatterPercentSymbol'); - late final _CFBagReplaceValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableBagRef, ffi.Pointer)>>('CFBagReplaceValue'); - late final _CFBagReplaceValue = _CFBagReplaceValuePtr.asFunction< - void Function(CFMutableBagRef, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterPercentSymbol => + _kCFNumberFormatterPercentSymbol.value; - void CFBagSetValue( - CFMutableBagRef theBag, - ffi.Pointer value, - ) { - return _CFBagSetValue( - theBag, - value, - ); - } + late final ffi.Pointer _kCFNumberFormatterZeroSymbol = + _lookup('kCFNumberFormatterZeroSymbol'); - late final _CFBagSetValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableBagRef, ffi.Pointer)>>('CFBagSetValue'); - late final _CFBagSetValue = _CFBagSetValuePtr.asFunction< - void Function(CFMutableBagRef, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterZeroSymbol => + _kCFNumberFormatterZeroSymbol.value; - void CFBagRemoveValue( - CFMutableBagRef theBag, - ffi.Pointer value, - ) { - return _CFBagRemoveValue( - theBag, - value, - ); - } + late final ffi.Pointer _kCFNumberFormatterNaNSymbol = + _lookup('kCFNumberFormatterNaNSymbol'); - late final _CFBagRemoveValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableBagRef, ffi.Pointer)>>('CFBagRemoveValue'); - late final _CFBagRemoveValue = _CFBagRemoveValuePtr.asFunction< - void Function(CFMutableBagRef, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterNaNSymbol => + _kCFNumberFormatterNaNSymbol.value; - void CFBagRemoveAllValues( - CFMutableBagRef theBag, - ) { - return _CFBagRemoveAllValues( - theBag, - ); - } + late final ffi.Pointer + _kCFNumberFormatterInfinitySymbol = + _lookup('kCFNumberFormatterInfinitySymbol'); - late final _CFBagRemoveAllValuesPtr = - _lookup>( - 'CFBagRemoveAllValues'); - late final _CFBagRemoveAllValues = - _CFBagRemoveAllValuesPtr.asFunction(); + CFNumberFormatterKey get kCFNumberFormatterInfinitySymbol => + _kCFNumberFormatterInfinitySymbol.value; - late final ffi.Pointer _kCFStringBinaryHeapCallBacks = - _lookup('kCFStringBinaryHeapCallBacks'); + late final ffi.Pointer _kCFNumberFormatterMinusSign = + _lookup('kCFNumberFormatterMinusSign'); - CFBinaryHeapCallBacks get kCFStringBinaryHeapCallBacks => - _kCFStringBinaryHeapCallBacks.ref; + CFNumberFormatterKey get kCFNumberFormatterMinusSign => + _kCFNumberFormatterMinusSign.value; - int CFBinaryHeapGetTypeID() { - return _CFBinaryHeapGetTypeID(); - } + late final ffi.Pointer _kCFNumberFormatterPlusSign = + _lookup('kCFNumberFormatterPlusSign'); - late final _CFBinaryHeapGetTypeIDPtr = - _lookup>('CFBinaryHeapGetTypeID'); - late final _CFBinaryHeapGetTypeID = - _CFBinaryHeapGetTypeIDPtr.asFunction(); + CFNumberFormatterKey get kCFNumberFormatterPlusSign => + _kCFNumberFormatterPlusSign.value; - CFBinaryHeapRef CFBinaryHeapCreate( - CFAllocatorRef allocator, - int capacity, - ffi.Pointer callBacks, - ffi.Pointer compareContext, - ) { - return _CFBinaryHeapCreate( - allocator, - capacity, - callBacks, - compareContext, - ); - } + late final ffi.Pointer + _kCFNumberFormatterCurrencySymbol = + _lookup('kCFNumberFormatterCurrencySymbol'); - late final _CFBinaryHeapCreatePtr = _lookup< - ffi.NativeFunction< - CFBinaryHeapRef Function( - CFAllocatorRef, - CFIndex, - ffi.Pointer, - ffi.Pointer)>>('CFBinaryHeapCreate'); - late final _CFBinaryHeapCreate = _CFBinaryHeapCreatePtr.asFunction< - CFBinaryHeapRef Function( - CFAllocatorRef, - int, - ffi.Pointer, - ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterCurrencySymbol => + _kCFNumberFormatterCurrencySymbol.value; - CFBinaryHeapRef CFBinaryHeapCreateCopy( - CFAllocatorRef allocator, - int capacity, - CFBinaryHeapRef heap, - ) { - return _CFBinaryHeapCreateCopy( - allocator, - capacity, - heap, - ); - } + late final ffi.Pointer + _kCFNumberFormatterExponentSymbol = + _lookup('kCFNumberFormatterExponentSymbol'); - late final _CFBinaryHeapCreateCopyPtr = _lookup< - ffi.NativeFunction< - CFBinaryHeapRef Function(CFAllocatorRef, CFIndex, - CFBinaryHeapRef)>>('CFBinaryHeapCreateCopy'); - late final _CFBinaryHeapCreateCopy = _CFBinaryHeapCreateCopyPtr.asFunction< - CFBinaryHeapRef Function(CFAllocatorRef, int, CFBinaryHeapRef)>(); + CFNumberFormatterKey get kCFNumberFormatterExponentSymbol => + _kCFNumberFormatterExponentSymbol.value; - int CFBinaryHeapGetCount( - CFBinaryHeapRef heap, - ) { - return _CFBinaryHeapGetCount( - heap, - ); - } + late final ffi.Pointer + _kCFNumberFormatterMinIntegerDigits = + _lookup('kCFNumberFormatterMinIntegerDigits'); - late final _CFBinaryHeapGetCountPtr = - _lookup>( - 'CFBinaryHeapGetCount'); - late final _CFBinaryHeapGetCount = - _CFBinaryHeapGetCountPtr.asFunction(); + CFNumberFormatterKey get kCFNumberFormatterMinIntegerDigits => + _kCFNumberFormatterMinIntegerDigits.value; - int CFBinaryHeapGetCountOfValue( - CFBinaryHeapRef heap, - ffi.Pointer value, - ) { - return _CFBinaryHeapGetCountOfValue( - heap, - value, - ); - } + late final ffi.Pointer + _kCFNumberFormatterMaxIntegerDigits = + _lookup('kCFNumberFormatterMaxIntegerDigits'); - late final _CFBinaryHeapGetCountOfValuePtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFBinaryHeapRef, - ffi.Pointer)>>('CFBinaryHeapGetCountOfValue'); - late final _CFBinaryHeapGetCountOfValue = _CFBinaryHeapGetCountOfValuePtr - .asFunction)>(); + CFNumberFormatterKey get kCFNumberFormatterMaxIntegerDigits => + _kCFNumberFormatterMaxIntegerDigits.value; - int CFBinaryHeapContainsValue( - CFBinaryHeapRef heap, - ffi.Pointer value, - ) { - return _CFBinaryHeapContainsValue( - heap, - value, - ); - } + late final ffi.Pointer + _kCFNumberFormatterMinFractionDigits = + _lookup('kCFNumberFormatterMinFractionDigits'); - late final _CFBinaryHeapContainsValuePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFBinaryHeapRef, - ffi.Pointer)>>('CFBinaryHeapContainsValue'); - late final _CFBinaryHeapContainsValue = _CFBinaryHeapContainsValuePtr - .asFunction)>(); + CFNumberFormatterKey get kCFNumberFormatterMinFractionDigits => + _kCFNumberFormatterMinFractionDigits.value; - ffi.Pointer CFBinaryHeapGetMinimum( - CFBinaryHeapRef heap, - ) { - return _CFBinaryHeapGetMinimum( - heap, - ); - } + late final ffi.Pointer + _kCFNumberFormatterMaxFractionDigits = + _lookup('kCFNumberFormatterMaxFractionDigits'); - late final _CFBinaryHeapGetMinimumPtr = _lookup< - ffi.NativeFunction Function(CFBinaryHeapRef)>>( - 'CFBinaryHeapGetMinimum'); - late final _CFBinaryHeapGetMinimum = _CFBinaryHeapGetMinimumPtr.asFunction< - ffi.Pointer Function(CFBinaryHeapRef)>(); + CFNumberFormatterKey get kCFNumberFormatterMaxFractionDigits => + _kCFNumberFormatterMaxFractionDigits.value; - int CFBinaryHeapGetMinimumIfPresent( - CFBinaryHeapRef heap, - ffi.Pointer> value, - ) { - return _CFBinaryHeapGetMinimumIfPresent( - heap, - value, - ); - } + late final ffi.Pointer _kCFNumberFormatterGroupingSize = + _lookup('kCFNumberFormatterGroupingSize'); - late final _CFBinaryHeapGetMinimumIfPresentPtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFBinaryHeapRef, ffi.Pointer>)>>( - 'CFBinaryHeapGetMinimumIfPresent'); - late final _CFBinaryHeapGetMinimumIfPresent = - _CFBinaryHeapGetMinimumIfPresentPtr.asFunction< - int Function(CFBinaryHeapRef, ffi.Pointer>)>(); + CFNumberFormatterKey get kCFNumberFormatterGroupingSize => + _kCFNumberFormatterGroupingSize.value; - void CFBinaryHeapGetValues( - CFBinaryHeapRef heap, - ffi.Pointer> values, - ) { - return _CFBinaryHeapGetValues( - heap, - values, - ); - } + late final ffi.Pointer + _kCFNumberFormatterSecondaryGroupingSize = + _lookup('kCFNumberFormatterSecondaryGroupingSize'); - late final _CFBinaryHeapGetValuesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFBinaryHeapRef, - ffi.Pointer>)>>('CFBinaryHeapGetValues'); - late final _CFBinaryHeapGetValues = _CFBinaryHeapGetValuesPtr.asFunction< - void Function(CFBinaryHeapRef, ffi.Pointer>)>(); + CFNumberFormatterKey get kCFNumberFormatterSecondaryGroupingSize => + _kCFNumberFormatterSecondaryGroupingSize.value; - void CFBinaryHeapApplyFunction( - CFBinaryHeapRef heap, - CFBinaryHeapApplierFunction applier, - ffi.Pointer context, - ) { - return _CFBinaryHeapApplyFunction( - heap, - applier, - context, - ); - } + late final ffi.Pointer _kCFNumberFormatterRoundingMode = + _lookup('kCFNumberFormatterRoundingMode'); - late final _CFBinaryHeapApplyFunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFBinaryHeapRef, CFBinaryHeapApplierFunction, - ffi.Pointer)>>('CFBinaryHeapApplyFunction'); - late final _CFBinaryHeapApplyFunction = - _CFBinaryHeapApplyFunctionPtr.asFunction< - void Function(CFBinaryHeapRef, CFBinaryHeapApplierFunction, - ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterRoundingMode => + _kCFNumberFormatterRoundingMode.value; - void CFBinaryHeapAddValue( - CFBinaryHeapRef heap, - ffi.Pointer value, - ) { - return _CFBinaryHeapAddValue( - heap, - value, - ); - } + late final ffi.Pointer + _kCFNumberFormatterRoundingIncrement = + _lookup('kCFNumberFormatterRoundingIncrement'); - late final _CFBinaryHeapAddValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFBinaryHeapRef, ffi.Pointer)>>('CFBinaryHeapAddValue'); - late final _CFBinaryHeapAddValue = _CFBinaryHeapAddValuePtr.asFunction< - void Function(CFBinaryHeapRef, ffi.Pointer)>(); + CFNumberFormatterKey get kCFNumberFormatterRoundingIncrement => + _kCFNumberFormatterRoundingIncrement.value; - void CFBinaryHeapRemoveMinimumValue( - CFBinaryHeapRef heap, - ) { - return _CFBinaryHeapRemoveMinimumValue( - heap, - ); - } + late final ffi.Pointer _kCFNumberFormatterFormatWidth = + _lookup('kCFNumberFormatterFormatWidth'); - late final _CFBinaryHeapRemoveMinimumValuePtr = - _lookup>( - 'CFBinaryHeapRemoveMinimumValue'); - late final _CFBinaryHeapRemoveMinimumValue = - _CFBinaryHeapRemoveMinimumValuePtr.asFunction< - void Function(CFBinaryHeapRef)>(); + CFNumberFormatterKey get kCFNumberFormatterFormatWidth => + _kCFNumberFormatterFormatWidth.value; - void CFBinaryHeapRemoveAllValues( - CFBinaryHeapRef heap, - ) { - return _CFBinaryHeapRemoveAllValues( - heap, - ); - } + late final ffi.Pointer + _kCFNumberFormatterPaddingPosition = + _lookup('kCFNumberFormatterPaddingPosition'); - late final _CFBinaryHeapRemoveAllValuesPtr = - _lookup>( - 'CFBinaryHeapRemoveAllValues'); - late final _CFBinaryHeapRemoveAllValues = _CFBinaryHeapRemoveAllValuesPtr - .asFunction(); + CFNumberFormatterKey get kCFNumberFormatterPaddingPosition => + _kCFNumberFormatterPaddingPosition.value; - int CFBitVectorGetTypeID() { - return _CFBitVectorGetTypeID(); - } + late final ffi.Pointer + _kCFNumberFormatterPaddingCharacter = + _lookup('kCFNumberFormatterPaddingCharacter'); - late final _CFBitVectorGetTypeIDPtr = - _lookup>('CFBitVectorGetTypeID'); - late final _CFBitVectorGetTypeID = - _CFBitVectorGetTypeIDPtr.asFunction(); + CFNumberFormatterKey get kCFNumberFormatterPaddingCharacter => + _kCFNumberFormatterPaddingCharacter.value; - CFBitVectorRef CFBitVectorCreate( - CFAllocatorRef allocator, - ffi.Pointer bytes, - int numBits, + late final ffi.Pointer + _kCFNumberFormatterDefaultFormat = + _lookup('kCFNumberFormatterDefaultFormat'); + + CFNumberFormatterKey get kCFNumberFormatterDefaultFormat => + _kCFNumberFormatterDefaultFormat.value; + + late final ffi.Pointer _kCFNumberFormatterMultiplier = + _lookup('kCFNumberFormatterMultiplier'); + + CFNumberFormatterKey get kCFNumberFormatterMultiplier => + _kCFNumberFormatterMultiplier.value; + + late final ffi.Pointer + _kCFNumberFormatterPositivePrefix = + _lookup('kCFNumberFormatterPositivePrefix'); + + CFNumberFormatterKey get kCFNumberFormatterPositivePrefix => + _kCFNumberFormatterPositivePrefix.value; + + late final ffi.Pointer + _kCFNumberFormatterPositiveSuffix = + _lookup('kCFNumberFormatterPositiveSuffix'); + + CFNumberFormatterKey get kCFNumberFormatterPositiveSuffix => + _kCFNumberFormatterPositiveSuffix.value; + + late final ffi.Pointer + _kCFNumberFormatterNegativePrefix = + _lookup('kCFNumberFormatterNegativePrefix'); + + CFNumberFormatterKey get kCFNumberFormatterNegativePrefix => + _kCFNumberFormatterNegativePrefix.value; + + late final ffi.Pointer + _kCFNumberFormatterNegativeSuffix = + _lookup('kCFNumberFormatterNegativeSuffix'); + + CFNumberFormatterKey get kCFNumberFormatterNegativeSuffix => + _kCFNumberFormatterNegativeSuffix.value; + + late final ffi.Pointer + _kCFNumberFormatterPerMillSymbol = + _lookup('kCFNumberFormatterPerMillSymbol'); + + CFNumberFormatterKey get kCFNumberFormatterPerMillSymbol => + _kCFNumberFormatterPerMillSymbol.value; + + late final ffi.Pointer + _kCFNumberFormatterInternationalCurrencySymbol = + _lookup( + 'kCFNumberFormatterInternationalCurrencySymbol'); + + CFNumberFormatterKey get kCFNumberFormatterInternationalCurrencySymbol => + _kCFNumberFormatterInternationalCurrencySymbol.value; + + late final ffi.Pointer + _kCFNumberFormatterCurrencyGroupingSeparator = + _lookup( + 'kCFNumberFormatterCurrencyGroupingSeparator'); + + CFNumberFormatterKey get kCFNumberFormatterCurrencyGroupingSeparator => + _kCFNumberFormatterCurrencyGroupingSeparator.value; + + late final ffi.Pointer _kCFNumberFormatterIsLenient = + _lookup('kCFNumberFormatterIsLenient'); + + CFNumberFormatterKey get kCFNumberFormatterIsLenient => + _kCFNumberFormatterIsLenient.value; + + late final ffi.Pointer + _kCFNumberFormatterUseSignificantDigits = + _lookup('kCFNumberFormatterUseSignificantDigits'); + + CFNumberFormatterKey get kCFNumberFormatterUseSignificantDigits => + _kCFNumberFormatterUseSignificantDigits.value; + + late final ffi.Pointer + _kCFNumberFormatterMinSignificantDigits = + _lookup('kCFNumberFormatterMinSignificantDigits'); + + CFNumberFormatterKey get kCFNumberFormatterMinSignificantDigits => + _kCFNumberFormatterMinSignificantDigits.value; + + late final ffi.Pointer + _kCFNumberFormatterMaxSignificantDigits = + _lookup('kCFNumberFormatterMaxSignificantDigits'); + + CFNumberFormatterKey get kCFNumberFormatterMaxSignificantDigits => + _kCFNumberFormatterMaxSignificantDigits.value; + + int CFNumberFormatterGetDecimalInfoForCurrencyCode( + CFStringRef currencyCode, + ffi.Pointer defaultFractionDigits, + ffi.Pointer roundingIncrement, ) { - return _CFBitVectorCreate( - allocator, - bytes, - numBits, + return _CFNumberFormatterGetDecimalInfoForCurrencyCode( + currencyCode, + defaultFractionDigits, + roundingIncrement, ); } - late final _CFBitVectorCreatePtr = _lookup< - ffi.NativeFunction< - CFBitVectorRef Function(CFAllocatorRef, ffi.Pointer, - CFIndex)>>('CFBitVectorCreate'); - late final _CFBitVectorCreate = _CFBitVectorCreatePtr.asFunction< - CFBitVectorRef Function(CFAllocatorRef, ffi.Pointer, int)>(); + late final _CFNumberFormatterGetDecimalInfoForCurrencyCodePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFStringRef, ffi.Pointer, + ffi.Pointer)>>( + 'CFNumberFormatterGetDecimalInfoForCurrencyCode'); + late final _CFNumberFormatterGetDecimalInfoForCurrencyCode = + _CFNumberFormatterGetDecimalInfoForCurrencyCodePtr.asFunction< + int Function( + CFStringRef, ffi.Pointer, ffi.Pointer)>(); - CFBitVectorRef CFBitVectorCreateCopy( - CFAllocatorRef allocator, - CFBitVectorRef bv, + late final ffi.Pointer _kCFPreferencesAnyApplication = + _lookup('kCFPreferencesAnyApplication'); + + CFStringRef get kCFPreferencesAnyApplication => + _kCFPreferencesAnyApplication.value; + + set kCFPreferencesAnyApplication(CFStringRef value) => + _kCFPreferencesAnyApplication.value = value; + + late final ffi.Pointer _kCFPreferencesCurrentApplication = + _lookup('kCFPreferencesCurrentApplication'); + + CFStringRef get kCFPreferencesCurrentApplication => + _kCFPreferencesCurrentApplication.value; + + set kCFPreferencesCurrentApplication(CFStringRef value) => + _kCFPreferencesCurrentApplication.value = value; + + late final ffi.Pointer _kCFPreferencesAnyHost = + _lookup('kCFPreferencesAnyHost'); + + CFStringRef get kCFPreferencesAnyHost => _kCFPreferencesAnyHost.value; + + set kCFPreferencesAnyHost(CFStringRef value) => + _kCFPreferencesAnyHost.value = value; + + late final ffi.Pointer _kCFPreferencesCurrentHost = + _lookup('kCFPreferencesCurrentHost'); + + CFStringRef get kCFPreferencesCurrentHost => _kCFPreferencesCurrentHost.value; + + set kCFPreferencesCurrentHost(CFStringRef value) => + _kCFPreferencesCurrentHost.value = value; + + late final ffi.Pointer _kCFPreferencesAnyUser = + _lookup('kCFPreferencesAnyUser'); + + CFStringRef get kCFPreferencesAnyUser => _kCFPreferencesAnyUser.value; + + set kCFPreferencesAnyUser(CFStringRef value) => + _kCFPreferencesAnyUser.value = value; + + late final ffi.Pointer _kCFPreferencesCurrentUser = + _lookup('kCFPreferencesCurrentUser'); + + CFStringRef get kCFPreferencesCurrentUser => _kCFPreferencesCurrentUser.value; + + set kCFPreferencesCurrentUser(CFStringRef value) => + _kCFPreferencesCurrentUser.value = value; + + CFPropertyListRef CFPreferencesCopyAppValue( + CFStringRef key, + CFStringRef applicationID, ) { - return _CFBitVectorCreateCopy( - allocator, - bv, + return _CFPreferencesCopyAppValue( + key, + applicationID, ); } - late final _CFBitVectorCreateCopyPtr = _lookup< + late final _CFPreferencesCopyAppValuePtr = _lookup< ffi.NativeFunction< - CFBitVectorRef Function( - CFAllocatorRef, CFBitVectorRef)>>('CFBitVectorCreateCopy'); - late final _CFBitVectorCreateCopy = _CFBitVectorCreateCopyPtr.asFunction< - CFBitVectorRef Function(CFAllocatorRef, CFBitVectorRef)>(); + CFPropertyListRef Function( + CFStringRef, CFStringRef)>>('CFPreferencesCopyAppValue'); + late final _CFPreferencesCopyAppValue = _CFPreferencesCopyAppValuePtr + .asFunction(); - CFMutableBitVectorRef CFBitVectorCreateMutable( - CFAllocatorRef allocator, - int capacity, + int CFPreferencesGetAppBooleanValue( + CFStringRef key, + CFStringRef applicationID, + ffi.Pointer keyExistsAndHasValidFormat, ) { - return _CFBitVectorCreateMutable( - allocator, - capacity, + return _CFPreferencesGetAppBooleanValue( + key, + applicationID, + keyExistsAndHasValidFormat, ); } - late final _CFBitVectorCreateMutablePtr = _lookup< + late final _CFPreferencesGetAppBooleanValuePtr = _lookup< ffi.NativeFunction< - CFMutableBitVectorRef Function( - CFAllocatorRef, CFIndex)>>('CFBitVectorCreateMutable'); - late final _CFBitVectorCreateMutable = _CFBitVectorCreateMutablePtr - .asFunction(); + Boolean Function(CFStringRef, CFStringRef, + ffi.Pointer)>>('CFPreferencesGetAppBooleanValue'); + late final _CFPreferencesGetAppBooleanValue = + _CFPreferencesGetAppBooleanValuePtr.asFunction< + int Function(CFStringRef, CFStringRef, ffi.Pointer)>(); - CFMutableBitVectorRef CFBitVectorCreateMutableCopy( - CFAllocatorRef allocator, - int capacity, - CFBitVectorRef bv, + int CFPreferencesGetAppIntegerValue( + CFStringRef key, + CFStringRef applicationID, + ffi.Pointer keyExistsAndHasValidFormat, ) { - return _CFBitVectorCreateMutableCopy( - allocator, - capacity, - bv, + return _CFPreferencesGetAppIntegerValue( + key, + applicationID, + keyExistsAndHasValidFormat, ); } - late final _CFBitVectorCreateMutableCopyPtr = _lookup< + late final _CFPreferencesGetAppIntegerValuePtr = _lookup< ffi.NativeFunction< - CFMutableBitVectorRef Function(CFAllocatorRef, CFIndex, - CFBitVectorRef)>>('CFBitVectorCreateMutableCopy'); - late final _CFBitVectorCreateMutableCopy = - _CFBitVectorCreateMutableCopyPtr.asFunction< - CFMutableBitVectorRef Function( - CFAllocatorRef, int, CFBitVectorRef)>(); + CFIndex Function(CFStringRef, CFStringRef, + ffi.Pointer)>>('CFPreferencesGetAppIntegerValue'); + late final _CFPreferencesGetAppIntegerValue = + _CFPreferencesGetAppIntegerValuePtr.asFunction< + int Function(CFStringRef, CFStringRef, ffi.Pointer)>(); - int CFBitVectorGetCount( - CFBitVectorRef bv, + void CFPreferencesSetAppValue( + CFStringRef key, + CFPropertyListRef value, + CFStringRef applicationID, ) { - return _CFBitVectorGetCount( - bv, + return _CFPreferencesSetAppValue( + key, + value, + applicationID, ); } - late final _CFBitVectorGetCountPtr = - _lookup>( - 'CFBitVectorGetCount'); - late final _CFBitVectorGetCount = - _CFBitVectorGetCountPtr.asFunction(); + late final _CFPreferencesSetAppValuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFStringRef, CFPropertyListRef, + CFStringRef)>>('CFPreferencesSetAppValue'); + late final _CFPreferencesSetAppValue = _CFPreferencesSetAppValuePtr + .asFunction(); - int CFBitVectorGetCountOfBit( - CFBitVectorRef bv, - CFRange range, - int value, + void CFPreferencesAddSuitePreferencesToApp( + CFStringRef applicationID, + CFStringRef suiteID, ) { - return _CFBitVectorGetCountOfBit( - bv, - range, - value, + return _CFPreferencesAddSuitePreferencesToApp( + applicationID, + suiteID, ); } - late final _CFBitVectorGetCountOfBitPtr = _lookup< - ffi.NativeFunction>( - 'CFBitVectorGetCountOfBit'); - late final _CFBitVectorGetCountOfBit = _CFBitVectorGetCountOfBitPtr - .asFunction(); + late final _CFPreferencesAddSuitePreferencesToAppPtr = + _lookup>( + 'CFPreferencesAddSuitePreferencesToApp'); + late final _CFPreferencesAddSuitePreferencesToApp = + _CFPreferencesAddSuitePreferencesToAppPtr.asFunction< + void Function(CFStringRef, CFStringRef)>(); - int CFBitVectorContainsBit( - CFBitVectorRef bv, - CFRange range, - int value, + void CFPreferencesRemoveSuitePreferencesFromApp( + CFStringRef applicationID, + CFStringRef suiteID, ) { - return _CFBitVectorContainsBit( - bv, - range, - value, + return _CFPreferencesRemoveSuitePreferencesFromApp( + applicationID, + suiteID, ); } - late final _CFBitVectorContainsBitPtr = _lookup< - ffi.NativeFunction>( - 'CFBitVectorContainsBit'); - late final _CFBitVectorContainsBit = _CFBitVectorContainsBitPtr.asFunction< - int Function(CFBitVectorRef, CFRange, int)>(); + late final _CFPreferencesRemoveSuitePreferencesFromAppPtr = + _lookup>( + 'CFPreferencesRemoveSuitePreferencesFromApp'); + late final _CFPreferencesRemoveSuitePreferencesFromApp = + _CFPreferencesRemoveSuitePreferencesFromAppPtr.asFunction< + void Function(CFStringRef, CFStringRef)>(); - int CFBitVectorGetBitAtIndex( - CFBitVectorRef bv, - int idx, + int CFPreferencesAppSynchronize( + CFStringRef applicationID, ) { - return _CFBitVectorGetBitAtIndex( - bv, - idx, + return _CFPreferencesAppSynchronize( + applicationID, ); } - late final _CFBitVectorGetBitAtIndexPtr = - _lookup>( - 'CFBitVectorGetBitAtIndex'); - late final _CFBitVectorGetBitAtIndex = _CFBitVectorGetBitAtIndexPtr - .asFunction(); + late final _CFPreferencesAppSynchronizePtr = + _lookup>( + 'CFPreferencesAppSynchronize'); + late final _CFPreferencesAppSynchronize = + _CFPreferencesAppSynchronizePtr.asFunction(); - void CFBitVectorGetBits( - CFBitVectorRef bv, - CFRange range, - ffi.Pointer bytes, + CFPropertyListRef CFPreferencesCopyValue( + CFStringRef key, + CFStringRef applicationID, + CFStringRef userName, + CFStringRef hostName, ) { - return _CFBitVectorGetBits( - bv, - range, - bytes, + return _CFPreferencesCopyValue( + key, + applicationID, + userName, + hostName, ); } - late final _CFBitVectorGetBitsPtr = _lookup< + late final _CFPreferencesCopyValuePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFBitVectorRef, CFRange, - ffi.Pointer)>>('CFBitVectorGetBits'); - late final _CFBitVectorGetBits = _CFBitVectorGetBitsPtr.asFunction< - void Function(CFBitVectorRef, CFRange, ffi.Pointer)>(); + CFPropertyListRef Function(CFStringRef, CFStringRef, CFStringRef, + CFStringRef)>>('CFPreferencesCopyValue'); + late final _CFPreferencesCopyValue = _CFPreferencesCopyValuePtr.asFunction< + CFPropertyListRef Function( + CFStringRef, CFStringRef, CFStringRef, CFStringRef)>(); - int CFBitVectorGetFirstIndexOfBit( - CFBitVectorRef bv, - CFRange range, - int value, + CFDictionaryRef CFPreferencesCopyMultiple( + CFArrayRef keysToFetch, + CFStringRef applicationID, + CFStringRef userName, + CFStringRef hostName, ) { - return _CFBitVectorGetFirstIndexOfBit( - bv, - range, - value, + return _CFPreferencesCopyMultiple( + keysToFetch, + applicationID, + userName, + hostName, ); } - late final _CFBitVectorGetFirstIndexOfBitPtr = _lookup< - ffi.NativeFunction>( - 'CFBitVectorGetFirstIndexOfBit'); - late final _CFBitVectorGetFirstIndexOfBit = _CFBitVectorGetFirstIndexOfBitPtr - .asFunction(); + late final _CFPreferencesCopyMultiplePtr = _lookup< + ffi.NativeFunction< + CFDictionaryRef Function(CFArrayRef, CFStringRef, CFStringRef, + CFStringRef)>>('CFPreferencesCopyMultiple'); + late final _CFPreferencesCopyMultiple = + _CFPreferencesCopyMultiplePtr.asFunction< + CFDictionaryRef Function( + CFArrayRef, CFStringRef, CFStringRef, CFStringRef)>(); - int CFBitVectorGetLastIndexOfBit( - CFBitVectorRef bv, - CFRange range, - int value, + void CFPreferencesSetValue( + CFStringRef key, + CFPropertyListRef value, + CFStringRef applicationID, + CFStringRef userName, + CFStringRef hostName, ) { - return _CFBitVectorGetLastIndexOfBit( - bv, - range, + return _CFPreferencesSetValue( + key, value, + applicationID, + userName, + hostName, ); } - late final _CFBitVectorGetLastIndexOfBitPtr = _lookup< - ffi.NativeFunction>( - 'CFBitVectorGetLastIndexOfBit'); - late final _CFBitVectorGetLastIndexOfBit = _CFBitVectorGetLastIndexOfBitPtr - .asFunction(); + late final _CFPreferencesSetValuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFStringRef, CFPropertyListRef, CFStringRef, + CFStringRef, CFStringRef)>>('CFPreferencesSetValue'); + late final _CFPreferencesSetValue = _CFPreferencesSetValuePtr.asFunction< + void Function(CFStringRef, CFPropertyListRef, CFStringRef, CFStringRef, + CFStringRef)>(); - void CFBitVectorSetCount( - CFMutableBitVectorRef bv, - int count, + void CFPreferencesSetMultiple( + CFDictionaryRef keysToSet, + CFArrayRef keysToRemove, + CFStringRef applicationID, + CFStringRef userName, + CFStringRef hostName, ) { - return _CFBitVectorSetCount( - bv, - count, + return _CFPreferencesSetMultiple( + keysToSet, + keysToRemove, + applicationID, + userName, + hostName, ); } - late final _CFBitVectorSetCountPtr = _lookup< - ffi - .NativeFunction>( - 'CFBitVectorSetCount'); - late final _CFBitVectorSetCount = _CFBitVectorSetCountPtr.asFunction< - void Function(CFMutableBitVectorRef, int)>(); + late final _CFPreferencesSetMultiplePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFDictionaryRef, CFArrayRef, CFStringRef, + CFStringRef, CFStringRef)>>('CFPreferencesSetMultiple'); + late final _CFPreferencesSetMultiple = + _CFPreferencesSetMultiplePtr.asFunction< + void Function(CFDictionaryRef, CFArrayRef, CFStringRef, CFStringRef, + CFStringRef)>(); - void CFBitVectorFlipBitAtIndex( - CFMutableBitVectorRef bv, - int idx, + int CFPreferencesSynchronize( + CFStringRef applicationID, + CFStringRef userName, + CFStringRef hostName, ) { - return _CFBitVectorFlipBitAtIndex( - bv, - idx, + return _CFPreferencesSynchronize( + applicationID, + userName, + hostName, ); } - late final _CFBitVectorFlipBitAtIndexPtr = _lookup< - ffi - .NativeFunction>( - 'CFBitVectorFlipBitAtIndex'); - late final _CFBitVectorFlipBitAtIndex = _CFBitVectorFlipBitAtIndexPtr - .asFunction(); + late final _CFPreferencesSynchronizePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFStringRef, CFStringRef, + CFStringRef)>>('CFPreferencesSynchronize'); + late final _CFPreferencesSynchronize = _CFPreferencesSynchronizePtr + .asFunction(); - void CFBitVectorFlipBits( - CFMutableBitVectorRef bv, - CFRange range, + CFArrayRef CFPreferencesCopyApplicationList( + CFStringRef userName, + CFStringRef hostName, ) { - return _CFBitVectorFlipBits( - bv, - range, + return _CFPreferencesCopyApplicationList( + userName, + hostName, ); } - late final _CFBitVectorFlipBitsPtr = _lookup< - ffi - .NativeFunction>( - 'CFBitVectorFlipBits'); - late final _CFBitVectorFlipBits = _CFBitVectorFlipBitsPtr.asFunction< - void Function(CFMutableBitVectorRef, CFRange)>(); + late final _CFPreferencesCopyApplicationListPtr = _lookup< + ffi.NativeFunction>( + 'CFPreferencesCopyApplicationList'); + late final _CFPreferencesCopyApplicationList = + _CFPreferencesCopyApplicationListPtr.asFunction< + CFArrayRef Function(CFStringRef, CFStringRef)>(); - void CFBitVectorSetBitAtIndex( - CFMutableBitVectorRef bv, - int idx, - int value, + CFArrayRef CFPreferencesCopyKeyList( + CFStringRef applicationID, + CFStringRef userName, + CFStringRef hostName, ) { - return _CFBitVectorSetBitAtIndex( - bv, - idx, - value, + return _CFPreferencesCopyKeyList( + applicationID, + userName, + hostName, ); } - late final _CFBitVectorSetBitAtIndexPtr = _lookup< + late final _CFPreferencesCopyKeyListPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFMutableBitVectorRef, CFIndex, - CFBit)>>('CFBitVectorSetBitAtIndex'); - late final _CFBitVectorSetBitAtIndex = _CFBitVectorSetBitAtIndexPtr - .asFunction(); + CFArrayRef Function(CFStringRef, CFStringRef, + CFStringRef)>>('CFPreferencesCopyKeyList'); + late final _CFPreferencesCopyKeyList = _CFPreferencesCopyKeyListPtr + .asFunction(); - void CFBitVectorSetBits( - CFMutableBitVectorRef bv, - CFRange range, - int value, + int CFPreferencesAppValueIsForced( + CFStringRef key, + CFStringRef applicationID, ) { - return _CFBitVectorSetBits( - bv, - range, - value, + return _CFPreferencesAppValueIsForced( + key, + applicationID, ); } - late final _CFBitVectorSetBitsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableBitVectorRef, CFRange, CFBit)>>('CFBitVectorSetBits'); - late final _CFBitVectorSetBits = _CFBitVectorSetBitsPtr.asFunction< - void Function(CFMutableBitVectorRef, CFRange, int)>(); + late final _CFPreferencesAppValueIsForcedPtr = + _lookup>( + 'CFPreferencesAppValueIsForced'); + late final _CFPreferencesAppValueIsForced = _CFPreferencesAppValueIsForcedPtr + .asFunction(); - void CFBitVectorSetAllBits( - CFMutableBitVectorRef bv, - int value, - ) { - return _CFBitVectorSetAllBits( - bv, - value, - ); + int CFURLGetTypeID() { + return _CFURLGetTypeID(); } - late final _CFBitVectorSetAllBitsPtr = _lookup< - ffi.NativeFunction>( - 'CFBitVectorSetAllBits'); - late final _CFBitVectorSetAllBits = _CFBitVectorSetAllBitsPtr.asFunction< - void Function(CFMutableBitVectorRef, int)>(); - - late final ffi.Pointer - _kCFTypeDictionaryKeyCallBacks = - _lookup('kCFTypeDictionaryKeyCallBacks'); - - CFDictionaryKeyCallBacks get kCFTypeDictionaryKeyCallBacks => - _kCFTypeDictionaryKeyCallBacks.ref; - - late final ffi.Pointer - _kCFCopyStringDictionaryKeyCallBacks = - _lookup('kCFCopyStringDictionaryKeyCallBacks'); - - CFDictionaryKeyCallBacks get kCFCopyStringDictionaryKeyCallBacks => - _kCFCopyStringDictionaryKeyCallBacks.ref; - - late final ffi.Pointer - _kCFTypeDictionaryValueCallBacks = - _lookup('kCFTypeDictionaryValueCallBacks'); - - CFDictionaryValueCallBacks get kCFTypeDictionaryValueCallBacks => - _kCFTypeDictionaryValueCallBacks.ref; + late final _CFURLGetTypeIDPtr = + _lookup>('CFURLGetTypeID'); + late final _CFURLGetTypeID = _CFURLGetTypeIDPtr.asFunction(); - int CFDictionaryGetTypeID() { - return _CFDictionaryGetTypeID(); + CFURLRef CFURLCreateWithBytes( + CFAllocatorRef allocator, + ffi.Pointer URLBytes, + int length, + int encoding, + CFURLRef baseURL, + ) { + return _CFURLCreateWithBytes( + allocator, + URLBytes, + length, + encoding, + baseURL, + ); } - late final _CFDictionaryGetTypeIDPtr = - _lookup>('CFDictionaryGetTypeID'); - late final _CFDictionaryGetTypeID = - _CFDictionaryGetTypeIDPtr.asFunction(); + late final _CFURLCreateWithBytesPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, + CFStringEncoding, CFURLRef)>>('CFURLCreateWithBytes'); + late final _CFURLCreateWithBytes = _CFURLCreateWithBytesPtr.asFunction< + CFURLRef Function( + CFAllocatorRef, ffi.Pointer, int, int, CFURLRef)>(); - CFDictionaryRef CFDictionaryCreate( + CFDataRef CFURLCreateData( CFAllocatorRef allocator, - ffi.Pointer> keys, - ffi.Pointer> values, - int numValues, - ffi.Pointer keyCallBacks, - ffi.Pointer valueCallBacks, + CFURLRef url, + int encoding, + int escapeWhitespace, ) { - return _CFDictionaryCreate( + return _CFURLCreateData( allocator, - keys, - values, - numValues, - keyCallBacks, - valueCallBacks, + url, + encoding, + escapeWhitespace, ); } - late final _CFDictionaryCreatePtr = _lookup< + late final _CFURLCreateDataPtr = _lookup< ffi.NativeFunction< - CFDictionaryRef Function( - CFAllocatorRef, - ffi.Pointer>, - ffi.Pointer>, - CFIndex, - ffi.Pointer, - ffi.Pointer)>>('CFDictionaryCreate'); - late final _CFDictionaryCreate = _CFDictionaryCreatePtr.asFunction< - CFDictionaryRef Function( - CFAllocatorRef, - ffi.Pointer>, - ffi.Pointer>, - int, - ffi.Pointer, - ffi.Pointer)>(); + CFDataRef Function(CFAllocatorRef, CFURLRef, CFStringEncoding, + Boolean)>>('CFURLCreateData'); + late final _CFURLCreateData = _CFURLCreateDataPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFURLRef, int, int)>(); - CFDictionaryRef CFDictionaryCreateCopy( + CFURLRef CFURLCreateWithString( CFAllocatorRef allocator, - CFDictionaryRef theDict, + CFStringRef URLString, + CFURLRef baseURL, ) { - return _CFDictionaryCreateCopy( + return _CFURLCreateWithString( allocator, - theDict, + URLString, + baseURL, ); } - late final _CFDictionaryCreateCopyPtr = _lookup< + late final _CFURLCreateWithStringPtr = _lookup< ffi.NativeFunction< - CFDictionaryRef Function( - CFAllocatorRef, CFDictionaryRef)>>('CFDictionaryCreateCopy'); - late final _CFDictionaryCreateCopy = _CFDictionaryCreateCopyPtr.asFunction< - CFDictionaryRef Function(CFAllocatorRef, CFDictionaryRef)>(); + CFURLRef Function( + CFAllocatorRef, CFStringRef, CFURLRef)>>('CFURLCreateWithString'); + late final _CFURLCreateWithString = _CFURLCreateWithStringPtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFStringRef, CFURLRef)>(); - CFMutableDictionaryRef CFDictionaryCreateMutable( - CFAllocatorRef allocator, - int capacity, - ffi.Pointer keyCallBacks, - ffi.Pointer valueCallBacks, + CFURLRef CFURLCreateAbsoluteURLWithBytes( + CFAllocatorRef alloc, + ffi.Pointer relativeURLBytes, + int length, + int encoding, + CFURLRef baseURL, + int useCompatibilityMode, ) { - return _CFDictionaryCreateMutable( - allocator, - capacity, - keyCallBacks, - valueCallBacks, + return _CFURLCreateAbsoluteURLWithBytes( + alloc, + relativeURLBytes, + length, + encoding, + baseURL, + useCompatibilityMode, ); } - late final _CFDictionaryCreateMutablePtr = _lookup< - ffi.NativeFunction< - CFMutableDictionaryRef Function( - CFAllocatorRef, - CFIndex, - ffi.Pointer, - ffi.Pointer)>>( - 'CFDictionaryCreateMutable'); - late final _CFDictionaryCreateMutable = - _CFDictionaryCreateMutablePtr.asFunction< - CFMutableDictionaryRef Function( + late final _CFURLCreateAbsoluteURLWithBytesPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function( CFAllocatorRef, - int, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer, + CFIndex, + CFStringEncoding, + CFURLRef, + Boolean)>>('CFURLCreateAbsoluteURLWithBytes'); + late final _CFURLCreateAbsoluteURLWithBytes = + _CFURLCreateAbsoluteURLWithBytesPtr.asFunction< + CFURLRef Function( + CFAllocatorRef, ffi.Pointer, int, int, CFURLRef, int)>(); - CFMutableDictionaryRef CFDictionaryCreateMutableCopy( + CFURLRef CFURLCreateWithFileSystemPath( CFAllocatorRef allocator, - int capacity, - CFDictionaryRef theDict, + CFStringRef filePath, + CFURLPathStyle pathStyle, + DartBoolean isDirectory, ) { - return _CFDictionaryCreateMutableCopy( + return _CFURLCreateWithFileSystemPath( allocator, - capacity, - theDict, + filePath, + pathStyle.value, + isDirectory, ); } - late final _CFDictionaryCreateMutableCopyPtr = _lookup< + late final _CFURLCreateWithFileSystemPathPtr = _lookup< ffi.NativeFunction< - CFMutableDictionaryRef Function(CFAllocatorRef, CFIndex, - CFDictionaryRef)>>('CFDictionaryCreateMutableCopy'); - late final _CFDictionaryCreateMutableCopy = - _CFDictionaryCreateMutableCopyPtr.asFunction< - CFMutableDictionaryRef Function( - CFAllocatorRef, int, CFDictionaryRef)>(); + CFURLRef Function(CFAllocatorRef, CFStringRef, CFIndex, + Boolean)>>('CFURLCreateWithFileSystemPath'); + late final _CFURLCreateWithFileSystemPath = _CFURLCreateWithFileSystemPathPtr + .asFunction(); - int CFDictionaryGetCount( - CFDictionaryRef theDict, + CFURLRef CFURLCreateFromFileSystemRepresentation( + CFAllocatorRef allocator, + ffi.Pointer buffer, + int bufLen, + int isDirectory, ) { - return _CFDictionaryGetCount( - theDict, + return _CFURLCreateFromFileSystemRepresentation( + allocator, + buffer, + bufLen, + isDirectory, ); } - late final _CFDictionaryGetCountPtr = - _lookup>( - 'CFDictionaryGetCount'); - late final _CFDictionaryGetCount = - _CFDictionaryGetCountPtr.asFunction(); + late final _CFURLCreateFromFileSystemRepresentationPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, + Boolean)>>('CFURLCreateFromFileSystemRepresentation'); + late final _CFURLCreateFromFileSystemRepresentation = + _CFURLCreateFromFileSystemRepresentationPtr.asFunction< + CFURLRef Function(CFAllocatorRef, ffi.Pointer, int, int)>(); - int CFDictionaryGetCountOfKey( - CFDictionaryRef theDict, - ffi.Pointer key, + CFURLRef CFURLCreateWithFileSystemPathRelativeToBase( + CFAllocatorRef allocator, + CFStringRef filePath, + CFURLPathStyle pathStyle, + DartBoolean isDirectory, + CFURLRef baseURL, ) { - return _CFDictionaryGetCountOfKey( - theDict, - key, + return _CFURLCreateWithFileSystemPathRelativeToBase( + allocator, + filePath, + pathStyle.value, + isDirectory, + baseURL, ); } - late final _CFDictionaryGetCountOfKeyPtr = _lookup< + late final _CFURLCreateWithFileSystemPathRelativeToBasePtr = _lookup< ffi.NativeFunction< - CFIndex Function(CFDictionaryRef, - ffi.Pointer)>>('CFDictionaryGetCountOfKey'); - late final _CFDictionaryGetCountOfKey = _CFDictionaryGetCountOfKeyPtr - .asFunction)>(); + CFURLRef Function(CFAllocatorRef, CFStringRef, CFIndex, Boolean, + CFURLRef)>>('CFURLCreateWithFileSystemPathRelativeToBase'); + late final _CFURLCreateWithFileSystemPathRelativeToBase = + _CFURLCreateWithFileSystemPathRelativeToBasePtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFStringRef, int, int, CFURLRef)>(); - int CFDictionaryGetCountOfValue( - CFDictionaryRef theDict, - ffi.Pointer value, + CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase( + CFAllocatorRef allocator, + ffi.Pointer buffer, + int bufLen, + int isDirectory, + CFURLRef baseURL, ) { - return _CFDictionaryGetCountOfValue( - theDict, - value, + return _CFURLCreateFromFileSystemRepresentationRelativeToBase( + allocator, + buffer, + bufLen, + isDirectory, + baseURL, ); } - late final _CFDictionaryGetCountOfValuePtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFDictionaryRef, - ffi.Pointer)>>('CFDictionaryGetCountOfValue'); - late final _CFDictionaryGetCountOfValue = _CFDictionaryGetCountOfValuePtr - .asFunction)>(); + late final _CFURLCreateFromFileSystemRepresentationRelativeToBasePtr = + _lookup< + ffi.NativeFunction< + CFURLRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, + Boolean, CFURLRef)>>( + 'CFURLCreateFromFileSystemRepresentationRelativeToBase'); + late final _CFURLCreateFromFileSystemRepresentationRelativeToBase = + _CFURLCreateFromFileSystemRepresentationRelativeToBasePtr.asFunction< + CFURLRef Function( + CFAllocatorRef, ffi.Pointer, int, int, CFURLRef)>(); - int CFDictionaryContainsKey( - CFDictionaryRef theDict, - ffi.Pointer key, + int CFURLGetFileSystemRepresentation( + CFURLRef url, + int resolveAgainstBase, + ffi.Pointer buffer, + int maxBufLen, ) { - return _CFDictionaryContainsKey( - theDict, - key, + return _CFURLGetFileSystemRepresentation( + url, + resolveAgainstBase, + buffer, + maxBufLen, ); } - late final _CFDictionaryContainsKeyPtr = _lookup< + late final _CFURLGetFileSystemRepresentationPtr = _lookup< ffi.NativeFunction< - Boolean Function(CFDictionaryRef, - ffi.Pointer)>>('CFDictionaryContainsKey'); - late final _CFDictionaryContainsKey = _CFDictionaryContainsKeyPtr.asFunction< - int Function(CFDictionaryRef, ffi.Pointer)>(); + Boolean Function(CFURLRef, Boolean, ffi.Pointer, + CFIndex)>>('CFURLGetFileSystemRepresentation'); + late final _CFURLGetFileSystemRepresentation = + _CFURLGetFileSystemRepresentationPtr.asFunction< + int Function(CFURLRef, int, ffi.Pointer, int)>(); - int CFDictionaryContainsValue( - CFDictionaryRef theDict, - ffi.Pointer value, + CFURLRef CFURLCopyAbsoluteURL( + CFURLRef relativeURL, ) { - return _CFDictionaryContainsValue( - theDict, - value, + return _CFURLCopyAbsoluteURL( + relativeURL, ); } - late final _CFDictionaryContainsValuePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFDictionaryRef, - ffi.Pointer)>>('CFDictionaryContainsValue'); - late final _CFDictionaryContainsValue = _CFDictionaryContainsValuePtr - .asFunction)>(); + late final _CFURLCopyAbsoluteURLPtr = + _lookup>( + 'CFURLCopyAbsoluteURL'); + late final _CFURLCopyAbsoluteURL = + _CFURLCopyAbsoluteURLPtr.asFunction(); - ffi.Pointer CFDictionaryGetValue( - CFDictionaryRef theDict, - ffi.Pointer key, + CFStringRef CFURLGetString( + CFURLRef anURL, ) { - return _CFDictionaryGetValue( - theDict, - key, + return _CFURLGetString( + anURL, ); } - late final _CFDictionaryGetValuePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - CFDictionaryRef, ffi.Pointer)>>('CFDictionaryGetValue'); - late final _CFDictionaryGetValue = _CFDictionaryGetValuePtr.asFunction< - ffi.Pointer Function(CFDictionaryRef, ffi.Pointer)>(); + late final _CFURLGetStringPtr = + _lookup>( + 'CFURLGetString'); + late final _CFURLGetString = + _CFURLGetStringPtr.asFunction(); - int CFDictionaryGetValueIfPresent( - CFDictionaryRef theDict, - ffi.Pointer key, - ffi.Pointer> value, + CFURLRef CFURLGetBaseURL( + CFURLRef anURL, ) { - return _CFDictionaryGetValueIfPresent( - theDict, - key, - value, + return _CFURLGetBaseURL( + anURL, ); } - late final _CFDictionaryGetValueIfPresentPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFDictionaryRef, ffi.Pointer, - ffi.Pointer>)>>( - 'CFDictionaryGetValueIfPresent'); - late final _CFDictionaryGetValueIfPresent = - _CFDictionaryGetValueIfPresentPtr.asFunction< - int Function(CFDictionaryRef, ffi.Pointer, - ffi.Pointer>)>(); + late final _CFURLGetBaseURLPtr = + _lookup>( + 'CFURLGetBaseURL'); + late final _CFURLGetBaseURL = + _CFURLGetBaseURLPtr.asFunction(); - void CFDictionaryGetKeysAndValues( - CFDictionaryRef theDict, - ffi.Pointer> keys, - ffi.Pointer> values, + int CFURLCanBeDecomposed( + CFURLRef anURL, ) { - return _CFDictionaryGetKeysAndValues( - theDict, - keys, - values, + return _CFURLCanBeDecomposed( + anURL, ); } - late final _CFDictionaryGetKeysAndValuesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFDictionaryRef, - ffi.Pointer>, - ffi.Pointer>)>>( - 'CFDictionaryGetKeysAndValues'); - late final _CFDictionaryGetKeysAndValues = - _CFDictionaryGetKeysAndValuesPtr.asFunction< - void Function(CFDictionaryRef, ffi.Pointer>, - ffi.Pointer>)>(); + late final _CFURLCanBeDecomposedPtr = + _lookup>( + 'CFURLCanBeDecomposed'); + late final _CFURLCanBeDecomposed = + _CFURLCanBeDecomposedPtr.asFunction(); - void CFDictionaryApplyFunction( - CFDictionaryRef theDict, - CFDictionaryApplierFunction applier, - ffi.Pointer context, + CFStringRef CFURLCopyScheme( + CFURLRef anURL, ) { - return _CFDictionaryApplyFunction( - theDict, - applier, - context, + return _CFURLCopyScheme( + anURL, ); } - late final _CFDictionaryApplyFunctionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFDictionaryRef, CFDictionaryApplierFunction, - ffi.Pointer)>>('CFDictionaryApplyFunction'); - late final _CFDictionaryApplyFunction = - _CFDictionaryApplyFunctionPtr.asFunction< - void Function(CFDictionaryRef, CFDictionaryApplierFunction, - ffi.Pointer)>(); + late final _CFURLCopySchemePtr = + _lookup>( + 'CFURLCopyScheme'); + late final _CFURLCopyScheme = + _CFURLCopySchemePtr.asFunction(); - void CFDictionaryAddValue( - CFMutableDictionaryRef theDict, - ffi.Pointer key, - ffi.Pointer value, + CFStringRef CFURLCopyNetLocation( + CFURLRef anURL, ) { - return _CFDictionaryAddValue( - theDict, - key, - value, + return _CFURLCopyNetLocation( + anURL, ); } - late final _CFDictionaryAddValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableDictionaryRef, ffi.Pointer, - ffi.Pointer)>>('CFDictionaryAddValue'); - late final _CFDictionaryAddValue = _CFDictionaryAddValuePtr.asFunction< - void Function(CFMutableDictionaryRef, ffi.Pointer, - ffi.Pointer)>(); + late final _CFURLCopyNetLocationPtr = + _lookup>( + 'CFURLCopyNetLocation'); + late final _CFURLCopyNetLocation = + _CFURLCopyNetLocationPtr.asFunction(); - void CFDictionarySetValue( - CFMutableDictionaryRef theDict, - ffi.Pointer key, - ffi.Pointer value, + CFStringRef CFURLCopyPath( + CFURLRef anURL, ) { - return _CFDictionarySetValue( - theDict, - key, - value, + return _CFURLCopyPath( + anURL, ); } - late final _CFDictionarySetValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableDictionaryRef, ffi.Pointer, - ffi.Pointer)>>('CFDictionarySetValue'); - late final _CFDictionarySetValue = _CFDictionarySetValuePtr.asFunction< - void Function(CFMutableDictionaryRef, ffi.Pointer, - ffi.Pointer)>(); + late final _CFURLCopyPathPtr = + _lookup>( + 'CFURLCopyPath'); + late final _CFURLCopyPath = + _CFURLCopyPathPtr.asFunction(); - void CFDictionaryReplaceValue( - CFMutableDictionaryRef theDict, - ffi.Pointer key, - ffi.Pointer value, + CFStringRef CFURLCopyStrictPath( + CFURLRef anURL, + ffi.Pointer isAbsolute, ) { - return _CFDictionaryReplaceValue( - theDict, - key, - value, + return _CFURLCopyStrictPath( + anURL, + isAbsolute, ); } - late final _CFDictionaryReplaceValuePtr = _lookup< + late final _CFURLCopyStrictPathPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFMutableDictionaryRef, ffi.Pointer, - ffi.Pointer)>>('CFDictionaryReplaceValue'); - late final _CFDictionaryReplaceValue = - _CFDictionaryReplaceValuePtr.asFunction< - void Function(CFMutableDictionaryRef, ffi.Pointer, - ffi.Pointer)>(); + CFStringRef Function( + CFURLRef, ffi.Pointer)>>('CFURLCopyStrictPath'); + late final _CFURLCopyStrictPath = _CFURLCopyStrictPathPtr.asFunction< + CFStringRef Function(CFURLRef, ffi.Pointer)>(); - void CFDictionaryRemoveValue( - CFMutableDictionaryRef theDict, - ffi.Pointer key, + CFStringRef CFURLCopyFileSystemPath( + CFURLRef anURL, + CFURLPathStyle pathStyle, ) { - return _CFDictionaryRemoveValue( - theDict, - key, + return _CFURLCopyFileSystemPath( + anURL, + pathStyle.value, ); } - late final _CFDictionaryRemoveValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableDictionaryRef, - ffi.Pointer)>>('CFDictionaryRemoveValue'); - late final _CFDictionaryRemoveValue = _CFDictionaryRemoveValuePtr.asFunction< - void Function(CFMutableDictionaryRef, ffi.Pointer)>(); + late final _CFURLCopyFileSystemPathPtr = + _lookup>( + 'CFURLCopyFileSystemPath'); + late final _CFURLCopyFileSystemPath = _CFURLCopyFileSystemPathPtr.asFunction< + CFStringRef Function(CFURLRef, int)>(); - void CFDictionaryRemoveAllValues( - CFMutableDictionaryRef theDict, + int CFURLHasDirectoryPath( + CFURLRef anURL, ) { - return _CFDictionaryRemoveAllValues( - theDict, + return _CFURLHasDirectoryPath( + anURL, ); } - late final _CFDictionaryRemoveAllValuesPtr = - _lookup>( - 'CFDictionaryRemoveAllValues'); - late final _CFDictionaryRemoveAllValues = _CFDictionaryRemoveAllValuesPtr - .asFunction(); + late final _CFURLHasDirectoryPathPtr = + _lookup>( + 'CFURLHasDirectoryPath'); + late final _CFURLHasDirectoryPath = + _CFURLHasDirectoryPathPtr.asFunction(); - int CFNotificationCenterGetTypeID() { - return _CFNotificationCenterGetTypeID(); + CFStringRef CFURLCopyResourceSpecifier( + CFURLRef anURL, + ) { + return _CFURLCopyResourceSpecifier( + anURL, + ); } - late final _CFNotificationCenterGetTypeIDPtr = - _lookup>( - 'CFNotificationCenterGetTypeID'); - late final _CFNotificationCenterGetTypeID = - _CFNotificationCenterGetTypeIDPtr.asFunction(); + late final _CFURLCopyResourceSpecifierPtr = + _lookup>( + 'CFURLCopyResourceSpecifier'); + late final _CFURLCopyResourceSpecifier = _CFURLCopyResourceSpecifierPtr + .asFunction(); - CFNotificationCenterRef CFNotificationCenterGetLocalCenter() { - return _CFNotificationCenterGetLocalCenter(); + CFStringRef CFURLCopyHostName( + CFURLRef anURL, + ) { + return _CFURLCopyHostName( + anURL, + ); } - late final _CFNotificationCenterGetLocalCenterPtr = - _lookup>( - 'CFNotificationCenterGetLocalCenter'); - late final _CFNotificationCenterGetLocalCenter = - _CFNotificationCenterGetLocalCenterPtr.asFunction< - CFNotificationCenterRef Function()>(); + late final _CFURLCopyHostNamePtr = + _lookup>( + 'CFURLCopyHostName'); + late final _CFURLCopyHostName = + _CFURLCopyHostNamePtr.asFunction(); - CFNotificationCenterRef CFNotificationCenterGetDistributedCenter() { - return _CFNotificationCenterGetDistributedCenter(); + int CFURLGetPortNumber( + CFURLRef anURL, + ) { + return _CFURLGetPortNumber( + anURL, + ); } - late final _CFNotificationCenterGetDistributedCenterPtr = - _lookup>( - 'CFNotificationCenterGetDistributedCenter'); - late final _CFNotificationCenterGetDistributedCenter = - _CFNotificationCenterGetDistributedCenterPtr.asFunction< - CFNotificationCenterRef Function()>(); + late final _CFURLGetPortNumberPtr = + _lookup>( + 'CFURLGetPortNumber'); + late final _CFURLGetPortNumber = + _CFURLGetPortNumberPtr.asFunction(); - CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter() { - return _CFNotificationCenterGetDarwinNotifyCenter(); + CFStringRef CFURLCopyUserName( + CFURLRef anURL, + ) { + return _CFURLCopyUserName( + anURL, + ); } - late final _CFNotificationCenterGetDarwinNotifyCenterPtr = - _lookup>( - 'CFNotificationCenterGetDarwinNotifyCenter'); - late final _CFNotificationCenterGetDarwinNotifyCenter = - _CFNotificationCenterGetDarwinNotifyCenterPtr.asFunction< - CFNotificationCenterRef Function()>(); + late final _CFURLCopyUserNamePtr = + _lookup>( + 'CFURLCopyUserName'); + late final _CFURLCopyUserName = + _CFURLCopyUserNamePtr.asFunction(); - void CFNotificationCenterAddObserver( - CFNotificationCenterRef center, - ffi.Pointer observer, - CFNotificationCallback callBack, - CFStringRef name, - ffi.Pointer object, - int suspensionBehavior, + CFStringRef CFURLCopyPassword( + CFURLRef anURL, ) { - return _CFNotificationCenterAddObserver( - center, - observer, - callBack, - name, - object, - suspensionBehavior, + return _CFURLCopyPassword( + anURL, ); } - late final _CFNotificationCenterAddObserverPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFNotificationCenterRef, - ffi.Pointer, - CFNotificationCallback, - CFStringRef, - ffi.Pointer, - ffi.Int32)>>('CFNotificationCenterAddObserver'); - late final _CFNotificationCenterAddObserver = - _CFNotificationCenterAddObserverPtr.asFunction< - void Function( - CFNotificationCenterRef, - ffi.Pointer, - CFNotificationCallback, - CFStringRef, - ffi.Pointer, - int)>(); + late final _CFURLCopyPasswordPtr = + _lookup>( + 'CFURLCopyPassword'); + late final _CFURLCopyPassword = + _CFURLCopyPasswordPtr.asFunction(); - void CFNotificationCenterRemoveObserver( - CFNotificationCenterRef center, - ffi.Pointer observer, - CFNotificationName name, - ffi.Pointer object, + CFStringRef CFURLCopyParameterString( + CFURLRef anURL, + CFStringRef charactersToLeaveEscaped, ) { - return _CFNotificationCenterRemoveObserver( - center, - observer, - name, - object, + return _CFURLCopyParameterString( + anURL, + charactersToLeaveEscaped, ); } - late final _CFNotificationCenterRemoveObserverPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFNotificationCenterRef, - ffi.Pointer, - CFNotificationName, - ffi.Pointer)>>('CFNotificationCenterRemoveObserver'); - late final _CFNotificationCenterRemoveObserver = - _CFNotificationCenterRemoveObserverPtr.asFunction< - void Function(CFNotificationCenterRef, ffi.Pointer, - CFNotificationName, ffi.Pointer)>(); + late final _CFURLCopyParameterStringPtr = + _lookup>( + 'CFURLCopyParameterString'); + late final _CFURLCopyParameterString = _CFURLCopyParameterStringPtr + .asFunction(); - void CFNotificationCenterRemoveEveryObserver( - CFNotificationCenterRef center, - ffi.Pointer observer, + CFStringRef CFURLCopyQueryString( + CFURLRef anURL, + CFStringRef charactersToLeaveEscaped, ) { - return _CFNotificationCenterRemoveEveryObserver( - center, - observer, + return _CFURLCopyQueryString( + anURL, + charactersToLeaveEscaped, ); } - late final _CFNotificationCenterRemoveEveryObserverPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFNotificationCenterRef, ffi.Pointer)>>( - 'CFNotificationCenterRemoveEveryObserver'); - late final _CFNotificationCenterRemoveEveryObserver = - _CFNotificationCenterRemoveEveryObserverPtr.asFunction< - void Function(CFNotificationCenterRef, ffi.Pointer)>(); + late final _CFURLCopyQueryStringPtr = + _lookup>( + 'CFURLCopyQueryString'); + late final _CFURLCopyQueryString = _CFURLCopyQueryStringPtr.asFunction< + CFStringRef Function(CFURLRef, CFStringRef)>(); - void CFNotificationCenterPostNotification( - CFNotificationCenterRef center, - CFNotificationName name, - ffi.Pointer object, - CFDictionaryRef userInfo, - int deliverImmediately, + CFStringRef CFURLCopyFragment( + CFURLRef anURL, + CFStringRef charactersToLeaveEscaped, ) { - return _CFNotificationCenterPostNotification( - center, - name, - object, - userInfo, - deliverImmediately, + return _CFURLCopyFragment( + anURL, + charactersToLeaveEscaped, ); } - late final _CFNotificationCenterPostNotificationPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFNotificationCenterRef, - CFNotificationName, - ffi.Pointer, - CFDictionaryRef, - Boolean)>>('CFNotificationCenterPostNotification'); - late final _CFNotificationCenterPostNotification = - _CFNotificationCenterPostNotificationPtr.asFunction< - void Function(CFNotificationCenterRef, CFNotificationName, - ffi.Pointer, CFDictionaryRef, int)>(); + late final _CFURLCopyFragmentPtr = + _lookup>( + 'CFURLCopyFragment'); + late final _CFURLCopyFragment = _CFURLCopyFragmentPtr.asFunction< + CFStringRef Function(CFURLRef, CFStringRef)>(); - void CFNotificationCenterPostNotificationWithOptions( - CFNotificationCenterRef center, - CFNotificationName name, - ffi.Pointer object, - CFDictionaryRef userInfo, - int options, + CFStringRef CFURLCopyLastPathComponent( + CFURLRef url, ) { - return _CFNotificationCenterPostNotificationWithOptions( - center, - name, - object, - userInfo, - options, + return _CFURLCopyLastPathComponent( + url, ); } - late final _CFNotificationCenterPostNotificationWithOptionsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFNotificationCenterRef, CFNotificationName, - ffi.Pointer, CFDictionaryRef, CFOptionFlags)>>( - 'CFNotificationCenterPostNotificationWithOptions'); - late final _CFNotificationCenterPostNotificationWithOptions = - _CFNotificationCenterPostNotificationWithOptionsPtr.asFunction< - void Function(CFNotificationCenterRef, CFNotificationName, - ffi.Pointer, CFDictionaryRef, int)>(); + late final _CFURLCopyLastPathComponentPtr = + _lookup>( + 'CFURLCopyLastPathComponent'); + late final _CFURLCopyLastPathComponent = _CFURLCopyLastPathComponentPtr + .asFunction(); - int CFLocaleGetTypeID() { - return _CFLocaleGetTypeID(); + CFStringRef CFURLCopyPathExtension( + CFURLRef url, + ) { + return _CFURLCopyPathExtension( + url, + ); } - late final _CFLocaleGetTypeIDPtr = - _lookup>('CFLocaleGetTypeID'); - late final _CFLocaleGetTypeID = - _CFLocaleGetTypeIDPtr.asFunction(); + late final _CFURLCopyPathExtensionPtr = + _lookup>( + 'CFURLCopyPathExtension'); + late final _CFURLCopyPathExtension = + _CFURLCopyPathExtensionPtr.asFunction(); - CFLocaleRef CFLocaleGetSystem() { - return _CFLocaleGetSystem(); + CFURLRef CFURLCreateCopyAppendingPathComponent( + CFAllocatorRef allocator, + CFURLRef url, + CFStringRef pathComponent, + int isDirectory, + ) { + return _CFURLCreateCopyAppendingPathComponent( + allocator, + url, + pathComponent, + isDirectory, + ); } - late final _CFLocaleGetSystemPtr = - _lookup>('CFLocaleGetSystem'); - late final _CFLocaleGetSystem = - _CFLocaleGetSystemPtr.asFunction(); + late final _CFURLCreateCopyAppendingPathComponentPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef, CFStringRef, + Boolean)>>('CFURLCreateCopyAppendingPathComponent'); + late final _CFURLCreateCopyAppendingPathComponent = + _CFURLCreateCopyAppendingPathComponentPtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef, CFStringRef, int)>(); - CFLocaleRef CFLocaleCopyCurrent() { - return _CFLocaleCopyCurrent(); + CFURLRef CFURLCreateCopyDeletingLastPathComponent( + CFAllocatorRef allocator, + CFURLRef url, + ) { + return _CFURLCreateCopyDeletingLastPathComponent( + allocator, + url, + ); } - late final _CFLocaleCopyCurrentPtr = - _lookup>( - 'CFLocaleCopyCurrent'); - late final _CFLocaleCopyCurrent = - _CFLocaleCopyCurrentPtr.asFunction(); + late final _CFURLCreateCopyDeletingLastPathComponentPtr = + _lookup>( + 'CFURLCreateCopyDeletingLastPathComponent'); + late final _CFURLCreateCopyDeletingLastPathComponent = + _CFURLCreateCopyDeletingLastPathComponentPtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef)>(); - CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers() { - return _CFLocaleCopyAvailableLocaleIdentifiers(); + CFURLRef CFURLCreateCopyAppendingPathExtension( + CFAllocatorRef allocator, + CFURLRef url, + CFStringRef extension1, + ) { + return _CFURLCreateCopyAppendingPathExtension( + allocator, + url, + extension1, + ); } - late final _CFLocaleCopyAvailableLocaleIdentifiersPtr = - _lookup>( - 'CFLocaleCopyAvailableLocaleIdentifiers'); - late final _CFLocaleCopyAvailableLocaleIdentifiers = - _CFLocaleCopyAvailableLocaleIdentifiersPtr.asFunction< - CFArrayRef Function()>(); + late final _CFURLCreateCopyAppendingPathExtensionPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef, + CFStringRef)>>('CFURLCreateCopyAppendingPathExtension'); + late final _CFURLCreateCopyAppendingPathExtension = + _CFURLCreateCopyAppendingPathExtensionPtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef, CFStringRef)>(); - CFArrayRef CFLocaleCopyISOLanguageCodes() { - return _CFLocaleCopyISOLanguageCodes(); + CFURLRef CFURLCreateCopyDeletingPathExtension( + CFAllocatorRef allocator, + CFURLRef url, + ) { + return _CFURLCreateCopyDeletingPathExtension( + allocator, + url, + ); } - late final _CFLocaleCopyISOLanguageCodesPtr = - _lookup>( - 'CFLocaleCopyISOLanguageCodes'); - late final _CFLocaleCopyISOLanguageCodes = - _CFLocaleCopyISOLanguageCodesPtr.asFunction(); - - CFArrayRef CFLocaleCopyISOCountryCodes() { - return _CFLocaleCopyISOCountryCodes(); - } - - late final _CFLocaleCopyISOCountryCodesPtr = - _lookup>( - 'CFLocaleCopyISOCountryCodes'); - late final _CFLocaleCopyISOCountryCodes = - _CFLocaleCopyISOCountryCodesPtr.asFunction(); + late final _CFURLCreateCopyDeletingPathExtensionPtr = + _lookup>( + 'CFURLCreateCopyDeletingPathExtension'); + late final _CFURLCreateCopyDeletingPathExtension = + _CFURLCreateCopyDeletingPathExtensionPtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef)>(); - CFArrayRef CFLocaleCopyISOCurrencyCodes() { - return _CFLocaleCopyISOCurrencyCodes(); + int CFURLGetBytes( + CFURLRef url, + ffi.Pointer buffer, + int bufferLength, + ) { + return _CFURLGetBytes( + url, + buffer, + bufferLength, + ); } - late final _CFLocaleCopyISOCurrencyCodesPtr = - _lookup>( - 'CFLocaleCopyISOCurrencyCodes'); - late final _CFLocaleCopyISOCurrencyCodes = - _CFLocaleCopyISOCurrencyCodesPtr.asFunction(); + late final _CFURLGetBytesPtr = _lookup< + ffi.NativeFunction< + CFIndex Function( + CFURLRef, ffi.Pointer, CFIndex)>>('CFURLGetBytes'); + late final _CFURLGetBytes = _CFURLGetBytesPtr.asFunction< + int Function(CFURLRef, ffi.Pointer, int)>(); - CFArrayRef CFLocaleCopyCommonISOCurrencyCodes() { - return _CFLocaleCopyCommonISOCurrencyCodes(); + CFRange CFURLGetByteRangeForComponent( + CFURLRef url, + CFURLComponentType component, + ffi.Pointer rangeIncludingSeparators, + ) { + return _CFURLGetByteRangeForComponent( + url, + component.value, + rangeIncludingSeparators, + ); } - late final _CFLocaleCopyCommonISOCurrencyCodesPtr = - _lookup>( - 'CFLocaleCopyCommonISOCurrencyCodes'); - late final _CFLocaleCopyCommonISOCurrencyCodes = - _CFLocaleCopyCommonISOCurrencyCodesPtr.asFunction< - CFArrayRef Function()>(); + late final _CFURLGetByteRangeForComponentPtr = _lookup< + ffi.NativeFunction< + CFRange Function(CFURLRef, CFIndex, + ffi.Pointer)>>('CFURLGetByteRangeForComponent'); + late final _CFURLGetByteRangeForComponent = _CFURLGetByteRangeForComponentPtr + .asFunction)>(); - CFArrayRef CFLocaleCopyPreferredLanguages() { - return _CFLocaleCopyPreferredLanguages(); + CFStringRef CFURLCreateStringByReplacingPercentEscapes( + CFAllocatorRef allocator, + CFStringRef originalString, + CFStringRef charactersToLeaveEscaped, + ) { + return _CFURLCreateStringByReplacingPercentEscapes( + allocator, + originalString, + charactersToLeaveEscaped, + ); } - late final _CFLocaleCopyPreferredLanguagesPtr = - _lookup>( - 'CFLocaleCopyPreferredLanguages'); - late final _CFLocaleCopyPreferredLanguages = - _CFLocaleCopyPreferredLanguagesPtr.asFunction(); + late final _CFURLCreateStringByReplacingPercentEscapesPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, + CFStringRef)>>('CFURLCreateStringByReplacingPercentEscapes'); + late final _CFURLCreateStringByReplacingPercentEscapes = + _CFURLCreateStringByReplacingPercentEscapesPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, CFStringRef)>(); - CFLocaleIdentifier CFLocaleCreateCanonicalLanguageIdentifierFromString( + CFStringRef CFURLCreateStringByReplacingPercentEscapesUsingEncoding( CFAllocatorRef allocator, - CFStringRef localeIdentifier, + CFStringRef origString, + CFStringRef charsToLeaveEscaped, + int encoding, ) { - return _CFLocaleCreateCanonicalLanguageIdentifierFromString( + return _CFURLCreateStringByReplacingPercentEscapesUsingEncoding( allocator, - localeIdentifier, + origString, + charsToLeaveEscaped, + encoding, ); } - late final _CFLocaleCreateCanonicalLanguageIdentifierFromStringPtr = _lookup< - ffi.NativeFunction< - CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>>( - 'CFLocaleCreateCanonicalLanguageIdentifierFromString'); - late final _CFLocaleCreateCanonicalLanguageIdentifierFromString = - _CFLocaleCreateCanonicalLanguageIdentifierFromStringPtr.asFunction< - CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>(); + late final _CFURLCreateStringByReplacingPercentEscapesUsingEncodingPtr = + _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, CFStringRef, + CFStringEncoding)>>( + 'CFURLCreateStringByReplacingPercentEscapesUsingEncoding'); + late final _CFURLCreateStringByReplacingPercentEscapesUsingEncoding = + _CFURLCreateStringByReplacingPercentEscapesUsingEncodingPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, CFStringRef, CFStringRef, int)>(); - CFLocaleIdentifier CFLocaleCreateCanonicalLocaleIdentifierFromString( + CFStringRef CFURLCreateStringByAddingPercentEscapes( CFAllocatorRef allocator, - CFStringRef localeIdentifier, + CFStringRef originalString, + CFStringRef charactersToLeaveUnescaped, + CFStringRef legalURLCharactersToBeEscaped, + int encoding, ) { - return _CFLocaleCreateCanonicalLocaleIdentifierFromString( + return _CFURLCreateStringByAddingPercentEscapes( allocator, - localeIdentifier, + originalString, + charactersToLeaveUnescaped, + legalURLCharactersToBeEscaped, + encoding, ); } - late final _CFLocaleCreateCanonicalLocaleIdentifierFromStringPtr = _lookup< - ffi.NativeFunction< - CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>>( - 'CFLocaleCreateCanonicalLocaleIdentifierFromString'); - late final _CFLocaleCreateCanonicalLocaleIdentifierFromString = - _CFLocaleCreateCanonicalLocaleIdentifierFromStringPtr.asFunction< - CFLocaleIdentifier Function(CFAllocatorRef, CFStringRef)>(); + late final _CFURLCreateStringByAddingPercentEscapesPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function( + CFAllocatorRef, + CFStringRef, + CFStringRef, + CFStringRef, + CFStringEncoding)>>('CFURLCreateStringByAddingPercentEscapes'); + late final _CFURLCreateStringByAddingPercentEscapes = + _CFURLCreateStringByAddingPercentEscapesPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, CFStringRef, CFStringRef, CFStringRef, int)>(); - CFLocaleIdentifier - CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes( + int CFURLIsFileReferenceURL( + CFURLRef url, + ) { + return _CFURLIsFileReferenceURL( + url, + ); + } + + late final _CFURLIsFileReferenceURLPtr = + _lookup>( + 'CFURLIsFileReferenceURL'); + late final _CFURLIsFileReferenceURL = + _CFURLIsFileReferenceURLPtr.asFunction(); + + CFURLRef CFURLCreateFileReferenceURL( CFAllocatorRef allocator, - int lcode, - int rcode, + CFURLRef url, + ffi.Pointer error, ) { - return _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes( + return _CFURLCreateFileReferenceURL( allocator, - lcode, - rcode, + url, + error, ); } - late final _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodesPtr = - _lookup< - ffi.NativeFunction< - CFLocaleIdentifier Function( - CFAllocatorRef, LangCode, RegionCode)>>( - 'CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes'); - late final _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes = - _CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodesPtr - .asFunction(); + late final _CFURLCreateFileReferenceURLPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef, + ffi.Pointer)>>('CFURLCreateFileReferenceURL'); + late final _CFURLCreateFileReferenceURL = + _CFURLCreateFileReferenceURLPtr.asFunction< + CFURLRef Function( + CFAllocatorRef, CFURLRef, ffi.Pointer)>(); - CFLocaleIdentifier CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode( + CFURLRef CFURLCreateFilePathURL( CFAllocatorRef allocator, - int lcid, + CFURLRef url, + ffi.Pointer error, ) { - return _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode( + return _CFURLCreateFilePathURL( allocator, - lcid, + url, + error, ); } - late final _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCodePtr = _lookup< - ffi.NativeFunction< - CFLocaleIdentifier Function(CFAllocatorRef, ffi.Uint32)>>( - 'CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode'); - late final _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCode = - _CFLocaleCreateLocaleIdentifierFromWindowsLocaleCodePtr.asFunction< - CFLocaleIdentifier Function(CFAllocatorRef, int)>(); + late final _CFURLCreateFilePathURLPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef, + ffi.Pointer)>>('CFURLCreateFilePathURL'); + late final _CFURLCreateFilePathURL = _CFURLCreateFilePathURLPtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFURLRef, ffi.Pointer)>(); - int CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier( - CFLocaleIdentifier localeIdentifier, + CFURLRef CFURLCreateFromFSRef( + CFAllocatorRef allocator, + ffi.Pointer fsRef, ) { - return _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier( - localeIdentifier, + return _CFURLCreateFromFSRef( + allocator, + fsRef, ); } - late final _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifierPtr = - _lookup>( - 'CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier'); - late final _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier = - _CFLocaleGetWindowsLocaleCodeFromLocaleIdentifierPtr.asFunction< - int Function(CFLocaleIdentifier)>(); + late final _CFURLCreateFromFSRefPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function( + CFAllocatorRef, ffi.Pointer)>>('CFURLCreateFromFSRef'); + late final _CFURLCreateFromFSRef = _CFURLCreateFromFSRefPtr.asFunction< + CFURLRef Function(CFAllocatorRef, ffi.Pointer)>(); - int CFLocaleGetLanguageCharacterDirection( - CFStringRef isoLangCode, + int CFURLGetFSRef( + CFURLRef url, + ffi.Pointer fsRef, ) { - return _CFLocaleGetLanguageCharacterDirection( - isoLangCode, + return _CFURLGetFSRef( + url, + fsRef, ); } - late final _CFLocaleGetLanguageCharacterDirectionPtr = - _lookup>( - 'CFLocaleGetLanguageCharacterDirection'); - late final _CFLocaleGetLanguageCharacterDirection = - _CFLocaleGetLanguageCharacterDirectionPtr.asFunction< - int Function(CFStringRef)>(); + late final _CFURLGetFSRefPtr = _lookup< + ffi.NativeFunction)>>( + 'CFURLGetFSRef'); + late final _CFURLGetFSRef = _CFURLGetFSRefPtr.asFunction< + int Function(CFURLRef, ffi.Pointer)>(); - int CFLocaleGetLanguageLineDirection( - CFStringRef isoLangCode, + int CFURLCopyResourcePropertyForKey( + CFURLRef url, + CFStringRef key, + ffi.Pointer propertyValueTypeRefPtr, + ffi.Pointer error, ) { - return _CFLocaleGetLanguageLineDirection( - isoLangCode, + return _CFURLCopyResourcePropertyForKey( + url, + key, + propertyValueTypeRefPtr, + error, ); } - late final _CFLocaleGetLanguageLineDirectionPtr = - _lookup>( - 'CFLocaleGetLanguageLineDirection'); - late final _CFLocaleGetLanguageLineDirection = - _CFLocaleGetLanguageLineDirectionPtr.asFunction< - int Function(CFStringRef)>(); + late final _CFURLCopyResourcePropertyForKeyPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFURLRef, CFStringRef, ffi.Pointer, + ffi.Pointer)>>('CFURLCopyResourcePropertyForKey'); + late final _CFURLCopyResourcePropertyForKey = + _CFURLCopyResourcePropertyForKeyPtr.asFunction< + int Function(CFURLRef, CFStringRef, ffi.Pointer, + ffi.Pointer)>(); - CFDictionaryRef CFLocaleCreateComponentsFromLocaleIdentifier( - CFAllocatorRef allocator, - CFLocaleIdentifier localeID, + CFDictionaryRef CFURLCopyResourcePropertiesForKeys( + CFURLRef url, + CFArrayRef keys, + ffi.Pointer error, ) { - return _CFLocaleCreateComponentsFromLocaleIdentifier( - allocator, - localeID, + return _CFURLCopyResourcePropertiesForKeys( + url, + keys, + error, ); } - late final _CFLocaleCreateComponentsFromLocaleIdentifierPtr = _lookup< - ffi.NativeFunction< - CFDictionaryRef Function(CFAllocatorRef, CFLocaleIdentifier)>>( - 'CFLocaleCreateComponentsFromLocaleIdentifier'); - late final _CFLocaleCreateComponentsFromLocaleIdentifier = - _CFLocaleCreateComponentsFromLocaleIdentifierPtr.asFunction< - CFDictionaryRef Function(CFAllocatorRef, CFLocaleIdentifier)>(); + late final _CFURLCopyResourcePropertiesForKeysPtr = _lookup< + ffi.NativeFunction< + CFDictionaryRef Function(CFURLRef, CFArrayRef, + ffi.Pointer)>>('CFURLCopyResourcePropertiesForKeys'); + late final _CFURLCopyResourcePropertiesForKeys = + _CFURLCopyResourcePropertiesForKeysPtr.asFunction< + CFDictionaryRef Function( + CFURLRef, CFArrayRef, ffi.Pointer)>(); - CFLocaleIdentifier CFLocaleCreateLocaleIdentifierFromComponents( - CFAllocatorRef allocator, - CFDictionaryRef dictionary, + int CFURLSetResourcePropertyForKey( + CFURLRef url, + CFStringRef key, + CFTypeRef propertyValue, + ffi.Pointer error, ) { - return _CFLocaleCreateLocaleIdentifierFromComponents( - allocator, - dictionary, + return _CFURLSetResourcePropertyForKey( + url, + key, + propertyValue, + error, ); } - late final _CFLocaleCreateLocaleIdentifierFromComponentsPtr = _lookup< - ffi.NativeFunction< - CFLocaleIdentifier Function(CFAllocatorRef, CFDictionaryRef)>>( - 'CFLocaleCreateLocaleIdentifierFromComponents'); - late final _CFLocaleCreateLocaleIdentifierFromComponents = - _CFLocaleCreateLocaleIdentifierFromComponentsPtr.asFunction< - CFLocaleIdentifier Function(CFAllocatorRef, CFDictionaryRef)>(); + late final _CFURLSetResourcePropertyForKeyPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFURLRef, CFStringRef, CFTypeRef, + ffi.Pointer)>>('CFURLSetResourcePropertyForKey'); + late final _CFURLSetResourcePropertyForKey = + _CFURLSetResourcePropertyForKeyPtr.asFunction< + int Function( + CFURLRef, CFStringRef, CFTypeRef, ffi.Pointer)>(); - CFLocaleRef CFLocaleCreate( - CFAllocatorRef allocator, - CFLocaleIdentifier localeIdentifier, + int CFURLSetResourcePropertiesForKeys( + CFURLRef url, + CFDictionaryRef keyedPropertyValues, + ffi.Pointer error, ) { - return _CFLocaleCreate( - allocator, - localeIdentifier, + return _CFURLSetResourcePropertiesForKeys( + url, + keyedPropertyValues, + error, ); } - late final _CFLocaleCreatePtr = _lookup< + late final _CFURLSetResourcePropertiesForKeysPtr = _lookup< ffi.NativeFunction< - CFLocaleRef Function( - CFAllocatorRef, CFLocaleIdentifier)>>('CFLocaleCreate'); - late final _CFLocaleCreate = _CFLocaleCreatePtr.asFunction< - CFLocaleRef Function(CFAllocatorRef, CFLocaleIdentifier)>(); + Boolean Function(CFURLRef, CFDictionaryRef, + ffi.Pointer)>>('CFURLSetResourcePropertiesForKeys'); + late final _CFURLSetResourcePropertiesForKeys = + _CFURLSetResourcePropertiesForKeysPtr.asFunction< + int Function(CFURLRef, CFDictionaryRef, ffi.Pointer)>(); - CFLocaleRef CFLocaleCreateCopy( - CFAllocatorRef allocator, - CFLocaleRef locale, + late final ffi.Pointer _kCFURLKeysOfUnsetValuesKey = + _lookup('kCFURLKeysOfUnsetValuesKey'); + + CFStringRef get kCFURLKeysOfUnsetValuesKey => + _kCFURLKeysOfUnsetValuesKey.value; + + void CFURLClearResourcePropertyCacheForKey( + CFURLRef url, + CFStringRef key, ) { - return _CFLocaleCreateCopy( - allocator, - locale, + return _CFURLClearResourcePropertyCacheForKey( + url, + key, ); } - late final _CFLocaleCreateCopyPtr = _lookup< - ffi - .NativeFunction>( - 'CFLocaleCreateCopy'); - late final _CFLocaleCreateCopy = _CFLocaleCreateCopyPtr.asFunction< - CFLocaleRef Function(CFAllocatorRef, CFLocaleRef)>(); + late final _CFURLClearResourcePropertyCacheForKeyPtr = + _lookup>( + 'CFURLClearResourcePropertyCacheForKey'); + late final _CFURLClearResourcePropertyCacheForKey = + _CFURLClearResourcePropertyCacheForKeyPtr.asFunction< + void Function(CFURLRef, CFStringRef)>(); - CFLocaleIdentifier CFLocaleGetIdentifier( - CFLocaleRef locale, + void CFURLClearResourcePropertyCache( + CFURLRef url, ) { - return _CFLocaleGetIdentifier( - locale, + return _CFURLClearResourcePropertyCache( + url, ); } - late final _CFLocaleGetIdentifierPtr = - _lookup>( - 'CFLocaleGetIdentifier'); - late final _CFLocaleGetIdentifier = _CFLocaleGetIdentifierPtr.asFunction< - CFLocaleIdentifier Function(CFLocaleRef)>(); + late final _CFURLClearResourcePropertyCachePtr = + _lookup>( + 'CFURLClearResourcePropertyCache'); + late final _CFURLClearResourcePropertyCache = + _CFURLClearResourcePropertyCachePtr.asFunction(); - CFTypeRef CFLocaleGetValue( - CFLocaleRef locale, - CFLocaleKey key, + void CFURLSetTemporaryResourcePropertyForKey( + CFURLRef url, + CFStringRef key, + CFTypeRef propertyValue, ) { - return _CFLocaleGetValue( - locale, + return _CFURLSetTemporaryResourcePropertyForKey( + url, key, + propertyValue, ); } - late final _CFLocaleGetValuePtr = - _lookup>( - 'CFLocaleGetValue'); - late final _CFLocaleGetValue = _CFLocaleGetValuePtr.asFunction< - CFTypeRef Function(CFLocaleRef, CFLocaleKey)>(); + late final _CFURLSetTemporaryResourcePropertyForKeyPtr = _lookup< + ffi + .NativeFunction>( + 'CFURLSetTemporaryResourcePropertyForKey'); + late final _CFURLSetTemporaryResourcePropertyForKey = + _CFURLSetTemporaryResourcePropertyForKeyPtr.asFunction< + void Function(CFURLRef, CFStringRef, CFTypeRef)>(); - CFStringRef CFLocaleCopyDisplayNameForPropertyValue( - CFLocaleRef displayLocale, - CFLocaleKey key, - CFStringRef value, + int CFURLResourceIsReachable( + CFURLRef url, + ffi.Pointer error, ) { - return _CFLocaleCopyDisplayNameForPropertyValue( - displayLocale, - key, - value, + return _CFURLResourceIsReachable( + url, + error, ); } - late final _CFLocaleCopyDisplayNameForPropertyValuePtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFLocaleRef, CFLocaleKey, - CFStringRef)>>('CFLocaleCopyDisplayNameForPropertyValue'); - late final _CFLocaleCopyDisplayNameForPropertyValue = - _CFLocaleCopyDisplayNameForPropertyValuePtr.asFunction< - CFStringRef Function(CFLocaleRef, CFLocaleKey, CFStringRef)>(); + late final _CFURLResourceIsReachablePtr = _lookup< + ffi + .NativeFunction)>>( + 'CFURLResourceIsReachable'); + late final _CFURLResourceIsReachable = _CFURLResourceIsReachablePtr + .asFunction)>(); - late final ffi.Pointer - _kCFLocaleCurrentLocaleDidChangeNotification = - _lookup( - 'kCFLocaleCurrentLocaleDidChangeNotification'); + late final ffi.Pointer _kCFURLNameKey = + _lookup('kCFURLNameKey'); - CFNotificationName get kCFLocaleCurrentLocaleDidChangeNotification => - _kCFLocaleCurrentLocaleDidChangeNotification.value; + CFStringRef get kCFURLNameKey => _kCFURLNameKey.value; - late final ffi.Pointer _kCFLocaleIdentifier = - _lookup('kCFLocaleIdentifier'); + late final ffi.Pointer _kCFURLLocalizedNameKey = + _lookup('kCFURLLocalizedNameKey'); - CFLocaleKey get kCFLocaleIdentifier => _kCFLocaleIdentifier.value; + CFStringRef get kCFURLLocalizedNameKey => _kCFURLLocalizedNameKey.value; - late final ffi.Pointer _kCFLocaleLanguageCode = - _lookup('kCFLocaleLanguageCode'); + late final ffi.Pointer _kCFURLIsRegularFileKey = + _lookup('kCFURLIsRegularFileKey'); - CFLocaleKey get kCFLocaleLanguageCode => _kCFLocaleLanguageCode.value; + CFStringRef get kCFURLIsRegularFileKey => _kCFURLIsRegularFileKey.value; - late final ffi.Pointer _kCFLocaleCountryCode = - _lookup('kCFLocaleCountryCode'); + late final ffi.Pointer _kCFURLIsDirectoryKey = + _lookup('kCFURLIsDirectoryKey'); - CFLocaleKey get kCFLocaleCountryCode => _kCFLocaleCountryCode.value; + CFStringRef get kCFURLIsDirectoryKey => _kCFURLIsDirectoryKey.value; - late final ffi.Pointer _kCFLocaleScriptCode = - _lookup('kCFLocaleScriptCode'); + late final ffi.Pointer _kCFURLIsSymbolicLinkKey = + _lookup('kCFURLIsSymbolicLinkKey'); - CFLocaleKey get kCFLocaleScriptCode => _kCFLocaleScriptCode.value; + CFStringRef get kCFURLIsSymbolicLinkKey => _kCFURLIsSymbolicLinkKey.value; - late final ffi.Pointer _kCFLocaleVariantCode = - _lookup('kCFLocaleVariantCode'); + late final ffi.Pointer _kCFURLIsVolumeKey = + _lookup('kCFURLIsVolumeKey'); - CFLocaleKey get kCFLocaleVariantCode => _kCFLocaleVariantCode.value; + CFStringRef get kCFURLIsVolumeKey => _kCFURLIsVolumeKey.value; - late final ffi.Pointer _kCFLocaleExemplarCharacterSet = - _lookup('kCFLocaleExemplarCharacterSet'); + late final ffi.Pointer _kCFURLIsPackageKey = + _lookup('kCFURLIsPackageKey'); - CFLocaleKey get kCFLocaleExemplarCharacterSet => - _kCFLocaleExemplarCharacterSet.value; + CFStringRef get kCFURLIsPackageKey => _kCFURLIsPackageKey.value; - late final ffi.Pointer _kCFLocaleCalendarIdentifier = - _lookup('kCFLocaleCalendarIdentifier'); + late final ffi.Pointer _kCFURLIsApplicationKey = + _lookup('kCFURLIsApplicationKey'); - CFLocaleKey get kCFLocaleCalendarIdentifier => - _kCFLocaleCalendarIdentifier.value; + CFStringRef get kCFURLIsApplicationKey => _kCFURLIsApplicationKey.value; - late final ffi.Pointer _kCFLocaleCalendar = - _lookup('kCFLocaleCalendar'); + late final ffi.Pointer _kCFURLApplicationIsScriptableKey = + _lookup('kCFURLApplicationIsScriptableKey'); - CFLocaleKey get kCFLocaleCalendar => _kCFLocaleCalendar.value; + CFStringRef get kCFURLApplicationIsScriptableKey => + _kCFURLApplicationIsScriptableKey.value; - late final ffi.Pointer _kCFLocaleCollationIdentifier = - _lookup('kCFLocaleCollationIdentifier'); + late final ffi.Pointer _kCFURLIsSystemImmutableKey = + _lookup('kCFURLIsSystemImmutableKey'); - CFLocaleKey get kCFLocaleCollationIdentifier => - _kCFLocaleCollationIdentifier.value; + CFStringRef get kCFURLIsSystemImmutableKey => + _kCFURLIsSystemImmutableKey.value; - late final ffi.Pointer _kCFLocaleUsesMetricSystem = - _lookup('kCFLocaleUsesMetricSystem'); + late final ffi.Pointer _kCFURLIsUserImmutableKey = + _lookup('kCFURLIsUserImmutableKey'); - CFLocaleKey get kCFLocaleUsesMetricSystem => _kCFLocaleUsesMetricSystem.value; + CFStringRef get kCFURLIsUserImmutableKey => _kCFURLIsUserImmutableKey.value; - late final ffi.Pointer _kCFLocaleMeasurementSystem = - _lookup('kCFLocaleMeasurementSystem'); + late final ffi.Pointer _kCFURLIsHiddenKey = + _lookup('kCFURLIsHiddenKey'); - CFLocaleKey get kCFLocaleMeasurementSystem => - _kCFLocaleMeasurementSystem.value; + CFStringRef get kCFURLIsHiddenKey => _kCFURLIsHiddenKey.value; - late final ffi.Pointer _kCFLocaleDecimalSeparator = - _lookup('kCFLocaleDecimalSeparator'); + late final ffi.Pointer _kCFURLHasHiddenExtensionKey = + _lookup('kCFURLHasHiddenExtensionKey'); - CFLocaleKey get kCFLocaleDecimalSeparator => _kCFLocaleDecimalSeparator.value; + CFStringRef get kCFURLHasHiddenExtensionKey => + _kCFURLHasHiddenExtensionKey.value; - late final ffi.Pointer _kCFLocaleGroupingSeparator = - _lookup('kCFLocaleGroupingSeparator'); + late final ffi.Pointer _kCFURLCreationDateKey = + _lookup('kCFURLCreationDateKey'); - CFLocaleKey get kCFLocaleGroupingSeparator => - _kCFLocaleGroupingSeparator.value; + CFStringRef get kCFURLCreationDateKey => _kCFURLCreationDateKey.value; - late final ffi.Pointer _kCFLocaleCurrencySymbol = - _lookup('kCFLocaleCurrencySymbol'); + late final ffi.Pointer _kCFURLContentAccessDateKey = + _lookup('kCFURLContentAccessDateKey'); - CFLocaleKey get kCFLocaleCurrencySymbol => _kCFLocaleCurrencySymbol.value; + CFStringRef get kCFURLContentAccessDateKey => + _kCFURLContentAccessDateKey.value; - late final ffi.Pointer _kCFLocaleCurrencyCode = - _lookup('kCFLocaleCurrencyCode'); + late final ffi.Pointer _kCFURLContentModificationDateKey = + _lookup('kCFURLContentModificationDateKey'); - CFLocaleKey get kCFLocaleCurrencyCode => _kCFLocaleCurrencyCode.value; + CFStringRef get kCFURLContentModificationDateKey => + _kCFURLContentModificationDateKey.value; - late final ffi.Pointer _kCFLocaleCollatorIdentifier = - _lookup('kCFLocaleCollatorIdentifier'); + late final ffi.Pointer _kCFURLAttributeModificationDateKey = + _lookup('kCFURLAttributeModificationDateKey'); - CFLocaleKey get kCFLocaleCollatorIdentifier => - _kCFLocaleCollatorIdentifier.value; + CFStringRef get kCFURLAttributeModificationDateKey => + _kCFURLAttributeModificationDateKey.value; - late final ffi.Pointer _kCFLocaleQuotationBeginDelimiterKey = - _lookup('kCFLocaleQuotationBeginDelimiterKey'); + late final ffi.Pointer _kCFURLFileIdentifierKey = + _lookup('kCFURLFileIdentifierKey'); - CFLocaleKey get kCFLocaleQuotationBeginDelimiterKey => - _kCFLocaleQuotationBeginDelimiterKey.value; + CFStringRef get kCFURLFileIdentifierKey => _kCFURLFileIdentifierKey.value; - late final ffi.Pointer _kCFLocaleQuotationEndDelimiterKey = - _lookup('kCFLocaleQuotationEndDelimiterKey'); + late final ffi.Pointer _kCFURLFileContentIdentifierKey = + _lookup('kCFURLFileContentIdentifierKey'); - CFLocaleKey get kCFLocaleQuotationEndDelimiterKey => - _kCFLocaleQuotationEndDelimiterKey.value; + CFStringRef get kCFURLFileContentIdentifierKey => + _kCFURLFileContentIdentifierKey.value; - late final ffi.Pointer - _kCFLocaleAlternateQuotationBeginDelimiterKey = - _lookup('kCFLocaleAlternateQuotationBeginDelimiterKey'); + late final ffi.Pointer _kCFURLMayShareFileContentKey = + _lookup('kCFURLMayShareFileContentKey'); - CFLocaleKey get kCFLocaleAlternateQuotationBeginDelimiterKey => - _kCFLocaleAlternateQuotationBeginDelimiterKey.value; + CFStringRef get kCFURLMayShareFileContentKey => + _kCFURLMayShareFileContentKey.value; - late final ffi.Pointer - _kCFLocaleAlternateQuotationEndDelimiterKey = - _lookup('kCFLocaleAlternateQuotationEndDelimiterKey'); + late final ffi.Pointer _kCFURLMayHaveExtendedAttributesKey = + _lookup('kCFURLMayHaveExtendedAttributesKey'); - CFLocaleKey get kCFLocaleAlternateQuotationEndDelimiterKey => - _kCFLocaleAlternateQuotationEndDelimiterKey.value; + CFStringRef get kCFURLMayHaveExtendedAttributesKey => + _kCFURLMayHaveExtendedAttributesKey.value; - late final ffi.Pointer _kCFGregorianCalendar = - _lookup('kCFGregorianCalendar'); + late final ffi.Pointer _kCFURLIsPurgeableKey = + _lookup('kCFURLIsPurgeableKey'); - CFCalendarIdentifier get kCFGregorianCalendar => _kCFGregorianCalendar.value; + CFStringRef get kCFURLIsPurgeableKey => _kCFURLIsPurgeableKey.value; - late final ffi.Pointer _kCFBuddhistCalendar = - _lookup('kCFBuddhistCalendar'); + late final ffi.Pointer _kCFURLIsSparseKey = + _lookup('kCFURLIsSparseKey'); - CFCalendarIdentifier get kCFBuddhistCalendar => _kCFBuddhistCalendar.value; + CFStringRef get kCFURLIsSparseKey => _kCFURLIsSparseKey.value; - late final ffi.Pointer _kCFChineseCalendar = - _lookup('kCFChineseCalendar'); + late final ffi.Pointer _kCFURLLinkCountKey = + _lookup('kCFURLLinkCountKey'); - CFCalendarIdentifier get kCFChineseCalendar => _kCFChineseCalendar.value; + CFStringRef get kCFURLLinkCountKey => _kCFURLLinkCountKey.value; - late final ffi.Pointer _kCFHebrewCalendar = - _lookup('kCFHebrewCalendar'); + late final ffi.Pointer _kCFURLParentDirectoryURLKey = + _lookup('kCFURLParentDirectoryURLKey'); - CFCalendarIdentifier get kCFHebrewCalendar => _kCFHebrewCalendar.value; + CFStringRef get kCFURLParentDirectoryURLKey => + _kCFURLParentDirectoryURLKey.value; - late final ffi.Pointer _kCFIslamicCalendar = - _lookup('kCFIslamicCalendar'); + late final ffi.Pointer _kCFURLVolumeURLKey = + _lookup('kCFURLVolumeURLKey'); - CFCalendarIdentifier get kCFIslamicCalendar => _kCFIslamicCalendar.value; + CFStringRef get kCFURLVolumeURLKey => _kCFURLVolumeURLKey.value; - late final ffi.Pointer _kCFIslamicCivilCalendar = - _lookup('kCFIslamicCivilCalendar'); + late final ffi.Pointer _kCFURLTypeIdentifierKey = + _lookup('kCFURLTypeIdentifierKey'); - CFCalendarIdentifier get kCFIslamicCivilCalendar => - _kCFIslamicCivilCalendar.value; + CFStringRef get kCFURLTypeIdentifierKey => _kCFURLTypeIdentifierKey.value; - late final ffi.Pointer _kCFJapaneseCalendar = - _lookup('kCFJapaneseCalendar'); + late final ffi.Pointer _kCFURLLocalizedTypeDescriptionKey = + _lookup('kCFURLLocalizedTypeDescriptionKey'); - CFCalendarIdentifier get kCFJapaneseCalendar => _kCFJapaneseCalendar.value; + CFStringRef get kCFURLLocalizedTypeDescriptionKey => + _kCFURLLocalizedTypeDescriptionKey.value; - late final ffi.Pointer _kCFRepublicOfChinaCalendar = - _lookup('kCFRepublicOfChinaCalendar'); + late final ffi.Pointer _kCFURLLabelNumberKey = + _lookup('kCFURLLabelNumberKey'); - CFCalendarIdentifier get kCFRepublicOfChinaCalendar => - _kCFRepublicOfChinaCalendar.value; + CFStringRef get kCFURLLabelNumberKey => _kCFURLLabelNumberKey.value; - late final ffi.Pointer _kCFPersianCalendar = - _lookup('kCFPersianCalendar'); + late final ffi.Pointer _kCFURLLabelColorKey = + _lookup('kCFURLLabelColorKey'); - CFCalendarIdentifier get kCFPersianCalendar => _kCFPersianCalendar.value; + CFStringRef get kCFURLLabelColorKey => _kCFURLLabelColorKey.value; - late final ffi.Pointer _kCFIndianCalendar = - _lookup('kCFIndianCalendar'); + late final ffi.Pointer _kCFURLLocalizedLabelKey = + _lookup('kCFURLLocalizedLabelKey'); - CFCalendarIdentifier get kCFIndianCalendar => _kCFIndianCalendar.value; + CFStringRef get kCFURLLocalizedLabelKey => _kCFURLLocalizedLabelKey.value; - late final ffi.Pointer _kCFISO8601Calendar = - _lookup('kCFISO8601Calendar'); + late final ffi.Pointer _kCFURLEffectiveIconKey = + _lookup('kCFURLEffectiveIconKey'); - CFCalendarIdentifier get kCFISO8601Calendar => _kCFISO8601Calendar.value; + CFStringRef get kCFURLEffectiveIconKey => _kCFURLEffectiveIconKey.value; - late final ffi.Pointer _kCFIslamicTabularCalendar = - _lookup('kCFIslamicTabularCalendar'); + late final ffi.Pointer _kCFURLCustomIconKey = + _lookup('kCFURLCustomIconKey'); - CFCalendarIdentifier get kCFIslamicTabularCalendar => - _kCFIslamicTabularCalendar.value; + CFStringRef get kCFURLCustomIconKey => _kCFURLCustomIconKey.value; - late final ffi.Pointer _kCFIslamicUmmAlQuraCalendar = - _lookup('kCFIslamicUmmAlQuraCalendar'); + late final ffi.Pointer _kCFURLFileResourceIdentifierKey = + _lookup('kCFURLFileResourceIdentifierKey'); - CFCalendarIdentifier get kCFIslamicUmmAlQuraCalendar => - _kCFIslamicUmmAlQuraCalendar.value; + CFStringRef get kCFURLFileResourceIdentifierKey => + _kCFURLFileResourceIdentifierKey.value; - double CFAbsoluteTimeGetCurrent() { - return _CFAbsoluteTimeGetCurrent(); - } + late final ffi.Pointer _kCFURLVolumeIdentifierKey = + _lookup('kCFURLVolumeIdentifierKey'); - late final _CFAbsoluteTimeGetCurrentPtr = - _lookup>( - 'CFAbsoluteTimeGetCurrent'); - late final _CFAbsoluteTimeGetCurrent = - _CFAbsoluteTimeGetCurrentPtr.asFunction(); + CFStringRef get kCFURLVolumeIdentifierKey => _kCFURLVolumeIdentifierKey.value; - late final ffi.Pointer _kCFAbsoluteTimeIntervalSince1970 = - _lookup('kCFAbsoluteTimeIntervalSince1970'); + late final ffi.Pointer _kCFURLPreferredIOBlockSizeKey = + _lookup('kCFURLPreferredIOBlockSizeKey'); - double get kCFAbsoluteTimeIntervalSince1970 => - _kCFAbsoluteTimeIntervalSince1970.value; + CFStringRef get kCFURLPreferredIOBlockSizeKey => + _kCFURLPreferredIOBlockSizeKey.value; - late final ffi.Pointer _kCFAbsoluteTimeIntervalSince1904 = - _lookup('kCFAbsoluteTimeIntervalSince1904'); + late final ffi.Pointer _kCFURLIsReadableKey = + _lookup('kCFURLIsReadableKey'); - double get kCFAbsoluteTimeIntervalSince1904 => - _kCFAbsoluteTimeIntervalSince1904.value; + CFStringRef get kCFURLIsReadableKey => _kCFURLIsReadableKey.value; - int CFDateGetTypeID() { - return _CFDateGetTypeID(); - } + late final ffi.Pointer _kCFURLIsWritableKey = + _lookup('kCFURLIsWritableKey'); - late final _CFDateGetTypeIDPtr = - _lookup>('CFDateGetTypeID'); - late final _CFDateGetTypeID = - _CFDateGetTypeIDPtr.asFunction(); + CFStringRef get kCFURLIsWritableKey => _kCFURLIsWritableKey.value; - CFDateRef CFDateCreate( - CFAllocatorRef allocator, - double at, - ) { - return _CFDateCreate( - allocator, - at, - ); - } + late final ffi.Pointer _kCFURLIsExecutableKey = + _lookup('kCFURLIsExecutableKey'); - late final _CFDateCreatePtr = _lookup< - ffi.NativeFunction< - CFDateRef Function(CFAllocatorRef, CFAbsoluteTime)>>('CFDateCreate'); - late final _CFDateCreate = - _CFDateCreatePtr.asFunction(); + CFStringRef get kCFURLIsExecutableKey => _kCFURLIsExecutableKey.value; - double CFDateGetAbsoluteTime( - CFDateRef theDate, - ) { - return _CFDateGetAbsoluteTime( - theDate, - ); - } + late final ffi.Pointer _kCFURLFileSecurityKey = + _lookup('kCFURLFileSecurityKey'); - late final _CFDateGetAbsoluteTimePtr = - _lookup>( - 'CFDateGetAbsoluteTime'); - late final _CFDateGetAbsoluteTime = - _CFDateGetAbsoluteTimePtr.asFunction(); + CFStringRef get kCFURLFileSecurityKey => _kCFURLFileSecurityKey.value; - double CFDateGetTimeIntervalSinceDate( - CFDateRef theDate, - CFDateRef otherDate, - ) { - return _CFDateGetTimeIntervalSinceDate( - theDate, - otherDate, - ); - } + late final ffi.Pointer _kCFURLIsExcludedFromBackupKey = + _lookup('kCFURLIsExcludedFromBackupKey'); - late final _CFDateGetTimeIntervalSinceDatePtr = _lookup< - ffi.NativeFunction>( - 'CFDateGetTimeIntervalSinceDate'); - late final _CFDateGetTimeIntervalSinceDate = - _CFDateGetTimeIntervalSinceDatePtr.asFunction< - double Function(CFDateRef, CFDateRef)>(); + CFStringRef get kCFURLIsExcludedFromBackupKey => + _kCFURLIsExcludedFromBackupKey.value; - int CFDateCompare( - CFDateRef theDate, - CFDateRef otherDate, - ffi.Pointer context, - ) { - return _CFDateCompare( - theDate, - otherDate, - context, - ); - } + late final ffi.Pointer _kCFURLTagNamesKey = + _lookup('kCFURLTagNamesKey'); - late final _CFDateComparePtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - CFDateRef, CFDateRef, ffi.Pointer)>>('CFDateCompare'); - late final _CFDateCompare = _CFDateComparePtr.asFunction< - int Function(CFDateRef, CFDateRef, ffi.Pointer)>(); + CFStringRef get kCFURLTagNamesKey => _kCFURLTagNamesKey.value; - int CFGregorianDateIsValid( - CFGregorianDate gdate, - int unitFlags, - ) { - return _CFGregorianDateIsValid( - gdate, - unitFlags, - ); - } + late final ffi.Pointer _kCFURLPathKey = + _lookup('kCFURLPathKey'); - late final _CFGregorianDateIsValidPtr = _lookup< - ffi.NativeFunction>( - 'CFGregorianDateIsValid'); - late final _CFGregorianDateIsValid = _CFGregorianDateIsValidPtr.asFunction< - int Function(CFGregorianDate, int)>(); + CFStringRef get kCFURLPathKey => _kCFURLPathKey.value; - double CFGregorianDateGetAbsoluteTime( - CFGregorianDate gdate, - CFTimeZoneRef tz, - ) { - return _CFGregorianDateGetAbsoluteTime( - gdate, - tz, - ); - } + late final ffi.Pointer _kCFURLCanonicalPathKey = + _lookup('kCFURLCanonicalPathKey'); - late final _CFGregorianDateGetAbsoluteTimePtr = _lookup< - ffi.NativeFunction< - CFAbsoluteTime Function(CFGregorianDate, - CFTimeZoneRef)>>('CFGregorianDateGetAbsoluteTime'); - late final _CFGregorianDateGetAbsoluteTime = - _CFGregorianDateGetAbsoluteTimePtr.asFunction< - double Function(CFGregorianDate, CFTimeZoneRef)>(); + CFStringRef get kCFURLCanonicalPathKey => _kCFURLCanonicalPathKey.value; - CFGregorianDate CFAbsoluteTimeGetGregorianDate( - double at, - CFTimeZoneRef tz, - ) { - return _CFAbsoluteTimeGetGregorianDate( - at, - tz, - ); - } + late final ffi.Pointer _kCFURLIsMountTriggerKey = + _lookup('kCFURLIsMountTriggerKey'); - late final _CFAbsoluteTimeGetGregorianDatePtr = _lookup< - ffi.NativeFunction< - CFGregorianDate Function(CFAbsoluteTime, - CFTimeZoneRef)>>('CFAbsoluteTimeGetGregorianDate'); - late final _CFAbsoluteTimeGetGregorianDate = - _CFAbsoluteTimeGetGregorianDatePtr.asFunction< - CFGregorianDate Function(double, CFTimeZoneRef)>(); + CFStringRef get kCFURLIsMountTriggerKey => _kCFURLIsMountTriggerKey.value; - double CFAbsoluteTimeAddGregorianUnits( - double at, - CFTimeZoneRef tz, - CFGregorianUnits units, - ) { - return _CFAbsoluteTimeAddGregorianUnits( - at, - tz, - units, - ); - } + late final ffi.Pointer _kCFURLGenerationIdentifierKey = + _lookup('kCFURLGenerationIdentifierKey'); - late final _CFAbsoluteTimeAddGregorianUnitsPtr = _lookup< - ffi.NativeFunction< - CFAbsoluteTime Function(CFAbsoluteTime, CFTimeZoneRef, - CFGregorianUnits)>>('CFAbsoluteTimeAddGregorianUnits'); - late final _CFAbsoluteTimeAddGregorianUnits = - _CFAbsoluteTimeAddGregorianUnitsPtr.asFunction< - double Function(double, CFTimeZoneRef, CFGregorianUnits)>(); + CFStringRef get kCFURLGenerationIdentifierKey => + _kCFURLGenerationIdentifierKey.value; - CFGregorianUnits CFAbsoluteTimeGetDifferenceAsGregorianUnits( - double at1, - double at2, - CFTimeZoneRef tz, - int unitFlags, - ) { - return _CFAbsoluteTimeGetDifferenceAsGregorianUnits( - at1, - at2, - tz, - unitFlags, - ); - } + late final ffi.Pointer _kCFURLDocumentIdentifierKey = + _lookup('kCFURLDocumentIdentifierKey'); - late final _CFAbsoluteTimeGetDifferenceAsGregorianUnitsPtr = _lookup< - ffi.NativeFunction< - CFGregorianUnits Function( - CFAbsoluteTime, - CFAbsoluteTime, - CFTimeZoneRef, - CFOptionFlags)>>('CFAbsoluteTimeGetDifferenceAsGregorianUnits'); - late final _CFAbsoluteTimeGetDifferenceAsGregorianUnits = - _CFAbsoluteTimeGetDifferenceAsGregorianUnitsPtr.asFunction< - CFGregorianUnits Function(double, double, CFTimeZoneRef, int)>(); + CFStringRef get kCFURLDocumentIdentifierKey => + _kCFURLDocumentIdentifierKey.value; - int CFAbsoluteTimeGetDayOfWeek( - double at, - CFTimeZoneRef tz, - ) { - return _CFAbsoluteTimeGetDayOfWeek( - at, - tz, - ); - } + late final ffi.Pointer _kCFURLAddedToDirectoryDateKey = + _lookup('kCFURLAddedToDirectoryDateKey'); - late final _CFAbsoluteTimeGetDayOfWeekPtr = _lookup< - ffi.NativeFunction>( - 'CFAbsoluteTimeGetDayOfWeek'); - late final _CFAbsoluteTimeGetDayOfWeek = _CFAbsoluteTimeGetDayOfWeekPtr - .asFunction(); + CFStringRef get kCFURLAddedToDirectoryDateKey => + _kCFURLAddedToDirectoryDateKey.value; - int CFAbsoluteTimeGetDayOfYear( - double at, - CFTimeZoneRef tz, - ) { - return _CFAbsoluteTimeGetDayOfYear( - at, - tz, - ); - } + late final ffi.Pointer _kCFURLQuarantinePropertiesKey = + _lookup('kCFURLQuarantinePropertiesKey'); - late final _CFAbsoluteTimeGetDayOfYearPtr = _lookup< - ffi.NativeFunction>( - 'CFAbsoluteTimeGetDayOfYear'); - late final _CFAbsoluteTimeGetDayOfYear = _CFAbsoluteTimeGetDayOfYearPtr - .asFunction(); + CFStringRef get kCFURLQuarantinePropertiesKey => + _kCFURLQuarantinePropertiesKey.value; - int CFAbsoluteTimeGetWeekOfYear( - double at, - CFTimeZoneRef tz, - ) { - return _CFAbsoluteTimeGetWeekOfYear( - at, - tz, - ); - } + late final ffi.Pointer _kCFURLFileResourceTypeKey = + _lookup('kCFURLFileResourceTypeKey'); - late final _CFAbsoluteTimeGetWeekOfYearPtr = _lookup< - ffi.NativeFunction>( - 'CFAbsoluteTimeGetWeekOfYear'); - late final _CFAbsoluteTimeGetWeekOfYear = _CFAbsoluteTimeGetWeekOfYearPtr - .asFunction(); + CFStringRef get kCFURLFileResourceTypeKey => _kCFURLFileResourceTypeKey.value; - int CFDataGetTypeID() { - return _CFDataGetTypeID(); - } + late final ffi.Pointer _kCFURLFileResourceTypeNamedPipe = + _lookup('kCFURLFileResourceTypeNamedPipe'); - late final _CFDataGetTypeIDPtr = - _lookup>('CFDataGetTypeID'); - late final _CFDataGetTypeID = - _CFDataGetTypeIDPtr.asFunction(); + CFStringRef get kCFURLFileResourceTypeNamedPipe => + _kCFURLFileResourceTypeNamedPipe.value; - CFDataRef CFDataCreate( - CFAllocatorRef allocator, - ffi.Pointer bytes, - int length, - ) { - return _CFDataCreate( - allocator, - bytes, - length, - ); - } + late final ffi.Pointer _kCFURLFileResourceTypeCharacterSpecial = + _lookup('kCFURLFileResourceTypeCharacterSpecial'); - late final _CFDataCreatePtr = _lookup< - ffi.NativeFunction< - CFDataRef Function( - CFAllocatorRef, ffi.Pointer, CFIndex)>>('CFDataCreate'); - late final _CFDataCreate = _CFDataCreatePtr.asFunction< - CFDataRef Function(CFAllocatorRef, ffi.Pointer, int)>(); + CFStringRef get kCFURLFileResourceTypeCharacterSpecial => + _kCFURLFileResourceTypeCharacterSpecial.value; - CFDataRef CFDataCreateWithBytesNoCopy( - CFAllocatorRef allocator, - ffi.Pointer bytes, - int length, - CFAllocatorRef bytesDeallocator, - ) { - return _CFDataCreateWithBytesNoCopy( - allocator, - bytes, - length, - bytesDeallocator, - ); - } + late final ffi.Pointer _kCFURLFileResourceTypeDirectory = + _lookup('kCFURLFileResourceTypeDirectory'); - late final _CFDataCreateWithBytesNoCopyPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, - CFAllocatorRef)>>('CFDataCreateWithBytesNoCopy'); - late final _CFDataCreateWithBytesNoCopy = - _CFDataCreateWithBytesNoCopyPtr.asFunction< - CFDataRef Function( - CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); + CFStringRef get kCFURLFileResourceTypeDirectory => + _kCFURLFileResourceTypeDirectory.value; - CFDataRef CFDataCreateCopy( - CFAllocatorRef allocator, - CFDataRef theData, - ) { - return _CFDataCreateCopy( - allocator, - theData, - ); - } + late final ffi.Pointer _kCFURLFileResourceTypeBlockSpecial = + _lookup('kCFURLFileResourceTypeBlockSpecial'); - late final _CFDataCreateCopyPtr = _lookup< - ffi.NativeFunction>( - 'CFDataCreateCopy'); - late final _CFDataCreateCopy = _CFDataCreateCopyPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFDataRef)>(); - - CFMutableDataRef CFDataCreateMutable( - CFAllocatorRef allocator, - int capacity, - ) { - return _CFDataCreateMutable( - allocator, - capacity, - ); - } + CFStringRef get kCFURLFileResourceTypeBlockSpecial => + _kCFURLFileResourceTypeBlockSpecial.value; - late final _CFDataCreateMutablePtr = _lookup< - ffi - .NativeFunction>( - 'CFDataCreateMutable'); - late final _CFDataCreateMutable = _CFDataCreateMutablePtr.asFunction< - CFMutableDataRef Function(CFAllocatorRef, int)>(); + late final ffi.Pointer _kCFURLFileResourceTypeRegular = + _lookup('kCFURLFileResourceTypeRegular'); - CFMutableDataRef CFDataCreateMutableCopy( - CFAllocatorRef allocator, - int capacity, - CFDataRef theData, - ) { - return _CFDataCreateMutableCopy( - allocator, - capacity, - theData, - ); - } + CFStringRef get kCFURLFileResourceTypeRegular => + _kCFURLFileResourceTypeRegular.value; - late final _CFDataCreateMutableCopyPtr = _lookup< - ffi.NativeFunction< - CFMutableDataRef Function( - CFAllocatorRef, CFIndex, CFDataRef)>>('CFDataCreateMutableCopy'); - late final _CFDataCreateMutableCopy = _CFDataCreateMutableCopyPtr.asFunction< - CFMutableDataRef Function(CFAllocatorRef, int, CFDataRef)>(); + late final ffi.Pointer _kCFURLFileResourceTypeSymbolicLink = + _lookup('kCFURLFileResourceTypeSymbolicLink'); - int CFDataGetLength( - CFDataRef theData, - ) { - return _CFDataGetLength( - theData, - ); - } + CFStringRef get kCFURLFileResourceTypeSymbolicLink => + _kCFURLFileResourceTypeSymbolicLink.value; - late final _CFDataGetLengthPtr = - _lookup>( - 'CFDataGetLength'); - late final _CFDataGetLength = - _CFDataGetLengthPtr.asFunction(); + late final ffi.Pointer _kCFURLFileResourceTypeSocket = + _lookup('kCFURLFileResourceTypeSocket'); - ffi.Pointer CFDataGetBytePtr( - CFDataRef theData, - ) { - return _CFDataGetBytePtr( - theData, - ); - } + CFStringRef get kCFURLFileResourceTypeSocket => + _kCFURLFileResourceTypeSocket.value; - late final _CFDataGetBytePtrPtr = - _lookup Function(CFDataRef)>>( - 'CFDataGetBytePtr'); - late final _CFDataGetBytePtr = - _CFDataGetBytePtrPtr.asFunction Function(CFDataRef)>(); + late final ffi.Pointer _kCFURLFileResourceTypeUnknown = + _lookup('kCFURLFileResourceTypeUnknown'); - ffi.Pointer CFDataGetMutableBytePtr( - CFMutableDataRef theData, - ) { - return _CFDataGetMutableBytePtr( - theData, - ); - } + CFStringRef get kCFURLFileResourceTypeUnknown => + _kCFURLFileResourceTypeUnknown.value; - late final _CFDataGetMutableBytePtrPtr = _lookup< - ffi.NativeFunction Function(CFMutableDataRef)>>( - 'CFDataGetMutableBytePtr'); - late final _CFDataGetMutableBytePtr = _CFDataGetMutableBytePtrPtr.asFunction< - ffi.Pointer Function(CFMutableDataRef)>(); + late final ffi.Pointer _kCFURLFileSizeKey = + _lookup('kCFURLFileSizeKey'); - void CFDataGetBytes( - CFDataRef theData, - CFRange range, - ffi.Pointer buffer, - ) { - return _CFDataGetBytes( - theData, - range, - buffer, - ); - } + CFStringRef get kCFURLFileSizeKey => _kCFURLFileSizeKey.value; - late final _CFDataGetBytesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFDataRef, CFRange, ffi.Pointer)>>('CFDataGetBytes'); - late final _CFDataGetBytes = _CFDataGetBytesPtr.asFunction< - void Function(CFDataRef, CFRange, ffi.Pointer)>(); + late final ffi.Pointer _kCFURLFileAllocatedSizeKey = + _lookup('kCFURLFileAllocatedSizeKey'); - void CFDataSetLength( - CFMutableDataRef theData, - int length, - ) { - return _CFDataSetLength( - theData, - length, - ); - } + CFStringRef get kCFURLFileAllocatedSizeKey => + _kCFURLFileAllocatedSizeKey.value; - late final _CFDataSetLengthPtr = - _lookup>( - 'CFDataSetLength'); - late final _CFDataSetLength = - _CFDataSetLengthPtr.asFunction(); + late final ffi.Pointer _kCFURLTotalFileSizeKey = + _lookup('kCFURLTotalFileSizeKey'); - void CFDataIncreaseLength( - CFMutableDataRef theData, - int extraLength, - ) { - return _CFDataIncreaseLength( - theData, - extraLength, - ); - } + CFStringRef get kCFURLTotalFileSizeKey => _kCFURLTotalFileSizeKey.value; - late final _CFDataIncreaseLengthPtr = - _lookup>( - 'CFDataIncreaseLength'); - late final _CFDataIncreaseLength = _CFDataIncreaseLengthPtr.asFunction< - void Function(CFMutableDataRef, int)>(); + late final ffi.Pointer _kCFURLTotalFileAllocatedSizeKey = + _lookup('kCFURLTotalFileAllocatedSizeKey'); - void CFDataAppendBytes( - CFMutableDataRef theData, - ffi.Pointer bytes, - int length, - ) { - return _CFDataAppendBytes( - theData, - bytes, - length, - ); - } + CFStringRef get kCFURLTotalFileAllocatedSizeKey => + _kCFURLTotalFileAllocatedSizeKey.value; - late final _CFDataAppendBytesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableDataRef, ffi.Pointer, - CFIndex)>>('CFDataAppendBytes'); - late final _CFDataAppendBytes = _CFDataAppendBytesPtr.asFunction< - void Function(CFMutableDataRef, ffi.Pointer, int)>(); + late final ffi.Pointer _kCFURLIsAliasFileKey = + _lookup('kCFURLIsAliasFileKey'); - void CFDataReplaceBytes( - CFMutableDataRef theData, - CFRange range, - ffi.Pointer newBytes, - int newLength, - ) { - return _CFDataReplaceBytes( - theData, - range, - newBytes, - newLength, - ); - } + CFStringRef get kCFURLIsAliasFileKey => _kCFURLIsAliasFileKey.value; - late final _CFDataReplaceBytesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableDataRef, CFRange, ffi.Pointer, - CFIndex)>>('CFDataReplaceBytes'); - late final _CFDataReplaceBytes = _CFDataReplaceBytesPtr.asFunction< - void Function(CFMutableDataRef, CFRange, ffi.Pointer, int)>(); + late final ffi.Pointer _kCFURLFileProtectionKey = + _lookup('kCFURLFileProtectionKey'); - void CFDataDeleteBytes( - CFMutableDataRef theData, - CFRange range, - ) { - return _CFDataDeleteBytes( - theData, - range, - ); - } + CFStringRef get kCFURLFileProtectionKey => _kCFURLFileProtectionKey.value; - late final _CFDataDeleteBytesPtr = - _lookup>( - 'CFDataDeleteBytes'); - late final _CFDataDeleteBytes = _CFDataDeleteBytesPtr.asFunction< - void Function(CFMutableDataRef, CFRange)>(); + late final ffi.Pointer _kCFURLFileProtectionNone = + _lookup('kCFURLFileProtectionNone'); - CFRange CFDataFind( - CFDataRef theData, - CFDataRef dataToFind, - CFRange searchRange, - int compareOptions, - ) { - return _CFDataFind( - theData, - dataToFind, - searchRange, - compareOptions, - ); - } + CFStringRef get kCFURLFileProtectionNone => _kCFURLFileProtectionNone.value; - late final _CFDataFindPtr = _lookup< - ffi.NativeFunction< - CFRange Function( - CFDataRef, CFDataRef, CFRange, ffi.Int32)>>('CFDataFind'); - late final _CFDataFind = _CFDataFindPtr.asFunction< - CFRange Function(CFDataRef, CFDataRef, CFRange, int)>(); + late final ffi.Pointer _kCFURLFileProtectionComplete = + _lookup('kCFURLFileProtectionComplete'); - int CFCharacterSetGetTypeID() { - return _CFCharacterSetGetTypeID(); - } + CFStringRef get kCFURLFileProtectionComplete => + _kCFURLFileProtectionComplete.value; - late final _CFCharacterSetGetTypeIDPtr = - _lookup>( - 'CFCharacterSetGetTypeID'); - late final _CFCharacterSetGetTypeID = - _CFCharacterSetGetTypeIDPtr.asFunction(); + late final ffi.Pointer _kCFURLFileProtectionCompleteUnlessOpen = + _lookup('kCFURLFileProtectionCompleteUnlessOpen'); - CFCharacterSetRef CFCharacterSetGetPredefined( - int theSetIdentifier, - ) { - return _CFCharacterSetGetPredefined( - theSetIdentifier, - ); - } + CFStringRef get kCFURLFileProtectionCompleteUnlessOpen => + _kCFURLFileProtectionCompleteUnlessOpen.value; - late final _CFCharacterSetGetPredefinedPtr = - _lookup>( - 'CFCharacterSetGetPredefined'); - late final _CFCharacterSetGetPredefined = _CFCharacterSetGetPredefinedPtr - .asFunction(); + late final ffi.Pointer + _kCFURLFileProtectionCompleteUntilFirstUserAuthentication = + _lookup( + 'kCFURLFileProtectionCompleteUntilFirstUserAuthentication'); - CFCharacterSetRef CFCharacterSetCreateWithCharactersInRange( - CFAllocatorRef alloc, - CFRange theRange, - ) { - return _CFCharacterSetCreateWithCharactersInRange( - alloc, - theRange, - ); - } + CFStringRef get kCFURLFileProtectionCompleteUntilFirstUserAuthentication => + _kCFURLFileProtectionCompleteUntilFirstUserAuthentication.value; - late final _CFCharacterSetCreateWithCharactersInRangePtr = _lookup< - ffi - .NativeFunction>( - 'CFCharacterSetCreateWithCharactersInRange'); - late final _CFCharacterSetCreateWithCharactersInRange = - _CFCharacterSetCreateWithCharactersInRangePtr.asFunction< - CFCharacterSetRef Function(CFAllocatorRef, CFRange)>(); + late final ffi.Pointer + _kCFURLFileProtectionCompleteWhenUserInactive = + _lookup('kCFURLFileProtectionCompleteWhenUserInactive'); - CFCharacterSetRef CFCharacterSetCreateWithCharactersInString( - CFAllocatorRef alloc, - CFStringRef theString, - ) { - return _CFCharacterSetCreateWithCharactersInString( - alloc, - theString, - ); - } + CFStringRef get kCFURLFileProtectionCompleteWhenUserInactive => + _kCFURLFileProtectionCompleteWhenUserInactive.value; - late final _CFCharacterSetCreateWithCharactersInStringPtr = _lookup< - ffi.NativeFunction< - CFCharacterSetRef Function(CFAllocatorRef, - CFStringRef)>>('CFCharacterSetCreateWithCharactersInString'); - late final _CFCharacterSetCreateWithCharactersInString = - _CFCharacterSetCreateWithCharactersInStringPtr.asFunction< - CFCharacterSetRef Function(CFAllocatorRef, CFStringRef)>(); + late final ffi.Pointer _kCFURLDirectoryEntryCountKey = + _lookup('kCFURLDirectoryEntryCountKey'); - CFCharacterSetRef CFCharacterSetCreateWithBitmapRepresentation( - CFAllocatorRef alloc, - CFDataRef theData, - ) { - return _CFCharacterSetCreateWithBitmapRepresentation( - alloc, - theData, - ); - } + CFStringRef get kCFURLDirectoryEntryCountKey => + _kCFURLDirectoryEntryCountKey.value; - late final _CFCharacterSetCreateWithBitmapRepresentationPtr = _lookup< - ffi.NativeFunction< - CFCharacterSetRef Function(CFAllocatorRef, - CFDataRef)>>('CFCharacterSetCreateWithBitmapRepresentation'); - late final _CFCharacterSetCreateWithBitmapRepresentation = - _CFCharacterSetCreateWithBitmapRepresentationPtr.asFunction< - CFCharacterSetRef Function(CFAllocatorRef, CFDataRef)>(); + late final ffi.Pointer + _kCFURLVolumeLocalizedFormatDescriptionKey = + _lookup('kCFURLVolumeLocalizedFormatDescriptionKey'); - CFCharacterSetRef CFCharacterSetCreateInvertedSet( - CFAllocatorRef alloc, - CFCharacterSetRef theSet, - ) { - return _CFCharacterSetCreateInvertedSet( - alloc, - theSet, - ); - } + CFStringRef get kCFURLVolumeLocalizedFormatDescriptionKey => + _kCFURLVolumeLocalizedFormatDescriptionKey.value; - late final _CFCharacterSetCreateInvertedSetPtr = _lookup< - ffi.NativeFunction< - CFCharacterSetRef Function(CFAllocatorRef, - CFCharacterSetRef)>>('CFCharacterSetCreateInvertedSet'); - late final _CFCharacterSetCreateInvertedSet = - _CFCharacterSetCreateInvertedSetPtr.asFunction< - CFCharacterSetRef Function(CFAllocatorRef, CFCharacterSetRef)>(); + late final ffi.Pointer _kCFURLVolumeTotalCapacityKey = + _lookup('kCFURLVolumeTotalCapacityKey'); - int CFCharacterSetIsSupersetOfSet( - CFCharacterSetRef theSet, - CFCharacterSetRef theOtherset, - ) { - return _CFCharacterSetIsSupersetOfSet( - theSet, - theOtherset, - ); - } + CFStringRef get kCFURLVolumeTotalCapacityKey => + _kCFURLVolumeTotalCapacityKey.value; - late final _CFCharacterSetIsSupersetOfSetPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFCharacterSetRef, - CFCharacterSetRef)>>('CFCharacterSetIsSupersetOfSet'); - late final _CFCharacterSetIsSupersetOfSet = _CFCharacterSetIsSupersetOfSetPtr - .asFunction(); + late final ffi.Pointer _kCFURLVolumeAvailableCapacityKey = + _lookup('kCFURLVolumeAvailableCapacityKey'); - int CFCharacterSetHasMemberInPlane( - CFCharacterSetRef theSet, - int thePlane, - ) { - return _CFCharacterSetHasMemberInPlane( - theSet, - thePlane, - ); - } + CFStringRef get kCFURLVolumeAvailableCapacityKey => + _kCFURLVolumeAvailableCapacityKey.value; - late final _CFCharacterSetHasMemberInPlanePtr = - _lookup>( - 'CFCharacterSetHasMemberInPlane'); - late final _CFCharacterSetHasMemberInPlane = - _CFCharacterSetHasMemberInPlanePtr.asFunction< - int Function(CFCharacterSetRef, int)>(); + late final ffi.Pointer + _kCFURLVolumeAvailableCapacityForImportantUsageKey = + _lookup('kCFURLVolumeAvailableCapacityForImportantUsageKey'); - CFMutableCharacterSetRef CFCharacterSetCreateMutable( - CFAllocatorRef alloc, - ) { - return _CFCharacterSetCreateMutable( - alloc, - ); - } + CFStringRef get kCFURLVolumeAvailableCapacityForImportantUsageKey => + _kCFURLVolumeAvailableCapacityForImportantUsageKey.value; - late final _CFCharacterSetCreateMutablePtr = _lookup< - ffi - .NativeFunction>( - 'CFCharacterSetCreateMutable'); - late final _CFCharacterSetCreateMutable = _CFCharacterSetCreateMutablePtr - .asFunction(); + late final ffi.Pointer + _kCFURLVolumeAvailableCapacityForOpportunisticUsageKey = + _lookup( + 'kCFURLVolumeAvailableCapacityForOpportunisticUsageKey'); - CFCharacterSetRef CFCharacterSetCreateCopy( - CFAllocatorRef alloc, - CFCharacterSetRef theSet, - ) { - return _CFCharacterSetCreateCopy( - alloc, - theSet, - ); - } + CFStringRef get kCFURLVolumeAvailableCapacityForOpportunisticUsageKey => + _kCFURLVolumeAvailableCapacityForOpportunisticUsageKey.value; - late final _CFCharacterSetCreateCopyPtr = _lookup< - ffi.NativeFunction< - CFCharacterSetRef Function( - CFAllocatorRef, CFCharacterSetRef)>>('CFCharacterSetCreateCopy'); - late final _CFCharacterSetCreateCopy = - _CFCharacterSetCreateCopyPtr.asFunction< - CFCharacterSetRef Function(CFAllocatorRef, CFCharacterSetRef)>(); + late final ffi.Pointer _kCFURLVolumeResourceCountKey = + _lookup('kCFURLVolumeResourceCountKey'); - CFMutableCharacterSetRef CFCharacterSetCreateMutableCopy( - CFAllocatorRef alloc, - CFCharacterSetRef theSet, - ) { - return _CFCharacterSetCreateMutableCopy( - alloc, - theSet, - ); - } + CFStringRef get kCFURLVolumeResourceCountKey => + _kCFURLVolumeResourceCountKey.value; - late final _CFCharacterSetCreateMutableCopyPtr = _lookup< - ffi.NativeFunction< - CFMutableCharacterSetRef Function(CFAllocatorRef, - CFCharacterSetRef)>>('CFCharacterSetCreateMutableCopy'); - late final _CFCharacterSetCreateMutableCopy = - _CFCharacterSetCreateMutableCopyPtr.asFunction< - CFMutableCharacterSetRef Function( - CFAllocatorRef, CFCharacterSetRef)>(); + late final ffi.Pointer _kCFURLVolumeSupportsPersistentIDsKey = + _lookup('kCFURLVolumeSupportsPersistentIDsKey'); - int CFCharacterSetIsCharacterMember( - CFCharacterSetRef theSet, - int theChar, - ) { - return _CFCharacterSetIsCharacterMember( - theSet, - theChar, - ); - } + CFStringRef get kCFURLVolumeSupportsPersistentIDsKey => + _kCFURLVolumeSupportsPersistentIDsKey.value; - late final _CFCharacterSetIsCharacterMemberPtr = - _lookup>( - 'CFCharacterSetIsCharacterMember'); - late final _CFCharacterSetIsCharacterMember = - _CFCharacterSetIsCharacterMemberPtr.asFunction< - int Function(CFCharacterSetRef, int)>(); + late final ffi.Pointer _kCFURLVolumeSupportsSymbolicLinksKey = + _lookup('kCFURLVolumeSupportsSymbolicLinksKey'); - int CFCharacterSetIsLongCharacterMember( - CFCharacterSetRef theSet, - int theChar, - ) { - return _CFCharacterSetIsLongCharacterMember( - theSet, - theChar, - ); - } + CFStringRef get kCFURLVolumeSupportsSymbolicLinksKey => + _kCFURLVolumeSupportsSymbolicLinksKey.value; - late final _CFCharacterSetIsLongCharacterMemberPtr = _lookup< - ffi.NativeFunction>( - 'CFCharacterSetIsLongCharacterMember'); - late final _CFCharacterSetIsLongCharacterMember = - _CFCharacterSetIsLongCharacterMemberPtr.asFunction< - int Function(CFCharacterSetRef, int)>(); + late final ffi.Pointer _kCFURLVolumeSupportsHardLinksKey = + _lookup('kCFURLVolumeSupportsHardLinksKey'); - CFDataRef CFCharacterSetCreateBitmapRepresentation( - CFAllocatorRef alloc, - CFCharacterSetRef theSet, - ) { - return _CFCharacterSetCreateBitmapRepresentation( - alloc, - theSet, - ); - } + CFStringRef get kCFURLVolumeSupportsHardLinksKey => + _kCFURLVolumeSupportsHardLinksKey.value; - late final _CFCharacterSetCreateBitmapRepresentationPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(CFAllocatorRef, - CFCharacterSetRef)>>('CFCharacterSetCreateBitmapRepresentation'); - late final _CFCharacterSetCreateBitmapRepresentation = - _CFCharacterSetCreateBitmapRepresentationPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFCharacterSetRef)>(); + late final ffi.Pointer _kCFURLVolumeSupportsJournalingKey = + _lookup('kCFURLVolumeSupportsJournalingKey'); - void CFCharacterSetAddCharactersInRange( - CFMutableCharacterSetRef theSet, - CFRange theRange, - ) { - return _CFCharacterSetAddCharactersInRange( - theSet, - theRange, - ); - } + CFStringRef get kCFURLVolumeSupportsJournalingKey => + _kCFURLVolumeSupportsJournalingKey.value; - late final _CFCharacterSetAddCharactersInRangePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableCharacterSetRef, - CFRange)>>('CFCharacterSetAddCharactersInRange'); - late final _CFCharacterSetAddCharactersInRange = - _CFCharacterSetAddCharactersInRangePtr.asFunction< - void Function(CFMutableCharacterSetRef, CFRange)>(); + late final ffi.Pointer _kCFURLVolumeIsJournalingKey = + _lookup('kCFURLVolumeIsJournalingKey'); - void CFCharacterSetRemoveCharactersInRange( - CFMutableCharacterSetRef theSet, - CFRange theRange, - ) { - return _CFCharacterSetRemoveCharactersInRange( - theSet, - theRange, - ); - } + CFStringRef get kCFURLVolumeIsJournalingKey => + _kCFURLVolumeIsJournalingKey.value; - late final _CFCharacterSetRemoveCharactersInRangePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableCharacterSetRef, - CFRange)>>('CFCharacterSetRemoveCharactersInRange'); - late final _CFCharacterSetRemoveCharactersInRange = - _CFCharacterSetRemoveCharactersInRangePtr.asFunction< - void Function(CFMutableCharacterSetRef, CFRange)>(); + late final ffi.Pointer _kCFURLVolumeSupportsSparseFilesKey = + _lookup('kCFURLVolumeSupportsSparseFilesKey'); - void CFCharacterSetAddCharactersInString( - CFMutableCharacterSetRef theSet, - CFStringRef theString, - ) { - return _CFCharacterSetAddCharactersInString( - theSet, - theString, - ); - } + CFStringRef get kCFURLVolumeSupportsSparseFilesKey => + _kCFURLVolumeSupportsSparseFilesKey.value; - late final _CFCharacterSetAddCharactersInStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableCharacterSetRef, - CFStringRef)>>('CFCharacterSetAddCharactersInString'); - late final _CFCharacterSetAddCharactersInString = - _CFCharacterSetAddCharactersInStringPtr.asFunction< - void Function(CFMutableCharacterSetRef, CFStringRef)>(); + late final ffi.Pointer _kCFURLVolumeSupportsZeroRunsKey = + _lookup('kCFURLVolumeSupportsZeroRunsKey'); - void CFCharacterSetRemoveCharactersInString( - CFMutableCharacterSetRef theSet, - CFStringRef theString, - ) { - return _CFCharacterSetRemoveCharactersInString( - theSet, - theString, - ); - } + CFStringRef get kCFURLVolumeSupportsZeroRunsKey => + _kCFURLVolumeSupportsZeroRunsKey.value; - late final _CFCharacterSetRemoveCharactersInStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableCharacterSetRef, - CFStringRef)>>('CFCharacterSetRemoveCharactersInString'); - late final _CFCharacterSetRemoveCharactersInString = - _CFCharacterSetRemoveCharactersInStringPtr.asFunction< - void Function(CFMutableCharacterSetRef, CFStringRef)>(); + late final ffi.Pointer + _kCFURLVolumeSupportsCaseSensitiveNamesKey = + _lookup('kCFURLVolumeSupportsCaseSensitiveNamesKey'); - void CFCharacterSetUnion( - CFMutableCharacterSetRef theSet, - CFCharacterSetRef theOtherSet, - ) { - return _CFCharacterSetUnion( - theSet, - theOtherSet, - ); - } + CFStringRef get kCFURLVolumeSupportsCaseSensitiveNamesKey => + _kCFURLVolumeSupportsCaseSensitiveNamesKey.value; - late final _CFCharacterSetUnionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableCharacterSetRef, - CFCharacterSetRef)>>('CFCharacterSetUnion'); - late final _CFCharacterSetUnion = _CFCharacterSetUnionPtr.asFunction< - void Function(CFMutableCharacterSetRef, CFCharacterSetRef)>(); + late final ffi.Pointer + _kCFURLVolumeSupportsCasePreservedNamesKey = + _lookup('kCFURLVolumeSupportsCasePreservedNamesKey'); - void CFCharacterSetIntersect( - CFMutableCharacterSetRef theSet, - CFCharacterSetRef theOtherSet, - ) { - return _CFCharacterSetIntersect( - theSet, - theOtherSet, - ); - } + CFStringRef get kCFURLVolumeSupportsCasePreservedNamesKey => + _kCFURLVolumeSupportsCasePreservedNamesKey.value; - late final _CFCharacterSetIntersectPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableCharacterSetRef, - CFCharacterSetRef)>>('CFCharacterSetIntersect'); - late final _CFCharacterSetIntersect = _CFCharacterSetIntersectPtr.asFunction< - void Function(CFMutableCharacterSetRef, CFCharacterSetRef)>(); + late final ffi.Pointer + _kCFURLVolumeSupportsRootDirectoryDatesKey = + _lookup('kCFURLVolumeSupportsRootDirectoryDatesKey'); - void CFCharacterSetInvert( - CFMutableCharacterSetRef theSet, - ) { - return _CFCharacterSetInvert( - theSet, - ); - } + CFStringRef get kCFURLVolumeSupportsRootDirectoryDatesKey => + _kCFURLVolumeSupportsRootDirectoryDatesKey.value; - late final _CFCharacterSetInvertPtr = - _lookup>( - 'CFCharacterSetInvert'); - late final _CFCharacterSetInvert = _CFCharacterSetInvertPtr.asFunction< - void Function(CFMutableCharacterSetRef)>(); + late final ffi.Pointer _kCFURLVolumeSupportsVolumeSizesKey = + _lookup('kCFURLVolumeSupportsVolumeSizesKey'); - int CFErrorGetTypeID() { - return _CFErrorGetTypeID(); - } + CFStringRef get kCFURLVolumeSupportsVolumeSizesKey => + _kCFURLVolumeSupportsVolumeSizesKey.value; - late final _CFErrorGetTypeIDPtr = - _lookup>('CFErrorGetTypeID'); - late final _CFErrorGetTypeID = - _CFErrorGetTypeIDPtr.asFunction(); + late final ffi.Pointer _kCFURLVolumeSupportsRenamingKey = + _lookup('kCFURLVolumeSupportsRenamingKey'); - late final ffi.Pointer _kCFErrorDomainPOSIX = - _lookup('kCFErrorDomainPOSIX'); + CFStringRef get kCFURLVolumeSupportsRenamingKey => + _kCFURLVolumeSupportsRenamingKey.value; - CFErrorDomain get kCFErrorDomainPOSIX => _kCFErrorDomainPOSIX.value; + late final ffi.Pointer + _kCFURLVolumeSupportsAdvisoryFileLockingKey = + _lookup('kCFURLVolumeSupportsAdvisoryFileLockingKey'); - late final ffi.Pointer _kCFErrorDomainOSStatus = - _lookup('kCFErrorDomainOSStatus'); + CFStringRef get kCFURLVolumeSupportsAdvisoryFileLockingKey => + _kCFURLVolumeSupportsAdvisoryFileLockingKey.value; - CFErrorDomain get kCFErrorDomainOSStatus => _kCFErrorDomainOSStatus.value; + late final ffi.Pointer _kCFURLVolumeSupportsExtendedSecurityKey = + _lookup('kCFURLVolumeSupportsExtendedSecurityKey'); - late final ffi.Pointer _kCFErrorDomainMach = - _lookup('kCFErrorDomainMach'); + CFStringRef get kCFURLVolumeSupportsExtendedSecurityKey => + _kCFURLVolumeSupportsExtendedSecurityKey.value; - CFErrorDomain get kCFErrorDomainMach => _kCFErrorDomainMach.value; + late final ffi.Pointer _kCFURLVolumeIsBrowsableKey = + _lookup('kCFURLVolumeIsBrowsableKey'); - late final ffi.Pointer _kCFErrorDomainCocoa = - _lookup('kCFErrorDomainCocoa'); + CFStringRef get kCFURLVolumeIsBrowsableKey => + _kCFURLVolumeIsBrowsableKey.value; - CFErrorDomain get kCFErrorDomainCocoa => _kCFErrorDomainCocoa.value; + late final ffi.Pointer _kCFURLVolumeMaximumFileSizeKey = + _lookup('kCFURLVolumeMaximumFileSizeKey'); - late final ffi.Pointer _kCFErrorLocalizedDescriptionKey = - _lookup('kCFErrorLocalizedDescriptionKey'); + CFStringRef get kCFURLVolumeMaximumFileSizeKey => + _kCFURLVolumeMaximumFileSizeKey.value; - CFStringRef get kCFErrorLocalizedDescriptionKey => - _kCFErrorLocalizedDescriptionKey.value; + late final ffi.Pointer _kCFURLVolumeIsEjectableKey = + _lookup('kCFURLVolumeIsEjectableKey'); - late final ffi.Pointer _kCFErrorLocalizedFailureKey = - _lookup('kCFErrorLocalizedFailureKey'); + CFStringRef get kCFURLVolumeIsEjectableKey => + _kCFURLVolumeIsEjectableKey.value; - CFStringRef get kCFErrorLocalizedFailureKey => - _kCFErrorLocalizedFailureKey.value; + late final ffi.Pointer _kCFURLVolumeIsRemovableKey = + _lookup('kCFURLVolumeIsRemovableKey'); - late final ffi.Pointer _kCFErrorLocalizedFailureReasonKey = - _lookup('kCFErrorLocalizedFailureReasonKey'); + CFStringRef get kCFURLVolumeIsRemovableKey => + _kCFURLVolumeIsRemovableKey.value; - CFStringRef get kCFErrorLocalizedFailureReasonKey => - _kCFErrorLocalizedFailureReasonKey.value; + late final ffi.Pointer _kCFURLVolumeIsInternalKey = + _lookup('kCFURLVolumeIsInternalKey'); - late final ffi.Pointer _kCFErrorLocalizedRecoverySuggestionKey = - _lookup('kCFErrorLocalizedRecoverySuggestionKey'); + CFStringRef get kCFURLVolumeIsInternalKey => _kCFURLVolumeIsInternalKey.value; - CFStringRef get kCFErrorLocalizedRecoverySuggestionKey => - _kCFErrorLocalizedRecoverySuggestionKey.value; + late final ffi.Pointer _kCFURLVolumeIsAutomountedKey = + _lookup('kCFURLVolumeIsAutomountedKey'); - late final ffi.Pointer _kCFErrorDescriptionKey = - _lookup('kCFErrorDescriptionKey'); + CFStringRef get kCFURLVolumeIsAutomountedKey => + _kCFURLVolumeIsAutomountedKey.value; - CFStringRef get kCFErrorDescriptionKey => _kCFErrorDescriptionKey.value; + late final ffi.Pointer _kCFURLVolumeIsLocalKey = + _lookup('kCFURLVolumeIsLocalKey'); - late final ffi.Pointer _kCFErrorUnderlyingErrorKey = - _lookup('kCFErrorUnderlyingErrorKey'); + CFStringRef get kCFURLVolumeIsLocalKey => _kCFURLVolumeIsLocalKey.value; - CFStringRef get kCFErrorUnderlyingErrorKey => - _kCFErrorUnderlyingErrorKey.value; + late final ffi.Pointer _kCFURLVolumeIsReadOnlyKey = + _lookup('kCFURLVolumeIsReadOnlyKey'); - late final ffi.Pointer _kCFErrorURLKey = - _lookup('kCFErrorURLKey'); + CFStringRef get kCFURLVolumeIsReadOnlyKey => _kCFURLVolumeIsReadOnlyKey.value; - CFStringRef get kCFErrorURLKey => _kCFErrorURLKey.value; + late final ffi.Pointer _kCFURLVolumeCreationDateKey = + _lookup('kCFURLVolumeCreationDateKey'); - late final ffi.Pointer _kCFErrorFilePathKey = - _lookup('kCFErrorFilePathKey'); + CFStringRef get kCFURLVolumeCreationDateKey => + _kCFURLVolumeCreationDateKey.value; - CFStringRef get kCFErrorFilePathKey => _kCFErrorFilePathKey.value; + late final ffi.Pointer _kCFURLVolumeURLForRemountingKey = + _lookup('kCFURLVolumeURLForRemountingKey'); - CFErrorRef CFErrorCreate( - CFAllocatorRef allocator, - CFErrorDomain domain, - int code, - CFDictionaryRef userInfo, - ) { - return _CFErrorCreate( - allocator, - domain, - code, - userInfo, - ); - } + CFStringRef get kCFURLVolumeURLForRemountingKey => + _kCFURLVolumeURLForRemountingKey.value; - late final _CFErrorCreatePtr = _lookup< - ffi.NativeFunction< - CFErrorRef Function(CFAllocatorRef, CFErrorDomain, CFIndex, - CFDictionaryRef)>>('CFErrorCreate'); - late final _CFErrorCreate = _CFErrorCreatePtr.asFunction< - CFErrorRef Function( - CFAllocatorRef, CFErrorDomain, int, CFDictionaryRef)>(); + late final ffi.Pointer _kCFURLVolumeUUIDStringKey = + _lookup('kCFURLVolumeUUIDStringKey'); - CFErrorRef CFErrorCreateWithUserInfoKeysAndValues( - CFAllocatorRef allocator, - CFErrorDomain domain, - int code, - ffi.Pointer> userInfoKeys, - ffi.Pointer> userInfoValues, - int numUserInfoValues, - ) { - return _CFErrorCreateWithUserInfoKeysAndValues( - allocator, - domain, - code, - userInfoKeys, - userInfoValues, - numUserInfoValues, - ); - } + CFStringRef get kCFURLVolumeUUIDStringKey => _kCFURLVolumeUUIDStringKey.value; - late final _CFErrorCreateWithUserInfoKeysAndValuesPtr = _lookup< - ffi.NativeFunction< - CFErrorRef Function( - CFAllocatorRef, - CFErrorDomain, - CFIndex, - ffi.Pointer>, - ffi.Pointer>, - CFIndex)>>('CFErrorCreateWithUserInfoKeysAndValues'); - late final _CFErrorCreateWithUserInfoKeysAndValues = - _CFErrorCreateWithUserInfoKeysAndValuesPtr.asFunction< - CFErrorRef Function( - CFAllocatorRef, - CFErrorDomain, - int, - ffi.Pointer>, - ffi.Pointer>, - int)>(); + late final ffi.Pointer _kCFURLVolumeNameKey = + _lookup('kCFURLVolumeNameKey'); - CFErrorDomain CFErrorGetDomain( - CFErrorRef err, - ) { - return _CFErrorGetDomain( - err, - ); - } + CFStringRef get kCFURLVolumeNameKey => _kCFURLVolumeNameKey.value; - late final _CFErrorGetDomainPtr = - _lookup>( - 'CFErrorGetDomain'); - late final _CFErrorGetDomain = - _CFErrorGetDomainPtr.asFunction(); + late final ffi.Pointer _kCFURLVolumeLocalizedNameKey = + _lookup('kCFURLVolumeLocalizedNameKey'); - int CFErrorGetCode( - CFErrorRef err, - ) { - return _CFErrorGetCode( - err, - ); - } + CFStringRef get kCFURLVolumeLocalizedNameKey => + _kCFURLVolumeLocalizedNameKey.value; - late final _CFErrorGetCodePtr = - _lookup>( - 'CFErrorGetCode'); - late final _CFErrorGetCode = - _CFErrorGetCodePtr.asFunction(); + late final ffi.Pointer _kCFURLVolumeIsEncryptedKey = + _lookup('kCFURLVolumeIsEncryptedKey'); - CFDictionaryRef CFErrorCopyUserInfo( - CFErrorRef err, - ) { - return _CFErrorCopyUserInfo( - err, - ); - } + CFStringRef get kCFURLVolumeIsEncryptedKey => + _kCFURLVolumeIsEncryptedKey.value; - late final _CFErrorCopyUserInfoPtr = - _lookup>( - 'CFErrorCopyUserInfo'); - late final _CFErrorCopyUserInfo = _CFErrorCopyUserInfoPtr.asFunction< - CFDictionaryRef Function(CFErrorRef)>(); + late final ffi.Pointer _kCFURLVolumeIsRootFileSystemKey = + _lookup('kCFURLVolumeIsRootFileSystemKey'); - CFStringRef CFErrorCopyDescription( - CFErrorRef err, - ) { - return _CFErrorCopyDescription( - err, - ); - } + CFStringRef get kCFURLVolumeIsRootFileSystemKey => + _kCFURLVolumeIsRootFileSystemKey.value; - late final _CFErrorCopyDescriptionPtr = - _lookup>( - 'CFErrorCopyDescription'); - late final _CFErrorCopyDescription = - _CFErrorCopyDescriptionPtr.asFunction(); + late final ffi.Pointer _kCFURLVolumeSupportsCompressionKey = + _lookup('kCFURLVolumeSupportsCompressionKey'); - CFStringRef CFErrorCopyFailureReason( - CFErrorRef err, - ) { - return _CFErrorCopyFailureReason( - err, - ); - } + CFStringRef get kCFURLVolumeSupportsCompressionKey => + _kCFURLVolumeSupportsCompressionKey.value; - late final _CFErrorCopyFailureReasonPtr = - _lookup>( - 'CFErrorCopyFailureReason'); - late final _CFErrorCopyFailureReason = _CFErrorCopyFailureReasonPtr - .asFunction(); + late final ffi.Pointer _kCFURLVolumeSupportsFileCloningKey = + _lookup('kCFURLVolumeSupportsFileCloningKey'); - CFStringRef CFErrorCopyRecoverySuggestion( - CFErrorRef err, - ) { - return _CFErrorCopyRecoverySuggestion( - err, - ); - } + CFStringRef get kCFURLVolumeSupportsFileCloningKey => + _kCFURLVolumeSupportsFileCloningKey.value; - late final _CFErrorCopyRecoverySuggestionPtr = - _lookup>( - 'CFErrorCopyRecoverySuggestion'); - late final _CFErrorCopyRecoverySuggestion = _CFErrorCopyRecoverySuggestionPtr - .asFunction(); + late final ffi.Pointer _kCFURLVolumeSupportsSwapRenamingKey = + _lookup('kCFURLVolumeSupportsSwapRenamingKey'); - int CFStringGetTypeID() { - return _CFStringGetTypeID(); - } + CFStringRef get kCFURLVolumeSupportsSwapRenamingKey => + _kCFURLVolumeSupportsSwapRenamingKey.value; - late final _CFStringGetTypeIDPtr = - _lookup>('CFStringGetTypeID'); - late final _CFStringGetTypeID = - _CFStringGetTypeIDPtr.asFunction(); + late final ffi.Pointer + _kCFURLVolumeSupportsExclusiveRenamingKey = + _lookup('kCFURLVolumeSupportsExclusiveRenamingKey'); - CFStringRef CFStringCreateWithPascalString( - CFAllocatorRef alloc, - ConstStr255Param pStr, - int encoding, - ) { - return _CFStringCreateWithPascalString( - alloc, - pStr, - encoding, - ); - } + CFStringRef get kCFURLVolumeSupportsExclusiveRenamingKey => + _kCFURLVolumeSupportsExclusiveRenamingKey.value; - late final _CFStringCreateWithPascalStringPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, ConstStr255Param, - CFStringEncoding)>>('CFStringCreateWithPascalString'); - late final _CFStringCreateWithPascalString = - _CFStringCreateWithPascalStringPtr.asFunction< - CFStringRef Function(CFAllocatorRef, ConstStr255Param, int)>(); + late final ffi.Pointer _kCFURLVolumeSupportsImmutableFilesKey = + _lookup('kCFURLVolumeSupportsImmutableFilesKey'); - CFStringRef CFStringCreateWithCString( - CFAllocatorRef alloc, - ffi.Pointer cStr, - int encoding, - ) { - return _CFStringCreateWithCString( - alloc, - cStr, - encoding, - ); - } + CFStringRef get kCFURLVolumeSupportsImmutableFilesKey => + _kCFURLVolumeSupportsImmutableFilesKey.value; - late final _CFStringCreateWithCStringPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer, - CFStringEncoding)>>('CFStringCreateWithCString'); - late final _CFStringCreateWithCString = - _CFStringCreateWithCStringPtr.asFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer, int)>(); + late final ffi.Pointer + _kCFURLVolumeSupportsAccessPermissionsKey = + _lookup('kCFURLVolumeSupportsAccessPermissionsKey'); - CFStringRef CFStringCreateWithBytes( - CFAllocatorRef alloc, - ffi.Pointer bytes, - int numBytes, - int encoding, - int isExternalRepresentation, - ) { - return _CFStringCreateWithBytes( - alloc, - bytes, - numBytes, - encoding, - isExternalRepresentation, - ); - } + CFStringRef get kCFURLVolumeSupportsAccessPermissionsKey => + _kCFURLVolumeSupportsAccessPermissionsKey.value; - late final _CFStringCreateWithBytesPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, - CFStringEncoding, Boolean)>>('CFStringCreateWithBytes'); - late final _CFStringCreateWithBytes = _CFStringCreateWithBytesPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, ffi.Pointer, int, int, int)>(); + late final ffi.Pointer _kCFURLVolumeSupportsFileProtectionKey = + _lookup('kCFURLVolumeSupportsFileProtectionKey'); - CFStringRef CFStringCreateWithCharacters( - CFAllocatorRef alloc, - ffi.Pointer chars, - int numChars, - ) { - return _CFStringCreateWithCharacters( - alloc, - chars, - numChars, - ); - } + CFStringRef get kCFURLVolumeSupportsFileProtectionKey => + _kCFURLVolumeSupportsFileProtectionKey.value; - late final _CFStringCreateWithCharactersPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer, - CFIndex)>>('CFStringCreateWithCharacters'); - late final _CFStringCreateWithCharacters = - _CFStringCreateWithCharactersPtr.asFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer, int)>(); + late final ffi.Pointer _kCFURLVolumeTypeNameKey = + _lookup('kCFURLVolumeTypeNameKey'); - CFStringRef CFStringCreateWithPascalStringNoCopy( - CFAllocatorRef alloc, - ConstStr255Param pStr, - int encoding, - CFAllocatorRef contentsDeallocator, - ) { - return _CFStringCreateWithPascalStringNoCopy( - alloc, - pStr, - encoding, - contentsDeallocator, - ); - } + CFStringRef get kCFURLVolumeTypeNameKey => _kCFURLVolumeTypeNameKey.value; - late final _CFStringCreateWithPascalStringNoCopyPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function( - CFAllocatorRef, - ConstStr255Param, - CFStringEncoding, - CFAllocatorRef)>>('CFStringCreateWithPascalStringNoCopy'); - late final _CFStringCreateWithPascalStringNoCopy = - _CFStringCreateWithPascalStringNoCopyPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, ConstStr255Param, int, CFAllocatorRef)>(); + late final ffi.Pointer _kCFURLVolumeSubtypeKey = + _lookup('kCFURLVolumeSubtypeKey'); - CFStringRef CFStringCreateWithCStringNoCopy( - CFAllocatorRef alloc, - ffi.Pointer cStr, - int encoding, - CFAllocatorRef contentsDeallocator, - ) { - return _CFStringCreateWithCStringNoCopy( - alloc, - cStr, - encoding, - contentsDeallocator, - ); - } + CFStringRef get kCFURLVolumeSubtypeKey => _kCFURLVolumeSubtypeKey.value; - late final _CFStringCreateWithCStringNoCopyPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function( - CFAllocatorRef, - ffi.Pointer, - CFStringEncoding, - CFAllocatorRef)>>('CFStringCreateWithCStringNoCopy'); - late final _CFStringCreateWithCStringNoCopy = - _CFStringCreateWithCStringNoCopyPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); + late final ffi.Pointer _kCFURLVolumeMountFromLocationKey = + _lookup('kCFURLVolumeMountFromLocationKey'); - CFStringRef CFStringCreateWithBytesNoCopy( - CFAllocatorRef alloc, - ffi.Pointer bytes, - int numBytes, - int encoding, - int isExternalRepresentation, - CFAllocatorRef contentsDeallocator, + CFStringRef get kCFURLVolumeMountFromLocationKey => + _kCFURLVolumeMountFromLocationKey.value; + + late final ffi.Pointer _kCFURLIsUbiquitousItemKey = + _lookup('kCFURLIsUbiquitousItemKey'); + + CFStringRef get kCFURLIsUbiquitousItemKey => _kCFURLIsUbiquitousItemKey.value; + + late final ffi.Pointer + _kCFURLUbiquitousItemHasUnresolvedConflictsKey = + _lookup('kCFURLUbiquitousItemHasUnresolvedConflictsKey'); + + CFStringRef get kCFURLUbiquitousItemHasUnresolvedConflictsKey => + _kCFURLUbiquitousItemHasUnresolvedConflictsKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemIsDownloadedKey = + _lookup('kCFURLUbiquitousItemIsDownloadedKey'); + + CFStringRef get kCFURLUbiquitousItemIsDownloadedKey => + _kCFURLUbiquitousItemIsDownloadedKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemIsDownloadingKey = + _lookup('kCFURLUbiquitousItemIsDownloadingKey'); + + CFStringRef get kCFURLUbiquitousItemIsDownloadingKey => + _kCFURLUbiquitousItemIsDownloadingKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemIsUploadedKey = + _lookup('kCFURLUbiquitousItemIsUploadedKey'); + + CFStringRef get kCFURLUbiquitousItemIsUploadedKey => + _kCFURLUbiquitousItemIsUploadedKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemIsUploadingKey = + _lookup('kCFURLUbiquitousItemIsUploadingKey'); + + CFStringRef get kCFURLUbiquitousItemIsUploadingKey => + _kCFURLUbiquitousItemIsUploadingKey.value; + + late final ffi.Pointer + _kCFURLUbiquitousItemPercentDownloadedKey = + _lookup('kCFURLUbiquitousItemPercentDownloadedKey'); + + CFStringRef get kCFURLUbiquitousItemPercentDownloadedKey => + _kCFURLUbiquitousItemPercentDownloadedKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemPercentUploadedKey = + _lookup('kCFURLUbiquitousItemPercentUploadedKey'); + + CFStringRef get kCFURLUbiquitousItemPercentUploadedKey => + _kCFURLUbiquitousItemPercentUploadedKey.value; + + late final ffi.Pointer + _kCFURLUbiquitousItemDownloadingStatusKey = + _lookup('kCFURLUbiquitousItemDownloadingStatusKey'); + + CFStringRef get kCFURLUbiquitousItemDownloadingStatusKey => + _kCFURLUbiquitousItemDownloadingStatusKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemDownloadingErrorKey = + _lookup('kCFURLUbiquitousItemDownloadingErrorKey'); + + CFStringRef get kCFURLUbiquitousItemDownloadingErrorKey => + _kCFURLUbiquitousItemDownloadingErrorKey.value; + + late final ffi.Pointer _kCFURLUbiquitousItemUploadingErrorKey = + _lookup('kCFURLUbiquitousItemUploadingErrorKey'); + + CFStringRef get kCFURLUbiquitousItemUploadingErrorKey => + _kCFURLUbiquitousItemUploadingErrorKey.value; + + late final ffi.Pointer + _kCFURLUbiquitousItemIsExcludedFromSyncKey = + _lookup('kCFURLUbiquitousItemIsExcludedFromSyncKey'); + + CFStringRef get kCFURLUbiquitousItemIsExcludedFromSyncKey => + _kCFURLUbiquitousItemIsExcludedFromSyncKey.value; + + late final ffi.Pointer + _kCFURLUbiquitousItemDownloadingStatusNotDownloaded = + _lookup( + 'kCFURLUbiquitousItemDownloadingStatusNotDownloaded'); + + CFStringRef get kCFURLUbiquitousItemDownloadingStatusNotDownloaded => + _kCFURLUbiquitousItemDownloadingStatusNotDownloaded.value; + + late final ffi.Pointer + _kCFURLUbiquitousItemDownloadingStatusDownloaded = + _lookup('kCFURLUbiquitousItemDownloadingStatusDownloaded'); + + CFStringRef get kCFURLUbiquitousItemDownloadingStatusDownloaded => + _kCFURLUbiquitousItemDownloadingStatusDownloaded.value; + + late final ffi.Pointer + _kCFURLUbiquitousItemDownloadingStatusCurrent = + _lookup('kCFURLUbiquitousItemDownloadingStatusCurrent'); + + CFStringRef get kCFURLUbiquitousItemDownloadingStatusCurrent => + _kCFURLUbiquitousItemDownloadingStatusCurrent.value; + + CFDataRef CFURLCreateBookmarkData( + CFAllocatorRef allocator, + CFURLRef url, + CFURLBookmarkCreationOptions options, + CFArrayRef resourcePropertiesToInclude, + CFURLRef relativeToURL, + ffi.Pointer error, ) { - return _CFStringCreateWithBytesNoCopy( - alloc, - bytes, - numBytes, - encoding, - isExternalRepresentation, - contentsDeallocator, + return _CFURLCreateBookmarkData( + allocator, + url, + options.value, + resourcePropertiesToInclude, + relativeToURL, + error, ); } - late final _CFStringCreateWithBytesNoCopyPtr = _lookup< + late final _CFURLCreateBookmarkDataPtr = _lookup< ffi.NativeFunction< - CFStringRef Function( + CFDataRef Function( CFAllocatorRef, - ffi.Pointer, - CFIndex, - CFStringEncoding, - Boolean, - CFAllocatorRef)>>('CFStringCreateWithBytesNoCopy'); - late final _CFStringCreateWithBytesNoCopy = - _CFStringCreateWithBytesNoCopyPtr.asFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer, int, int, - int, CFAllocatorRef)>(); + CFURLRef, + CFOptionFlags, + CFArrayRef, + CFURLRef, + ffi.Pointer)>>('CFURLCreateBookmarkData'); + late final _CFURLCreateBookmarkData = _CFURLCreateBookmarkDataPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFURLRef, int, CFArrayRef, CFURLRef, + ffi.Pointer)>(); - CFStringRef CFStringCreateWithCharactersNoCopy( - CFAllocatorRef alloc, - ffi.Pointer chars, - int numChars, - CFAllocatorRef contentsDeallocator, + CFURLRef CFURLCreateByResolvingBookmarkData( + CFAllocatorRef allocator, + CFDataRef bookmark, + CFURLBookmarkResolutionOptions options, + CFURLRef relativeToURL, + CFArrayRef resourcePropertiesToInclude, + ffi.Pointer isStale, + ffi.Pointer error, ) { - return _CFStringCreateWithCharactersNoCopy( - alloc, - chars, - numChars, - contentsDeallocator, + return _CFURLCreateByResolvingBookmarkData( + allocator, + bookmark, + options.value, + relativeToURL, + resourcePropertiesToInclude, + isStale, + error, ); } - late final _CFStringCreateWithCharactersNoCopyPtr = _lookup< + late final _CFURLCreateByResolvingBookmarkDataPtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, - CFAllocatorRef)>>('CFStringCreateWithCharactersNoCopy'); - late final _CFStringCreateWithCharactersNoCopy = - _CFStringCreateWithCharactersNoCopyPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); + CFURLRef Function( + CFAllocatorRef, + CFDataRef, + CFOptionFlags, + CFURLRef, + CFArrayRef, + ffi.Pointer, + ffi.Pointer)>>('CFURLCreateByResolvingBookmarkData'); + late final _CFURLCreateByResolvingBookmarkData = + _CFURLCreateByResolvingBookmarkDataPtr.asFunction< + CFURLRef Function(CFAllocatorRef, CFDataRef, int, CFURLRef, + CFArrayRef, ffi.Pointer, ffi.Pointer)>(); - CFStringRef CFStringCreateWithSubstring( - CFAllocatorRef alloc, - CFStringRef str, - CFRange range, + CFDictionaryRef CFURLCreateResourcePropertiesForKeysFromBookmarkData( + CFAllocatorRef allocator, + CFArrayRef resourcePropertiesToReturn, + CFDataRef bookmark, ) { - return _CFStringCreateWithSubstring( - alloc, - str, - range, + return _CFURLCreateResourcePropertiesForKeysFromBookmarkData( + allocator, + resourcePropertiesToReturn, + bookmark, ); } - late final _CFStringCreateWithSubstringPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, - CFRange)>>('CFStringCreateWithSubstring'); - late final _CFStringCreateWithSubstring = _CFStringCreateWithSubstringPtr - .asFunction(); + late final _CFURLCreateResourcePropertiesForKeysFromBookmarkDataPtr = _lookup< + ffi.NativeFunction< + CFDictionaryRef Function(CFAllocatorRef, CFArrayRef, CFDataRef)>>( + 'CFURLCreateResourcePropertiesForKeysFromBookmarkData'); + late final _CFURLCreateResourcePropertiesForKeysFromBookmarkData = + _CFURLCreateResourcePropertiesForKeysFromBookmarkDataPtr.asFunction< + CFDictionaryRef Function(CFAllocatorRef, CFArrayRef, CFDataRef)>(); - CFStringRef CFStringCreateCopy( - CFAllocatorRef alloc, - CFStringRef theString, + CFTypeRef CFURLCreateResourcePropertyForKeyFromBookmarkData( + CFAllocatorRef allocator, + CFStringRef resourcePropertyKey, + CFDataRef bookmark, ) { - return _CFStringCreateCopy( - alloc, - theString, + return _CFURLCreateResourcePropertyForKeyFromBookmarkData( + allocator, + resourcePropertyKey, + bookmark, ); } - late final _CFStringCreateCopyPtr = _lookup< - ffi - .NativeFunction>( - 'CFStringCreateCopy'); - late final _CFStringCreateCopy = _CFStringCreateCopyPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef)>(); + late final _CFURLCreateResourcePropertyForKeyFromBookmarkDataPtr = _lookup< + ffi.NativeFunction< + CFTypeRef Function(CFAllocatorRef, CFStringRef, + CFDataRef)>>('CFURLCreateResourcePropertyForKeyFromBookmarkData'); + late final _CFURLCreateResourcePropertyForKeyFromBookmarkData = + _CFURLCreateResourcePropertyForKeyFromBookmarkDataPtr.asFunction< + CFTypeRef Function(CFAllocatorRef, CFStringRef, CFDataRef)>(); - CFStringRef CFStringCreateWithFormat( - CFAllocatorRef alloc, - CFDictionaryRef formatOptions, - CFStringRef format, + CFDataRef CFURLCreateBookmarkDataFromFile( + CFAllocatorRef allocator, + CFURLRef fileURL, + ffi.Pointer errorRef, ) { - return _CFStringCreateWithFormat( - alloc, - formatOptions, - format, + return _CFURLCreateBookmarkDataFromFile( + allocator, + fileURL, + errorRef, ); } - late final _CFStringCreateWithFormatPtr = _lookup< + late final _CFURLCreateBookmarkDataFromFilePtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFDictionaryRef, - CFStringRef)>>('CFStringCreateWithFormat'); - late final _CFStringCreateWithFormat = - _CFStringCreateWithFormatPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef)>(); + CFDataRef Function(CFAllocatorRef, CFURLRef, + ffi.Pointer)>>('CFURLCreateBookmarkDataFromFile'); + late final _CFURLCreateBookmarkDataFromFile = + _CFURLCreateBookmarkDataFromFilePtr.asFunction< + CFDataRef Function( + CFAllocatorRef, CFURLRef, ffi.Pointer)>(); - CFStringRef CFStringCreateWithFormatAndArguments( - CFAllocatorRef alloc, - CFDictionaryRef formatOptions, - CFStringRef format, - va_list arguments, + int CFURLWriteBookmarkDataToFile( + CFDataRef bookmarkRef, + CFURLRef fileURL, + int options, + ffi.Pointer errorRef, ) { - return _CFStringCreateWithFormatAndArguments( - alloc, - formatOptions, - format, - arguments, + return _CFURLWriteBookmarkDataToFile( + bookmarkRef, + fileURL, + options, + errorRef, ); } - late final _CFStringCreateWithFormatAndArgumentsPtr = _lookup< + late final _CFURLWriteBookmarkDataToFilePtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, - va_list)>>('CFStringCreateWithFormatAndArguments'); - late final _CFStringCreateWithFormatAndArguments = - _CFStringCreateWithFormatAndArgumentsPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, CFDictionaryRef, CFStringRef, va_list)>(); + Boolean Function( + CFDataRef, + CFURLRef, + CFURLBookmarkFileCreationOptions, + ffi.Pointer)>>('CFURLWriteBookmarkDataToFile'); + late final _CFURLWriteBookmarkDataToFile = + _CFURLWriteBookmarkDataToFilePtr.asFunction< + int Function(CFDataRef, CFURLRef, int, ffi.Pointer)>(); - CFStringRef CFStringCreateStringWithValidatedFormat( - CFAllocatorRef alloc, - CFDictionaryRef formatOptions, - CFStringRef validFormatSpecifiers, - CFStringRef format, - ffi.Pointer errorPtr, + CFDataRef CFURLCreateBookmarkDataFromAliasRecord( + CFAllocatorRef allocatorRef, + CFDataRef aliasRecordDataRef, ) { - return _CFStringCreateStringWithValidatedFormat( - alloc, - formatOptions, - validFormatSpecifiers, - format, - errorPtr, + return _CFURLCreateBookmarkDataFromAliasRecord( + allocatorRef, + aliasRecordDataRef, ); } - late final _CFStringCreateStringWithValidatedFormatPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, - CFStringRef, ffi.Pointer)>>( - 'CFStringCreateStringWithValidatedFormat'); - late final _CFStringCreateStringWithValidatedFormat = - _CFStringCreateStringWithValidatedFormatPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, - CFStringRef, ffi.Pointer)>(); + late final _CFURLCreateBookmarkDataFromAliasRecordPtr = _lookup< + ffi.NativeFunction>( + 'CFURLCreateBookmarkDataFromAliasRecord'); + late final _CFURLCreateBookmarkDataFromAliasRecord = + _CFURLCreateBookmarkDataFromAliasRecordPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFDataRef)>(); - CFStringRef CFStringCreateStringWithValidatedFormatAndArguments( - CFAllocatorRef alloc, - CFDictionaryRef formatOptions, - CFStringRef validFormatSpecifiers, - CFStringRef format, - va_list arguments, - ffi.Pointer errorPtr, + int CFURLStartAccessingSecurityScopedResource( + CFURLRef url, ) { - return _CFStringCreateStringWithValidatedFormatAndArguments( - alloc, - formatOptions, - validFormatSpecifiers, - format, - arguments, - errorPtr, + return _CFURLStartAccessingSecurityScopedResource( + url, ); } - late final _CFStringCreateStringWithValidatedFormatAndArgumentsPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, - CFStringRef, va_list, ffi.Pointer)>>( - 'CFStringCreateStringWithValidatedFormatAndArguments'); - late final _CFStringCreateStringWithValidatedFormatAndArguments = - _CFStringCreateStringWithValidatedFormatAndArgumentsPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFDictionaryRef, CFStringRef, - CFStringRef, va_list, ffi.Pointer)>(); + late final _CFURLStartAccessingSecurityScopedResourcePtr = + _lookup>( + 'CFURLStartAccessingSecurityScopedResource'); + late final _CFURLStartAccessingSecurityScopedResource = + _CFURLStartAccessingSecurityScopedResourcePtr.asFunction< + int Function(CFURLRef)>(); - CFMutableStringRef CFStringCreateMutable( - CFAllocatorRef alloc, - int maxLength, + void CFURLStopAccessingSecurityScopedResource( + CFURLRef url, ) { - return _CFStringCreateMutable( - alloc, - maxLength, + return _CFURLStopAccessingSecurityScopedResource( + url, ); } - late final _CFStringCreateMutablePtr = _lookup< - ffi.NativeFunction< - CFMutableStringRef Function( - CFAllocatorRef, CFIndex)>>('CFStringCreateMutable'); - late final _CFStringCreateMutable = _CFStringCreateMutablePtr.asFunction< - CFMutableStringRef Function(CFAllocatorRef, int)>(); + late final _CFURLStopAccessingSecurityScopedResourcePtr = + _lookup>( + 'CFURLStopAccessingSecurityScopedResource'); + late final _CFURLStopAccessingSecurityScopedResource = + _CFURLStopAccessingSecurityScopedResourcePtr.asFunction< + void Function(CFURLRef)>(); - CFMutableStringRef CFStringCreateMutableCopy( - CFAllocatorRef alloc, - int maxLength, - CFStringRef theString, - ) { - return _CFStringCreateMutableCopy( - alloc, - maxLength, - theString, - ); + late final ffi.Pointer _kCFRunLoopDefaultMode = + _lookup('kCFRunLoopDefaultMode'); + + CFRunLoopMode get kCFRunLoopDefaultMode => _kCFRunLoopDefaultMode.value; + + late final ffi.Pointer _kCFRunLoopCommonModes = + _lookup('kCFRunLoopCommonModes'); + + CFRunLoopMode get kCFRunLoopCommonModes => _kCFRunLoopCommonModes.value; + + int CFRunLoopGetTypeID() { + return _CFRunLoopGetTypeID(); } - late final _CFStringCreateMutableCopyPtr = _lookup< - ffi.NativeFunction< - CFMutableStringRef Function(CFAllocatorRef, CFIndex, - CFStringRef)>>('CFStringCreateMutableCopy'); - late final _CFStringCreateMutableCopy = - _CFStringCreateMutableCopyPtr.asFunction< - CFMutableStringRef Function(CFAllocatorRef, int, CFStringRef)>(); + late final _CFRunLoopGetTypeIDPtr = + _lookup>('CFRunLoopGetTypeID'); + late final _CFRunLoopGetTypeID = + _CFRunLoopGetTypeIDPtr.asFunction(); - CFMutableStringRef CFStringCreateMutableWithExternalCharactersNoCopy( - CFAllocatorRef alloc, - ffi.Pointer chars, - int numChars, - int capacity, - CFAllocatorRef externalCharactersAllocator, - ) { - return _CFStringCreateMutableWithExternalCharactersNoCopy( - alloc, - chars, - numChars, - capacity, - externalCharactersAllocator, - ); + CFRunLoopRef CFRunLoopGetCurrent() { + return _CFRunLoopGetCurrent(); } - late final _CFStringCreateMutableWithExternalCharactersNoCopyPtr = _lookup< - ffi.NativeFunction< - CFMutableStringRef Function(CFAllocatorRef, ffi.Pointer, - CFIndex, CFIndex, CFAllocatorRef)>>( - 'CFStringCreateMutableWithExternalCharactersNoCopy'); - late final _CFStringCreateMutableWithExternalCharactersNoCopy = - _CFStringCreateMutableWithExternalCharactersNoCopyPtr.asFunction< - CFMutableStringRef Function(CFAllocatorRef, ffi.Pointer, int, - int, CFAllocatorRef)>(); + late final _CFRunLoopGetCurrentPtr = + _lookup>( + 'CFRunLoopGetCurrent'); + late final _CFRunLoopGetCurrent = + _CFRunLoopGetCurrentPtr.asFunction(); - int CFStringGetLength( - CFStringRef theString, - ) { - return _CFStringGetLength( - theString, - ); + CFRunLoopRef CFRunLoopGetMain() { + return _CFRunLoopGetMain(); } - late final _CFStringGetLengthPtr = - _lookup>( - 'CFStringGetLength'); - late final _CFStringGetLength = - _CFStringGetLengthPtr.asFunction(); + late final _CFRunLoopGetMainPtr = + _lookup>('CFRunLoopGetMain'); + late final _CFRunLoopGetMain = + _CFRunLoopGetMainPtr.asFunction(); - int CFStringGetCharacterAtIndex( - CFStringRef theString, - int idx, + CFRunLoopMode CFRunLoopCopyCurrentMode( + CFRunLoopRef rl, ) { - return _CFStringGetCharacterAtIndex( - theString, - idx, + return _CFRunLoopCopyCurrentMode( + rl, ); } - late final _CFStringGetCharacterAtIndexPtr = - _lookup>( - 'CFStringGetCharacterAtIndex'); - late final _CFStringGetCharacterAtIndex = _CFStringGetCharacterAtIndexPtr - .asFunction(); + late final _CFRunLoopCopyCurrentModePtr = + _lookup>( + 'CFRunLoopCopyCurrentMode'); + late final _CFRunLoopCopyCurrentMode = _CFRunLoopCopyCurrentModePtr + .asFunction(); - void CFStringGetCharacters( - CFStringRef theString, - CFRange range, - ffi.Pointer buffer, + CFArrayRef CFRunLoopCopyAllModes( + CFRunLoopRef rl, ) { - return _CFStringGetCharacters( - theString, - range, - buffer, + return _CFRunLoopCopyAllModes( + rl, ); } - late final _CFStringGetCharactersPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFStringRef, CFRange, - ffi.Pointer)>>('CFStringGetCharacters'); - late final _CFStringGetCharacters = _CFStringGetCharactersPtr.asFunction< - void Function(CFStringRef, CFRange, ffi.Pointer)>(); + late final _CFRunLoopCopyAllModesPtr = + _lookup>( + 'CFRunLoopCopyAllModes'); + late final _CFRunLoopCopyAllModes = + _CFRunLoopCopyAllModesPtr.asFunction(); - int CFStringGetPascalString( - CFStringRef theString, - StringPtr buffer, - int bufferSize, - int encoding, + void CFRunLoopAddCommonMode( + CFRunLoopRef rl, + CFRunLoopMode mode, ) { - return _CFStringGetPascalString( - theString, - buffer, - bufferSize, - encoding, + return _CFRunLoopAddCommonMode( + rl, + mode, ); } - late final _CFStringGetPascalStringPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFStringRef, StringPtr, CFIndex, - CFStringEncoding)>>('CFStringGetPascalString'); - late final _CFStringGetPascalString = _CFStringGetPascalStringPtr.asFunction< - int Function(CFStringRef, StringPtr, int, int)>(); + late final _CFRunLoopAddCommonModePtr = _lookup< + ffi.NativeFunction>( + 'CFRunLoopAddCommonMode'); + late final _CFRunLoopAddCommonMode = _CFRunLoopAddCommonModePtr.asFunction< + void Function(CFRunLoopRef, CFRunLoopMode)>(); - int CFStringGetCString( - CFStringRef theString, - ffi.Pointer buffer, - int bufferSize, - int encoding, + double CFRunLoopGetNextTimerFireDate( + CFRunLoopRef rl, + CFRunLoopMode mode, ) { - return _CFStringGetCString( - theString, - buffer, - bufferSize, - encoding, + return _CFRunLoopGetNextTimerFireDate( + rl, + mode, ); } - late final _CFStringGetCStringPtr = _lookup< + late final _CFRunLoopGetNextTimerFireDatePtr = _lookup< ffi.NativeFunction< - Boolean Function(CFStringRef, ffi.Pointer, CFIndex, - CFStringEncoding)>>('CFStringGetCString'); - late final _CFStringGetCString = _CFStringGetCStringPtr.asFunction< - int Function(CFStringRef, ffi.Pointer, int, int)>(); + CFAbsoluteTime Function( + CFRunLoopRef, CFRunLoopMode)>>('CFRunLoopGetNextTimerFireDate'); + late final _CFRunLoopGetNextTimerFireDate = _CFRunLoopGetNextTimerFireDatePtr + .asFunction(); - ConstStringPtr CFStringGetPascalStringPtr( - CFStringRef theString, - int encoding, + void CFRunLoopRun() { + return _CFRunLoopRun(); + } + + late final _CFRunLoopRunPtr = + _lookup>('CFRunLoopRun'); + late final _CFRunLoopRun = _CFRunLoopRunPtr.asFunction(); + + CFRunLoopRunResult CFRunLoopRunInMode( + CFRunLoopMode mode, + DartCFTimeInterval seconds, + DartBoolean returnAfterSourceHandled, ) { - return _CFStringGetPascalStringPtr1( - theString, - encoding, - ); + return CFRunLoopRunResult.fromValue(_CFRunLoopRunInMode( + mode, + seconds, + returnAfterSourceHandled, + )); } - late final _CFStringGetPascalStringPtrPtr = _lookup< + late final _CFRunLoopRunInModePtr = _lookup< ffi.NativeFunction< - ConstStringPtr Function( - CFStringRef, CFStringEncoding)>>('CFStringGetPascalStringPtr'); - late final _CFStringGetPascalStringPtr1 = _CFStringGetPascalStringPtrPtr - .asFunction(); + SInt32 Function( + CFRunLoopMode, CFTimeInterval, Boolean)>>('CFRunLoopRunInMode'); + late final _CFRunLoopRunInMode = _CFRunLoopRunInModePtr.asFunction< + int Function(CFRunLoopMode, double, int)>(); - ffi.Pointer CFStringGetCStringPtr( - CFStringRef theString, - int encoding, + int CFRunLoopIsWaiting( + CFRunLoopRef rl, ) { - return _CFStringGetCStringPtr1( - theString, - encoding, + return _CFRunLoopIsWaiting( + rl, ); } - late final _CFStringGetCStringPtrPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - CFStringRef, CFStringEncoding)>>('CFStringGetCStringPtr'); - late final _CFStringGetCStringPtr1 = _CFStringGetCStringPtrPtr.asFunction< - ffi.Pointer Function(CFStringRef, int)>(); + late final _CFRunLoopIsWaitingPtr = + _lookup>( + 'CFRunLoopIsWaiting'); + late final _CFRunLoopIsWaiting = + _CFRunLoopIsWaitingPtr.asFunction(); - ffi.Pointer CFStringGetCharactersPtr( - CFStringRef theString, + void CFRunLoopWakeUp( + CFRunLoopRef rl, ) { - return _CFStringGetCharactersPtr1( - theString, + return _CFRunLoopWakeUp( + rl, ); } - late final _CFStringGetCharactersPtrPtr = - _lookup Function(CFStringRef)>>( - 'CFStringGetCharactersPtr'); - late final _CFStringGetCharactersPtr1 = _CFStringGetCharactersPtrPtr - .asFunction Function(CFStringRef)>(); + late final _CFRunLoopWakeUpPtr = + _lookup>( + 'CFRunLoopWakeUp'); + late final _CFRunLoopWakeUp = + _CFRunLoopWakeUpPtr.asFunction(); - int CFStringGetBytes( - CFStringRef theString, - CFRange range, - int encoding, - int lossByte, - int isExternalRepresentation, - ffi.Pointer buffer, - int maxBufLen, - ffi.Pointer usedBufLen, + void CFRunLoopStop( + CFRunLoopRef rl, ) { - return _CFStringGetBytes( - theString, - range, - encoding, - lossByte, - isExternalRepresentation, - buffer, - maxBufLen, - usedBufLen, + return _CFRunLoopStop( + rl, ); } - late final _CFStringGetBytesPtr = _lookup< - ffi.NativeFunction< - CFIndex Function( - CFStringRef, - CFRange, - CFStringEncoding, - UInt8, - Boolean, - ffi.Pointer, - CFIndex, - ffi.Pointer)>>('CFStringGetBytes'); - late final _CFStringGetBytes = _CFStringGetBytesPtr.asFunction< - int Function(CFStringRef, CFRange, int, int, int, ffi.Pointer, int, - ffi.Pointer)>(); + late final _CFRunLoopStopPtr = + _lookup>( + 'CFRunLoopStop'); + late final _CFRunLoopStop = + _CFRunLoopStopPtr.asFunction(); - CFStringRef CFStringCreateFromExternalRepresentation( - CFAllocatorRef alloc, - CFDataRef data, - int encoding, + void CFRunLoopPerformBlock( + CFRunLoopRef rl, + CFTypeRef mode, + objc.ObjCBlock block, ) { - return _CFStringCreateFromExternalRepresentation( - alloc, - data, - encoding, + return _CFRunLoopPerformBlock( + rl, + mode, + block.ref.pointer, ); } - late final _CFStringCreateFromExternalRepresentationPtr = _lookup< + late final _CFRunLoopPerformBlockPtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFDataRef, - CFStringEncoding)>>('CFStringCreateFromExternalRepresentation'); - late final _CFStringCreateFromExternalRepresentation = - _CFStringCreateFromExternalRepresentationPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFDataRef, int)>(); + ffi.Void Function(CFRunLoopRef, CFTypeRef, + ffi.Pointer)>>('CFRunLoopPerformBlock'); + late final _CFRunLoopPerformBlock = _CFRunLoopPerformBlockPtr.asFunction< + void Function( + CFRunLoopRef, CFTypeRef, ffi.Pointer)>(); - CFDataRef CFStringCreateExternalRepresentation( - CFAllocatorRef alloc, - CFStringRef theString, - int encoding, - int lossByte, + int CFRunLoopContainsSource( + CFRunLoopRef rl, + CFRunLoopSourceRef source, + CFRunLoopMode mode, ) { - return _CFStringCreateExternalRepresentation( - alloc, - theString, - encoding, - lossByte, + return _CFRunLoopContainsSource( + rl, + source, + mode, ); } - late final _CFStringCreateExternalRepresentationPtr = _lookup< + late final _CFRunLoopContainsSourcePtr = _lookup< ffi.NativeFunction< - CFDataRef Function(CFAllocatorRef, CFStringRef, CFStringEncoding, - UInt8)>>('CFStringCreateExternalRepresentation'); - late final _CFStringCreateExternalRepresentation = - _CFStringCreateExternalRepresentationPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFStringRef, int, int)>(); + Boolean Function(CFRunLoopRef, CFRunLoopSourceRef, + CFRunLoopMode)>>('CFRunLoopContainsSource'); + late final _CFRunLoopContainsSource = _CFRunLoopContainsSourcePtr.asFunction< + int Function(CFRunLoopRef, CFRunLoopSourceRef, CFRunLoopMode)>(); - int CFStringGetSmallestEncoding( - CFStringRef theString, + void CFRunLoopAddSource( + CFRunLoopRef rl, + CFRunLoopSourceRef source, + CFRunLoopMode mode, ) { - return _CFStringGetSmallestEncoding( - theString, + return _CFRunLoopAddSource( + rl, + source, + mode, ); } - late final _CFStringGetSmallestEncodingPtr = - _lookup>( - 'CFStringGetSmallestEncoding'); - late final _CFStringGetSmallestEncoding = - _CFStringGetSmallestEncodingPtr.asFunction(); + late final _CFRunLoopAddSourcePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFRunLoopRef, CFRunLoopSourceRef, + CFRunLoopMode)>>('CFRunLoopAddSource'); + late final _CFRunLoopAddSource = _CFRunLoopAddSourcePtr.asFunction< + void Function(CFRunLoopRef, CFRunLoopSourceRef, CFRunLoopMode)>(); - int CFStringGetFastestEncoding( - CFStringRef theString, + void CFRunLoopRemoveSource( + CFRunLoopRef rl, + CFRunLoopSourceRef source, + CFRunLoopMode mode, ) { - return _CFStringGetFastestEncoding( - theString, + return _CFRunLoopRemoveSource( + rl, + source, + mode, ); } - late final _CFStringGetFastestEncodingPtr = - _lookup>( - 'CFStringGetFastestEncoding'); - late final _CFStringGetFastestEncoding = - _CFStringGetFastestEncodingPtr.asFunction(); + late final _CFRunLoopRemoveSourcePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFRunLoopRef, CFRunLoopSourceRef, + CFRunLoopMode)>>('CFRunLoopRemoveSource'); + late final _CFRunLoopRemoveSource = _CFRunLoopRemoveSourcePtr.asFunction< + void Function(CFRunLoopRef, CFRunLoopSourceRef, CFRunLoopMode)>(); - int CFStringGetSystemEncoding() { - return _CFStringGetSystemEncoding(); + int CFRunLoopContainsObserver( + CFRunLoopRef rl, + CFRunLoopObserverRef observer, + CFRunLoopMode mode, + ) { + return _CFRunLoopContainsObserver( + rl, + observer, + mode, + ); } - late final _CFStringGetSystemEncodingPtr = - _lookup>( - 'CFStringGetSystemEncoding'); - late final _CFStringGetSystemEncoding = - _CFStringGetSystemEncodingPtr.asFunction(); + late final _CFRunLoopContainsObserverPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFRunLoopRef, CFRunLoopObserverRef, + CFRunLoopMode)>>('CFRunLoopContainsObserver'); + late final _CFRunLoopContainsObserver = + _CFRunLoopContainsObserverPtr.asFunction< + int Function(CFRunLoopRef, CFRunLoopObserverRef, CFRunLoopMode)>(); - int CFStringGetMaximumSizeForEncoding( - int length, - int encoding, + void CFRunLoopAddObserver( + CFRunLoopRef rl, + CFRunLoopObserverRef observer, + CFRunLoopMode mode, ) { - return _CFStringGetMaximumSizeForEncoding( - length, - encoding, + return _CFRunLoopAddObserver( + rl, + observer, + mode, ); } - late final _CFStringGetMaximumSizeForEncodingPtr = - _lookup>( - 'CFStringGetMaximumSizeForEncoding'); - late final _CFStringGetMaximumSizeForEncoding = - _CFStringGetMaximumSizeForEncodingPtr.asFunction< - int Function(int, int)>(); + late final _CFRunLoopAddObserverPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFRunLoopRef, CFRunLoopObserverRef, + CFRunLoopMode)>>('CFRunLoopAddObserver'); + late final _CFRunLoopAddObserver = _CFRunLoopAddObserverPtr.asFunction< + void Function(CFRunLoopRef, CFRunLoopObserverRef, CFRunLoopMode)>(); - int CFStringGetFileSystemRepresentation( - CFStringRef string, - ffi.Pointer buffer, - int maxBufLen, + void CFRunLoopRemoveObserver( + CFRunLoopRef rl, + CFRunLoopObserverRef observer, + CFRunLoopMode mode, ) { - return _CFStringGetFileSystemRepresentation( - string, - buffer, - maxBufLen, + return _CFRunLoopRemoveObserver( + rl, + observer, + mode, ); } - late final _CFStringGetFileSystemRepresentationPtr = _lookup< + late final _CFRunLoopRemoveObserverPtr = _lookup< ffi.NativeFunction< - Boolean Function(CFStringRef, ffi.Pointer, - CFIndex)>>('CFStringGetFileSystemRepresentation'); - late final _CFStringGetFileSystemRepresentation = - _CFStringGetFileSystemRepresentationPtr.asFunction< - int Function(CFStringRef, ffi.Pointer, int)>(); + ffi.Void Function(CFRunLoopRef, CFRunLoopObserverRef, + CFRunLoopMode)>>('CFRunLoopRemoveObserver'); + late final _CFRunLoopRemoveObserver = _CFRunLoopRemoveObserverPtr.asFunction< + void Function(CFRunLoopRef, CFRunLoopObserverRef, CFRunLoopMode)>(); - int CFStringGetMaximumSizeOfFileSystemRepresentation( - CFStringRef string, + int CFRunLoopContainsTimer( + CFRunLoopRef rl, + CFRunLoopTimerRef timer, + CFRunLoopMode mode, ) { - return _CFStringGetMaximumSizeOfFileSystemRepresentation( - string, + return _CFRunLoopContainsTimer( + rl, + timer, + mode, ); } - late final _CFStringGetMaximumSizeOfFileSystemRepresentationPtr = - _lookup>( - 'CFStringGetMaximumSizeOfFileSystemRepresentation'); - late final _CFStringGetMaximumSizeOfFileSystemRepresentation = - _CFStringGetMaximumSizeOfFileSystemRepresentationPtr.asFunction< - int Function(CFStringRef)>(); + late final _CFRunLoopContainsTimerPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFRunLoopRef, CFRunLoopTimerRef, + CFRunLoopMode)>>('CFRunLoopContainsTimer'); + late final _CFRunLoopContainsTimer = _CFRunLoopContainsTimerPtr.asFunction< + int Function(CFRunLoopRef, CFRunLoopTimerRef, CFRunLoopMode)>(); - CFStringRef CFStringCreateWithFileSystemRepresentation( - CFAllocatorRef alloc, - ffi.Pointer buffer, + void CFRunLoopAddTimer( + CFRunLoopRef rl, + CFRunLoopTimerRef timer, + CFRunLoopMode mode, ) { - return _CFStringCreateWithFileSystemRepresentation( - alloc, - buffer, + return _CFRunLoopAddTimer( + rl, + timer, + mode, ); } - late final _CFStringCreateWithFileSystemRepresentationPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer)>>( - 'CFStringCreateWithFileSystemRepresentation'); - late final _CFStringCreateWithFileSystemRepresentation = - _CFStringCreateWithFileSystemRepresentationPtr.asFunction< - CFStringRef Function(CFAllocatorRef, ffi.Pointer)>(); + late final _CFRunLoopAddTimerPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFRunLoopRef, CFRunLoopTimerRef, + CFRunLoopMode)>>('CFRunLoopAddTimer'); + late final _CFRunLoopAddTimer = _CFRunLoopAddTimerPtr.asFunction< + void Function(CFRunLoopRef, CFRunLoopTimerRef, CFRunLoopMode)>(); - int CFStringCompareWithOptionsAndLocale( - CFStringRef theString1, - CFStringRef theString2, - CFRange rangeToCompare, - int compareOptions, - CFLocaleRef locale, + void CFRunLoopRemoveTimer( + CFRunLoopRef rl, + CFRunLoopTimerRef timer, + CFRunLoopMode mode, ) { - return _CFStringCompareWithOptionsAndLocale( - theString1, - theString2, - rangeToCompare, - compareOptions, - locale, + return _CFRunLoopRemoveTimer( + rl, + timer, + mode, ); } - late final _CFStringCompareWithOptionsAndLocalePtr = _lookup< + late final _CFRunLoopRemoveTimerPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CFStringRef, CFStringRef, CFRange, ffi.Int32, - CFLocaleRef)>>('CFStringCompareWithOptionsAndLocale'); - late final _CFStringCompareWithOptionsAndLocale = - _CFStringCompareWithOptionsAndLocalePtr.asFunction< - int Function(CFStringRef, CFStringRef, CFRange, int, CFLocaleRef)>(); + ffi.Void Function(CFRunLoopRef, CFRunLoopTimerRef, + CFRunLoopMode)>>('CFRunLoopRemoveTimer'); + late final _CFRunLoopRemoveTimer = _CFRunLoopRemoveTimerPtr.asFunction< + void Function(CFRunLoopRef, CFRunLoopTimerRef, CFRunLoopMode)>(); - int CFStringCompareWithOptions( - CFStringRef theString1, - CFStringRef theString2, - CFRange rangeToCompare, - int compareOptions, + int CFRunLoopSourceGetTypeID() { + return _CFRunLoopSourceGetTypeID(); + } + + late final _CFRunLoopSourceGetTypeIDPtr = + _lookup>( + 'CFRunLoopSourceGetTypeID'); + late final _CFRunLoopSourceGetTypeID = + _CFRunLoopSourceGetTypeIDPtr.asFunction(); + + CFRunLoopSourceRef CFRunLoopSourceCreate( + CFAllocatorRef allocator, + int order, + ffi.Pointer context, ) { - return _CFStringCompareWithOptions( - theString1, - theString2, - rangeToCompare, - compareOptions, + return _CFRunLoopSourceCreate( + allocator, + order, + context, ); } - late final _CFStringCompareWithOptionsPtr = _lookup< + late final _CFRunLoopSourceCreatePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CFStringRef, CFStringRef, CFRange, - ffi.Int32)>>('CFStringCompareWithOptions'); - late final _CFStringCompareWithOptions = _CFStringCompareWithOptionsPtr - .asFunction(); + CFRunLoopSourceRef Function(CFAllocatorRef, CFIndex, + ffi.Pointer)>>('CFRunLoopSourceCreate'); + late final _CFRunLoopSourceCreate = _CFRunLoopSourceCreatePtr.asFunction< + CFRunLoopSourceRef Function( + CFAllocatorRef, int, ffi.Pointer)>(); - int CFStringCompare( - CFStringRef theString1, - CFStringRef theString2, - int compareOptions, + int CFRunLoopSourceGetOrder( + CFRunLoopSourceRef source, ) { - return _CFStringCompare( - theString1, - theString2, - compareOptions, + return _CFRunLoopSourceGetOrder( + source, ); } - late final _CFStringComparePtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - CFStringRef, CFStringRef, ffi.Int32)>>('CFStringCompare'); - late final _CFStringCompare = _CFStringComparePtr.asFunction< - int Function(CFStringRef, CFStringRef, int)>(); + late final _CFRunLoopSourceGetOrderPtr = + _lookup>( + 'CFRunLoopSourceGetOrder'); + late final _CFRunLoopSourceGetOrder = _CFRunLoopSourceGetOrderPtr.asFunction< + int Function(CFRunLoopSourceRef)>(); - int CFStringFindWithOptionsAndLocale( - CFStringRef theString, - CFStringRef stringToFind, - CFRange rangeToSearch, - int searchOptions, - CFLocaleRef locale, - ffi.Pointer result, + void CFRunLoopSourceInvalidate( + CFRunLoopSourceRef source, ) { - return _CFStringFindWithOptionsAndLocale( - theString, - stringToFind, - rangeToSearch, - searchOptions, - locale, - result, + return _CFRunLoopSourceInvalidate( + source, ); } - late final _CFStringFindWithOptionsAndLocalePtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFStringRef, - CFStringRef, - CFRange, - ffi.Int32, - CFLocaleRef, - ffi.Pointer)>>('CFStringFindWithOptionsAndLocale'); - late final _CFStringFindWithOptionsAndLocale = - _CFStringFindWithOptionsAndLocalePtr.asFunction< - int Function(CFStringRef, CFStringRef, CFRange, int, CFLocaleRef, - ffi.Pointer)>(); + late final _CFRunLoopSourceInvalidatePtr = + _lookup>( + 'CFRunLoopSourceInvalidate'); + late final _CFRunLoopSourceInvalidate = _CFRunLoopSourceInvalidatePtr + .asFunction(); - int CFStringFindWithOptions( - CFStringRef theString, - CFStringRef stringToFind, - CFRange rangeToSearch, - int searchOptions, - ffi.Pointer result, + int CFRunLoopSourceIsValid( + CFRunLoopSourceRef source, ) { - return _CFStringFindWithOptions( - theString, - stringToFind, - rangeToSearch, - searchOptions, - result, + return _CFRunLoopSourceIsValid( + source, ); } - late final _CFStringFindWithOptionsPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFStringRef, CFStringRef, CFRange, ffi.Int32, - ffi.Pointer)>>('CFStringFindWithOptions'); - late final _CFStringFindWithOptions = _CFStringFindWithOptionsPtr.asFunction< - int Function( - CFStringRef, CFStringRef, CFRange, int, ffi.Pointer)>(); + late final _CFRunLoopSourceIsValidPtr = + _lookup>( + 'CFRunLoopSourceIsValid'); + late final _CFRunLoopSourceIsValid = + _CFRunLoopSourceIsValidPtr.asFunction(); - CFArrayRef CFStringCreateArrayWithFindResults( - CFAllocatorRef alloc, - CFStringRef theString, - CFStringRef stringToFind, - CFRange rangeToSearch, - int compareOptions, + void CFRunLoopSourceGetContext( + CFRunLoopSourceRef source, + ffi.Pointer context, ) { - return _CFStringCreateArrayWithFindResults( - alloc, - theString, - stringToFind, - rangeToSearch, - compareOptions, + return _CFRunLoopSourceGetContext( + source, + context, ); } - late final _CFStringCreateArrayWithFindResultsPtr = _lookup< - ffi.NativeFunction< - CFArrayRef Function(CFAllocatorRef, CFStringRef, CFStringRef, CFRange, - ffi.Int32)>>('CFStringCreateArrayWithFindResults'); - late final _CFStringCreateArrayWithFindResults = - _CFStringCreateArrayWithFindResultsPtr.asFunction< - CFArrayRef Function( - CFAllocatorRef, CFStringRef, CFStringRef, CFRange, int)>(); + late final _CFRunLoopSourceGetContextPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFRunLoopSourceRef, ffi.Pointer)>>( + 'CFRunLoopSourceGetContext'); + late final _CFRunLoopSourceGetContext = + _CFRunLoopSourceGetContextPtr.asFunction< + void Function( + CFRunLoopSourceRef, ffi.Pointer)>(); - CFRange CFStringFind( - CFStringRef theString, - CFStringRef stringToFind, - int compareOptions, + void CFRunLoopSourceSignal( + CFRunLoopSourceRef source, ) { - return _CFStringFind( - theString, - stringToFind, - compareOptions, + return _CFRunLoopSourceSignal( + source, ); } - late final _CFStringFindPtr = _lookup< - ffi.NativeFunction< - CFRange Function( - CFStringRef, CFStringRef, ffi.Int32)>>('CFStringFind'); - late final _CFStringFind = _CFStringFindPtr.asFunction< - CFRange Function(CFStringRef, CFStringRef, int)>(); + late final _CFRunLoopSourceSignalPtr = + _lookup>( + 'CFRunLoopSourceSignal'); + late final _CFRunLoopSourceSignal = + _CFRunLoopSourceSignalPtr.asFunction(); - int CFStringHasPrefix( - CFStringRef theString, - CFStringRef prefix, - ) { - return _CFStringHasPrefix( - theString, - prefix, - ); + int CFRunLoopObserverGetTypeID() { + return _CFRunLoopObserverGetTypeID(); } - late final _CFStringHasPrefixPtr = - _lookup>( - 'CFStringHasPrefix'); - late final _CFStringHasPrefix = _CFStringHasPrefixPtr.asFunction< - int Function(CFStringRef, CFStringRef)>(); + late final _CFRunLoopObserverGetTypeIDPtr = + _lookup>( + 'CFRunLoopObserverGetTypeID'); + late final _CFRunLoopObserverGetTypeID = + _CFRunLoopObserverGetTypeIDPtr.asFunction(); - int CFStringHasSuffix( - CFStringRef theString, - CFStringRef suffix, + CFRunLoopObserverRef CFRunLoopObserverCreate( + CFAllocatorRef allocator, + int activities, + int repeats, + int order, + CFRunLoopObserverCallBack callout, + ffi.Pointer context, ) { - return _CFStringHasSuffix( - theString, - suffix, + return _CFRunLoopObserverCreate( + allocator, + activities, + repeats, + order, + callout, + context, ); } - late final _CFStringHasSuffixPtr = - _lookup>( - 'CFStringHasSuffix'); - late final _CFStringHasSuffix = _CFStringHasSuffixPtr.asFunction< - int Function(CFStringRef, CFStringRef)>(); + late final _CFRunLoopObserverCreatePtr = _lookup< + ffi.NativeFunction< + CFRunLoopObserverRef Function( + CFAllocatorRef, + CFOptionFlags, + Boolean, + CFIndex, + CFRunLoopObserverCallBack, + ffi.Pointer)>>( + 'CFRunLoopObserverCreate'); + late final _CFRunLoopObserverCreate = _CFRunLoopObserverCreatePtr.asFunction< + CFRunLoopObserverRef Function(CFAllocatorRef, int, int, int, + CFRunLoopObserverCallBack, ffi.Pointer)>(); - CFRange CFStringGetRangeOfComposedCharactersAtIndex( - CFStringRef theString, - int theIndex, + CFRunLoopObserverRef CFRunLoopObserverCreateWithHandler( + CFAllocatorRef allocator, + DartCFOptionFlags activities, + DartBoolean repeats, + DartCFIndex order, + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> + block, ) { - return _CFStringGetRangeOfComposedCharactersAtIndex( - theString, - theIndex, + return _CFRunLoopObserverCreateWithHandler( + allocator, + activities, + repeats, + order, + block.ref.pointer, ); } - late final _CFStringGetRangeOfComposedCharactersAtIndexPtr = - _lookup>( - 'CFStringGetRangeOfComposedCharactersAtIndex'); - late final _CFStringGetRangeOfComposedCharactersAtIndex = - _CFStringGetRangeOfComposedCharactersAtIndexPtr.asFunction< - CFRange Function(CFStringRef, int)>(); + late final _CFRunLoopObserverCreateWithHandlerPtr = _lookup< + ffi.NativeFunction< + CFRunLoopObserverRef Function(CFAllocatorRef, CFOptionFlags, + Boolean, CFIndex, ffi.Pointer)>>( + 'CFRunLoopObserverCreateWithHandler'); + late final _CFRunLoopObserverCreateWithHandler = + _CFRunLoopObserverCreateWithHandlerPtr.asFunction< + CFRunLoopObserverRef Function(CFAllocatorRef, int, int, int, + ffi.Pointer)>(); - int CFStringFindCharacterFromSet( - CFStringRef theString, - CFCharacterSetRef theSet, - CFRange rangeToSearch, - int searchOptions, - ffi.Pointer result, + int CFRunLoopObserverGetActivities( + CFRunLoopObserverRef observer, ) { - return _CFStringFindCharacterFromSet( - theString, - theSet, - rangeToSearch, - searchOptions, - result, + return _CFRunLoopObserverGetActivities( + observer, ); } - late final _CFStringFindCharacterFromSetPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFStringRef, CFCharacterSetRef, CFRange, ffi.Int32, - ffi.Pointer)>>('CFStringFindCharacterFromSet'); - late final _CFStringFindCharacterFromSet = - _CFStringFindCharacterFromSetPtr.asFunction< - int Function(CFStringRef, CFCharacterSetRef, CFRange, int, - ffi.Pointer)>(); + late final _CFRunLoopObserverGetActivitiesPtr = + _lookup>( + 'CFRunLoopObserverGetActivities'); + late final _CFRunLoopObserverGetActivities = + _CFRunLoopObserverGetActivitiesPtr.asFunction< + int Function(CFRunLoopObserverRef)>(); - void CFStringGetLineBounds( - CFStringRef theString, - CFRange range, - ffi.Pointer lineBeginIndex, - ffi.Pointer lineEndIndex, - ffi.Pointer contentsEndIndex, + int CFRunLoopObserverDoesRepeat( + CFRunLoopObserverRef observer, ) { - return _CFStringGetLineBounds( - theString, - range, - lineBeginIndex, - lineEndIndex, - contentsEndIndex, + return _CFRunLoopObserverDoesRepeat( + observer, ); } - late final _CFStringGetLineBoundsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFStringRef, - CFRange, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('CFStringGetLineBounds'); - late final _CFStringGetLineBounds = _CFStringGetLineBoundsPtr.asFunction< - void Function(CFStringRef, CFRange, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _CFRunLoopObserverDoesRepeatPtr = + _lookup>( + 'CFRunLoopObserverDoesRepeat'); + late final _CFRunLoopObserverDoesRepeat = _CFRunLoopObserverDoesRepeatPtr + .asFunction(); - void CFStringGetParagraphBounds( - CFStringRef string, - CFRange range, - ffi.Pointer parBeginIndex, - ffi.Pointer parEndIndex, - ffi.Pointer contentsEndIndex, + int CFRunLoopObserverGetOrder( + CFRunLoopObserverRef observer, ) { - return _CFStringGetParagraphBounds( - string, - range, - parBeginIndex, - parEndIndex, - contentsEndIndex, + return _CFRunLoopObserverGetOrder( + observer, ); } - late final _CFStringGetParagraphBoundsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFStringRef, - CFRange, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('CFStringGetParagraphBounds'); - late final _CFStringGetParagraphBounds = - _CFStringGetParagraphBoundsPtr.asFunction< - void Function(CFStringRef, CFRange, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _CFRunLoopObserverGetOrderPtr = + _lookup>( + 'CFRunLoopObserverGetOrder'); + late final _CFRunLoopObserverGetOrder = _CFRunLoopObserverGetOrderPtr + .asFunction(); - int CFStringGetHyphenationLocationBeforeIndex( - CFStringRef string, - int location, - CFRange limitRange, - int options, - CFLocaleRef locale, - ffi.Pointer character, + void CFRunLoopObserverInvalidate( + CFRunLoopObserverRef observer, ) { - return _CFStringGetHyphenationLocationBeforeIndex( - string, - location, - limitRange, - options, - locale, - character, + return _CFRunLoopObserverInvalidate( + observer, ); } - late final _CFStringGetHyphenationLocationBeforeIndexPtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFStringRef, CFIndex, CFRange, CFOptionFlags, - CFLocaleRef, ffi.Pointer)>>( - 'CFStringGetHyphenationLocationBeforeIndex'); - late final _CFStringGetHyphenationLocationBeforeIndex = - _CFStringGetHyphenationLocationBeforeIndexPtr.asFunction< - int Function(CFStringRef, int, CFRange, int, CFLocaleRef, - ffi.Pointer)>(); + late final _CFRunLoopObserverInvalidatePtr = + _lookup>( + 'CFRunLoopObserverInvalidate'); + late final _CFRunLoopObserverInvalidate = _CFRunLoopObserverInvalidatePtr + .asFunction(); - int CFStringIsHyphenationAvailableForLocale( - CFLocaleRef locale, + int CFRunLoopObserverIsValid( + CFRunLoopObserverRef observer, ) { - return _CFStringIsHyphenationAvailableForLocale( - locale, + return _CFRunLoopObserverIsValid( + observer, ); } - late final _CFStringIsHyphenationAvailableForLocalePtr = - _lookup>( - 'CFStringIsHyphenationAvailableForLocale'); - late final _CFStringIsHyphenationAvailableForLocale = - _CFStringIsHyphenationAvailableForLocalePtr.asFunction< - int Function(CFLocaleRef)>(); + late final _CFRunLoopObserverIsValidPtr = + _lookup>( + 'CFRunLoopObserverIsValid'); + late final _CFRunLoopObserverIsValid = _CFRunLoopObserverIsValidPtr + .asFunction(); - CFStringRef CFStringCreateByCombiningStrings( - CFAllocatorRef alloc, - CFArrayRef theArray, - CFStringRef separatorString, + void CFRunLoopObserverGetContext( + CFRunLoopObserverRef observer, + ffi.Pointer context, ) { - return _CFStringCreateByCombiningStrings( - alloc, - theArray, - separatorString, + return _CFRunLoopObserverGetContext( + observer, + context, ); } - late final _CFStringCreateByCombiningStringsPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFArrayRef, - CFStringRef)>>('CFStringCreateByCombiningStrings'); - late final _CFStringCreateByCombiningStrings = - _CFStringCreateByCombiningStringsPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFArrayRef, CFStringRef)>(); + late final _CFRunLoopObserverGetContextPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFRunLoopObserverRef, + ffi.Pointer)>>( + 'CFRunLoopObserverGetContext'); + late final _CFRunLoopObserverGetContext = + _CFRunLoopObserverGetContextPtr.asFunction< + void Function( + CFRunLoopObserverRef, ffi.Pointer)>(); - CFArrayRef CFStringCreateArrayBySeparatingStrings( - CFAllocatorRef alloc, - CFStringRef theString, - CFStringRef separatorString, + int CFRunLoopTimerGetTypeID() { + return _CFRunLoopTimerGetTypeID(); + } + + late final _CFRunLoopTimerGetTypeIDPtr = + _lookup>( + 'CFRunLoopTimerGetTypeID'); + late final _CFRunLoopTimerGetTypeID = + _CFRunLoopTimerGetTypeIDPtr.asFunction(); + + CFRunLoopTimerRef CFRunLoopTimerCreate( + CFAllocatorRef allocator, + double fireDate, + double interval, + int flags, + int order, + CFRunLoopTimerCallBack callout, + ffi.Pointer context, ) { - return _CFStringCreateArrayBySeparatingStrings( - alloc, - theString, - separatorString, + return _CFRunLoopTimerCreate( + allocator, + fireDate, + interval, + flags, + order, + callout, + context, ); } - late final _CFStringCreateArrayBySeparatingStringsPtr = _lookup< + late final _CFRunLoopTimerCreatePtr = _lookup< ffi.NativeFunction< - CFArrayRef Function(CFAllocatorRef, CFStringRef, - CFStringRef)>>('CFStringCreateArrayBySeparatingStrings'); - late final _CFStringCreateArrayBySeparatingStrings = - _CFStringCreateArrayBySeparatingStringsPtr.asFunction< - CFArrayRef Function(CFAllocatorRef, CFStringRef, CFStringRef)>(); + CFRunLoopTimerRef Function( + CFAllocatorRef, + CFAbsoluteTime, + CFTimeInterval, + CFOptionFlags, + CFIndex, + CFRunLoopTimerCallBack, + ffi.Pointer)>>('CFRunLoopTimerCreate'); + late final _CFRunLoopTimerCreate = _CFRunLoopTimerCreatePtr.asFunction< + CFRunLoopTimerRef Function(CFAllocatorRef, double, double, int, int, + CFRunLoopTimerCallBack, ffi.Pointer)>(); - int CFStringGetIntValue( - CFStringRef str, + CFRunLoopTimerRef CFRunLoopTimerCreateWithHandler( + CFAllocatorRef allocator, + DartCFTimeInterval fireDate, + DartCFTimeInterval interval, + DartCFOptionFlags flags, + DartCFIndex order, + objc.ObjCBlock)> block, ) { - return _CFStringGetIntValue( - str, + return _CFRunLoopTimerCreateWithHandler( + allocator, + fireDate, + interval, + flags, + order, + block.ref.pointer, ); } - late final _CFStringGetIntValuePtr = - _lookup>( - 'CFStringGetIntValue'); - late final _CFStringGetIntValue = - _CFStringGetIntValuePtr.asFunction(); + late final _CFRunLoopTimerCreateWithHandlerPtr = _lookup< + ffi.NativeFunction< + CFRunLoopTimerRef Function( + CFAllocatorRef, + CFAbsoluteTime, + CFTimeInterval, + CFOptionFlags, + CFIndex, + ffi.Pointer)>>( + 'CFRunLoopTimerCreateWithHandler'); + late final _CFRunLoopTimerCreateWithHandler = + _CFRunLoopTimerCreateWithHandlerPtr.asFunction< + CFRunLoopTimerRef Function(CFAllocatorRef, double, double, int, int, + ffi.Pointer)>(); - double CFStringGetDoubleValue( - CFStringRef str, + double CFRunLoopTimerGetNextFireDate( + CFRunLoopTimerRef timer, ) { - return _CFStringGetDoubleValue( - str, + return _CFRunLoopTimerGetNextFireDate( + timer, ); } - late final _CFStringGetDoubleValuePtr = - _lookup>( - 'CFStringGetDoubleValue'); - late final _CFStringGetDoubleValue = - _CFStringGetDoubleValuePtr.asFunction(); + late final _CFRunLoopTimerGetNextFireDatePtr = + _lookup>( + 'CFRunLoopTimerGetNextFireDate'); + late final _CFRunLoopTimerGetNextFireDate = _CFRunLoopTimerGetNextFireDatePtr + .asFunction(); - void CFStringAppend( - CFMutableStringRef theString, - CFStringRef appendedString, + void CFRunLoopTimerSetNextFireDate( + CFRunLoopTimerRef timer, + double fireDate, ) { - return _CFStringAppend( - theString, - appendedString, + return _CFRunLoopTimerSetNextFireDate( + timer, + fireDate, ); } - late final _CFStringAppendPtr = _lookup< - ffi - .NativeFunction>( - 'CFStringAppend'); - late final _CFStringAppend = _CFStringAppendPtr.asFunction< - void Function(CFMutableStringRef, CFStringRef)>(); + late final _CFRunLoopTimerSetNextFireDatePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFRunLoopTimerRef, + CFAbsoluteTime)>>('CFRunLoopTimerSetNextFireDate'); + late final _CFRunLoopTimerSetNextFireDate = _CFRunLoopTimerSetNextFireDatePtr + .asFunction(); - void CFStringAppendCharacters( - CFMutableStringRef theString, - ffi.Pointer chars, - int numChars, + double CFRunLoopTimerGetInterval( + CFRunLoopTimerRef timer, ) { - return _CFStringAppendCharacters( - theString, - chars, - numChars, + return _CFRunLoopTimerGetInterval( + timer, ); } - late final _CFStringAppendCharactersPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, ffi.Pointer, - CFIndex)>>('CFStringAppendCharacters'); - late final _CFStringAppendCharacters = - _CFStringAppendCharactersPtr.asFunction< - void Function(CFMutableStringRef, ffi.Pointer, int)>(); + late final _CFRunLoopTimerGetIntervalPtr = + _lookup>( + 'CFRunLoopTimerGetInterval'); + late final _CFRunLoopTimerGetInterval = _CFRunLoopTimerGetIntervalPtr + .asFunction(); - void CFStringAppendPascalString( - CFMutableStringRef theString, - ConstStr255Param pStr, - int encoding, + int CFRunLoopTimerDoesRepeat( + CFRunLoopTimerRef timer, ) { - return _CFStringAppendPascalString( - theString, - pStr, - encoding, + return _CFRunLoopTimerDoesRepeat( + timer, ); } - late final _CFStringAppendPascalStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, ConstStr255Param, - CFStringEncoding)>>('CFStringAppendPascalString'); - late final _CFStringAppendPascalString = _CFStringAppendPascalStringPtr - .asFunction(); + late final _CFRunLoopTimerDoesRepeatPtr = + _lookup>( + 'CFRunLoopTimerDoesRepeat'); + late final _CFRunLoopTimerDoesRepeat = _CFRunLoopTimerDoesRepeatPtr + .asFunction(); - void CFStringAppendCString( - CFMutableStringRef theString, - ffi.Pointer cStr, - int encoding, + int CFRunLoopTimerGetOrder( + CFRunLoopTimerRef timer, ) { - return _CFStringAppendCString( - theString, - cStr, - encoding, + return _CFRunLoopTimerGetOrder( + timer, ); } - late final _CFStringAppendCStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, ffi.Pointer, - CFStringEncoding)>>('CFStringAppendCString'); - late final _CFStringAppendCString = _CFStringAppendCStringPtr.asFunction< - void Function(CFMutableStringRef, ffi.Pointer, int)>(); + late final _CFRunLoopTimerGetOrderPtr = + _lookup>( + 'CFRunLoopTimerGetOrder'); + late final _CFRunLoopTimerGetOrder = + _CFRunLoopTimerGetOrderPtr.asFunction(); - void CFStringAppendFormat( - CFMutableStringRef theString, - CFDictionaryRef formatOptions, - CFStringRef format, + void CFRunLoopTimerInvalidate( + CFRunLoopTimerRef timer, ) { - return _CFStringAppendFormat( - theString, - formatOptions, - format, + return _CFRunLoopTimerInvalidate( + timer, ); } - late final _CFStringAppendFormatPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, CFDictionaryRef, - CFStringRef)>>('CFStringAppendFormat'); - late final _CFStringAppendFormat = _CFStringAppendFormatPtr.asFunction< - void Function(CFMutableStringRef, CFDictionaryRef, CFStringRef)>(); + late final _CFRunLoopTimerInvalidatePtr = + _lookup>( + 'CFRunLoopTimerInvalidate'); + late final _CFRunLoopTimerInvalidate = _CFRunLoopTimerInvalidatePtr + .asFunction(); - void CFStringAppendFormatAndArguments( - CFMutableStringRef theString, - CFDictionaryRef formatOptions, - CFStringRef format, - va_list arguments, + int CFRunLoopTimerIsValid( + CFRunLoopTimerRef timer, ) { - return _CFStringAppendFormatAndArguments( - theString, - formatOptions, - format, - arguments, + return _CFRunLoopTimerIsValid( + timer, ); } - late final _CFStringAppendFormatAndArgumentsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, CFDictionaryRef, CFStringRef, - va_list)>>('CFStringAppendFormatAndArguments'); - late final _CFStringAppendFormatAndArguments = - _CFStringAppendFormatAndArgumentsPtr.asFunction< - void Function( - CFMutableStringRef, CFDictionaryRef, CFStringRef, va_list)>(); + late final _CFRunLoopTimerIsValidPtr = + _lookup>( + 'CFRunLoopTimerIsValid'); + late final _CFRunLoopTimerIsValid = + _CFRunLoopTimerIsValidPtr.asFunction(); - void CFStringInsert( - CFMutableStringRef str, - int idx, - CFStringRef insertedStr, + void CFRunLoopTimerGetContext( + CFRunLoopTimerRef timer, + ffi.Pointer context, ) { - return _CFStringInsert( - str, - idx, - insertedStr, + return _CFRunLoopTimerGetContext( + timer, + context, ); } - late final _CFStringInsertPtr = _lookup< + late final _CFRunLoopTimerGetContextPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFMutableStringRef, CFIndex, CFStringRef)>>('CFStringInsert'); - late final _CFStringInsert = _CFStringInsertPtr.asFunction< - void Function(CFMutableStringRef, int, CFStringRef)>(); + ffi.Void Function(CFRunLoopTimerRef, + ffi.Pointer)>>('CFRunLoopTimerGetContext'); + late final _CFRunLoopTimerGetContext = + _CFRunLoopTimerGetContextPtr.asFunction< + void Function( + CFRunLoopTimerRef, ffi.Pointer)>(); - void CFStringDelete( - CFMutableStringRef theString, - CFRange range, + double CFRunLoopTimerGetTolerance( + CFRunLoopTimerRef timer, ) { - return _CFStringDelete( - theString, - range, + return _CFRunLoopTimerGetTolerance( + timer, ); } - late final _CFStringDeletePtr = _lookup< - ffi.NativeFunction>( - 'CFStringDelete'); - late final _CFStringDelete = _CFStringDeletePtr.asFunction< - void Function(CFMutableStringRef, CFRange)>(); + late final _CFRunLoopTimerGetTolerancePtr = + _lookup>( + 'CFRunLoopTimerGetTolerance'); + late final _CFRunLoopTimerGetTolerance = _CFRunLoopTimerGetTolerancePtr + .asFunction(); - void CFStringReplace( - CFMutableStringRef theString, - CFRange range, - CFStringRef replacement, + void CFRunLoopTimerSetTolerance( + CFRunLoopTimerRef timer, + double tolerance, ) { - return _CFStringReplace( - theString, - range, - replacement, + return _CFRunLoopTimerSetTolerance( + timer, + tolerance, ); } - late final _CFStringReplacePtr = _lookup< + late final _CFRunLoopTimerSetTolerancePtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFMutableStringRef, CFRange, CFStringRef)>>('CFStringReplace'); - late final _CFStringReplace = _CFStringReplacePtr.asFunction< - void Function(CFMutableStringRef, CFRange, CFStringRef)>(); + ffi.Void Function(CFRunLoopTimerRef, + CFTimeInterval)>>('CFRunLoopTimerSetTolerance'); + late final _CFRunLoopTimerSetTolerance = _CFRunLoopTimerSetTolerancePtr + .asFunction(); - void CFStringReplaceAll( - CFMutableStringRef theString, - CFStringRef replacement, - ) { - return _CFStringReplaceAll( - theString, - replacement, - ); + int CFSocketGetTypeID() { + return _CFSocketGetTypeID(); } - late final _CFStringReplaceAllPtr = _lookup< - ffi - .NativeFunction>( - 'CFStringReplaceAll'); - late final _CFStringReplaceAll = _CFStringReplaceAllPtr.asFunction< - void Function(CFMutableStringRef, CFStringRef)>(); + late final _CFSocketGetTypeIDPtr = + _lookup>('CFSocketGetTypeID'); + late final _CFSocketGetTypeID = + _CFSocketGetTypeIDPtr.asFunction(); - int CFStringFindAndReplace( - CFMutableStringRef theString, - CFStringRef stringToFind, - CFStringRef replacementString, - CFRange rangeToSearch, - int compareOptions, + CFSocketRef CFSocketCreate( + CFAllocatorRef allocator, + int protocolFamily, + int socketType, + int protocol, + int callBackTypes, + CFSocketCallBack callout, + ffi.Pointer context, ) { - return _CFStringFindAndReplace( - theString, - stringToFind, - replacementString, - rangeToSearch, - compareOptions, + return _CFSocketCreate( + allocator, + protocolFamily, + socketType, + protocol, + callBackTypes, + callout, + context, ); } - late final _CFStringFindAndReplacePtr = _lookup< + late final _CFSocketCreatePtr = _lookup< ffi.NativeFunction< - CFIndex Function(CFMutableStringRef, CFStringRef, CFStringRef, - CFRange, ffi.Int32)>>('CFStringFindAndReplace'); - late final _CFStringFindAndReplace = _CFStringFindAndReplacePtr.asFunction< - int Function( - CFMutableStringRef, CFStringRef, CFStringRef, CFRange, int)>(); + CFSocketRef Function( + CFAllocatorRef, + SInt32, + SInt32, + SInt32, + CFOptionFlags, + CFSocketCallBack, + ffi.Pointer)>>('CFSocketCreate'); + late final _CFSocketCreate = _CFSocketCreatePtr.asFunction< + CFSocketRef Function(CFAllocatorRef, int, int, int, int, CFSocketCallBack, + ffi.Pointer)>(); - void CFStringSetExternalCharactersNoCopy( - CFMutableStringRef theString, - ffi.Pointer chars, - int length, - int capacity, + CFSocketRef CFSocketCreateWithNative( + CFAllocatorRef allocator, + int sock, + int callBackTypes, + CFSocketCallBack callout, + ffi.Pointer context, ) { - return _CFStringSetExternalCharactersNoCopy( - theString, - chars, - length, - capacity, + return _CFSocketCreateWithNative( + allocator, + sock, + callBackTypes, + callout, + context, ); } - late final _CFStringSetExternalCharactersNoCopyPtr = _lookup< + late final _CFSocketCreateWithNativePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, ffi.Pointer, CFIndex, - CFIndex)>>('CFStringSetExternalCharactersNoCopy'); - late final _CFStringSetExternalCharactersNoCopy = - _CFStringSetExternalCharactersNoCopyPtr.asFunction< - void Function(CFMutableStringRef, ffi.Pointer, int, int)>(); + CFSocketRef Function( + CFAllocatorRef, + CFSocketNativeHandle, + CFOptionFlags, + CFSocketCallBack, + ffi.Pointer)>>('CFSocketCreateWithNative'); + late final _CFSocketCreateWithNative = + _CFSocketCreateWithNativePtr.asFunction< + CFSocketRef Function(CFAllocatorRef, int, int, CFSocketCallBack, + ffi.Pointer)>(); - void CFStringPad( - CFMutableStringRef theString, - CFStringRef padString, - int length, - int indexIntoPad, + CFSocketRef CFSocketCreateWithSocketSignature( + CFAllocatorRef allocator, + ffi.Pointer signature, + int callBackTypes, + CFSocketCallBack callout, + ffi.Pointer context, ) { - return _CFStringPad( - theString, - padString, - length, - indexIntoPad, + return _CFSocketCreateWithSocketSignature( + allocator, + signature, + callBackTypes, + callout, + context, ); } - late final _CFStringPadPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, CFStringRef, CFIndex, - CFIndex)>>('CFStringPad'); - late final _CFStringPad = _CFStringPadPtr.asFunction< - void Function(CFMutableStringRef, CFStringRef, int, int)>(); + late final _CFSocketCreateWithSocketSignaturePtr = _lookup< + ffi.NativeFunction< + CFSocketRef Function( + CFAllocatorRef, + ffi.Pointer, + CFOptionFlags, + CFSocketCallBack, + ffi.Pointer)>>( + 'CFSocketCreateWithSocketSignature'); + late final _CFSocketCreateWithSocketSignature = + _CFSocketCreateWithSocketSignaturePtr.asFunction< + CFSocketRef Function(CFAllocatorRef, ffi.Pointer, + int, CFSocketCallBack, ffi.Pointer)>(); - void CFStringTrim( - CFMutableStringRef theString, - CFStringRef trimString, + CFSocketRef CFSocketCreateConnectedToSocketSignature( + CFAllocatorRef allocator, + ffi.Pointer signature, + int callBackTypes, + CFSocketCallBack callout, + ffi.Pointer context, + double timeout, ) { - return _CFStringTrim( - theString, - trimString, + return _CFSocketCreateConnectedToSocketSignature( + allocator, + signature, + callBackTypes, + callout, + context, + timeout, ); } - late final _CFStringTrimPtr = _lookup< + late final _CFSocketCreateConnectedToSocketSignaturePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFMutableStringRef, CFStringRef)>>('CFStringTrim'); - late final _CFStringTrim = _CFStringTrimPtr.asFunction< - void Function(CFMutableStringRef, CFStringRef)>(); + CFSocketRef Function( + CFAllocatorRef, + ffi.Pointer, + CFOptionFlags, + CFSocketCallBack, + ffi.Pointer, + CFTimeInterval)>>('CFSocketCreateConnectedToSocketSignature'); + late final _CFSocketCreateConnectedToSocketSignature = + _CFSocketCreateConnectedToSocketSignaturePtr.asFunction< + CFSocketRef Function(CFAllocatorRef, ffi.Pointer, + int, CFSocketCallBack, ffi.Pointer, double)>(); - void CFStringTrimWhitespace( - CFMutableStringRef theString, + CFSocketError CFSocketSetAddress( + CFSocketRef s, + CFDataRef address, ) { - return _CFStringTrimWhitespace( - theString, - ); + return CFSocketError.fromValue(_CFSocketSetAddress( + s, + address, + )); } - late final _CFStringTrimWhitespacePtr = - _lookup>( - 'CFStringTrimWhitespace'); - late final _CFStringTrimWhitespace = _CFStringTrimWhitespacePtr.asFunction< - void Function(CFMutableStringRef)>(); + late final _CFSocketSetAddressPtr = + _lookup>( + 'CFSocketSetAddress'); + late final _CFSocketSetAddress = + _CFSocketSetAddressPtr.asFunction(); - void CFStringLowercase( - CFMutableStringRef theString, - CFLocaleRef locale, + CFSocketError CFSocketConnectToAddress( + CFSocketRef s, + CFDataRef address, + DartCFTimeInterval timeout, ) { - return _CFStringLowercase( - theString, - locale, - ); + return CFSocketError.fromValue(_CFSocketConnectToAddress( + s, + address, + timeout, + )); } - late final _CFStringLowercasePtr = _lookup< - ffi - .NativeFunction>( - 'CFStringLowercase'); - late final _CFStringLowercase = _CFStringLowercasePtr.asFunction< - void Function(CFMutableStringRef, CFLocaleRef)>(); + late final _CFSocketConnectToAddressPtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFSocketRef, CFDataRef, + CFTimeInterval)>>('CFSocketConnectToAddress'); + late final _CFSocketConnectToAddress = _CFSocketConnectToAddressPtr + .asFunction(); - void CFStringUppercase( - CFMutableStringRef theString, - CFLocaleRef locale, + void CFSocketInvalidate( + CFSocketRef s, ) { - return _CFStringUppercase( - theString, - locale, + return _CFSocketInvalidate( + s, ); } - late final _CFStringUppercasePtr = _lookup< - ffi - .NativeFunction>( - 'CFStringUppercase'); - late final _CFStringUppercase = _CFStringUppercasePtr.asFunction< - void Function(CFMutableStringRef, CFLocaleRef)>(); + late final _CFSocketInvalidatePtr = + _lookup>( + 'CFSocketInvalidate'); + late final _CFSocketInvalidate = + _CFSocketInvalidatePtr.asFunction(); - void CFStringCapitalize( - CFMutableStringRef theString, - CFLocaleRef locale, + int CFSocketIsValid( + CFSocketRef s, ) { - return _CFStringCapitalize( - theString, - locale, + return _CFSocketIsValid( + s, ); } - late final _CFStringCapitalizePtr = _lookup< - ffi - .NativeFunction>( - 'CFStringCapitalize'); - late final _CFStringCapitalize = _CFStringCapitalizePtr.asFunction< - void Function(CFMutableStringRef, CFLocaleRef)>(); + late final _CFSocketIsValidPtr = + _lookup>( + 'CFSocketIsValid'); + late final _CFSocketIsValid = + _CFSocketIsValidPtr.asFunction(); - void CFStringNormalize( - CFMutableStringRef theString, - int theForm, + CFDataRef CFSocketCopyAddress( + CFSocketRef s, ) { - return _CFStringNormalize( - theString, - theForm, + return _CFSocketCopyAddress( + s, ); } - late final _CFStringNormalizePtr = _lookup< - ffi.NativeFunction>( - 'CFStringNormalize'); - late final _CFStringNormalize = _CFStringNormalizePtr.asFunction< - void Function(CFMutableStringRef, int)>(); + late final _CFSocketCopyAddressPtr = + _lookup>( + 'CFSocketCopyAddress'); + late final _CFSocketCopyAddress = + _CFSocketCopyAddressPtr.asFunction(); - void CFStringFold( - CFMutableStringRef theString, - int theFlags, - CFLocaleRef theLocale, + CFDataRef CFSocketCopyPeerAddress( + CFSocketRef s, ) { - return _CFStringFold( - theString, - theFlags, - theLocale, + return _CFSocketCopyPeerAddress( + s, ); } - late final _CFStringFoldPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableStringRef, ffi.Int32, CFLocaleRef)>>('CFStringFold'); - late final _CFStringFold = _CFStringFoldPtr.asFunction< - void Function(CFMutableStringRef, int, CFLocaleRef)>(); + late final _CFSocketCopyPeerAddressPtr = + _lookup>( + 'CFSocketCopyPeerAddress'); + late final _CFSocketCopyPeerAddress = + _CFSocketCopyPeerAddressPtr.asFunction(); - int CFStringTransform( - CFMutableStringRef string, - ffi.Pointer range, - CFStringRef transform, - int reverse, + void CFSocketGetContext( + CFSocketRef s, + ffi.Pointer context, ) { - return _CFStringTransform( - string, - range, - transform, - reverse, + return _CFSocketGetContext( + s, + context, ); } - late final _CFStringTransformPtr = _lookup< + late final _CFSocketGetContextPtr = _lookup< ffi.NativeFunction< - Boolean Function(CFMutableStringRef, ffi.Pointer, - CFStringRef, Boolean)>>('CFStringTransform'); - late final _CFStringTransform = _CFStringTransformPtr.asFunction< - int Function( - CFMutableStringRef, ffi.Pointer, CFStringRef, int)>(); + ffi.Void Function(CFSocketRef, + ffi.Pointer)>>('CFSocketGetContext'); + late final _CFSocketGetContext = _CFSocketGetContextPtr.asFunction< + void Function(CFSocketRef, ffi.Pointer)>(); - late final ffi.Pointer _kCFStringTransformStripCombiningMarks = - _lookup('kCFStringTransformStripCombiningMarks'); + int CFSocketGetNative( + CFSocketRef s, + ) { + return _CFSocketGetNative( + s, + ); + } - CFStringRef get kCFStringTransformStripCombiningMarks => - _kCFStringTransformStripCombiningMarks.value; + late final _CFSocketGetNativePtr = + _lookup>( + 'CFSocketGetNative'); + late final _CFSocketGetNative = + _CFSocketGetNativePtr.asFunction(); - late final ffi.Pointer _kCFStringTransformToLatin = - _lookup('kCFStringTransformToLatin'); + CFRunLoopSourceRef CFSocketCreateRunLoopSource( + CFAllocatorRef allocator, + CFSocketRef s, + int order, + ) { + return _CFSocketCreateRunLoopSource( + allocator, + s, + order, + ); + } - CFStringRef get kCFStringTransformToLatin => _kCFStringTransformToLatin.value; + late final _CFSocketCreateRunLoopSourcePtr = _lookup< + ffi.NativeFunction< + CFRunLoopSourceRef Function(CFAllocatorRef, CFSocketRef, + CFIndex)>>('CFSocketCreateRunLoopSource'); + late final _CFSocketCreateRunLoopSource = + _CFSocketCreateRunLoopSourcePtr.asFunction< + CFRunLoopSourceRef Function(CFAllocatorRef, CFSocketRef, int)>(); - late final ffi.Pointer _kCFStringTransformFullwidthHalfwidth = - _lookup('kCFStringTransformFullwidthHalfwidth'); - - CFStringRef get kCFStringTransformFullwidthHalfwidth => - _kCFStringTransformFullwidthHalfwidth.value; - - late final ffi.Pointer _kCFStringTransformLatinKatakana = - _lookup('kCFStringTransformLatinKatakana'); - - CFStringRef get kCFStringTransformLatinKatakana => - _kCFStringTransformLatinKatakana.value; - - late final ffi.Pointer _kCFStringTransformLatinHiragana = - _lookup('kCFStringTransformLatinHiragana'); - - CFStringRef get kCFStringTransformLatinHiragana => - _kCFStringTransformLatinHiragana.value; - - late final ffi.Pointer _kCFStringTransformHiraganaKatakana = - _lookup('kCFStringTransformHiraganaKatakana'); - - CFStringRef get kCFStringTransformHiraganaKatakana => - _kCFStringTransformHiraganaKatakana.value; - - late final ffi.Pointer _kCFStringTransformMandarinLatin = - _lookup('kCFStringTransformMandarinLatin'); - - CFStringRef get kCFStringTransformMandarinLatin => - _kCFStringTransformMandarinLatin.value; - - late final ffi.Pointer _kCFStringTransformLatinHangul = - _lookup('kCFStringTransformLatinHangul'); - - CFStringRef get kCFStringTransformLatinHangul => - _kCFStringTransformLatinHangul.value; - - late final ffi.Pointer _kCFStringTransformLatinArabic = - _lookup('kCFStringTransformLatinArabic'); - - CFStringRef get kCFStringTransformLatinArabic => - _kCFStringTransformLatinArabic.value; - - late final ffi.Pointer _kCFStringTransformLatinHebrew = - _lookup('kCFStringTransformLatinHebrew'); - - CFStringRef get kCFStringTransformLatinHebrew => - _kCFStringTransformLatinHebrew.value; - - late final ffi.Pointer _kCFStringTransformLatinThai = - _lookup('kCFStringTransformLatinThai'); - - CFStringRef get kCFStringTransformLatinThai => - _kCFStringTransformLatinThai.value; - - late final ffi.Pointer _kCFStringTransformLatinCyrillic = - _lookup('kCFStringTransformLatinCyrillic'); - - CFStringRef get kCFStringTransformLatinCyrillic => - _kCFStringTransformLatinCyrillic.value; - - late final ffi.Pointer _kCFStringTransformLatinGreek = - _lookup('kCFStringTransformLatinGreek'); - - CFStringRef get kCFStringTransformLatinGreek => - _kCFStringTransformLatinGreek.value; - - late final ffi.Pointer _kCFStringTransformToXMLHex = - _lookup('kCFStringTransformToXMLHex'); - - CFStringRef get kCFStringTransformToXMLHex => - _kCFStringTransformToXMLHex.value; - - late final ffi.Pointer _kCFStringTransformToUnicodeName = - _lookup('kCFStringTransformToUnicodeName'); - - CFStringRef get kCFStringTransformToUnicodeName => - _kCFStringTransformToUnicodeName.value; - - late final ffi.Pointer _kCFStringTransformStripDiacritics = - _lookup('kCFStringTransformStripDiacritics'); - - CFStringRef get kCFStringTransformStripDiacritics => - _kCFStringTransformStripDiacritics.value; - - int CFStringIsEncodingAvailable( - int encoding, - ) { - return _CFStringIsEncodingAvailable( - encoding, - ); - } - - late final _CFStringIsEncodingAvailablePtr = - _lookup>( - 'CFStringIsEncodingAvailable'); - late final _CFStringIsEncodingAvailable = - _CFStringIsEncodingAvailablePtr.asFunction(); - - ffi.Pointer CFStringGetListOfAvailableEncodings() { - return _CFStringGetListOfAvailableEncodings(); - } - - late final _CFStringGetListOfAvailableEncodingsPtr = - _lookup Function()>>( - 'CFStringGetListOfAvailableEncodings'); - late final _CFStringGetListOfAvailableEncodings = - _CFStringGetListOfAvailableEncodingsPtr.asFunction< - ffi.Pointer Function()>(); - - CFStringRef CFStringGetNameOfEncoding( - int encoding, + int CFSocketGetSocketFlags( + CFSocketRef s, ) { - return _CFStringGetNameOfEncoding( - encoding, + return _CFSocketGetSocketFlags( + s, ); } - late final _CFStringGetNameOfEncodingPtr = - _lookup>( - 'CFStringGetNameOfEncoding'); - late final _CFStringGetNameOfEncoding = - _CFStringGetNameOfEncodingPtr.asFunction(); + late final _CFSocketGetSocketFlagsPtr = + _lookup>( + 'CFSocketGetSocketFlags'); + late final _CFSocketGetSocketFlags = + _CFSocketGetSocketFlagsPtr.asFunction(); - int CFStringConvertEncodingToNSStringEncoding( - int encoding, + void CFSocketSetSocketFlags( + CFSocketRef s, + int flags, ) { - return _CFStringConvertEncodingToNSStringEncoding( - encoding, + return _CFSocketSetSocketFlags( + s, + flags, ); } - late final _CFStringConvertEncodingToNSStringEncodingPtr = - _lookup>( - 'CFStringConvertEncodingToNSStringEncoding'); - late final _CFStringConvertEncodingToNSStringEncoding = - _CFStringConvertEncodingToNSStringEncodingPtr.asFunction< - int Function(int)>(); + late final _CFSocketSetSocketFlagsPtr = _lookup< + ffi.NativeFunction>( + 'CFSocketSetSocketFlags'); + late final _CFSocketSetSocketFlags = + _CFSocketSetSocketFlagsPtr.asFunction(); - int CFStringConvertNSStringEncodingToEncoding( - int encoding, + void CFSocketDisableCallBacks( + CFSocketRef s, + int callBackTypes, ) { - return _CFStringConvertNSStringEncodingToEncoding( - encoding, + return _CFSocketDisableCallBacks( + s, + callBackTypes, ); } - late final _CFStringConvertNSStringEncodingToEncodingPtr = - _lookup>( - 'CFStringConvertNSStringEncodingToEncoding'); - late final _CFStringConvertNSStringEncodingToEncoding = - _CFStringConvertNSStringEncodingToEncodingPtr.asFunction< - int Function(int)>(); + late final _CFSocketDisableCallBacksPtr = _lookup< + ffi.NativeFunction>( + 'CFSocketDisableCallBacks'); + late final _CFSocketDisableCallBacks = _CFSocketDisableCallBacksPtr + .asFunction(); - int CFStringConvertEncodingToWindowsCodepage( - int encoding, + void CFSocketEnableCallBacks( + CFSocketRef s, + int callBackTypes, ) { - return _CFStringConvertEncodingToWindowsCodepage( - encoding, + return _CFSocketEnableCallBacks( + s, + callBackTypes, ); } - late final _CFStringConvertEncodingToWindowsCodepagePtr = - _lookup>( - 'CFStringConvertEncodingToWindowsCodepage'); - late final _CFStringConvertEncodingToWindowsCodepage = - _CFStringConvertEncodingToWindowsCodepagePtr.asFunction< - int Function(int)>(); + late final _CFSocketEnableCallBacksPtr = _lookup< + ffi.NativeFunction>( + 'CFSocketEnableCallBacks'); + late final _CFSocketEnableCallBacks = + _CFSocketEnableCallBacksPtr.asFunction(); - int CFStringConvertWindowsCodepageToEncoding( - int codepage, + CFSocketError CFSocketSendData( + CFSocketRef s, + CFDataRef address, + CFDataRef data, + DartCFTimeInterval timeout, ) { - return _CFStringConvertWindowsCodepageToEncoding( - codepage, - ); + return CFSocketError.fromValue(_CFSocketSendData( + s, + address, + data, + timeout, + )); } - late final _CFStringConvertWindowsCodepageToEncodingPtr = - _lookup>( - 'CFStringConvertWindowsCodepageToEncoding'); - late final _CFStringConvertWindowsCodepageToEncoding = - _CFStringConvertWindowsCodepageToEncodingPtr.asFunction< - int Function(int)>(); + late final _CFSocketSendDataPtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFSocketRef, CFDataRef, CFDataRef, + CFTimeInterval)>>('CFSocketSendData'); + late final _CFSocketSendData = _CFSocketSendDataPtr.asFunction< + int Function(CFSocketRef, CFDataRef, CFDataRef, double)>(); - int CFStringConvertIANACharSetNameToEncoding( - CFStringRef theString, + CFSocketError CFSocketRegisterValue( + ffi.Pointer nameServerSignature, + DartCFTimeInterval timeout, + CFStringRef name, + CFPropertyListRef value, ) { - return _CFStringConvertIANACharSetNameToEncoding( - theString, - ); + return CFSocketError.fromValue(_CFSocketRegisterValue( + nameServerSignature, + timeout, + name, + value, + )); } - late final _CFStringConvertIANACharSetNameToEncodingPtr = - _lookup>( - 'CFStringConvertIANACharSetNameToEncoding'); - late final _CFStringConvertIANACharSetNameToEncoding = - _CFStringConvertIANACharSetNameToEncodingPtr.asFunction< - int Function(CFStringRef)>(); + late final _CFSocketRegisterValuePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(ffi.Pointer, CFTimeInterval, + CFStringRef, CFPropertyListRef)>>('CFSocketRegisterValue'); + late final _CFSocketRegisterValue = _CFSocketRegisterValuePtr.asFunction< + int Function(ffi.Pointer, double, CFStringRef, + CFPropertyListRef)>(); - CFStringRef CFStringConvertEncodingToIANACharSetName( - int encoding, + CFSocketError CFSocketCopyRegisteredValue( + ffi.Pointer nameServerSignature, + DartCFTimeInterval timeout, + CFStringRef name, + ffi.Pointer value, + ffi.Pointer nameServerAddress, ) { - return _CFStringConvertEncodingToIANACharSetName( - encoding, - ); + return CFSocketError.fromValue(_CFSocketCopyRegisteredValue( + nameServerSignature, + timeout, + name, + value, + nameServerAddress, + )); } - late final _CFStringConvertEncodingToIANACharSetNamePtr = - _lookup>( - 'CFStringConvertEncodingToIANACharSetName'); - late final _CFStringConvertEncodingToIANACharSetName = - _CFStringConvertEncodingToIANACharSetNamePtr.asFunction< - CFStringRef Function(int)>(); + late final _CFSocketCopyRegisteredValuePtr = _lookup< + ffi.NativeFunction< + CFIndex Function( + ffi.Pointer, + CFTimeInterval, + CFStringRef, + ffi.Pointer, + ffi.Pointer)>>('CFSocketCopyRegisteredValue'); + late final _CFSocketCopyRegisteredValue = + _CFSocketCopyRegisteredValuePtr.asFunction< + int Function(ffi.Pointer, double, CFStringRef, + ffi.Pointer, ffi.Pointer)>(); - int CFStringGetMostCompatibleMacStringEncoding( - int encoding, + CFSocketError CFSocketRegisterSocketSignature( + ffi.Pointer nameServerSignature, + DartCFTimeInterval timeout, + CFStringRef name, + ffi.Pointer signature, ) { - return _CFStringGetMostCompatibleMacStringEncoding( - encoding, - ); + return CFSocketError.fromValue(_CFSocketRegisterSocketSignature( + nameServerSignature, + timeout, + name, + signature, + )); } - late final _CFStringGetMostCompatibleMacStringEncodingPtr = - _lookup>( - 'CFStringGetMostCompatibleMacStringEncoding'); - late final _CFStringGetMostCompatibleMacStringEncoding = - _CFStringGetMostCompatibleMacStringEncodingPtr.asFunction< - int Function(int)>(); + late final _CFSocketRegisterSocketSignaturePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(ffi.Pointer, CFTimeInterval, + CFStringRef, ffi.Pointer)>>( + 'CFSocketRegisterSocketSignature'); + late final _CFSocketRegisterSocketSignature = + _CFSocketRegisterSocketSignaturePtr.asFunction< + int Function(ffi.Pointer, double, CFStringRef, + ffi.Pointer)>(); - void CFShow( - CFTypeRef obj, + CFSocketError CFSocketCopyRegisteredSocketSignature( + ffi.Pointer nameServerSignature, + DartCFTimeInterval timeout, + CFStringRef name, + ffi.Pointer signature, + ffi.Pointer nameServerAddress, ) { - return _CFShow( - obj, - ); + return CFSocketError.fromValue(_CFSocketCopyRegisteredSocketSignature( + nameServerSignature, + timeout, + name, + signature, + nameServerAddress, + )); } - late final _CFShowPtr = - _lookup>('CFShow'); - late final _CFShow = _CFShowPtr.asFunction(); + late final _CFSocketCopyRegisteredSocketSignaturePtr = _lookup< + ffi.NativeFunction< + CFIndex Function( + ffi.Pointer, + CFTimeInterval, + CFStringRef, + ffi.Pointer, + ffi.Pointer)>>( + 'CFSocketCopyRegisteredSocketSignature'); + late final _CFSocketCopyRegisteredSocketSignature = + _CFSocketCopyRegisteredSocketSignaturePtr.asFunction< + int Function(ffi.Pointer, double, CFStringRef, + ffi.Pointer, ffi.Pointer)>(); - void CFShowStr( - CFStringRef str, + CFSocketError CFSocketUnregister( + ffi.Pointer nameServerSignature, + DartCFTimeInterval timeout, + CFStringRef name, ) { - return _CFShowStr( - str, - ); + return CFSocketError.fromValue(_CFSocketUnregister( + nameServerSignature, + timeout, + name, + )); } - late final _CFShowStrPtr = - _lookup>('CFShowStr'); - late final _CFShowStr = - _CFShowStrPtr.asFunction(); + late final _CFSocketUnregisterPtr = _lookup< + ffi.NativeFunction< + CFIndex Function(ffi.Pointer, CFTimeInterval, + CFStringRef)>>('CFSocketUnregister'); + late final _CFSocketUnregister = _CFSocketUnregisterPtr.asFunction< + int Function(ffi.Pointer, double, CFStringRef)>(); - CFStringRef __CFStringMakeConstantString( - ffi.Pointer cStr, + void CFSocketSetDefaultNameRegistryPortNumber( + int port, ) { - return ___CFStringMakeConstantString( - cStr, + return _CFSocketSetDefaultNameRegistryPortNumber( + port, ); } - late final ___CFStringMakeConstantStringPtr = - _lookup)>>( - '__CFStringMakeConstantString'); - late final ___CFStringMakeConstantString = ___CFStringMakeConstantStringPtr - .asFunction)>(); + late final _CFSocketSetDefaultNameRegistryPortNumberPtr = + _lookup>( + 'CFSocketSetDefaultNameRegistryPortNumber'); + late final _CFSocketSetDefaultNameRegistryPortNumber = + _CFSocketSetDefaultNameRegistryPortNumberPtr.asFunction< + void Function(int)>(); - int CFTimeZoneGetTypeID() { - return _CFTimeZoneGetTypeID(); + int CFSocketGetDefaultNameRegistryPortNumber() { + return _CFSocketGetDefaultNameRegistryPortNumber(); } - late final _CFTimeZoneGetTypeIDPtr = - _lookup>('CFTimeZoneGetTypeID'); - late final _CFTimeZoneGetTypeID = - _CFTimeZoneGetTypeIDPtr.asFunction(); + late final _CFSocketGetDefaultNameRegistryPortNumberPtr = + _lookup>( + 'CFSocketGetDefaultNameRegistryPortNumber'); + late final _CFSocketGetDefaultNameRegistryPortNumber = + _CFSocketGetDefaultNameRegistryPortNumberPtr.asFunction(); - CFTimeZoneRef CFTimeZoneCopySystem() { - return _CFTimeZoneCopySystem(); - } + late final ffi.Pointer _kCFSocketCommandKey = + _lookup('kCFSocketCommandKey'); - late final _CFTimeZoneCopySystemPtr = - _lookup>( - 'CFTimeZoneCopySystem'); - late final _CFTimeZoneCopySystem = - _CFTimeZoneCopySystemPtr.asFunction(); + CFStringRef get kCFSocketCommandKey => _kCFSocketCommandKey.value; - void CFTimeZoneResetSystem() { - return _CFTimeZoneResetSystem(); - } + late final ffi.Pointer _kCFSocketNameKey = + _lookup('kCFSocketNameKey'); - late final _CFTimeZoneResetSystemPtr = - _lookup>('CFTimeZoneResetSystem'); - late final _CFTimeZoneResetSystem = - _CFTimeZoneResetSystemPtr.asFunction(); + CFStringRef get kCFSocketNameKey => _kCFSocketNameKey.value; - CFTimeZoneRef CFTimeZoneCopyDefault() { - return _CFTimeZoneCopyDefault(); - } + late final ffi.Pointer _kCFSocketValueKey = + _lookup('kCFSocketValueKey'); - late final _CFTimeZoneCopyDefaultPtr = - _lookup>( - 'CFTimeZoneCopyDefault'); - late final _CFTimeZoneCopyDefault = - _CFTimeZoneCopyDefaultPtr.asFunction(); + CFStringRef get kCFSocketValueKey => _kCFSocketValueKey.value; - void CFTimeZoneSetDefault( - CFTimeZoneRef tz, - ) { - return _CFTimeZoneSetDefault( - tz, - ); - } + late final ffi.Pointer _kCFSocketResultKey = + _lookup('kCFSocketResultKey'); - late final _CFTimeZoneSetDefaultPtr = - _lookup>( - 'CFTimeZoneSetDefault'); - late final _CFTimeZoneSetDefault = - _CFTimeZoneSetDefaultPtr.asFunction(); + CFStringRef get kCFSocketResultKey => _kCFSocketResultKey.value; - CFArrayRef CFTimeZoneCopyKnownNames() { - return _CFTimeZoneCopyKnownNames(); - } + late final ffi.Pointer _kCFSocketErrorKey = + _lookup('kCFSocketErrorKey'); - late final _CFTimeZoneCopyKnownNamesPtr = - _lookup>( - 'CFTimeZoneCopyKnownNames'); - late final _CFTimeZoneCopyKnownNames = - _CFTimeZoneCopyKnownNamesPtr.asFunction(); + CFStringRef get kCFSocketErrorKey => _kCFSocketErrorKey.value; - CFDictionaryRef CFTimeZoneCopyAbbreviationDictionary() { - return _CFTimeZoneCopyAbbreviationDictionary(); - } + late final ffi.Pointer _kCFSocketRegisterCommand = + _lookup('kCFSocketRegisterCommand'); - late final _CFTimeZoneCopyAbbreviationDictionaryPtr = - _lookup>( - 'CFTimeZoneCopyAbbreviationDictionary'); - late final _CFTimeZoneCopyAbbreviationDictionary = - _CFTimeZoneCopyAbbreviationDictionaryPtr.asFunction< - CFDictionaryRef Function()>(); + CFStringRef get kCFSocketRegisterCommand => _kCFSocketRegisterCommand.value; - void CFTimeZoneSetAbbreviationDictionary( - CFDictionaryRef dict, - ) { - return _CFTimeZoneSetAbbreviationDictionary( - dict, - ); - } + late final ffi.Pointer _kCFSocketRetrieveCommand = + _lookup('kCFSocketRetrieveCommand'); - late final _CFTimeZoneSetAbbreviationDictionaryPtr = - _lookup>( - 'CFTimeZoneSetAbbreviationDictionary'); - late final _CFTimeZoneSetAbbreviationDictionary = - _CFTimeZoneSetAbbreviationDictionaryPtr.asFunction< - void Function(CFDictionaryRef)>(); + CFStringRef get kCFSocketRetrieveCommand => _kCFSocketRetrieveCommand.value; - CFTimeZoneRef CFTimeZoneCreate( - CFAllocatorRef allocator, - CFStringRef name, - CFDataRef data, + int getattrlistbulk( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, ) { - return _CFTimeZoneCreate( - allocator, - name, - data, + return _getattrlistbulk( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFTimeZoneCreatePtr = _lookup< + late final _getattrlistbulkPtr = _lookup< ffi.NativeFunction< - CFTimeZoneRef Function( - CFAllocatorRef, CFStringRef, CFDataRef)>>('CFTimeZoneCreate'); - late final _CFTimeZoneCreate = _CFTimeZoneCreatePtr.asFunction< - CFTimeZoneRef Function(CFAllocatorRef, CFStringRef, CFDataRef)>(); + ffi.Int Function(ffi.Int, ffi.Pointer, + ffi.Pointer, ffi.Size, ffi.Uint64)>>('getattrlistbulk'); + late final _getattrlistbulk = _getattrlistbulkPtr.asFunction< + int Function( + int, ffi.Pointer, ffi.Pointer, int, int)>(); - CFTimeZoneRef CFTimeZoneCreateWithTimeIntervalFromGMT( - CFAllocatorRef allocator, - double ti, + int getattrlistat( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + int arg4, + int arg5, ) { - return _CFTimeZoneCreateWithTimeIntervalFromGMT( - allocator, - ti, + return _getattrlistat( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, ); } - late final _CFTimeZoneCreateWithTimeIntervalFromGMTPtr = _lookup< + late final _getattrlistatPtr = _lookup< ffi.NativeFunction< - CFTimeZoneRef Function(CFAllocatorRef, - CFTimeInterval)>>('CFTimeZoneCreateWithTimeIntervalFromGMT'); - late final _CFTimeZoneCreateWithTimeIntervalFromGMT = - _CFTimeZoneCreateWithTimeIntervalFromGMTPtr.asFunction< - CFTimeZoneRef Function(CFAllocatorRef, double)>(); + ffi.Int Function( + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.UnsignedLong)>>('getattrlistat'); + late final _getattrlistat = _getattrlistatPtr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - CFTimeZoneRef CFTimeZoneCreateWithName( - CFAllocatorRef allocator, - CFStringRef name, - int tryAbbrev, + int setattrlistat( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + int arg4, + int arg5, ) { - return _CFTimeZoneCreateWithName( - allocator, - name, - tryAbbrev, + return _setattrlistat( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, ); } - late final _CFTimeZoneCreateWithNamePtr = _lookup< + late final _setattrlistatPtr = _lookup< ffi.NativeFunction< - CFTimeZoneRef Function(CFAllocatorRef, CFStringRef, - Boolean)>>('CFTimeZoneCreateWithName'); - late final _CFTimeZoneCreateWithName = _CFTimeZoneCreateWithNamePtr - .asFunction(); - - CFStringRef CFTimeZoneGetName( - CFTimeZoneRef tz, - ) { - return _CFTimeZoneGetName( - tz, - ); - } - - late final _CFTimeZoneGetNamePtr = - _lookup>( - 'CFTimeZoneGetName'); - late final _CFTimeZoneGetName = - _CFTimeZoneGetNamePtr.asFunction(); + ffi.Int Function( + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.Uint32)>>('setattrlistat'); + late final _setattrlistat = _setattrlistatPtr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - CFDataRef CFTimeZoneGetData( - CFTimeZoneRef tz, + int freadlink( + int arg0, + ffi.Pointer arg1, + int arg2, ) { - return _CFTimeZoneGetData( - tz, + return _freadlink( + arg0, + arg1, + arg2, ); } - late final _CFTimeZoneGetDataPtr = - _lookup>( - 'CFTimeZoneGetData'); - late final _CFTimeZoneGetData = - _CFTimeZoneGetDataPtr.asFunction(); + late final _freadlinkPtr = _lookup< + ffi.NativeFunction< + ssize_t Function( + ffi.Int, ffi.Pointer, ffi.Size)>>('freadlink'); + late final _freadlink = + _freadlinkPtr.asFunction, int)>(); - double CFTimeZoneGetSecondsFromGMT( - CFTimeZoneRef tz, - double at, + int faccessat( + int arg0, + ffi.Pointer arg1, + int arg2, + int arg3, ) { - return _CFTimeZoneGetSecondsFromGMT( - tz, - at, + return _faccessat( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFTimeZoneGetSecondsFromGMTPtr = _lookup< + late final _faccessatPtr = _lookup< ffi.NativeFunction< - CFTimeInterval Function( - CFTimeZoneRef, CFAbsoluteTime)>>('CFTimeZoneGetSecondsFromGMT'); - late final _CFTimeZoneGetSecondsFromGMT = _CFTimeZoneGetSecondsFromGMTPtr - .asFunction(); + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Int, ffi.Int)>>('faccessat'); + late final _faccessat = _faccessatPtr + .asFunction, int, int)>(); - CFStringRef CFTimeZoneCopyAbbreviation( - CFTimeZoneRef tz, - double at, + int fchownat( + int arg0, + ffi.Pointer arg1, + int arg2, + int arg3, + int arg4, ) { - return _CFTimeZoneCopyAbbreviation( - tz, - at, + return _fchownat( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFTimeZoneCopyAbbreviationPtr = _lookup< - ffi - .NativeFunction>( - 'CFTimeZoneCopyAbbreviation'); - late final _CFTimeZoneCopyAbbreviation = _CFTimeZoneCopyAbbreviationPtr - .asFunction(); + late final _fchownatPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, uid_t, gid_t, + ffi.Int)>>('fchownat'); + late final _fchownat = _fchownatPtr + .asFunction, int, int, int)>(); - int CFTimeZoneIsDaylightSavingTime( - CFTimeZoneRef tz, - double at, + int linkat( + int arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer arg3, + int arg4, ) { - return _CFTimeZoneIsDaylightSavingTime( - tz, - at, + return _linkat( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFTimeZoneIsDaylightSavingTimePtr = _lookup< - ffi.NativeFunction>( - 'CFTimeZoneIsDaylightSavingTime'); - late final _CFTimeZoneIsDaylightSavingTime = - _CFTimeZoneIsDaylightSavingTimePtr.asFunction< - int Function(CFTimeZoneRef, double)>(); + late final _linkatPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, + ffi.Pointer, ffi.Int)>>('linkat'); + late final _linkat = _linkatPtr.asFunction< + int Function( + int, ffi.Pointer, int, ffi.Pointer, int)>(); - double CFTimeZoneGetDaylightSavingTimeOffset( - CFTimeZoneRef tz, - double at, + int readlinkat( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, ) { - return _CFTimeZoneGetDaylightSavingTimeOffset( - tz, - at, + return _readlinkat( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFTimeZoneGetDaylightSavingTimeOffsetPtr = _lookup< + late final _readlinkatPtr = _lookup< ffi.NativeFunction< - CFTimeInterval Function(CFTimeZoneRef, - CFAbsoluteTime)>>('CFTimeZoneGetDaylightSavingTimeOffset'); - late final _CFTimeZoneGetDaylightSavingTimeOffset = - _CFTimeZoneGetDaylightSavingTimeOffsetPtr.asFunction< - double Function(CFTimeZoneRef, double)>(); + ssize_t Function(ffi.Int, ffi.Pointer, + ffi.Pointer, ffi.Size)>>('readlinkat'); + late final _readlinkat = _readlinkatPtr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer, int)>(); - double CFTimeZoneGetNextDaylightSavingTimeTransition( - CFTimeZoneRef tz, - double at, + int symlinkat( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, ) { - return _CFTimeZoneGetNextDaylightSavingTimeTransition( - tz, - at, + return _symlinkat( + arg0, + arg1, + arg2, ); } - late final _CFTimeZoneGetNextDaylightSavingTimeTransitionPtr = _lookup< - ffi.NativeFunction< - CFAbsoluteTime Function(CFTimeZoneRef, CFAbsoluteTime)>>( - 'CFTimeZoneGetNextDaylightSavingTimeTransition'); - late final _CFTimeZoneGetNextDaylightSavingTimeTransition = - _CFTimeZoneGetNextDaylightSavingTimeTransitionPtr.asFunction< - double Function(CFTimeZoneRef, double)>(); + late final _symlinkatPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Pointer)>>('symlinkat'); + late final _symlinkat = _symlinkatPtr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer)>(); - CFStringRef CFTimeZoneCopyLocalizedName( - CFTimeZoneRef tz, - int style, - CFLocaleRef locale, + int unlinkat( + int arg0, + ffi.Pointer arg1, + int arg2, ) { - return _CFTimeZoneCopyLocalizedName( - tz, - style, - locale, + return _unlinkat( + arg0, + arg1, + arg2, ); } - late final _CFTimeZoneCopyLocalizedNamePtr = _lookup< + late final _unlinkatPtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFTimeZoneRef, ffi.Int32, - CFLocaleRef)>>('CFTimeZoneCopyLocalizedName'); - late final _CFTimeZoneCopyLocalizedName = _CFTimeZoneCopyLocalizedNamePtr - .asFunction(); - - late final ffi.Pointer - _kCFTimeZoneSystemTimeZoneDidChangeNotification = - _lookup( - 'kCFTimeZoneSystemTimeZoneDidChangeNotification'); - - CFNotificationName get kCFTimeZoneSystemTimeZoneDidChangeNotification => - _kCFTimeZoneSystemTimeZoneDidChangeNotification.value; - - int CFCalendarGetTypeID() { - return _CFCalendarGetTypeID(); - } - - late final _CFCalendarGetTypeIDPtr = - _lookup>('CFCalendarGetTypeID'); - late final _CFCalendarGetTypeID = - _CFCalendarGetTypeIDPtr.asFunction(); - - CFCalendarRef CFCalendarCopyCurrent() { - return _CFCalendarCopyCurrent(); - } - - late final _CFCalendarCopyCurrentPtr = - _lookup>( - 'CFCalendarCopyCurrent'); - late final _CFCalendarCopyCurrent = - _CFCalendarCopyCurrentPtr.asFunction(); + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Int)>>('unlinkat'); + late final _unlinkat = + _unlinkatPtr.asFunction, int)>(); - CFCalendarRef CFCalendarCreateWithIdentifier( - CFAllocatorRef allocator, - CFCalendarIdentifier identifier, + void _exit( + int arg0, ) { - return _CFCalendarCreateWithIdentifier( - allocator, - identifier, + return __exit( + arg0, ); } - late final _CFCalendarCreateWithIdentifierPtr = _lookup< - ffi.NativeFunction< - CFCalendarRef Function(CFAllocatorRef, - CFCalendarIdentifier)>>('CFCalendarCreateWithIdentifier'); - late final _CFCalendarCreateWithIdentifier = - _CFCalendarCreateWithIdentifierPtr.asFunction< - CFCalendarRef Function(CFAllocatorRef, CFCalendarIdentifier)>(); + late final __exitPtr = + _lookup>('_exit'); + late final __exit = __exitPtr.asFunction(); - CFCalendarIdentifier CFCalendarGetIdentifier( - CFCalendarRef calendar, + int access( + ffi.Pointer arg0, + int arg1, ) { - return _CFCalendarGetIdentifier( - calendar, + return _access( + arg0, + arg1, ); } - late final _CFCalendarGetIdentifierPtr = - _lookup>( - 'CFCalendarGetIdentifier'); - late final _CFCalendarGetIdentifier = _CFCalendarGetIdentifierPtr.asFunction< - CFCalendarIdentifier Function(CFCalendarRef)>(); + late final _accessPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'access'); + late final _access = + _accessPtr.asFunction, int)>(); - CFLocaleRef CFCalendarCopyLocale( - CFCalendarRef calendar, + int alarm( + int arg0, ) { - return _CFCalendarCopyLocale( - calendar, + return _alarm( + arg0, ); } - late final _CFCalendarCopyLocalePtr = - _lookup>( - 'CFCalendarCopyLocale'); - late final _CFCalendarCopyLocale = _CFCalendarCopyLocalePtr.asFunction< - CFLocaleRef Function(CFCalendarRef)>(); + late final _alarmPtr = + _lookup>( + 'alarm'); + late final _alarm = _alarmPtr.asFunction(); - void CFCalendarSetLocale( - CFCalendarRef calendar, - CFLocaleRef locale, + int chdir( + ffi.Pointer arg0, ) { - return _CFCalendarSetLocale( - calendar, - locale, + return _chdir( + arg0, ); } - late final _CFCalendarSetLocalePtr = _lookup< - ffi.NativeFunction>( - 'CFCalendarSetLocale'); - late final _CFCalendarSetLocale = _CFCalendarSetLocalePtr.asFunction< - void Function(CFCalendarRef, CFLocaleRef)>(); + late final _chdirPtr = + _lookup)>>( + 'chdir'); + late final _chdir = + _chdirPtr.asFunction)>(); - CFTimeZoneRef CFCalendarCopyTimeZone( - CFCalendarRef calendar, + int chown( + ffi.Pointer arg0, + int arg1, + int arg2, ) { - return _CFCalendarCopyTimeZone( - calendar, + return _chown( + arg0, + arg1, + arg2, ); } - late final _CFCalendarCopyTimeZonePtr = - _lookup>( - 'CFCalendarCopyTimeZone'); - late final _CFCalendarCopyTimeZone = _CFCalendarCopyTimeZonePtr.asFunction< - CFTimeZoneRef Function(CFCalendarRef)>(); + late final _chownPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, uid_t, gid_t)>>('chown'); + late final _chown = + _chownPtr.asFunction, int, int)>(); - void CFCalendarSetTimeZone( - CFCalendarRef calendar, - CFTimeZoneRef tz, + int close( + int arg0, ) { - return _CFCalendarSetTimeZone( - calendar, - tz, + return _close( + arg0, ); } - late final _CFCalendarSetTimeZonePtr = _lookup< - ffi.NativeFunction>( - 'CFCalendarSetTimeZone'); - late final _CFCalendarSetTimeZone = _CFCalendarSetTimeZonePtr.asFunction< - void Function(CFCalendarRef, CFTimeZoneRef)>(); + late final _closePtr = + _lookup>('close'); + late final _close = _closePtr.asFunction(); - int CFCalendarGetFirstWeekday( - CFCalendarRef calendar, + int dup( + int arg0, ) { - return _CFCalendarGetFirstWeekday( - calendar, + return _dup( + arg0, ); } - late final _CFCalendarGetFirstWeekdayPtr = - _lookup>( - 'CFCalendarGetFirstWeekday'); - late final _CFCalendarGetFirstWeekday = - _CFCalendarGetFirstWeekdayPtr.asFunction(); + late final _dupPtr = + _lookup>('dup'); + late final _dup = _dupPtr.asFunction(); - void CFCalendarSetFirstWeekday( - CFCalendarRef calendar, - int wkdy, + int dup2( + int arg0, + int arg1, ) { - return _CFCalendarSetFirstWeekday( - calendar, - wkdy, + return _dup2( + arg0, + arg1, ); } - late final _CFCalendarSetFirstWeekdayPtr = - _lookup>( - 'CFCalendarSetFirstWeekday'); - late final _CFCalendarSetFirstWeekday = _CFCalendarSetFirstWeekdayPtr - .asFunction(); + late final _dup2Ptr = + _lookup>('dup2'); + late final _dup2 = _dup2Ptr.asFunction(); - int CFCalendarGetMinimumDaysInFirstWeek( - CFCalendarRef calendar, + int execl( + ffi.Pointer __path, + ffi.Pointer __arg0, ) { - return _CFCalendarGetMinimumDaysInFirstWeek( - calendar, + return _execl( + __path, + __arg0, ); } - late final _CFCalendarGetMinimumDaysInFirstWeekPtr = - _lookup>( - 'CFCalendarGetMinimumDaysInFirstWeek'); - late final _CFCalendarGetMinimumDaysInFirstWeek = - _CFCalendarGetMinimumDaysInFirstWeekPtr.asFunction< - int Function(CFCalendarRef)>(); + late final _execlPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('execl'); + late final _execl = _execlPtr + .asFunction, ffi.Pointer)>(); - void CFCalendarSetMinimumDaysInFirstWeek( - CFCalendarRef calendar, - int mwd, + int execle( + ffi.Pointer __path, + ffi.Pointer __arg0, ) { - return _CFCalendarSetMinimumDaysInFirstWeek( - calendar, - mwd, + return _execle( + __path, + __arg0, ); } - late final _CFCalendarSetMinimumDaysInFirstWeekPtr = - _lookup>( - 'CFCalendarSetMinimumDaysInFirstWeek'); - late final _CFCalendarSetMinimumDaysInFirstWeek = - _CFCalendarSetMinimumDaysInFirstWeekPtr.asFunction< - void Function(CFCalendarRef, int)>(); + late final _execlePtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('execle'); + late final _execle = _execlePtr + .asFunction, ffi.Pointer)>(); - CFRange CFCalendarGetMinimumRangeOfUnit( - CFCalendarRef calendar, - int unit, + int execlp( + ffi.Pointer __file, + ffi.Pointer __arg0, ) { - return _CFCalendarGetMinimumRangeOfUnit( - calendar, - unit, + return _execlp( + __file, + __arg0, ); } - late final _CFCalendarGetMinimumRangeOfUnitPtr = - _lookup>( - 'CFCalendarGetMinimumRangeOfUnit'); - late final _CFCalendarGetMinimumRangeOfUnit = - _CFCalendarGetMinimumRangeOfUnitPtr.asFunction< - CFRange Function(CFCalendarRef, int)>(); + late final _execlpPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('execlp'); + late final _execlp = _execlpPtr + .asFunction, ffi.Pointer)>(); - CFRange CFCalendarGetMaximumRangeOfUnit( - CFCalendarRef calendar, - int unit, + int execv( + ffi.Pointer __path, + ffi.Pointer> __argv, ) { - return _CFCalendarGetMaximumRangeOfUnit( - calendar, - unit, + return _execv( + __path, + __argv, ); } - late final _CFCalendarGetMaximumRangeOfUnitPtr = - _lookup>( - 'CFCalendarGetMaximumRangeOfUnit'); - late final _CFCalendarGetMaximumRangeOfUnit = - _CFCalendarGetMaximumRangeOfUnitPtr.asFunction< - CFRange Function(CFCalendarRef, int)>(); + late final _execvPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer>)>>('execv'); + late final _execv = _execvPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>)>(); - CFRange CFCalendarGetRangeOfUnit( - CFCalendarRef calendar, - int smallerUnit, - int biggerUnit, - double at, + int execve( + ffi.Pointer __file, + ffi.Pointer> __argv, + ffi.Pointer> __envp, ) { - return _CFCalendarGetRangeOfUnit( - calendar, - smallerUnit, - biggerUnit, - at, + return _execve( + __file, + __argv, + __envp, ); } - late final _CFCalendarGetRangeOfUnitPtr = _lookup< + late final _execvePtr = _lookup< ffi.NativeFunction< - CFRange Function(CFCalendarRef, ffi.Int32, ffi.Int32, - CFAbsoluteTime)>>('CFCalendarGetRangeOfUnit'); - late final _CFCalendarGetRangeOfUnit = _CFCalendarGetRangeOfUnitPtr - .asFunction(); + ffi.Int Function( + ffi.Pointer, + ffi.Pointer>, + ffi.Pointer>)>>('execve'); + late final _execve = _execvePtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer>, + ffi.Pointer>)>(); - int CFCalendarGetOrdinalityOfUnit( - CFCalendarRef calendar, - int smallerUnit, - int biggerUnit, - double at, + int execvp( + ffi.Pointer __file, + ffi.Pointer> __argv, ) { - return _CFCalendarGetOrdinalityOfUnit( - calendar, - smallerUnit, - biggerUnit, - at, + return _execvp( + __file, + __argv, ); } - late final _CFCalendarGetOrdinalityOfUnitPtr = _lookup< + late final _execvpPtr = _lookup< ffi.NativeFunction< - CFIndex Function(CFCalendarRef, ffi.Int32, ffi.Int32, - CFAbsoluteTime)>>('CFCalendarGetOrdinalityOfUnit'); - late final _CFCalendarGetOrdinalityOfUnit = _CFCalendarGetOrdinalityOfUnitPtr - .asFunction(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer>)>>('execvp'); + late final _execvp = _execvpPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>)>(); - int CFCalendarGetTimeRangeOfUnit( - CFCalendarRef calendar, - int unit, - double at, - ffi.Pointer startp, - ffi.Pointer tip, - ) { - return _CFCalendarGetTimeRangeOfUnit( - calendar, - unit, - at, - startp, - tip, - ); + int fork() { + return _fork(); } - late final _CFCalendarGetTimeRangeOfUnitPtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFCalendarRef, - ffi.Int32, - CFAbsoluteTime, - ffi.Pointer, - ffi.Pointer)>>('CFCalendarGetTimeRangeOfUnit'); - late final _CFCalendarGetTimeRangeOfUnit = - _CFCalendarGetTimeRangeOfUnitPtr.asFunction< - int Function(CFCalendarRef, int, double, ffi.Pointer, - ffi.Pointer)>(); + late final _forkPtr = _lookup>('fork'); + late final _fork = _forkPtr.asFunction(); - int CFCalendarComposeAbsoluteTime( - CFCalendarRef calendar, - ffi.Pointer at, - ffi.Pointer componentDesc, + int fpathconf( + int arg0, + int arg1, ) { - return _CFCalendarComposeAbsoluteTime( - calendar, - at, - componentDesc, + return _fpathconf( + arg0, + arg1, ); } - late final _CFCalendarComposeAbsoluteTimePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFCalendarRef, ffi.Pointer, - ffi.Pointer)>>('CFCalendarComposeAbsoluteTime'); - late final _CFCalendarComposeAbsoluteTime = - _CFCalendarComposeAbsoluteTimePtr.asFunction< - int Function(CFCalendarRef, ffi.Pointer, - ffi.Pointer)>(); + late final _fpathconfPtr = + _lookup>( + 'fpathconf'); + late final _fpathconf = _fpathconfPtr.asFunction(); - int CFCalendarDecomposeAbsoluteTime( - CFCalendarRef calendar, - double at, - ffi.Pointer componentDesc, + ffi.Pointer getcwd( + ffi.Pointer arg0, + int arg1, ) { - return _CFCalendarDecomposeAbsoluteTime( - calendar, - at, - componentDesc, + return _getcwd( + arg0, + arg1, ); } - late final _CFCalendarDecomposeAbsoluteTimePtr = _lookup< + late final _getcwdPtr = _lookup< ffi.NativeFunction< - Boolean Function(CFCalendarRef, CFAbsoluteTime, - ffi.Pointer)>>('CFCalendarDecomposeAbsoluteTime'); - late final _CFCalendarDecomposeAbsoluteTime = - _CFCalendarDecomposeAbsoluteTimePtr.asFunction< - int Function(CFCalendarRef, double, ffi.Pointer)>(); + ffi.Pointer Function( + ffi.Pointer, ffi.Size)>>('getcwd'); + late final _getcwd = _getcwdPtr + .asFunction Function(ffi.Pointer, int)>(); - int CFCalendarAddComponents( - CFCalendarRef calendar, - ffi.Pointer at, - int options, - ffi.Pointer componentDesc, - ) { - return _CFCalendarAddComponents( - calendar, - at, - options, - componentDesc, - ); + int getegid() { + return _getegid(); } - late final _CFCalendarAddComponentsPtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFCalendarRef, - ffi.Pointer, - CFOptionFlags, - ffi.Pointer)>>('CFCalendarAddComponents'); - late final _CFCalendarAddComponents = _CFCalendarAddComponentsPtr.asFunction< - int Function(CFCalendarRef, ffi.Pointer, int, - ffi.Pointer)>(); + late final _getegidPtr = + _lookup>('getegid'); + late final _getegid = _getegidPtr.asFunction(); - int CFCalendarGetComponentDifference( - CFCalendarRef calendar, - double startingAT, - double resultAT, - int options, - ffi.Pointer componentDesc, - ) { - return _CFCalendarGetComponentDifference( - calendar, - startingAT, - resultAT, - options, - componentDesc, - ); + int geteuid() { + return _geteuid(); } - late final _CFCalendarGetComponentDifferencePtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFCalendarRef, - CFAbsoluteTime, - CFAbsoluteTime, - CFOptionFlags, - ffi.Pointer)>>('CFCalendarGetComponentDifference'); - late final _CFCalendarGetComponentDifference = - _CFCalendarGetComponentDifferencePtr.asFunction< - int Function( - CFCalendarRef, double, double, int, ffi.Pointer)>(); + late final _geteuidPtr = + _lookup>('geteuid'); + late final _geteuid = _geteuidPtr.asFunction(); - CFStringRef CFDateFormatterCreateDateFormatFromTemplate( - CFAllocatorRef allocator, - CFStringRef tmplate, - int options, - CFLocaleRef locale, + int getgid() { + return _getgid(); + } + + late final _getgidPtr = + _lookup>('getgid'); + late final _getgid = _getgidPtr.asFunction(); + + int getgroups( + int arg0, + ffi.Pointer arg1, ) { - return _CFDateFormatterCreateDateFormatFromTemplate( - allocator, - tmplate, - options, - locale, + return _getgroups( + arg0, + arg1, ); } - late final _CFDateFormatterCreateDateFormatFromTemplatePtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, CFOptionFlags, - CFLocaleRef)>>('CFDateFormatterCreateDateFormatFromTemplate'); - late final _CFDateFormatterCreateDateFormatFromTemplate = - _CFDateFormatterCreateDateFormatFromTemplatePtr.asFunction< - CFStringRef Function( - CFAllocatorRef, CFStringRef, int, CFLocaleRef)>(); + late final _getgroupsPtr = _lookup< + ffi.NativeFunction)>>( + 'getgroups'); + late final _getgroups = + _getgroupsPtr.asFunction)>(); - int CFDateFormatterGetTypeID() { - return _CFDateFormatterGetTypeID(); + ffi.Pointer getlogin() { + return _getlogin(); } - late final _CFDateFormatterGetTypeIDPtr = - _lookup>( - 'CFDateFormatterGetTypeID'); - late final _CFDateFormatterGetTypeID = - _CFDateFormatterGetTypeIDPtr.asFunction(); + late final _getloginPtr = + _lookup Function()>>('getlogin'); + late final _getlogin = + _getloginPtr.asFunction Function()>(); - CFDateFormatterRef CFDateFormatterCreateISO8601Formatter( - CFAllocatorRef allocator, - int formatOptions, - ) { - return _CFDateFormatterCreateISO8601Formatter( - allocator, - formatOptions, - ); + int getpgrp() { + return _getpgrp(); } - late final _CFDateFormatterCreateISO8601FormatterPtr = _lookup< - ffi.NativeFunction< - CFDateFormatterRef Function(CFAllocatorRef, - ffi.Int32)>>('CFDateFormatterCreateISO8601Formatter'); - late final _CFDateFormatterCreateISO8601Formatter = - _CFDateFormatterCreateISO8601FormatterPtr.asFunction< - CFDateFormatterRef Function(CFAllocatorRef, int)>(); + late final _getpgrpPtr = + _lookup>('getpgrp'); + late final _getpgrp = _getpgrpPtr.asFunction(); - CFDateFormatterRef CFDateFormatterCreate( - CFAllocatorRef allocator, - CFLocaleRef locale, - int dateStyle, - int timeStyle, - ) { - return _CFDateFormatterCreate( - allocator, - locale, - dateStyle, - timeStyle, - ); + int getpid() { + return _getpid(); } - late final _CFDateFormatterCreatePtr = _lookup< - ffi.NativeFunction< - CFDateFormatterRef Function(CFAllocatorRef, CFLocaleRef, ffi.Int32, - ffi.Int32)>>('CFDateFormatterCreate'); - late final _CFDateFormatterCreate = _CFDateFormatterCreatePtr.asFunction< - CFDateFormatterRef Function(CFAllocatorRef, CFLocaleRef, int, int)>(); + late final _getpidPtr = + _lookup>('getpid'); + late final _getpid = _getpidPtr.asFunction(); - CFLocaleRef CFDateFormatterGetLocale( - CFDateFormatterRef formatter, - ) { - return _CFDateFormatterGetLocale( - formatter, - ); + int getppid() { + return _getppid(); } - late final _CFDateFormatterGetLocalePtr = - _lookup>( - 'CFDateFormatterGetLocale'); - late final _CFDateFormatterGetLocale = _CFDateFormatterGetLocalePtr - .asFunction(); + late final _getppidPtr = + _lookup>('getppid'); + late final _getppid = _getppidPtr.asFunction(); - int CFDateFormatterGetDateStyle( - CFDateFormatterRef formatter, - ) { - return _CFDateFormatterGetDateStyle( - formatter, - ); + int getuid() { + return _getuid(); } - late final _CFDateFormatterGetDateStylePtr = - _lookup>( - 'CFDateFormatterGetDateStyle'); - late final _CFDateFormatterGetDateStyle = _CFDateFormatterGetDateStylePtr - .asFunction(); + late final _getuidPtr = + _lookup>('getuid'); + late final _getuid = _getuidPtr.asFunction(); - int CFDateFormatterGetTimeStyle( - CFDateFormatterRef formatter, + int isatty( + int arg0, ) { - return _CFDateFormatterGetTimeStyle( - formatter, + return _isatty( + arg0, ); } - late final _CFDateFormatterGetTimeStylePtr = - _lookup>( - 'CFDateFormatterGetTimeStyle'); - late final _CFDateFormatterGetTimeStyle = _CFDateFormatterGetTimeStylePtr - .asFunction(); + late final _isattyPtr = + _lookup>('isatty'); + late final _isatty = _isattyPtr.asFunction(); - CFStringRef CFDateFormatterGetFormat( - CFDateFormatterRef formatter, + int link( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _CFDateFormatterGetFormat( - formatter, + return _link( + arg0, + arg1, ); } - late final _CFDateFormatterGetFormatPtr = - _lookup>( - 'CFDateFormatterGetFormat'); - late final _CFDateFormatterGetFormat = _CFDateFormatterGetFormatPtr - .asFunction(); + late final _linkPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('link'); + late final _link = _linkPtr + .asFunction, ffi.Pointer)>(); - void CFDateFormatterSetFormat( - CFDateFormatterRef formatter, - CFStringRef formatString, + int lseek( + int arg0, + int arg1, + int arg2, ) { - return _CFDateFormatterSetFormat( - formatter, - formatString, + return _lseek( + arg0, + arg1, + arg2, ); } - late final _CFDateFormatterSetFormatPtr = _lookup< - ffi - .NativeFunction>( - 'CFDateFormatterSetFormat'); - late final _CFDateFormatterSetFormat = _CFDateFormatterSetFormatPtr - .asFunction(); + late final _lseekPtr = + _lookup>( + 'lseek'); + late final _lseek = _lseekPtr.asFunction(); - CFStringRef CFDateFormatterCreateStringWithDate( - CFAllocatorRef allocator, - CFDateFormatterRef formatter, - CFDateRef date, + int pathconf( + ffi.Pointer arg0, + int arg1, ) { - return _CFDateFormatterCreateStringWithDate( - allocator, - formatter, - date, + return _pathconf( + arg0, + arg1, ); } - late final _CFDateFormatterCreateStringWithDatePtr = _lookup< + late final _pathconfPtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFDateFormatterRef, - CFDateRef)>>('CFDateFormatterCreateStringWithDate'); - late final _CFDateFormatterCreateStringWithDate = - _CFDateFormatterCreateStringWithDatePtr.asFunction< - CFStringRef Function( - CFAllocatorRef, CFDateFormatterRef, CFDateRef)>(); + ffi.Long Function(ffi.Pointer, ffi.Int)>>('pathconf'); + late final _pathconf = + _pathconfPtr.asFunction, int)>(); - CFStringRef CFDateFormatterCreateStringWithAbsoluteTime( - CFAllocatorRef allocator, - CFDateFormatterRef formatter, - double at, + int pause() { + return _pause(); + } + + late final _pausePtr = + _lookup>('pause'); + late final _pause = _pausePtr.asFunction(); + + int pipe( + ffi.Pointer arg0, ) { - return _CFDateFormatterCreateStringWithAbsoluteTime( - allocator, - formatter, - at, + return _pipe( + arg0, ); } - late final _CFDateFormatterCreateStringWithAbsoluteTimePtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFDateFormatterRef, - CFAbsoluteTime)>>('CFDateFormatterCreateStringWithAbsoluteTime'); - late final _CFDateFormatterCreateStringWithAbsoluteTime = - _CFDateFormatterCreateStringWithAbsoluteTimePtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFDateFormatterRef, double)>(); + late final _pipePtr = + _lookup)>>( + 'pipe'); + late final _pipe = _pipePtr.asFunction)>(); - CFDateRef CFDateFormatterCreateDateFromString( - CFAllocatorRef allocator, - CFDateFormatterRef formatter, - CFStringRef string, - ffi.Pointer rangep, + int read( + int arg0, + ffi.Pointer arg1, + int arg2, ) { - return _CFDateFormatterCreateDateFromString( - allocator, - formatter, - string, - rangep, + return _read( + arg0, + arg1, + arg2, ); } - late final _CFDateFormatterCreateDateFromStringPtr = _lookup< + late final _readPtr = _lookup< ffi.NativeFunction< - CFDateRef Function(CFAllocatorRef, CFDateFormatterRef, CFStringRef, - ffi.Pointer)>>('CFDateFormatterCreateDateFromString'); - late final _CFDateFormatterCreateDateFromString = - _CFDateFormatterCreateDateFromStringPtr.asFunction< - CFDateRef Function(CFAllocatorRef, CFDateFormatterRef, CFStringRef, - ffi.Pointer)>(); + ssize_t Function(ffi.Int, ffi.Pointer, ffi.Size)>>('read'); + late final _read = + _readPtr.asFunction, int)>(); - int CFDateFormatterGetAbsoluteTimeFromString( - CFDateFormatterRef formatter, - CFStringRef string, - ffi.Pointer rangep, - ffi.Pointer atp, + int rmdir( + ffi.Pointer arg0, ) { - return _CFDateFormatterGetAbsoluteTimeFromString( - formatter, - string, - rangep, - atp, + return _rmdir( + arg0, ); } - late final _CFDateFormatterGetAbsoluteTimeFromStringPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFDateFormatterRef, CFStringRef, - ffi.Pointer, ffi.Pointer)>>( - 'CFDateFormatterGetAbsoluteTimeFromString'); - late final _CFDateFormatterGetAbsoluteTimeFromString = - _CFDateFormatterGetAbsoluteTimeFromStringPtr.asFunction< - int Function(CFDateFormatterRef, CFStringRef, ffi.Pointer, - ffi.Pointer)>(); + late final _rmdirPtr = + _lookup)>>( + 'rmdir'); + late final _rmdir = + _rmdirPtr.asFunction)>(); - void CFDateFormatterSetProperty( - CFDateFormatterRef formatter, - CFStringRef key, - CFTypeRef value, + int setgid( + int arg0, ) { - return _CFDateFormatterSetProperty( - formatter, - key, - value, + return _setgid( + arg0, ); } - late final _CFDateFormatterSetPropertyPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFDateFormatterRef, CFStringRef, - CFTypeRef)>>('CFDateFormatterSetProperty'); - late final _CFDateFormatterSetProperty = _CFDateFormatterSetPropertyPtr - .asFunction(); + late final _setgidPtr = + _lookup>('setgid'); + late final _setgid = _setgidPtr.asFunction(); - CFTypeRef CFDateFormatterCopyProperty( - CFDateFormatterRef formatter, - CFDateFormatterKey key, + int setpgid( + int arg0, + int arg1, ) { - return _CFDateFormatterCopyProperty( - formatter, - key, + return _setpgid( + arg0, + arg1, ); } - late final _CFDateFormatterCopyPropertyPtr = _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFDateFormatterRef, - CFDateFormatterKey)>>('CFDateFormatterCopyProperty'); - late final _CFDateFormatterCopyProperty = _CFDateFormatterCopyPropertyPtr - .asFunction(); - - late final ffi.Pointer _kCFDateFormatterIsLenient = - _lookup('kCFDateFormatterIsLenient'); - - CFDateFormatterKey get kCFDateFormatterIsLenient => - _kCFDateFormatterIsLenient.value; - - late final ffi.Pointer _kCFDateFormatterTimeZone = - _lookup('kCFDateFormatterTimeZone'); - - CFDateFormatterKey get kCFDateFormatterTimeZone => - _kCFDateFormatterTimeZone.value; - - late final ffi.Pointer _kCFDateFormatterCalendarName = - _lookup('kCFDateFormatterCalendarName'); - - CFDateFormatterKey get kCFDateFormatterCalendarName => - _kCFDateFormatterCalendarName.value; - - late final ffi.Pointer _kCFDateFormatterDefaultFormat = - _lookup('kCFDateFormatterDefaultFormat'); - - CFDateFormatterKey get kCFDateFormatterDefaultFormat => - _kCFDateFormatterDefaultFormat.value; - - late final ffi.Pointer - _kCFDateFormatterTwoDigitStartDate = - _lookup('kCFDateFormatterTwoDigitStartDate'); - - CFDateFormatterKey get kCFDateFormatterTwoDigitStartDate => - _kCFDateFormatterTwoDigitStartDate.value; - - late final ffi.Pointer _kCFDateFormatterDefaultDate = - _lookup('kCFDateFormatterDefaultDate'); - - CFDateFormatterKey get kCFDateFormatterDefaultDate => - _kCFDateFormatterDefaultDate.value; - - late final ffi.Pointer _kCFDateFormatterCalendar = - _lookup('kCFDateFormatterCalendar'); - - CFDateFormatterKey get kCFDateFormatterCalendar => - _kCFDateFormatterCalendar.value; - - late final ffi.Pointer _kCFDateFormatterEraSymbols = - _lookup('kCFDateFormatterEraSymbols'); - - CFDateFormatterKey get kCFDateFormatterEraSymbols => - _kCFDateFormatterEraSymbols.value; + late final _setpgidPtr = + _lookup>('setpgid'); + late final _setpgid = _setpgidPtr.asFunction(); - late final ffi.Pointer _kCFDateFormatterMonthSymbols = - _lookup('kCFDateFormatterMonthSymbols'); + int setsid() { + return _setsid(); + } - CFDateFormatterKey get kCFDateFormatterMonthSymbols => - _kCFDateFormatterMonthSymbols.value; + late final _setsidPtr = + _lookup>('setsid'); + late final _setsid = _setsidPtr.asFunction(); - late final ffi.Pointer - _kCFDateFormatterShortMonthSymbols = - _lookup('kCFDateFormatterShortMonthSymbols'); + int setuid( + int arg0, + ) { + return _setuid( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterShortMonthSymbols => - _kCFDateFormatterShortMonthSymbols.value; + late final _setuidPtr = + _lookup>('setuid'); + late final _setuid = _setuidPtr.asFunction(); - late final ffi.Pointer _kCFDateFormatterWeekdaySymbols = - _lookup('kCFDateFormatterWeekdaySymbols'); + int sleep( + int arg0, + ) { + return _sleep( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterWeekdaySymbols => - _kCFDateFormatterWeekdaySymbols.value; + late final _sleepPtr = + _lookup>( + 'sleep'); + late final _sleep = _sleepPtr.asFunction(); - late final ffi.Pointer - _kCFDateFormatterShortWeekdaySymbols = - _lookup('kCFDateFormatterShortWeekdaySymbols'); + int sysconf( + int arg0, + ) { + return _sysconf( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterShortWeekdaySymbols => - _kCFDateFormatterShortWeekdaySymbols.value; + late final _sysconfPtr = + _lookup>('sysconf'); + late final _sysconf = _sysconfPtr.asFunction(); - late final ffi.Pointer _kCFDateFormatterAMSymbol = - _lookup('kCFDateFormatterAMSymbol'); + int tcgetpgrp( + int arg0, + ) { + return _tcgetpgrp( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterAMSymbol => - _kCFDateFormatterAMSymbol.value; + late final _tcgetpgrpPtr = + _lookup>('tcgetpgrp'); + late final _tcgetpgrp = _tcgetpgrpPtr.asFunction(); - late final ffi.Pointer _kCFDateFormatterPMSymbol = - _lookup('kCFDateFormatterPMSymbol'); + int tcsetpgrp( + int arg0, + int arg1, + ) { + return _tcsetpgrp( + arg0, + arg1, + ); + } - CFDateFormatterKey get kCFDateFormatterPMSymbol => - _kCFDateFormatterPMSymbol.value; + late final _tcsetpgrpPtr = + _lookup>( + 'tcsetpgrp'); + late final _tcsetpgrp = _tcsetpgrpPtr.asFunction(); - late final ffi.Pointer _kCFDateFormatterLongEraSymbols = - _lookup('kCFDateFormatterLongEraSymbols'); + ffi.Pointer ttyname( + int arg0, + ) { + return _ttyname( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterLongEraSymbols => - _kCFDateFormatterLongEraSymbols.value; + late final _ttynamePtr = + _lookup Function(ffi.Int)>>( + 'ttyname'); + late final _ttyname = + _ttynamePtr.asFunction Function(int)>(); - late final ffi.Pointer - _kCFDateFormatterVeryShortMonthSymbols = - _lookup('kCFDateFormatterVeryShortMonthSymbols'); + int ttyname_r( + int arg0, + ffi.Pointer arg1, + int arg2, + ) { + return _ttyname_r( + arg0, + arg1, + arg2, + ); + } - CFDateFormatterKey get kCFDateFormatterVeryShortMonthSymbols => - _kCFDateFormatterVeryShortMonthSymbols.value; + late final _ttyname_rPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Size)>>('ttyname_r'); + late final _ttyname_r = + _ttyname_rPtr.asFunction, int)>(); - late final ffi.Pointer - _kCFDateFormatterStandaloneMonthSymbols = - _lookup('kCFDateFormatterStandaloneMonthSymbols'); + int unlink( + ffi.Pointer arg0, + ) { + return _unlink( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterStandaloneMonthSymbols => - _kCFDateFormatterStandaloneMonthSymbols.value; + late final _unlinkPtr = + _lookup)>>( + 'unlink'); + late final _unlink = + _unlinkPtr.asFunction)>(); - late final ffi.Pointer - _kCFDateFormatterShortStandaloneMonthSymbols = - _lookup( - 'kCFDateFormatterShortStandaloneMonthSymbols'); + int write( + int __fd, + ffi.Pointer __buf, + int __nbyte, + ) { + return _write( + __fd, + __buf, + __nbyte, + ); + } - CFDateFormatterKey get kCFDateFormatterShortStandaloneMonthSymbols => - _kCFDateFormatterShortStandaloneMonthSymbols.value; + late final _writePtr = _lookup< + ffi.NativeFunction< + ssize_t Function(ffi.Int, ffi.Pointer, ffi.Size)>>('write'); + late final _write = + _writePtr.asFunction, int)>(); - late final ffi.Pointer - _kCFDateFormatterVeryShortStandaloneMonthSymbols = - _lookup( - 'kCFDateFormatterVeryShortStandaloneMonthSymbols'); + int confstr( + int arg0, + ffi.Pointer arg1, + int arg2, + ) { + return _confstr( + arg0, + arg1, + arg2, + ); + } - CFDateFormatterKey get kCFDateFormatterVeryShortStandaloneMonthSymbols => - _kCFDateFormatterVeryShortStandaloneMonthSymbols.value; + late final _confstrPtr = _lookup< + ffi.NativeFunction< + ffi.Size Function( + ffi.Int, ffi.Pointer, ffi.Size)>>('confstr'); + late final _confstr = + _confstrPtr.asFunction, int)>(); - late final ffi.Pointer - _kCFDateFormatterVeryShortWeekdaySymbols = - _lookup('kCFDateFormatterVeryShortWeekdaySymbols'); + int getopt( + int arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, + ) { + return _getopt( + arg0, + arg1, + arg2, + ); + } - CFDateFormatterKey get kCFDateFormatterVeryShortWeekdaySymbols => - _kCFDateFormatterVeryShortWeekdaySymbols.value; + late final _getoptPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer>, + ffi.Pointer)>>('getopt'); + late final _getopt = _getoptPtr.asFunction< + int Function( + int, ffi.Pointer>, ffi.Pointer)>(); - late final ffi.Pointer - _kCFDateFormatterStandaloneWeekdaySymbols = - _lookup('kCFDateFormatterStandaloneWeekdaySymbols'); + late final ffi.Pointer> _optarg = + _lookup>('optarg'); - CFDateFormatterKey get kCFDateFormatterStandaloneWeekdaySymbols => - _kCFDateFormatterStandaloneWeekdaySymbols.value; + ffi.Pointer get optarg => _optarg.value; - late final ffi.Pointer - _kCFDateFormatterShortStandaloneWeekdaySymbols = - _lookup( - 'kCFDateFormatterShortStandaloneWeekdaySymbols'); + set optarg(ffi.Pointer value) => _optarg.value = value; - CFDateFormatterKey get kCFDateFormatterShortStandaloneWeekdaySymbols => - _kCFDateFormatterShortStandaloneWeekdaySymbols.value; + late final ffi.Pointer _optind = _lookup('optind'); - late final ffi.Pointer - _kCFDateFormatterVeryShortStandaloneWeekdaySymbols = - _lookup( - 'kCFDateFormatterVeryShortStandaloneWeekdaySymbols'); + int get optind => _optind.value; - CFDateFormatterKey get kCFDateFormatterVeryShortStandaloneWeekdaySymbols => - _kCFDateFormatterVeryShortStandaloneWeekdaySymbols.value; + set optind(int value) => _optind.value = value; - late final ffi.Pointer _kCFDateFormatterQuarterSymbols = - _lookup('kCFDateFormatterQuarterSymbols'); + late final ffi.Pointer _opterr = _lookup('opterr'); - CFDateFormatterKey get kCFDateFormatterQuarterSymbols => - _kCFDateFormatterQuarterSymbols.value; + int get opterr => _opterr.value; - late final ffi.Pointer - _kCFDateFormatterShortQuarterSymbols = - _lookup('kCFDateFormatterShortQuarterSymbols'); + set opterr(int value) => _opterr.value = value; - CFDateFormatterKey get kCFDateFormatterShortQuarterSymbols => - _kCFDateFormatterShortQuarterSymbols.value; + late final ffi.Pointer _optopt = _lookup('optopt'); - late final ffi.Pointer - _kCFDateFormatterStandaloneQuarterSymbols = - _lookup('kCFDateFormatterStandaloneQuarterSymbols'); + int get optopt => _optopt.value; - CFDateFormatterKey get kCFDateFormatterStandaloneQuarterSymbols => - _kCFDateFormatterStandaloneQuarterSymbols.value; + set optopt(int value) => _optopt.value = value; - late final ffi.Pointer - _kCFDateFormatterShortStandaloneQuarterSymbols = - _lookup( - 'kCFDateFormatterShortStandaloneQuarterSymbols'); + ffi.Pointer brk( + ffi.Pointer arg0, + ) { + return _brk( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterShortStandaloneQuarterSymbols => - _kCFDateFormatterShortStandaloneQuarterSymbols.value; + late final _brkPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('brk'); + late final _brk = _brkPtr + .asFunction Function(ffi.Pointer)>(); - late final ffi.Pointer - _kCFDateFormatterGregorianStartDate = - _lookup('kCFDateFormatterGregorianStartDate'); + int chroot( + ffi.Pointer arg0, + ) { + return _chroot( + arg0, + ); + } - CFDateFormatterKey get kCFDateFormatterGregorianStartDate => - _kCFDateFormatterGregorianStartDate.value; + late final _chrootPtr = + _lookup)>>( + 'chroot'); + late final _chroot = + _chrootPtr.asFunction)>(); - late final ffi.Pointer - _kCFDateFormatterDoesRelativeDateFormattingKey = - _lookup( - 'kCFDateFormatterDoesRelativeDateFormattingKey'); + ffi.Pointer crypt( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _crypt( + arg0, + arg1, + ); + } - CFDateFormatterKey get kCFDateFormatterDoesRelativeDateFormattingKey => - _kCFDateFormatterDoesRelativeDateFormattingKey.value; + late final _cryptPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('crypt'); + late final _crypt = _cryptPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _kCFBooleanTrue = - _lookup('kCFBooleanTrue'); + void encrypt( + ffi.Pointer arg0, + int arg1, + ) { + return _encrypt( + arg0, + arg1, + ); + } - CFBooleanRef get kCFBooleanTrue => _kCFBooleanTrue.value; + late final _encryptPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int)>>('encrypt'); + late final _encrypt = + _encryptPtr.asFunction, int)>(); - late final ffi.Pointer _kCFBooleanFalse = - _lookup('kCFBooleanFalse'); + int fchdir( + int arg0, + ) { + return _fchdir( + arg0, + ); + } - CFBooleanRef get kCFBooleanFalse => _kCFBooleanFalse.value; + late final _fchdirPtr = + _lookup>('fchdir'); + late final _fchdir = _fchdirPtr.asFunction(); - int CFBooleanGetTypeID() { - return _CFBooleanGetTypeID(); + int gethostid() { + return _gethostid(); } - late final _CFBooleanGetTypeIDPtr = - _lookup>('CFBooleanGetTypeID'); - late final _CFBooleanGetTypeID = - _CFBooleanGetTypeIDPtr.asFunction(); + late final _gethostidPtr = + _lookup>('gethostid'); + late final _gethostid = _gethostidPtr.asFunction(); - int CFBooleanGetValue( - CFBooleanRef boolean, + int getpgid( + int arg0, ) { - return _CFBooleanGetValue( - boolean, + return _getpgid( + arg0, ); } - late final _CFBooleanGetValuePtr = - _lookup>( - 'CFBooleanGetValue'); - late final _CFBooleanGetValue = - _CFBooleanGetValuePtr.asFunction(); - - late final ffi.Pointer _kCFNumberPositiveInfinity = - _lookup('kCFNumberPositiveInfinity'); - - CFNumberRef get kCFNumberPositiveInfinity => _kCFNumberPositiveInfinity.value; + late final _getpgidPtr = + _lookup>('getpgid'); + late final _getpgid = _getpgidPtr.asFunction(); - late final ffi.Pointer _kCFNumberNegativeInfinity = - _lookup('kCFNumberNegativeInfinity'); + int getsid( + int arg0, + ) { + return _getsid( + arg0, + ); + } - CFNumberRef get kCFNumberNegativeInfinity => _kCFNumberNegativeInfinity.value; + late final _getsidPtr = + _lookup>('getsid'); + late final _getsid = _getsidPtr.asFunction(); - late final ffi.Pointer _kCFNumberNaN = - _lookup('kCFNumberNaN'); + int getdtablesize() { + return _getdtablesize(); + } - CFNumberRef get kCFNumberNaN => _kCFNumberNaN.value; + late final _getdtablesizePtr = + _lookup>('getdtablesize'); + late final _getdtablesize = _getdtablesizePtr.asFunction(); - int CFNumberGetTypeID() { - return _CFNumberGetTypeID(); + int getpagesize() { + return _getpagesize(); } - late final _CFNumberGetTypeIDPtr = - _lookup>('CFNumberGetTypeID'); - late final _CFNumberGetTypeID = - _CFNumberGetTypeIDPtr.asFunction(); + late final _getpagesizePtr = + _lookup>('getpagesize'); + late final _getpagesize = _getpagesizePtr.asFunction(); - CFNumberRef CFNumberCreate( - CFAllocatorRef allocator, - int theType, - ffi.Pointer valuePtr, + ffi.Pointer getpass( + ffi.Pointer arg0, ) { - return _CFNumberCreate( - allocator, - theType, - valuePtr, + return _getpass( + arg0, ); } - late final _CFNumberCreatePtr = _lookup< + late final _getpassPtr = _lookup< ffi.NativeFunction< - CFNumberRef Function(CFAllocatorRef, ffi.Int32, - ffi.Pointer)>>('CFNumberCreate'); - late final _CFNumberCreate = _CFNumberCreatePtr.asFunction< - CFNumberRef Function(CFAllocatorRef, int, ffi.Pointer)>(); + ffi.Pointer Function(ffi.Pointer)>>('getpass'); + late final _getpass = _getpassPtr + .asFunction Function(ffi.Pointer)>(); - int CFNumberGetType( - CFNumberRef number, + ffi.Pointer getwd( + ffi.Pointer arg0, ) { - return _CFNumberGetType( - number, + return _getwd( + arg0, ); } - late final _CFNumberGetTypePtr = - _lookup>( - 'CFNumberGetType'); - late final _CFNumberGetType = - _CFNumberGetTypePtr.asFunction(); + late final _getwdPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('getwd'); + late final _getwd = _getwdPtr + .asFunction Function(ffi.Pointer)>(); - int CFNumberGetByteSize( - CFNumberRef number, + int lchown( + ffi.Pointer arg0, + int arg1, + int arg2, ) { - return _CFNumberGetByteSize( - number, + return _lchown( + arg0, + arg1, + arg2, ); } - late final _CFNumberGetByteSizePtr = - _lookup>( - 'CFNumberGetByteSize'); - late final _CFNumberGetByteSize = - _CFNumberGetByteSizePtr.asFunction(); - - int CFNumberIsFloatType( - CFNumberRef number, - ) { - return _CFNumberIsFloatType( - number, + late final _lchownPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, uid_t, gid_t)>>('lchown'); + late final _lchown = + _lchownPtr.asFunction, int, int)>(); + + int lockf( + int arg0, + int arg1, + int arg2, + ) { + return _lockf( + arg0, + arg1, + arg2, ); } - late final _CFNumberIsFloatTypePtr = - _lookup>( - 'CFNumberIsFloatType'); - late final _CFNumberIsFloatType = - _CFNumberIsFloatTypePtr.asFunction(); + late final _lockfPtr = + _lookup>( + 'lockf'); + late final _lockf = _lockfPtr.asFunction(); - int CFNumberGetValue( - CFNumberRef number, - int theType, - ffi.Pointer valuePtr, + int nice( + int arg0, ) { - return _CFNumberGetValue( - number, - theType, - valuePtr, + return _nice( + arg0, ); } - late final _CFNumberGetValuePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFNumberRef, ffi.Int32, - ffi.Pointer)>>('CFNumberGetValue'); - late final _CFNumberGetValue = _CFNumberGetValuePtr.asFunction< - int Function(CFNumberRef, int, ffi.Pointer)>(); + late final _nicePtr = + _lookup>('nice'); + late final _nice = _nicePtr.asFunction(); - int CFNumberCompare( - CFNumberRef number, - CFNumberRef otherNumber, - ffi.Pointer context, + int pread( + int __fd, + ffi.Pointer __buf, + int __nbyte, + int __offset, ) { - return _CFNumberCompare( - number, - otherNumber, - context, + return _pread( + __fd, + __buf, + __nbyte, + __offset, ); } - late final _CFNumberComparePtr = _lookup< + late final _preadPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CFNumberRef, CFNumberRef, - ffi.Pointer)>>('CFNumberCompare'); - late final _CFNumberCompare = _CFNumberComparePtr.asFunction< - int Function(CFNumberRef, CFNumberRef, ffi.Pointer)>(); + ssize_t Function( + ffi.Int, ffi.Pointer, ffi.Size, off_t)>>('pread'); + late final _pread = _preadPtr + .asFunction, int, int)>(); - int CFNumberFormatterGetTypeID() { - return _CFNumberFormatterGetTypeID(); + int pwrite( + int __fd, + ffi.Pointer __buf, + int __nbyte, + int __offset, + ) { + return _pwrite( + __fd, + __buf, + __nbyte, + __offset, + ); } - late final _CFNumberFormatterGetTypeIDPtr = - _lookup>( - 'CFNumberFormatterGetTypeID'); - late final _CFNumberFormatterGetTypeID = - _CFNumberFormatterGetTypeIDPtr.asFunction(); + late final _pwritePtr = _lookup< + ffi.NativeFunction< + ssize_t Function( + ffi.Int, ffi.Pointer, ffi.Size, off_t)>>('pwrite'); + late final _pwrite = _pwritePtr + .asFunction, int, int)>(); - CFNumberFormatterRef CFNumberFormatterCreate( - CFAllocatorRef allocator, - CFLocaleRef locale, - int style, + ffi.Pointer sbrk( + int arg0, ) { - return _CFNumberFormatterCreate( - allocator, - locale, - style, + return _sbrk( + arg0, ); } - late final _CFNumberFormatterCreatePtr = _lookup< - ffi.NativeFunction< - CFNumberFormatterRef Function(CFAllocatorRef, CFLocaleRef, - ffi.Int32)>>('CFNumberFormatterCreate'); - late final _CFNumberFormatterCreate = _CFNumberFormatterCreatePtr.asFunction< - CFNumberFormatterRef Function(CFAllocatorRef, CFLocaleRef, int)>(); + late final _sbrkPtr = + _lookup Function(ffi.Int)>>( + 'sbrk'); + late final _sbrk = _sbrkPtr.asFunction Function(int)>(); - CFLocaleRef CFNumberFormatterGetLocale( - CFNumberFormatterRef formatter, + int setpgrp() { + return _setpgrp(); + } + + late final _setpgrpPtr = + _lookup>('setpgrp'); + late final _setpgrp = _setpgrpPtr.asFunction(); + + int setregid( + int arg0, + int arg1, ) { - return _CFNumberFormatterGetLocale( - formatter, + return _setregid( + arg0, + arg1, ); } - late final _CFNumberFormatterGetLocalePtr = - _lookup>( - 'CFNumberFormatterGetLocale'); - late final _CFNumberFormatterGetLocale = _CFNumberFormatterGetLocalePtr - .asFunction(); + late final _setregidPtr = + _lookup>('setregid'); + late final _setregid = _setregidPtr.asFunction(); - int CFNumberFormatterGetStyle( - CFNumberFormatterRef formatter, + int setreuid( + int arg0, + int arg1, ) { - return _CFNumberFormatterGetStyle( - formatter, + return _setreuid( + arg0, + arg1, ); } - late final _CFNumberFormatterGetStylePtr = - _lookup>( - 'CFNumberFormatterGetStyle'); - late final _CFNumberFormatterGetStyle = _CFNumberFormatterGetStylePtr - .asFunction(); + late final _setreuidPtr = + _lookup>('setreuid'); + late final _setreuid = _setreuidPtr.asFunction(); - CFStringRef CFNumberFormatterGetFormat( - CFNumberFormatterRef formatter, + void sync1() { + return _sync1(); + } + + late final _sync1Ptr = + _lookup>('sync'); + late final _sync1 = _sync1Ptr.asFunction(); + + int truncate( + ffi.Pointer arg0, + int arg1, ) { - return _CFNumberFormatterGetFormat( - formatter, + return _truncate( + arg0, + arg1, ); } - late final _CFNumberFormatterGetFormatPtr = - _lookup>( - 'CFNumberFormatterGetFormat'); - late final _CFNumberFormatterGetFormat = _CFNumberFormatterGetFormatPtr - .asFunction(); + late final _truncatePtr = _lookup< + ffi.NativeFunction, off_t)>>( + 'truncate'); + late final _truncate = + _truncatePtr.asFunction, int)>(); - void CFNumberFormatterSetFormat( - CFNumberFormatterRef formatter, - CFStringRef formatString, + int ualarm( + int arg0, + int arg1, ) { - return _CFNumberFormatterSetFormat( - formatter, - formatString, + return _ualarm( + arg0, + arg1, ); } - late final _CFNumberFormatterSetFormatPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFNumberFormatterRef, - CFStringRef)>>('CFNumberFormatterSetFormat'); - late final _CFNumberFormatterSetFormat = _CFNumberFormatterSetFormatPtr - .asFunction(); + late final _ualarmPtr = + _lookup>( + 'ualarm'); + late final _ualarm = _ualarmPtr.asFunction(); - CFStringRef CFNumberFormatterCreateStringWithNumber( - CFAllocatorRef allocator, - CFNumberFormatterRef formatter, - CFNumberRef number, + int usleep( + int arg0, ) { - return _CFNumberFormatterCreateStringWithNumber( - allocator, - formatter, - number, + return _usleep( + arg0, ); } - late final _CFNumberFormatterCreateStringWithNumberPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFNumberFormatterRef, - CFNumberRef)>>('CFNumberFormatterCreateStringWithNumber'); - late final _CFNumberFormatterCreateStringWithNumber = - _CFNumberFormatterCreateStringWithNumberPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, CFNumberFormatterRef, CFNumberRef)>(); + late final _usleepPtr = + _lookup>('usleep'); + late final _usleep = _usleepPtr.asFunction(); - CFStringRef CFNumberFormatterCreateStringWithValue( - CFAllocatorRef allocator, - CFNumberFormatterRef formatter, - int numberType, - ffi.Pointer valuePtr, + int vfork() { + return _vfork(); + } + + late final _vforkPtr = + _lookup>('vfork'); + late final _vfork = _vforkPtr.asFunction(); + + int fsync( + int arg0, ) { - return _CFNumberFormatterCreateStringWithValue( - allocator, - formatter, - numberType, - valuePtr, + return _fsync( + arg0, ); } - late final _CFNumberFormatterCreateStringWithValuePtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFNumberFormatterRef, - ffi.Int32, ffi.Pointer)>>( - 'CFNumberFormatterCreateStringWithValue'); - late final _CFNumberFormatterCreateStringWithValue = - _CFNumberFormatterCreateStringWithValuePtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFNumberFormatterRef, int, - ffi.Pointer)>(); + late final _fsyncPtr = + _lookup>('fsync'); + late final _fsync = _fsyncPtr.asFunction(); - CFNumberRef CFNumberFormatterCreateNumberFromString( - CFAllocatorRef allocator, - CFNumberFormatterRef formatter, - CFStringRef string, - ffi.Pointer rangep, - int options, + int ftruncate( + int arg0, + int arg1, ) { - return _CFNumberFormatterCreateNumberFromString( - allocator, - formatter, - string, - rangep, - options, + return _ftruncate( + arg0, + arg1, ); } - late final _CFNumberFormatterCreateNumberFromStringPtr = _lookup< - ffi.NativeFunction< - CFNumberRef Function( - CFAllocatorRef, - CFNumberFormatterRef, - CFStringRef, - ffi.Pointer, - CFOptionFlags)>>('CFNumberFormatterCreateNumberFromString'); - late final _CFNumberFormatterCreateNumberFromString = - _CFNumberFormatterCreateNumberFromStringPtr.asFunction< - CFNumberRef Function(CFAllocatorRef, CFNumberFormatterRef, - CFStringRef, ffi.Pointer, int)>(); + late final _ftruncatePtr = + _lookup>( + 'ftruncate'); + late final _ftruncate = _ftruncatePtr.asFunction(); - int CFNumberFormatterGetValueFromString( - CFNumberFormatterRef formatter, - CFStringRef string, - ffi.Pointer rangep, - int numberType, - ffi.Pointer valuePtr, + int getlogin_r( + ffi.Pointer arg0, + int arg1, ) { - return _CFNumberFormatterGetValueFromString( - formatter, - string, - rangep, - numberType, - valuePtr, + return _getlogin_r( + arg0, + arg1, ); } - late final _CFNumberFormatterGetValueFromStringPtr = _lookup< + late final _getlogin_rPtr = _lookup< ffi.NativeFunction< - Boolean Function( - CFNumberFormatterRef, - CFStringRef, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('CFNumberFormatterGetValueFromString'); - late final _CFNumberFormatterGetValueFromString = - _CFNumberFormatterGetValueFromStringPtr.asFunction< - int Function(CFNumberFormatterRef, CFStringRef, ffi.Pointer, - int, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Size)>>('getlogin_r'); + late final _getlogin_r = + _getlogin_rPtr.asFunction, int)>(); - void CFNumberFormatterSetProperty( - CFNumberFormatterRef formatter, - CFNumberFormatterKey key, - CFTypeRef value, + int fchown( + int arg0, + int arg1, + int arg2, ) { - return _CFNumberFormatterSetProperty( - formatter, - key, - value, + return _fchown( + arg0, + arg1, + arg2, ); } - late final _CFNumberFormatterSetPropertyPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFNumberFormatterRef, CFNumberFormatterKey, - CFTypeRef)>>('CFNumberFormatterSetProperty'); - late final _CFNumberFormatterSetProperty = - _CFNumberFormatterSetPropertyPtr.asFunction< - void Function( - CFNumberFormatterRef, CFNumberFormatterKey, CFTypeRef)>(); + late final _fchownPtr = + _lookup>( + 'fchown'); + late final _fchown = _fchownPtr.asFunction(); - CFTypeRef CFNumberFormatterCopyProperty( - CFNumberFormatterRef formatter, - CFNumberFormatterKey key, + int gethostname( + ffi.Pointer arg0, + int arg1, ) { - return _CFNumberFormatterCopyProperty( - formatter, - key, + return _gethostname( + arg0, + arg1, ); } - late final _CFNumberFormatterCopyPropertyPtr = _lookup< + late final _gethostnamePtr = _lookup< ffi.NativeFunction< - CFTypeRef Function(CFNumberFormatterRef, - CFNumberFormatterKey)>>('CFNumberFormatterCopyProperty'); - late final _CFNumberFormatterCopyProperty = - _CFNumberFormatterCopyPropertyPtr.asFunction< - CFTypeRef Function(CFNumberFormatterRef, CFNumberFormatterKey)>(); - - late final ffi.Pointer _kCFNumberFormatterCurrencyCode = - _lookup('kCFNumberFormatterCurrencyCode'); - - CFNumberFormatterKey get kCFNumberFormatterCurrencyCode => - _kCFNumberFormatterCurrencyCode.value; + ffi.Int Function(ffi.Pointer, ffi.Size)>>('gethostname'); + late final _gethostname = + _gethostnamePtr.asFunction, int)>(); - late final ffi.Pointer - _kCFNumberFormatterDecimalSeparator = - _lookup('kCFNumberFormatterDecimalSeparator'); + int readlink( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, + ) { + return _readlink( + arg0, + arg1, + arg2, + ); + } - CFNumberFormatterKey get kCFNumberFormatterDecimalSeparator => - _kCFNumberFormatterDecimalSeparator.value; + late final _readlinkPtr = _lookup< + ffi.NativeFunction< + ssize_t Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('readlink'); + late final _readlink = _readlinkPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - late final ffi.Pointer - _kCFNumberFormatterCurrencyDecimalSeparator = - _lookup( - 'kCFNumberFormatterCurrencyDecimalSeparator'); + int setegid( + int arg0, + ) { + return _setegid( + arg0, + ); + } - CFNumberFormatterKey get kCFNumberFormatterCurrencyDecimalSeparator => - _kCFNumberFormatterCurrencyDecimalSeparator.value; + late final _setegidPtr = + _lookup>('setegid'); + late final _setegid = _setegidPtr.asFunction(); - late final ffi.Pointer - _kCFNumberFormatterAlwaysShowDecimalSeparator = - _lookup( - 'kCFNumberFormatterAlwaysShowDecimalSeparator'); + int seteuid( + int arg0, + ) { + return _seteuid( + arg0, + ); + } - CFNumberFormatterKey get kCFNumberFormatterAlwaysShowDecimalSeparator => - _kCFNumberFormatterAlwaysShowDecimalSeparator.value; + late final _seteuidPtr = + _lookup>('seteuid'); + late final _seteuid = _seteuidPtr.asFunction(); - late final ffi.Pointer - _kCFNumberFormatterGroupingSeparator = - _lookup('kCFNumberFormatterGroupingSeparator'); + int symlink( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _symlink( + arg0, + arg1, + ); + } - CFNumberFormatterKey get kCFNumberFormatterGroupingSeparator => - _kCFNumberFormatterGroupingSeparator.value; + late final _symlinkPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('symlink'); + late final _symlink = _symlinkPtr + .asFunction, ffi.Pointer)>(); - late final ffi.Pointer - _kCFNumberFormatterUseGroupingSeparator = - _lookup('kCFNumberFormatterUseGroupingSeparator'); + int pselect( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + ) { + return _pselect( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + ); + } - CFNumberFormatterKey get kCFNumberFormatterUseGroupingSeparator => - _kCFNumberFormatterUseGroupingSeparator.value; + late final _pselectPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('pselect'); + late final _pselect = _pselectPtr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer - _kCFNumberFormatterPercentSymbol = - _lookup('kCFNumberFormatterPercentSymbol'); + int select( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ) { + return _select( + arg0, + arg1, + arg2, + arg3, + arg4, + ); + } - CFNumberFormatterKey get kCFNumberFormatterPercentSymbol => - _kCFNumberFormatterPercentSymbol.value; + late final _selectPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>>('select'); + late final _select = _selectPtr.asFunction< + int Function(int, ffi.Pointer, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - late final ffi.Pointer _kCFNumberFormatterZeroSymbol = - _lookup('kCFNumberFormatterZeroSymbol'); - - CFNumberFormatterKey get kCFNumberFormatterZeroSymbol => - _kCFNumberFormatterZeroSymbol.value; - - late final ffi.Pointer _kCFNumberFormatterNaNSymbol = - _lookup('kCFNumberFormatterNaNSymbol'); - - CFNumberFormatterKey get kCFNumberFormatterNaNSymbol => - _kCFNumberFormatterNaNSymbol.value; + int accessx_np( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, + ) { + return _accessx_np( + arg0, + arg1, + arg2, + arg3, + ); + } - late final ffi.Pointer - _kCFNumberFormatterInfinitySymbol = - _lookup('kCFNumberFormatterInfinitySymbol'); + late final _accessx_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Size, + ffi.Pointer, uid_t)>>('accessx_np'); + late final _accessx_np = _accessx_npPtr.asFunction< + int Function( + ffi.Pointer, int, ffi.Pointer, int)>(); - CFNumberFormatterKey get kCFNumberFormatterInfinitySymbol => - _kCFNumberFormatterInfinitySymbol.value; + int acct( + ffi.Pointer arg0, + ) { + return _acct( + arg0, + ); + } - late final ffi.Pointer _kCFNumberFormatterMinusSign = - _lookup('kCFNumberFormatterMinusSign'); + late final _acctPtr = + _lookup)>>( + 'acct'); + late final _acct = _acctPtr.asFunction)>(); - CFNumberFormatterKey get kCFNumberFormatterMinusSign => - _kCFNumberFormatterMinusSign.value; + int add_profil( + ffi.Pointer arg0, + int arg1, + int arg2, + int arg3, + ) { + return _add_profil( + arg0, + arg1, + arg2, + arg3, + ); + } - late final ffi.Pointer _kCFNumberFormatterPlusSign = - _lookup('kCFNumberFormatterPlusSign'); + late final _add_profilPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Size, ffi.UnsignedLong, + ffi.UnsignedInt)>>('add_profil'); + late final _add_profil = _add_profilPtr + .asFunction, int, int, int)>(); - CFNumberFormatterKey get kCFNumberFormatterPlusSign => - _kCFNumberFormatterPlusSign.value; + void endusershell() { + return _endusershell(); + } - late final ffi.Pointer - _kCFNumberFormatterCurrencySymbol = - _lookup('kCFNumberFormatterCurrencySymbol'); + late final _endusershellPtr = + _lookup>('endusershell'); + late final _endusershell = _endusershellPtr.asFunction(); - CFNumberFormatterKey get kCFNumberFormatterCurrencySymbol => - _kCFNumberFormatterCurrencySymbol.value; + int execvP( + ffi.Pointer __file, + ffi.Pointer __searchpath, + ffi.Pointer> __argv, + ) { + return _execvP( + __file, + __searchpath, + __argv, + ); + } - late final ffi.Pointer - _kCFNumberFormatterExponentSymbol = - _lookup('kCFNumberFormatterExponentSymbol'); + late final _execvPPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('execvP'); + late final _execvP = _execvPPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); - CFNumberFormatterKey get kCFNumberFormatterExponentSymbol => - _kCFNumberFormatterExponentSymbol.value; + ffi.Pointer fflagstostr( + int arg0, + ) { + return _fflagstostr( + arg0, + ); + } - late final ffi.Pointer - _kCFNumberFormatterMinIntegerDigits = - _lookup('kCFNumberFormatterMinIntegerDigits'); + late final _fflagstostrPtr = _lookup< + ffi.NativeFunction Function(ffi.UnsignedLong)>>( + 'fflagstostr'); + late final _fflagstostr = + _fflagstostrPtr.asFunction Function(int)>(); - CFNumberFormatterKey get kCFNumberFormatterMinIntegerDigits => - _kCFNumberFormatterMinIntegerDigits.value; + int getdomainname( + ffi.Pointer arg0, + int arg1, + ) { + return _getdomainname( + arg0, + arg1, + ); + } - late final ffi.Pointer - _kCFNumberFormatterMaxIntegerDigits = - _lookup('kCFNumberFormatterMaxIntegerDigits'); + late final _getdomainnamePtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'getdomainname'); + late final _getdomainname = + _getdomainnamePtr.asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterMaxIntegerDigits => - _kCFNumberFormatterMaxIntegerDigits.value; + int getgrouplist( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + return _getgrouplist( + arg0, + arg1, + arg2, + arg3, + ); + } - late final ffi.Pointer - _kCFNumberFormatterMinFractionDigits = - _lookup('kCFNumberFormatterMinFractionDigits'); + late final _getgrouplistPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Pointer, + ffi.Pointer)>>('getgrouplist'); + late final _getgrouplist = _getgrouplistPtr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer, + ffi.Pointer)>(); - CFNumberFormatterKey get kCFNumberFormatterMinFractionDigits => - _kCFNumberFormatterMinFractionDigits.value; + int gethostuuid( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _gethostuuid( + arg0, + arg1, + ); + } - late final ffi.Pointer - _kCFNumberFormatterMaxFractionDigits = - _lookup('kCFNumberFormatterMaxFractionDigits'); + late final _gethostuuidPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('gethostuuid'); + late final _gethostuuid = _gethostuuidPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - CFNumberFormatterKey get kCFNumberFormatterMaxFractionDigits => - _kCFNumberFormatterMaxFractionDigits.value; + int getmode( + ffi.Pointer arg0, + int arg1, + ) { + return _getmode( + arg0, + arg1, + ); + } - late final ffi.Pointer _kCFNumberFormatterGroupingSize = - _lookup('kCFNumberFormatterGroupingSize'); + late final _getmodePtr = _lookup< + ffi.NativeFunction, mode_t)>>( + 'getmode'); + late final _getmode = + _getmodePtr.asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterGroupingSize => - _kCFNumberFormatterGroupingSize.value; + int getpeereid( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ) { + return _getpeereid( + arg0, + arg1, + arg2, + ); + } - late final ffi.Pointer - _kCFNumberFormatterSecondaryGroupingSize = - _lookup('kCFNumberFormatterSecondaryGroupingSize'); + late final _getpeereidPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Pointer)>>('getpeereid'); + late final _getpeereid = _getpeereidPtr + .asFunction, ffi.Pointer)>(); - CFNumberFormatterKey get kCFNumberFormatterSecondaryGroupingSize => - _kCFNumberFormatterSecondaryGroupingSize.value; + int getsgroups_np( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _getsgroups_np( + arg0, + arg1, + ); + } - late final ffi.Pointer _kCFNumberFormatterRoundingMode = - _lookup('kCFNumberFormatterRoundingMode'); + late final _getsgroups_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('getsgroups_np'); + late final _getsgroups_np = _getsgroups_npPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - CFNumberFormatterKey get kCFNumberFormatterRoundingMode => - _kCFNumberFormatterRoundingMode.value; + ffi.Pointer getusershell() { + return _getusershell(); + } - late final ffi.Pointer - _kCFNumberFormatterRoundingIncrement = - _lookup('kCFNumberFormatterRoundingIncrement'); + late final _getusershellPtr = + _lookup Function()>>( + 'getusershell'); + late final _getusershell = + _getusershellPtr.asFunction Function()>(); - CFNumberFormatterKey get kCFNumberFormatterRoundingIncrement => - _kCFNumberFormatterRoundingIncrement.value; + int getwgroups_np( + ffi.Pointer arg0, + ffi.Pointer arg1, + ) { + return _getwgroups_np( + arg0, + arg1, + ); + } - late final ffi.Pointer _kCFNumberFormatterFormatWidth = - _lookup('kCFNumberFormatterFormatWidth'); + late final _getwgroups_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('getwgroups_np'); + late final _getwgroups_np = _getwgroups_npPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - CFNumberFormatterKey get kCFNumberFormatterFormatWidth => - _kCFNumberFormatterFormatWidth.value; + int initgroups( + ffi.Pointer arg0, + int arg1, + ) { + return _initgroups( + arg0, + arg1, + ); + } - late final ffi.Pointer - _kCFNumberFormatterPaddingPosition = - _lookup('kCFNumberFormatterPaddingPosition'); + late final _initgroupsPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'initgroups'); + late final _initgroups = + _initgroupsPtr.asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterPaddingPosition => - _kCFNumberFormatterPaddingPosition.value; + int issetugid() { + return _issetugid(); + } - late final ffi.Pointer - _kCFNumberFormatterPaddingCharacter = - _lookup('kCFNumberFormatterPaddingCharacter'); + late final _issetugidPtr = + _lookup>('issetugid'); + late final _issetugid = _issetugidPtr.asFunction(); - CFNumberFormatterKey get kCFNumberFormatterPaddingCharacter => - _kCFNumberFormatterPaddingCharacter.value; + ffi.Pointer mkdtemp( + ffi.Pointer arg0, + ) { + return _mkdtemp( + arg0, + ); + } - late final ffi.Pointer - _kCFNumberFormatterDefaultFormat = - _lookup('kCFNumberFormatterDefaultFormat'); + late final _mkdtempPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('mkdtemp'); + late final _mkdtemp = _mkdtempPtr + .asFunction Function(ffi.Pointer)>(); - CFNumberFormatterKey get kCFNumberFormatterDefaultFormat => - _kCFNumberFormatterDefaultFormat.value; + int mknod( + ffi.Pointer arg0, + int arg1, + int arg2, + ) { + return _mknod( + arg0, + arg1, + arg2, + ); + } - late final ffi.Pointer _kCFNumberFormatterMultiplier = - _lookup('kCFNumberFormatterMultiplier'); + late final _mknodPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, mode_t, dev_t)>>('mknod'); + late final _mknod = + _mknodPtr.asFunction, int, int)>(); - CFNumberFormatterKey get kCFNumberFormatterMultiplier => - _kCFNumberFormatterMultiplier.value; + int mkpath_np( + ffi.Pointer path, + int omode, + ) { + return _mkpath_np( + path, + omode, + ); + } - late final ffi.Pointer - _kCFNumberFormatterPositivePrefix = - _lookup('kCFNumberFormatterPositivePrefix'); + late final _mkpath_npPtr = _lookup< + ffi.NativeFunction, mode_t)>>( + 'mkpath_np'); + late final _mkpath_np = + _mkpath_npPtr.asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterPositivePrefix => - _kCFNumberFormatterPositivePrefix.value; + int mkpathat_np( + int dfd, + ffi.Pointer path, + int omode, + ) { + return _mkpathat_np( + dfd, + path, + omode, + ); + } - late final ffi.Pointer - _kCFNumberFormatterPositiveSuffix = - _lookup('kCFNumberFormatterPositiveSuffix'); + late final _mkpathat_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, ffi.Pointer, mode_t)>>('mkpathat_np'); + late final _mkpathat_np = _mkpathat_npPtr + .asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterPositiveSuffix => - _kCFNumberFormatterPositiveSuffix.value; + int mkstemps( + ffi.Pointer arg0, + int arg1, + ) { + return _mkstemps( + arg0, + arg1, + ); + } - late final ffi.Pointer - _kCFNumberFormatterNegativePrefix = - _lookup('kCFNumberFormatterNegativePrefix'); + late final _mkstempsPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'mkstemps'); + late final _mkstemps = + _mkstempsPtr.asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterNegativePrefix => - _kCFNumberFormatterNegativePrefix.value; + int mkostemp( + ffi.Pointer path, + int oflags, + ) { + return _mkostemp( + path, + oflags, + ); + } - late final ffi.Pointer - _kCFNumberFormatterNegativeSuffix = - _lookup('kCFNumberFormatterNegativeSuffix'); + late final _mkostempPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'mkostemp'); + late final _mkostemp = + _mkostempPtr.asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterNegativeSuffix => - _kCFNumberFormatterNegativeSuffix.value; + int mkostemps( + ffi.Pointer path, + int slen, + int oflags, + ) { + return _mkostemps( + path, + slen, + oflags, + ); + } - late final ffi.Pointer - _kCFNumberFormatterPerMillSymbol = - _lookup('kCFNumberFormatterPerMillSymbol'); + late final _mkostempsPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Int, ffi.Int)>>('mkostemps'); + late final _mkostemps = + _mkostempsPtr.asFunction, int, int)>(); - CFNumberFormatterKey get kCFNumberFormatterPerMillSymbol => - _kCFNumberFormatterPerMillSymbol.value; + int mkstemp_dprotected_np( + ffi.Pointer path, + int dpclass, + int dpflags, + ) { + return _mkstemp_dprotected_np( + path, + dpclass, + dpflags, + ); + } - late final ffi.Pointer - _kCFNumberFormatterInternationalCurrencySymbol = - _lookup( - 'kCFNumberFormatterInternationalCurrencySymbol'); + late final _mkstemp_dprotected_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Int)>>('mkstemp_dprotected_np'); + late final _mkstemp_dprotected_np = _mkstemp_dprotected_npPtr + .asFunction, int, int)>(); - CFNumberFormatterKey get kCFNumberFormatterInternationalCurrencySymbol => - _kCFNumberFormatterInternationalCurrencySymbol.value; + ffi.Pointer mkdtempat_np( + int dfd, + ffi.Pointer path, + ) { + return _mkdtempat_np( + dfd, + path, + ); + } - late final ffi.Pointer - _kCFNumberFormatterCurrencyGroupingSeparator = - _lookup( - 'kCFNumberFormatterCurrencyGroupingSeparator'); + late final _mkdtempat_npPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Int, ffi.Pointer)>>('mkdtempat_np'); + late final _mkdtempat_np = _mkdtempat_npPtr + .asFunction Function(int, ffi.Pointer)>(); - CFNumberFormatterKey get kCFNumberFormatterCurrencyGroupingSeparator => - _kCFNumberFormatterCurrencyGroupingSeparator.value; + int mkstempsat_np( + int dfd, + ffi.Pointer path, + int slen, + ) { + return _mkstempsat_np( + dfd, + path, + slen, + ); + } - late final ffi.Pointer _kCFNumberFormatterIsLenient = - _lookup('kCFNumberFormatterIsLenient'); + late final _mkstempsat_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Int)>>('mkstempsat_np'); + late final _mkstempsat_np = _mkstempsat_npPtr + .asFunction, int)>(); - CFNumberFormatterKey get kCFNumberFormatterIsLenient => - _kCFNumberFormatterIsLenient.value; - - late final ffi.Pointer - _kCFNumberFormatterUseSignificantDigits = - _lookup('kCFNumberFormatterUseSignificantDigits'); - - CFNumberFormatterKey get kCFNumberFormatterUseSignificantDigits => - _kCFNumberFormatterUseSignificantDigits.value; - - late final ffi.Pointer - _kCFNumberFormatterMinSignificantDigits = - _lookup('kCFNumberFormatterMinSignificantDigits'); - - CFNumberFormatterKey get kCFNumberFormatterMinSignificantDigits => - _kCFNumberFormatterMinSignificantDigits.value; - - late final ffi.Pointer - _kCFNumberFormatterMaxSignificantDigits = - _lookup('kCFNumberFormatterMaxSignificantDigits'); - - CFNumberFormatterKey get kCFNumberFormatterMaxSignificantDigits => - _kCFNumberFormatterMaxSignificantDigits.value; - - int CFNumberFormatterGetDecimalInfoForCurrencyCode( - CFStringRef currencyCode, - ffi.Pointer defaultFractionDigits, - ffi.Pointer roundingIncrement, + int mkostempsat_np( + int dfd, + ffi.Pointer path, + int slen, + int oflags, ) { - return _CFNumberFormatterGetDecimalInfoForCurrencyCode( - currencyCode, - defaultFractionDigits, - roundingIncrement, + return _mkostempsat_np( + dfd, + path, + slen, + oflags, ); } - late final _CFNumberFormatterGetDecimalInfoForCurrencyCodePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFStringRef, ffi.Pointer, - ffi.Pointer)>>( - 'CFNumberFormatterGetDecimalInfoForCurrencyCode'); - late final _CFNumberFormatterGetDecimalInfoForCurrencyCode = - _CFNumberFormatterGetDecimalInfoForCurrencyCodePtr.asFunction< - int Function( - CFStringRef, ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer _kCFPreferencesAnyApplication = - _lookup('kCFPreferencesAnyApplication'); - - CFStringRef get kCFPreferencesAnyApplication => - _kCFPreferencesAnyApplication.value; - - set kCFPreferencesAnyApplication(CFStringRef value) => - _kCFPreferencesAnyApplication.value = value; - - late final ffi.Pointer _kCFPreferencesCurrentApplication = - _lookup('kCFPreferencesCurrentApplication'); - - CFStringRef get kCFPreferencesCurrentApplication => - _kCFPreferencesCurrentApplication.value; - - set kCFPreferencesCurrentApplication(CFStringRef value) => - _kCFPreferencesCurrentApplication.value = value; - - late final ffi.Pointer _kCFPreferencesAnyHost = - _lookup('kCFPreferencesAnyHost'); - - CFStringRef get kCFPreferencesAnyHost => _kCFPreferencesAnyHost.value; - - set kCFPreferencesAnyHost(CFStringRef value) => - _kCFPreferencesAnyHost.value = value; - - late final ffi.Pointer _kCFPreferencesCurrentHost = - _lookup('kCFPreferencesCurrentHost'); - - CFStringRef get kCFPreferencesCurrentHost => _kCFPreferencesCurrentHost.value; - - set kCFPreferencesCurrentHost(CFStringRef value) => - _kCFPreferencesCurrentHost.value = value; + late final _mkostempsat_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, + ffi.Int)>>('mkostempsat_np'); + late final _mkostempsat_np = _mkostempsat_npPtr + .asFunction, int, int)>(); - late final ffi.Pointer _kCFPreferencesAnyUser = - _lookup('kCFPreferencesAnyUser'); + int nfssvc( + int arg0, + ffi.Pointer arg1, + ) { + return _nfssvc( + arg0, + arg1, + ); + } - CFStringRef get kCFPreferencesAnyUser => _kCFPreferencesAnyUser.value; + late final _nfssvcPtr = _lookup< + ffi.NativeFunction)>>( + 'nfssvc'); + late final _nfssvc = + _nfssvcPtr.asFunction)>(); - set kCFPreferencesAnyUser(CFStringRef value) => - _kCFPreferencesAnyUser.value = value; + int profil( + ffi.Pointer arg0, + int arg1, + int arg2, + int arg3, + ) { + return _profil( + arg0, + arg1, + arg2, + arg3, + ); + } - late final ffi.Pointer _kCFPreferencesCurrentUser = - _lookup('kCFPreferencesCurrentUser'); + late final _profilPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Size, ffi.UnsignedLong, + ffi.UnsignedInt)>>('profil'); + late final _profil = _profilPtr + .asFunction, int, int, int)>(); - CFStringRef get kCFPreferencesCurrentUser => _kCFPreferencesCurrentUser.value; + int pthread_setugid_np( + int arg0, + int arg1, + ) { + return _pthread_setugid_np( + arg0, + arg1, + ); + } - set kCFPreferencesCurrentUser(CFStringRef value) => - _kCFPreferencesCurrentUser.value = value; + late final _pthread_setugid_npPtr = + _lookup>( + 'pthread_setugid_np'); + late final _pthread_setugid_np = + _pthread_setugid_npPtr.asFunction(); - CFPropertyListRef CFPreferencesCopyAppValue( - CFStringRef key, - CFStringRef applicationID, + int pthread_getugid_np( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _CFPreferencesCopyAppValue( - key, - applicationID, + return _pthread_getugid_np( + arg0, + arg1, ); } - late final _CFPreferencesCopyAppValuePtr = _lookup< + late final _pthread_getugid_npPtr = _lookup< ffi.NativeFunction< - CFPropertyListRef Function( - CFStringRef, CFStringRef)>>('CFPreferencesCopyAppValue'); - late final _CFPreferencesCopyAppValue = _CFPreferencesCopyAppValuePtr - .asFunction(); + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('pthread_getugid_np'); + late final _pthread_getugid_np = _pthread_getugid_npPtr + .asFunction, ffi.Pointer)>(); - int CFPreferencesGetAppBooleanValue( - CFStringRef key, - CFStringRef applicationID, - ffi.Pointer keyExistsAndHasValidFormat, + int reboot( + int arg0, ) { - return _CFPreferencesGetAppBooleanValue( - key, - applicationID, - keyExistsAndHasValidFormat, + return _reboot( + arg0, ); } - late final _CFPreferencesGetAppBooleanValuePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFStringRef, CFStringRef, - ffi.Pointer)>>('CFPreferencesGetAppBooleanValue'); - late final _CFPreferencesGetAppBooleanValue = - _CFPreferencesGetAppBooleanValuePtr.asFunction< - int Function(CFStringRef, CFStringRef, ffi.Pointer)>(); + late final _rebootPtr = + _lookup>('reboot'); + late final _reboot = _rebootPtr.asFunction(); - int CFPreferencesGetAppIntegerValue( - CFStringRef key, - CFStringRef applicationID, - ffi.Pointer keyExistsAndHasValidFormat, + int revoke( + ffi.Pointer arg0, ) { - return _CFPreferencesGetAppIntegerValue( - key, - applicationID, - keyExistsAndHasValidFormat, + return _revoke( + arg0, ); } - late final _CFPreferencesGetAppIntegerValuePtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFStringRef, CFStringRef, - ffi.Pointer)>>('CFPreferencesGetAppIntegerValue'); - late final _CFPreferencesGetAppIntegerValue = - _CFPreferencesGetAppIntegerValuePtr.asFunction< - int Function(CFStringRef, CFStringRef, ffi.Pointer)>(); + late final _revokePtr = + _lookup)>>( + 'revoke'); + late final _revoke = + _revokePtr.asFunction)>(); - void CFPreferencesSetAppValue( - CFStringRef key, - CFPropertyListRef value, - CFStringRef applicationID, + int rcmd( + ffi.Pointer> arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, ) { - return _CFPreferencesSetAppValue( - key, - value, - applicationID, + return _rcmd( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, ); } - late final _CFPreferencesSetAppValuePtr = _lookup< + late final _rcmdPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFStringRef, CFPropertyListRef, - CFStringRef)>>('CFPreferencesSetAppValue'); - late final _CFPreferencesSetAppValue = _CFPreferencesSetAppValuePtr - .asFunction(); + ffi.Int Function( + ffi.Pointer>, + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>('rcmd'); + late final _rcmd = _rcmdPtr.asFunction< + int Function( + ffi.Pointer>, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - void CFPreferencesAddSuitePreferencesToApp( - CFStringRef applicationID, - CFStringRef suiteID, + int rcmd_af( + ffi.Pointer> arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + int arg6, ) { - return _CFPreferencesAddSuitePreferencesToApp( - applicationID, - suiteID, + return _rcmd_af( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, ); } - late final _CFPreferencesAddSuitePreferencesToAppPtr = - _lookup>( - 'CFPreferencesAddSuitePreferencesToApp'); - late final _CFPreferencesAddSuitePreferencesToApp = - _CFPreferencesAddSuitePreferencesToAppPtr.asFunction< - void Function(CFStringRef, CFStringRef)>(); + late final _rcmd_afPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer>, + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int)>>('rcmd_af'); + late final _rcmd_af = _rcmd_afPtr.asFunction< + int Function( + ffi.Pointer>, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); - void CFPreferencesRemoveSuitePreferencesFromApp( - CFStringRef applicationID, - CFStringRef suiteID, + int rresvport( + ffi.Pointer arg0, ) { - return _CFPreferencesRemoveSuitePreferencesFromApp( - applicationID, - suiteID, + return _rresvport( + arg0, ); } - late final _CFPreferencesRemoveSuitePreferencesFromAppPtr = - _lookup>( - 'CFPreferencesRemoveSuitePreferencesFromApp'); - late final _CFPreferencesRemoveSuitePreferencesFromApp = - _CFPreferencesRemoveSuitePreferencesFromAppPtr.asFunction< - void Function(CFStringRef, CFStringRef)>(); + late final _rresvportPtr = + _lookup)>>( + 'rresvport'); + late final _rresvport = + _rresvportPtr.asFunction)>(); - int CFPreferencesAppSynchronize( - CFStringRef applicationID, + int rresvport_af( + ffi.Pointer arg0, + int arg1, ) { - return _CFPreferencesAppSynchronize( - applicationID, + return _rresvport_af( + arg0, + arg1, ); } - late final _CFPreferencesAppSynchronizePtr = - _lookup>( - 'CFPreferencesAppSynchronize'); - late final _CFPreferencesAppSynchronize = - _CFPreferencesAppSynchronizePtr.asFunction(); + late final _rresvport_afPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'rresvport_af'); + late final _rresvport_af = + _rresvport_afPtr.asFunction, int)>(); - CFPropertyListRef CFPreferencesCopyValue( - CFStringRef key, - CFStringRef applicationID, - CFStringRef userName, - CFStringRef hostName, + int iruserok( + int arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) { - return _CFPreferencesCopyValue( - key, - applicationID, - userName, - hostName, + return _iruserok( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFPreferencesCopyValuePtr = _lookup< + late final _iruserokPtr = _lookup< ffi.NativeFunction< - CFPropertyListRef Function(CFStringRef, CFStringRef, CFStringRef, - CFStringRef)>>('CFPreferencesCopyValue'); - late final _CFPreferencesCopyValue = _CFPreferencesCopyValuePtr.asFunction< - CFPropertyListRef Function( - CFStringRef, CFStringRef, CFStringRef, CFStringRef)>(); + ffi.Int Function(ffi.UnsignedLong, ffi.Int, ffi.Pointer, + ffi.Pointer)>>('iruserok'); + late final _iruserok = _iruserokPtr.asFunction< + int Function(int, int, ffi.Pointer, ffi.Pointer)>(); - CFDictionaryRef CFPreferencesCopyMultiple( - CFArrayRef keysToFetch, - CFStringRef applicationID, - CFStringRef userName, - CFStringRef hostName, + int iruserok_sa( + ffi.Pointer arg0, + int arg1, + int arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, ) { - return _CFPreferencesCopyMultiple( - keysToFetch, - applicationID, - userName, - hostName, + return _iruserok_sa( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFPreferencesCopyMultiplePtr = _lookup< + late final _iruserok_saPtr = _lookup< ffi.NativeFunction< - CFDictionaryRef Function(CFArrayRef, CFStringRef, CFStringRef, - CFStringRef)>>('CFPreferencesCopyMultiple'); - late final _CFPreferencesCopyMultiple = - _CFPreferencesCopyMultiplePtr.asFunction< - CFDictionaryRef Function( - CFArrayRef, CFStringRef, CFStringRef, CFStringRef)>(); + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Int, + ffi.Pointer, ffi.Pointer)>>('iruserok_sa'); + late final _iruserok_sa = _iruserok_saPtr.asFunction< + int Function(ffi.Pointer, int, int, ffi.Pointer, + ffi.Pointer)>(); - void CFPreferencesSetValue( - CFStringRef key, - CFPropertyListRef value, - CFStringRef applicationID, - CFStringRef userName, - CFStringRef hostName, + int ruserok( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) { - return _CFPreferencesSetValue( - key, - value, - applicationID, - userName, - hostName, + return _ruserok( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFPreferencesSetValuePtr = _lookup< + late final _ruserokPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFStringRef, CFPropertyListRef, CFStringRef, - CFStringRef, CFStringRef)>>('CFPreferencesSetValue'); - late final _CFPreferencesSetValue = _CFPreferencesSetValuePtr.asFunction< - void Function(CFStringRef, CFPropertyListRef, CFStringRef, CFStringRef, - CFStringRef)>(); + ffi.Int Function(ffi.Pointer, ffi.Int, + ffi.Pointer, ffi.Pointer)>>('ruserok'); + late final _ruserok = _ruserokPtr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer, + ffi.Pointer)>(); - void CFPreferencesSetMultiple( - CFDictionaryRef keysToSet, - CFArrayRef keysToRemove, - CFStringRef applicationID, - CFStringRef userName, - CFStringRef hostName, + int setdomainname( + ffi.Pointer arg0, + int arg1, ) { - return _CFPreferencesSetMultiple( - keysToSet, - keysToRemove, - applicationID, - userName, - hostName, + return _setdomainname( + arg0, + arg1, ); } - late final _CFPreferencesSetMultiplePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFDictionaryRef, CFArrayRef, CFStringRef, - CFStringRef, CFStringRef)>>('CFPreferencesSetMultiple'); - late final _CFPreferencesSetMultiple = - _CFPreferencesSetMultiplePtr.asFunction< - void Function(CFDictionaryRef, CFArrayRef, CFStringRef, CFStringRef, - CFStringRef)>(); + late final _setdomainnamePtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'setdomainname'); + late final _setdomainname = + _setdomainnamePtr.asFunction, int)>(); - int CFPreferencesSynchronize( - CFStringRef applicationID, - CFStringRef userName, - CFStringRef hostName, + int setgroups( + int arg0, + ffi.Pointer arg1, ) { - return _CFPreferencesSynchronize( - applicationID, - userName, - hostName, + return _setgroups( + arg0, + arg1, ); } - late final _CFPreferencesSynchronizePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFStringRef, CFStringRef, - CFStringRef)>>('CFPreferencesSynchronize'); - late final _CFPreferencesSynchronize = _CFPreferencesSynchronizePtr - .asFunction(); + late final _setgroupsPtr = _lookup< + ffi.NativeFunction)>>( + 'setgroups'); + late final _setgroups = + _setgroupsPtr.asFunction)>(); - CFArrayRef CFPreferencesCopyApplicationList( - CFStringRef userName, - CFStringRef hostName, + void sethostid( + int arg0, ) { - return _CFPreferencesCopyApplicationList( - userName, - hostName, + return _sethostid( + arg0, ); } - late final _CFPreferencesCopyApplicationListPtr = _lookup< - ffi.NativeFunction>( - 'CFPreferencesCopyApplicationList'); - late final _CFPreferencesCopyApplicationList = - _CFPreferencesCopyApplicationListPtr.asFunction< - CFArrayRef Function(CFStringRef, CFStringRef)>(); + late final _sethostidPtr = + _lookup>('sethostid'); + late final _sethostid = _sethostidPtr.asFunction(); - CFArrayRef CFPreferencesCopyKeyList( - CFStringRef applicationID, - CFStringRef userName, - CFStringRef hostName, + int sethostname( + ffi.Pointer arg0, + int arg1, ) { - return _CFPreferencesCopyKeyList( - applicationID, - userName, - hostName, + return _sethostname( + arg0, + arg1, ); } - late final _CFPreferencesCopyKeyListPtr = _lookup< - ffi.NativeFunction< - CFArrayRef Function(CFStringRef, CFStringRef, - CFStringRef)>>('CFPreferencesCopyKeyList'); - late final _CFPreferencesCopyKeyList = _CFPreferencesCopyKeyListPtr - .asFunction(); + late final _sethostnamePtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'sethostname'); + late final _sethostname = + _sethostnamePtr.asFunction, int)>(); - int CFPreferencesAppValueIsForced( - CFStringRef key, - CFStringRef applicationID, + int setlogin( + ffi.Pointer arg0, ) { - return _CFPreferencesAppValueIsForced( - key, - applicationID, + return _setlogin( + arg0, ); } - late final _CFPreferencesAppValueIsForcedPtr = - _lookup>( - 'CFPreferencesAppValueIsForced'); - late final _CFPreferencesAppValueIsForced = _CFPreferencesAppValueIsForcedPtr - .asFunction(); - - int CFURLGetTypeID() { - return _CFURLGetTypeID(); - } - - late final _CFURLGetTypeIDPtr = - _lookup>('CFURLGetTypeID'); - late final _CFURLGetTypeID = _CFURLGetTypeIDPtr.asFunction(); + late final _setloginPtr = + _lookup)>>( + 'setlogin'); + late final _setlogin = + _setloginPtr.asFunction)>(); - CFURLRef CFURLCreateWithBytes( - CFAllocatorRef allocator, - ffi.Pointer URLBytes, - int length, - int encoding, - CFURLRef baseURL, + ffi.Pointer setmode( + ffi.Pointer arg0, ) { - return _CFURLCreateWithBytes( - allocator, - URLBytes, - length, - encoding, - baseURL, + return _setmode( + arg0, ); } - late final _CFURLCreateWithBytesPtr = _lookup< + late final _setmodePtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, - CFStringEncoding, CFURLRef)>>('CFURLCreateWithBytes'); - late final _CFURLCreateWithBytes = _CFURLCreateWithBytesPtr.asFunction< - CFURLRef Function( - CFAllocatorRef, ffi.Pointer, int, int, CFURLRef)>(); + ffi.Pointer Function(ffi.Pointer)>>('setmode'); + late final _setmode = _setmodePtr + .asFunction Function(ffi.Pointer)>(); - CFDataRef CFURLCreateData( - CFAllocatorRef allocator, - CFURLRef url, - int encoding, - int escapeWhitespace, + int setrgid( + int arg0, ) { - return _CFURLCreateData( - allocator, - url, - encoding, - escapeWhitespace, + return _setrgid( + arg0, ); } - late final _CFURLCreateDataPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(CFAllocatorRef, CFURLRef, CFStringEncoding, - Boolean)>>('CFURLCreateData'); - late final _CFURLCreateData = _CFURLCreateDataPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFURLRef, int, int)>(); + late final _setrgidPtr = + _lookup>('setrgid'); + late final _setrgid = _setrgidPtr.asFunction(); - CFURLRef CFURLCreateWithString( - CFAllocatorRef allocator, - CFStringRef URLString, - CFURLRef baseURL, + int setruid( + int arg0, ) { - return _CFURLCreateWithString( - allocator, - URLString, - baseURL, + return _setruid( + arg0, ); } - late final _CFURLCreateWithStringPtr = _lookup< - ffi.NativeFunction< - CFURLRef Function( - CFAllocatorRef, CFStringRef, CFURLRef)>>('CFURLCreateWithString'); - late final _CFURLCreateWithString = _CFURLCreateWithStringPtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFStringRef, CFURLRef)>(); + late final _setruidPtr = + _lookup>('setruid'); + late final _setruid = _setruidPtr.asFunction(); - CFURLRef CFURLCreateAbsoluteURLWithBytes( - CFAllocatorRef alloc, - ffi.Pointer relativeURLBytes, - int length, - int encoding, - CFURLRef baseURL, - int useCompatibilityMode, + int setsgroups_np( + int arg0, + ffi.Pointer arg1, ) { - return _CFURLCreateAbsoluteURLWithBytes( - alloc, - relativeURLBytes, - length, - encoding, - baseURL, - useCompatibilityMode, + return _setsgroups_np( + arg0, + arg1, ); } - late final _CFURLCreateAbsoluteURLWithBytesPtr = _lookup< + late final _setsgroups_npPtr = _lookup< ffi.NativeFunction< - CFURLRef Function( - CFAllocatorRef, - ffi.Pointer, - CFIndex, - CFStringEncoding, - CFURLRef, - Boolean)>>('CFURLCreateAbsoluteURLWithBytes'); - late final _CFURLCreateAbsoluteURLWithBytes = - _CFURLCreateAbsoluteURLWithBytesPtr.asFunction< - CFURLRef Function( - CFAllocatorRef, ffi.Pointer, int, int, CFURLRef, int)>(); + ffi.Int Function( + ffi.Int, ffi.Pointer)>>('setsgroups_np'); + late final _setsgroups_np = _setsgroups_npPtr + .asFunction)>(); - CFURLRef CFURLCreateWithFileSystemPath( - CFAllocatorRef allocator, - CFStringRef filePath, - int pathStyle, - int isDirectory, - ) { - return _CFURLCreateWithFileSystemPath( - allocator, - filePath, - pathStyle, - isDirectory, - ); + void setusershell() { + return _setusershell(); } - late final _CFURLCreateWithFileSystemPathPtr = _lookup< - ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, CFStringRef, ffi.Int32, - Boolean)>>('CFURLCreateWithFileSystemPath'); - late final _CFURLCreateWithFileSystemPath = _CFURLCreateWithFileSystemPathPtr - .asFunction(); + late final _setusershellPtr = + _lookup>('setusershell'); + late final _setusershell = _setusershellPtr.asFunction(); - CFURLRef CFURLCreateFromFileSystemRepresentation( - CFAllocatorRef allocator, - ffi.Pointer buffer, - int bufLen, - int isDirectory, + int setwgroups_np( + int arg0, + ffi.Pointer arg1, ) { - return _CFURLCreateFromFileSystemRepresentation( - allocator, - buffer, - bufLen, - isDirectory, + return _setwgroups_np( + arg0, + arg1, ); } - late final _CFURLCreateFromFileSystemRepresentationPtr = _lookup< + late final _setwgroups_npPtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, - Boolean)>>('CFURLCreateFromFileSystemRepresentation'); - late final _CFURLCreateFromFileSystemRepresentation = - _CFURLCreateFromFileSystemRepresentationPtr.asFunction< - CFURLRef Function(CFAllocatorRef, ffi.Pointer, int, int)>(); + ffi.Int Function( + ffi.Int, ffi.Pointer)>>('setwgroups_np'); + late final _setwgroups_np = _setwgroups_npPtr + .asFunction)>(); - CFURLRef CFURLCreateWithFileSystemPathRelativeToBase( - CFAllocatorRef allocator, - CFStringRef filePath, - int pathStyle, - int isDirectory, - CFURLRef baseURL, + int strtofflags( + ffi.Pointer> arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return _CFURLCreateWithFileSystemPathRelativeToBase( - allocator, - filePath, - pathStyle, - isDirectory, - baseURL, + return _strtofflags( + arg0, + arg1, + arg2, ); } - late final _CFURLCreateWithFileSystemPathRelativeToBasePtr = _lookup< + late final _strtofflagsPtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, CFStringRef, ffi.Int32, Boolean, - CFURLRef)>>('CFURLCreateWithFileSystemPathRelativeToBase'); - late final _CFURLCreateWithFileSystemPathRelativeToBase = - _CFURLCreateWithFileSystemPathRelativeToBasePtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFStringRef, int, int, CFURLRef)>(); + ffi.Int Function( + ffi.Pointer>, + ffi.Pointer, + ffi.Pointer)>>('strtofflags'); + late final _strtofflags = _strtofflagsPtr.asFunction< + int Function(ffi.Pointer>, + ffi.Pointer, ffi.Pointer)>(); - CFURLRef CFURLCreateFromFileSystemRepresentationRelativeToBase( - CFAllocatorRef allocator, - ffi.Pointer buffer, - int bufLen, - int isDirectory, - CFURLRef baseURL, + int swapon( + ffi.Pointer arg0, ) { - return _CFURLCreateFromFileSystemRepresentationRelativeToBase( - allocator, - buffer, - bufLen, - isDirectory, - baseURL, + return _swapon( + arg0, ); } - late final _CFURLCreateFromFileSystemRepresentationRelativeToBasePtr = - _lookup< - ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, - Boolean, CFURLRef)>>( - 'CFURLCreateFromFileSystemRepresentationRelativeToBase'); - late final _CFURLCreateFromFileSystemRepresentationRelativeToBase = - _CFURLCreateFromFileSystemRepresentationRelativeToBasePtr.asFunction< - CFURLRef Function( - CFAllocatorRef, ffi.Pointer, int, int, CFURLRef)>(); + late final _swaponPtr = + _lookup)>>( + 'swapon'); + late final _swapon = + _swaponPtr.asFunction)>(); - int CFURLGetFileSystemRepresentation( - CFURLRef url, - int resolveAgainstBase, - ffi.Pointer buffer, - int maxBufLen, - ) { - return _CFURLGetFileSystemRepresentation( - url, - resolveAgainstBase, - buffer, - maxBufLen, - ); + int ttyslot() { + return _ttyslot(); } - late final _CFURLGetFileSystemRepresentationPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFURLRef, Boolean, ffi.Pointer, - CFIndex)>>('CFURLGetFileSystemRepresentation'); - late final _CFURLGetFileSystemRepresentation = - _CFURLGetFileSystemRepresentationPtr.asFunction< - int Function(CFURLRef, int, ffi.Pointer, int)>(); + late final _ttyslotPtr = + _lookup>('ttyslot'); + late final _ttyslot = _ttyslotPtr.asFunction(); - CFURLRef CFURLCopyAbsoluteURL( - CFURLRef relativeURL, + int undelete( + ffi.Pointer arg0, ) { - return _CFURLCopyAbsoluteURL( - relativeURL, + return _undelete( + arg0, ); } - late final _CFURLCopyAbsoluteURLPtr = - _lookup>( - 'CFURLCopyAbsoluteURL'); - late final _CFURLCopyAbsoluteURL = - _CFURLCopyAbsoluteURLPtr.asFunction(); + late final _undeletePtr = + _lookup)>>( + 'undelete'); + late final _undelete = + _undeletePtr.asFunction)>(); - CFStringRef CFURLGetString( - CFURLRef anURL, + int unwhiteout( + ffi.Pointer arg0, ) { - return _CFURLGetString( - anURL, + return _unwhiteout( + arg0, ); } - late final _CFURLGetStringPtr = - _lookup>( - 'CFURLGetString'); - late final _CFURLGetString = - _CFURLGetStringPtr.asFunction(); + late final _unwhiteoutPtr = + _lookup)>>( + 'unwhiteout'); + late final _unwhiteout = + _unwhiteoutPtr.asFunction)>(); - CFURLRef CFURLGetBaseURL( - CFURLRef anURL, + int syscall( + int arg0, ) { - return _CFURLGetBaseURL( - anURL, + return _syscall( + arg0, ); } - late final _CFURLGetBaseURLPtr = - _lookup>( - 'CFURLGetBaseURL'); - late final _CFURLGetBaseURL = - _CFURLGetBaseURLPtr.asFunction(); + late final _syscallPtr = + _lookup>('syscall'); + late final _syscall = _syscallPtr.asFunction(); - int CFURLCanBeDecomposed( - CFURLRef anURL, + int fgetattrlist( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, ) { - return _CFURLCanBeDecomposed( - anURL, + return _fgetattrlist( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFURLCanBeDecomposedPtr = - _lookup>( - 'CFURLCanBeDecomposed'); - late final _CFURLCanBeDecomposed = - _CFURLCanBeDecomposedPtr.asFunction(); + late final _fgetattrlistPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.UnsignedInt)>>('fgetattrlist'); + late final _fgetattrlist = _fgetattrlistPtr.asFunction< + int Function( + int, ffi.Pointer, ffi.Pointer, int, int)>(); - CFStringRef CFURLCopyScheme( - CFURLRef anURL, + int fsetattrlist( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, ) { - return _CFURLCopyScheme( - anURL, + return _fsetattrlist( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFURLCopySchemePtr = - _lookup>( - 'CFURLCopyScheme'); - late final _CFURLCopyScheme = - _CFURLCopySchemePtr.asFunction(); + late final _fsetattrlistPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.UnsignedInt)>>('fsetattrlist'); + late final _fsetattrlist = _fsetattrlistPtr.asFunction< + int Function( + int, ffi.Pointer, ffi.Pointer, int, int)>(); - CFStringRef CFURLCopyNetLocation( - CFURLRef anURL, + int getattrlist( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, ) { - return _CFURLCopyNetLocation( - anURL, + return _getattrlist( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFURLCopyNetLocationPtr = - _lookup>( - 'CFURLCopyNetLocation'); - late final _CFURLCopyNetLocation = - _CFURLCopyNetLocationPtr.asFunction(); + late final _getattrlistPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.UnsignedInt)>>('getattrlist'); + late final _getattrlist = _getattrlistPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - CFStringRef CFURLCopyPath( - CFURLRef anURL, + int setattrlist( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, ) { - return _CFURLCopyPath( - anURL, + return _setattrlist( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFURLCopyPathPtr = - _lookup>( - 'CFURLCopyPath'); - late final _CFURLCopyPath = - _CFURLCopyPathPtr.asFunction(); + late final _setattrlistPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.UnsignedInt)>>('setattrlist'); + late final _setattrlist = _setattrlistPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int)>(); - CFStringRef CFURLCopyStrictPath( - CFURLRef anURL, - ffi.Pointer isAbsolute, + int exchangedata( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return _CFURLCopyStrictPath( - anURL, - isAbsolute, + return _exchangedata( + arg0, + arg1, + arg2, ); } - late final _CFURLCopyStrictPathPtr = _lookup< + late final _exchangedataPtr = _lookup< ffi.NativeFunction< - CFStringRef Function( - CFURLRef, ffi.Pointer)>>('CFURLCopyStrictPath'); - late final _CFURLCopyStrictPath = _CFURLCopyStrictPathPtr.asFunction< - CFStringRef Function(CFURLRef, ffi.Pointer)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.UnsignedInt)>>('exchangedata'); + late final _exchangedata = _exchangedataPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - CFStringRef CFURLCopyFileSystemPath( - CFURLRef anURL, - int pathStyle, - ) { - return _CFURLCopyFileSystemPath( - anURL, - pathStyle, - ); - } + int getdirentriesattr( + int arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4, + ffi.Pointer arg5, + ffi.Pointer arg6, + int arg7, + ) { + return _getdirentriesattr( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, + arg6, + arg7, + ); + } - late final _CFURLCopyFileSystemPathPtr = - _lookup>( - 'CFURLCopyFileSystemPath'); - late final _CFURLCopyFileSystemPath = _CFURLCopyFileSystemPathPtr.asFunction< - CFStringRef Function(CFURLRef, int)>(); + late final _getdirentriesattrPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt)>>('getdirentriesattr'); + late final _getdirentriesattr = _getdirentriesattrPtr.asFunction< + int Function( + int, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); - int CFURLHasDirectoryPath( - CFURLRef anURL, + int searchfs( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + ffi.Pointer arg5, ) { - return _CFURLHasDirectoryPath( - anURL, + return _searchfs( + arg0, + arg1, + arg2, + arg3, + arg4, + arg5, ); } - late final _CFURLHasDirectoryPathPtr = - _lookup>( - 'CFURLHasDirectoryPath'); - late final _CFURLHasDirectoryPath = - _CFURLHasDirectoryPathPtr.asFunction(); + late final _searchfsPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.UnsignedInt, + ffi.UnsignedInt, + ffi.Pointer)>>('searchfs'); + late final _searchfs = _searchfsPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer, int, int, ffi.Pointer)>(); - CFStringRef CFURLCopyResourceSpecifier( - CFURLRef anURL, + int fsctl( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, + int arg3, ) { - return _CFURLCopyResourceSpecifier( - anURL, + return _fsctl( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFURLCopyResourceSpecifierPtr = - _lookup>( - 'CFURLCopyResourceSpecifier'); - late final _CFURLCopyResourceSpecifier = _CFURLCopyResourceSpecifierPtr - .asFunction(); + late final _fsctlPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.UnsignedLong, + ffi.Pointer, ffi.UnsignedInt)>>('fsctl'); + late final _fsctl = _fsctlPtr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer, int)>(); - CFStringRef CFURLCopyHostName( - CFURLRef anURL, + int ffsctl( + int arg0, + int arg1, + ffi.Pointer arg2, + int arg3, ) { - return _CFURLCopyHostName( - anURL, + return _ffsctl( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFURLCopyHostNamePtr = - _lookup>( - 'CFURLCopyHostName'); - late final _CFURLCopyHostName = - _CFURLCopyHostNamePtr.asFunction(); + late final _ffsctlPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.UnsignedLong, ffi.Pointer, + ffi.UnsignedInt)>>('ffsctl'); + late final _ffsctl = _ffsctlPtr + .asFunction, int)>(); - int CFURLGetPortNumber( - CFURLRef anURL, + int fsync_volume_np( + int arg0, + int arg1, ) { - return _CFURLGetPortNumber( - anURL, + return _fsync_volume_np( + arg0, + arg1, ); } - late final _CFURLGetPortNumberPtr = - _lookup>( - 'CFURLGetPortNumber'); - late final _CFURLGetPortNumber = - _CFURLGetPortNumberPtr.asFunction(); + late final _fsync_volume_npPtr = + _lookup>( + 'fsync_volume_np'); + late final _fsync_volume_np = + _fsync_volume_npPtr.asFunction(); - CFStringRef CFURLCopyUserName( - CFURLRef anURL, + int sync_volume_np( + ffi.Pointer arg0, + int arg1, ) { - return _CFURLCopyUserName( - anURL, + return _sync_volume_np( + arg0, + arg1, ); } - late final _CFURLCopyUserNamePtr = - _lookup>( - 'CFURLCopyUserName'); - late final _CFURLCopyUserName = - _CFURLCopyUserNamePtr.asFunction(); + late final _sync_volume_npPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'sync_volume_np'); + late final _sync_volume_np = + _sync_volume_npPtr.asFunction, int)>(); - CFStringRef CFURLCopyPassword( - CFURLRef anURL, + late final ffi.Pointer _optreset = _lookup('optreset'); + + int get optreset => _optreset.value; + + set optreset(int value) => _optreset.value = value; + + int open( + ffi.Pointer arg0, + int arg1, ) { - return _CFURLCopyPassword( - anURL, + return _open( + arg0, + arg1, ); } - late final _CFURLCopyPasswordPtr = - _lookup>( - 'CFURLCopyPassword'); - late final _CFURLCopyPassword = - _CFURLCopyPasswordPtr.asFunction(); + late final _openPtr = _lookup< + ffi.NativeFunction, ffi.Int)>>( + 'open'); + late final _open = + _openPtr.asFunction, int)>(); - CFStringRef CFURLCopyParameterString( - CFURLRef anURL, - CFStringRef charactersToLeaveEscaped, + int openat( + int arg0, + ffi.Pointer arg1, + int arg2, ) { - return _CFURLCopyParameterString( - anURL, - charactersToLeaveEscaped, + return _openat( + arg0, + arg1, + arg2, ); } - late final _CFURLCopyParameterStringPtr = - _lookup>( - 'CFURLCopyParameterString'); - late final _CFURLCopyParameterString = _CFURLCopyParameterStringPtr - .asFunction(); + late final _openatPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int)>>('openat'); + late final _openat = + _openatPtr.asFunction, int)>(); - CFStringRef CFURLCopyQueryString( - CFURLRef anURL, - CFStringRef charactersToLeaveEscaped, + int creat( + ffi.Pointer arg0, + int arg1, ) { - return _CFURLCopyQueryString( - anURL, - charactersToLeaveEscaped, + return _creat( + arg0, + arg1, ); } - late final _CFURLCopyQueryStringPtr = - _lookup>( - 'CFURLCopyQueryString'); - late final _CFURLCopyQueryString = _CFURLCopyQueryStringPtr.asFunction< - CFStringRef Function(CFURLRef, CFStringRef)>(); + late final _creatPtr = _lookup< + ffi.NativeFunction, mode_t)>>( + 'creat'); + late final _creat = + _creatPtr.asFunction, int)>(); - CFStringRef CFURLCopyFragment( - CFURLRef anURL, - CFStringRef charactersToLeaveEscaped, + int fcntl( + int arg0, + int arg1, ) { - return _CFURLCopyFragment( - anURL, - charactersToLeaveEscaped, + return _fcntl( + arg0, + arg1, ); } - late final _CFURLCopyFragmentPtr = - _lookup>( - 'CFURLCopyFragment'); - late final _CFURLCopyFragment = _CFURLCopyFragmentPtr.asFunction< - CFStringRef Function(CFURLRef, CFStringRef)>(); + late final _fcntlPtr = + _lookup>('fcntl'); + late final _fcntl = _fcntlPtr.asFunction(); - CFStringRef CFURLCopyLastPathComponent( - CFURLRef url, + int openx_np( + ffi.Pointer arg0, + int arg1, + filesec_t arg2, ) { - return _CFURLCopyLastPathComponent( - url, + return _openx_np( + arg0, + arg1, + arg2, ); } - late final _CFURLCopyLastPathComponentPtr = - _lookup>( - 'CFURLCopyLastPathComponent'); - late final _CFURLCopyLastPathComponent = _CFURLCopyLastPathComponentPtr - .asFunction(); + late final _openx_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Int, filesec_t)>>('openx_np'); + late final _openx_np = _openx_npPtr + .asFunction, int, filesec_t)>(); - CFStringRef CFURLCopyPathExtension( - CFURLRef url, + int open_dprotected_np( + ffi.Pointer arg0, + int arg1, + int arg2, + int arg3, ) { - return _CFURLCopyPathExtension( - url, + return _open_dprotected_np( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFURLCopyPathExtensionPtr = - _lookup>( - 'CFURLCopyPathExtension'); - late final _CFURLCopyPathExtension = - _CFURLCopyPathExtensionPtr.asFunction(); + late final _open_dprotected_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Int, + ffi.Int)>>('open_dprotected_np'); + late final _open_dprotected_np = _open_dprotected_npPtr + .asFunction, int, int, int)>(); - CFURLRef CFURLCreateCopyAppendingPathComponent( - CFAllocatorRef allocator, - CFURLRef url, - CFStringRef pathComponent, - int isDirectory, + int openat_dprotected_np( + int arg0, + ffi.Pointer arg1, + int arg2, + int arg3, + int arg4, ) { - return _CFURLCreateCopyAppendingPathComponent( - allocator, - url, - pathComponent, - isDirectory, + return _openat_dprotected_np( + arg0, + arg1, + arg2, + arg3, + arg4, ); } - late final _CFURLCreateCopyAppendingPathComponentPtr = _lookup< + late final _openat_dprotected_npPtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef, CFStringRef, - Boolean)>>('CFURLCreateCopyAppendingPathComponent'); - late final _CFURLCreateCopyAppendingPathComponent = - _CFURLCreateCopyAppendingPathComponentPtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef, CFStringRef, int)>(); + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, ffi.Int, + ffi.Int)>>('openat_dprotected_np'); + late final _openat_dprotected_np = _openat_dprotected_npPtr + .asFunction, int, int, int)>(); - CFURLRef CFURLCreateCopyDeletingLastPathComponent( - CFAllocatorRef allocator, - CFURLRef url, + int openat_authenticated_np( + int arg0, + ffi.Pointer arg1, + int arg2, + int arg3, ) { - return _CFURLCreateCopyDeletingLastPathComponent( - allocator, - url, + return _openat_authenticated_np( + arg0, + arg1, + arg2, + arg3, ); } - late final _CFURLCreateCopyDeletingLastPathComponentPtr = - _lookup>( - 'CFURLCreateCopyDeletingLastPathComponent'); - late final _CFURLCreateCopyDeletingLastPathComponent = - _CFURLCreateCopyDeletingLastPathComponentPtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef)>(); + late final _openat_authenticated_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, + ffi.Int)>>('openat_authenticated_np'); + late final _openat_authenticated_np = _openat_authenticated_npPtr + .asFunction, int, int)>(); - CFURLRef CFURLCreateCopyAppendingPathExtension( - CFAllocatorRef allocator, - CFURLRef url, - CFStringRef extension1, + int flock1( + int arg0, + int arg1, ) { - return _CFURLCreateCopyAppendingPathExtension( - allocator, - url, - extension1, + return _flock1( + arg0, + arg1, ); } - late final _CFURLCreateCopyAppendingPathExtensionPtr = _lookup< - ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef, - CFStringRef)>>('CFURLCreateCopyAppendingPathExtension'); - late final _CFURLCreateCopyAppendingPathExtension = - _CFURLCreateCopyAppendingPathExtensionPtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef, CFStringRef)>(); + late final _flock1Ptr = + _lookup>('flock'); + late final _flock1 = _flock1Ptr.asFunction(); - CFURLRef CFURLCreateCopyDeletingPathExtension( - CFAllocatorRef allocator, - CFURLRef url, + filesec_t filesec_init() { + return _filesec_init(); + } + + late final _filesec_initPtr = + _lookup>('filesec_init'); + late final _filesec_init = + _filesec_initPtr.asFunction(); + + filesec_t filesec_dup( + filesec_t arg0, ) { - return _CFURLCreateCopyDeletingPathExtension( - allocator, - url, + return _filesec_dup( + arg0, ); } - late final _CFURLCreateCopyDeletingPathExtensionPtr = - _lookup>( - 'CFURLCreateCopyDeletingPathExtension'); - late final _CFURLCreateCopyDeletingPathExtension = - _CFURLCreateCopyDeletingPathExtensionPtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef)>(); + late final _filesec_dupPtr = + _lookup>('filesec_dup'); + late final _filesec_dup = + _filesec_dupPtr.asFunction(); - int CFURLGetBytes( - CFURLRef url, - ffi.Pointer buffer, - int bufferLength, + void filesec_free( + filesec_t arg0, ) { - return _CFURLGetBytes( - url, - buffer, - bufferLength, + return _filesec_free( + arg0, ); } - late final _CFURLGetBytesPtr = _lookup< - ffi.NativeFunction< - CFIndex Function( - CFURLRef, ffi.Pointer, CFIndex)>>('CFURLGetBytes'); - late final _CFURLGetBytes = _CFURLGetBytesPtr.asFunction< - int Function(CFURLRef, ffi.Pointer, int)>(); + late final _filesec_freePtr = + _lookup>('filesec_free'); + late final _filesec_free = + _filesec_freePtr.asFunction(); - CFRange CFURLGetByteRangeForComponent( - CFURLRef url, - int component, - ffi.Pointer rangeIncludingSeparators, + int filesec_get_property( + filesec_t arg0, + filesec_property_t arg1, + ffi.Pointer arg2, ) { - return _CFURLGetByteRangeForComponent( - url, - component, - rangeIncludingSeparators, + return _filesec_get_property( + arg0, + arg1.value, + arg2, ); } - late final _CFURLGetByteRangeForComponentPtr = _lookup< + late final _filesec_get_propertyPtr = _lookup< ffi.NativeFunction< - CFRange Function(CFURLRef, ffi.Int32, - ffi.Pointer)>>('CFURLGetByteRangeForComponent'); - late final _CFURLGetByteRangeForComponent = _CFURLGetByteRangeForComponentPtr - .asFunction)>(); + ffi.Int Function(filesec_t, ffi.UnsignedInt, + ffi.Pointer)>>('filesec_get_property'); + late final _filesec_get_property = _filesec_get_propertyPtr + .asFunction)>(); - CFStringRef CFURLCreateStringByReplacingPercentEscapes( - CFAllocatorRef allocator, - CFStringRef originalString, - CFStringRef charactersToLeaveEscaped, + int filesec_query_property( + filesec_t arg0, + filesec_property_t arg1, + ffi.Pointer arg2, ) { - return _CFURLCreateStringByReplacingPercentEscapes( - allocator, - originalString, - charactersToLeaveEscaped, + return _filesec_query_property( + arg0, + arg1.value, + arg2, ); } - late final _CFURLCreateStringByReplacingPercentEscapesPtr = _lookup< + late final _filesec_query_propertyPtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, - CFStringRef)>>('CFURLCreateStringByReplacingPercentEscapes'); - late final _CFURLCreateStringByReplacingPercentEscapes = - _CFURLCreateStringByReplacingPercentEscapesPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, CFStringRef)>(); + ffi.Int Function(filesec_t, ffi.UnsignedInt, + ffi.Pointer)>>('filesec_query_property'); + late final _filesec_query_property = _filesec_query_propertyPtr + .asFunction)>(); - CFStringRef CFURLCreateStringByReplacingPercentEscapesUsingEncoding( - CFAllocatorRef allocator, - CFStringRef origString, - CFStringRef charsToLeaveEscaped, - int encoding, + int filesec_set_property( + filesec_t arg0, + filesec_property_t arg1, + ffi.Pointer arg2, ) { - return _CFURLCreateStringByReplacingPercentEscapesUsingEncoding( - allocator, - origString, - charsToLeaveEscaped, - encoding, + return _filesec_set_property( + arg0, + arg1.value, + arg2, ); } - late final _CFURLCreateStringByReplacingPercentEscapesUsingEncodingPtr = - _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, CFStringRef, - CFStringEncoding)>>( - 'CFURLCreateStringByReplacingPercentEscapesUsingEncoding'); - late final _CFURLCreateStringByReplacingPercentEscapesUsingEncoding = - _CFURLCreateStringByReplacingPercentEscapesUsingEncodingPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, CFStringRef, CFStringRef, int)>(); + late final _filesec_set_propertyPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(filesec_t, ffi.UnsignedInt, + ffi.Pointer)>>('filesec_set_property'); + late final _filesec_set_property = _filesec_set_propertyPtr + .asFunction)>(); - CFStringRef CFURLCreateStringByAddingPercentEscapes( - CFAllocatorRef allocator, - CFStringRef originalString, - CFStringRef charactersToLeaveUnescaped, - CFStringRef legalURLCharactersToBeEscaped, - int encoding, + int filesec_unset_property( + filesec_t arg0, + filesec_property_t arg1, ) { - return _CFURLCreateStringByAddingPercentEscapes( - allocator, - originalString, - charactersToLeaveUnescaped, - legalURLCharactersToBeEscaped, - encoding, + return _filesec_unset_property( + arg0, + arg1.value, ); } - late final _CFURLCreateStringByAddingPercentEscapesPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function( - CFAllocatorRef, - CFStringRef, - CFStringRef, - CFStringRef, - CFStringEncoding)>>('CFURLCreateStringByAddingPercentEscapes'); - late final _CFURLCreateStringByAddingPercentEscapes = - _CFURLCreateStringByAddingPercentEscapesPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, CFStringRef, CFStringRef, CFStringRef, int)>(); + late final _filesec_unset_propertyPtr = + _lookup>( + 'filesec_unset_property'); + late final _filesec_unset_property = + _filesec_unset_propertyPtr.asFunction(); - int CFURLIsFileReferenceURL( - CFURLRef url, + int os_workgroup_copy_port( + Dartos_workgroup_t wg, + ffi.Pointer mach_port_out, ) { - return _CFURLIsFileReferenceURL( - url, + return _os_workgroup_copy_port( + wg.ref.pointer, + mach_port_out, ); } - late final _CFURLIsFileReferenceURLPtr = - _lookup>( - 'CFURLIsFileReferenceURL'); - late final _CFURLIsFileReferenceURL = - _CFURLIsFileReferenceURLPtr.asFunction(); + late final _os_workgroup_copy_portPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(os_workgroup_t, + ffi.Pointer)>>('os_workgroup_copy_port'); + late final _os_workgroup_copy_port = _os_workgroup_copy_portPtr + .asFunction)>(); - CFURLRef CFURLCreateFileReferenceURL( - CFAllocatorRef allocator, - CFURLRef url, - ffi.Pointer error, + Dartos_workgroup_t os_workgroup_create_with_port( + ffi.Pointer name, + Dart__darwin_natural_t mach_port, ) { - return _CFURLCreateFileReferenceURL( - allocator, - url, - error, - ); + return OS_os_workgroup.castFromPointer( + _os_workgroup_create_with_port( + name, + mach_port, + ), + retain: false, + release: true); } - late final _CFURLCreateFileReferenceURLPtr = _lookup< + late final _os_workgroup_create_with_portPtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef, - ffi.Pointer)>>('CFURLCreateFileReferenceURL'); - late final _CFURLCreateFileReferenceURL = - _CFURLCreateFileReferenceURLPtr.asFunction< - CFURLRef Function( - CFAllocatorRef, CFURLRef, ffi.Pointer)>(); + os_workgroup_t Function(ffi.Pointer, + mach_port_t)>>('os_workgroup_create_with_port'); + late final _os_workgroup_create_with_port = _os_workgroup_create_with_portPtr + .asFunction, int)>(); - CFURLRef CFURLCreateFilePathURL( - CFAllocatorRef allocator, - CFURLRef url, - ffi.Pointer error, + Dartos_workgroup_t os_workgroup_create_with_workgroup( + ffi.Pointer name, + Dartos_workgroup_t wg, ) { - return _CFURLCreateFilePathURL( - allocator, - url, - error, - ); + return OS_os_workgroup.castFromPointer( + _os_workgroup_create_with_workgroup( + name, + wg.ref.pointer, + ), + retain: false, + release: true); } - late final _CFURLCreateFilePathURLPtr = _lookup< + late final _os_workgroup_create_with_workgroupPtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef, - ffi.Pointer)>>('CFURLCreateFilePathURL'); - late final _CFURLCreateFilePathURL = _CFURLCreateFilePathURLPtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFURLRef, ffi.Pointer)>(); + os_workgroup_t Function(ffi.Pointer, + os_workgroup_t)>>('os_workgroup_create_with_workgroup'); + late final _os_workgroup_create_with_workgroup = + _os_workgroup_create_with_workgroupPtr.asFunction< + os_workgroup_t Function(ffi.Pointer, os_workgroup_t)>(); - CFURLRef CFURLCreateFromFSRef( - CFAllocatorRef allocator, - ffi.Pointer fsRef, + int os_workgroup_join( + Dartos_workgroup_t wg, + os_workgroup_join_token_t token_out, ) { - return _CFURLCreateFromFSRef( - allocator, - fsRef, + return _os_workgroup_join( + wg.ref.pointer, + token_out, ); } - late final _CFURLCreateFromFSRefPtr = _lookup< + late final _os_workgroup_joinPtr = _lookup< ffi.NativeFunction< - CFURLRef Function( - CFAllocatorRef, ffi.Pointer)>>('CFURLCreateFromFSRef'); - late final _CFURLCreateFromFSRef = _CFURLCreateFromFSRefPtr.asFunction< - CFURLRef Function(CFAllocatorRef, ffi.Pointer)>(); + ffi.Int Function( + os_workgroup_t, os_workgroup_join_token_t)>>('os_workgroup_join'); + late final _os_workgroup_join = _os_workgroup_joinPtr + .asFunction(); - int CFURLGetFSRef( - CFURLRef url, - ffi.Pointer fsRef, + void os_workgroup_leave( + Dartos_workgroup_t wg, + os_workgroup_join_token_t token, ) { - return _CFURLGetFSRef( - url, - fsRef, + return _os_workgroup_leave( + wg.ref.pointer, + token, ); } - late final _CFURLGetFSRefPtr = _lookup< - ffi.NativeFunction)>>( - 'CFURLGetFSRef'); - late final _CFURLGetFSRef = _CFURLGetFSRefPtr.asFunction< - int Function(CFURLRef, ffi.Pointer)>(); + late final _os_workgroup_leavePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(os_workgroup_t, + os_workgroup_join_token_t)>>('os_workgroup_leave'); + late final _os_workgroup_leave = _os_workgroup_leavePtr + .asFunction(); - int CFURLCopyResourcePropertyForKey( - CFURLRef url, - CFStringRef key, - ffi.Pointer propertyValueTypeRefPtr, - ffi.Pointer error, + int os_workgroup_set_working_arena( + Dartos_workgroup_t wg, + ffi.Pointer arena, + int max_workers, + os_workgroup_working_arena_destructor_t destructor, ) { - return _CFURLCopyResourcePropertyForKey( - url, - key, - propertyValueTypeRefPtr, - error, + return _os_workgroup_set_working_arena( + wg.ref.pointer, + arena, + max_workers, + destructor, ); } - late final _CFURLCopyResourcePropertyForKeyPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFURLRef, CFStringRef, ffi.Pointer, - ffi.Pointer)>>('CFURLCopyResourcePropertyForKey'); - late final _CFURLCopyResourcePropertyForKey = - _CFURLCopyResourcePropertyForKeyPtr.asFunction< - int Function(CFURLRef, CFStringRef, ffi.Pointer, - ffi.Pointer)>(); + late final _os_workgroup_set_working_arenaPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(os_workgroup_t, ffi.Pointer, + ffi.Uint32, os_workgroup_working_arena_destructor_t)>>( + 'os_workgroup_set_working_arena'); + late final _os_workgroup_set_working_arena = + _os_workgroup_set_working_arenaPtr.asFunction< + int Function(os_workgroup_t, ffi.Pointer, int, + os_workgroup_working_arena_destructor_t)>(); - CFDictionaryRef CFURLCopyResourcePropertiesForKeys( - CFURLRef url, - CFArrayRef keys, - ffi.Pointer error, + ffi.Pointer os_workgroup_get_working_arena( + Dartos_workgroup_t wg, + ffi.Pointer index_out, ) { - return _CFURLCopyResourcePropertiesForKeys( - url, - keys, - error, + return _os_workgroup_get_working_arena( + wg.ref.pointer, + index_out, ); } - late final _CFURLCopyResourcePropertiesForKeysPtr = _lookup< - ffi.NativeFunction< - CFDictionaryRef Function(CFURLRef, CFArrayRef, - ffi.Pointer)>>('CFURLCopyResourcePropertiesForKeys'); - late final _CFURLCopyResourcePropertiesForKeys = - _CFURLCopyResourcePropertiesForKeysPtr.asFunction< - CFDictionaryRef Function( - CFURLRef, CFArrayRef, ffi.Pointer)>(); + late final _os_workgroup_get_working_arenaPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + os_workgroup_t, ffi.Pointer)>>( + 'os_workgroup_get_working_arena'); + late final _os_workgroup_get_working_arena = + _os_workgroup_get_working_arenaPtr.asFunction< + ffi.Pointer Function( + os_workgroup_t, ffi.Pointer)>(); - int CFURLSetResourcePropertyForKey( - CFURLRef url, - CFStringRef key, - CFTypeRef propertyValue, - ffi.Pointer error, + void os_workgroup_cancel( + Dartos_workgroup_t wg, ) { - return _CFURLSetResourcePropertyForKey( - url, - key, - propertyValue, - error, + return _os_workgroup_cancel( + wg.ref.pointer, ); } - late final _CFURLSetResourcePropertyForKeyPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFURLRef, CFStringRef, CFTypeRef, - ffi.Pointer)>>('CFURLSetResourcePropertyForKey'); - late final _CFURLSetResourcePropertyForKey = - _CFURLSetResourcePropertyForKeyPtr.asFunction< - int Function( - CFURLRef, CFStringRef, CFTypeRef, ffi.Pointer)>(); + late final _os_workgroup_cancelPtr = + _lookup>( + 'os_workgroup_cancel'); + late final _os_workgroup_cancel = + _os_workgroup_cancelPtr.asFunction(); - int CFURLSetResourcePropertiesForKeys( - CFURLRef url, - CFDictionaryRef keyedPropertyValues, - ffi.Pointer error, + bool os_workgroup_testcancel( + Dartos_workgroup_t wg, ) { - return _CFURLSetResourcePropertiesForKeys( - url, - keyedPropertyValues, - error, + return _os_workgroup_testcancel( + wg.ref.pointer, ); } - late final _CFURLSetResourcePropertiesForKeysPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFURLRef, CFDictionaryRef, - ffi.Pointer)>>('CFURLSetResourcePropertiesForKeys'); - late final _CFURLSetResourcePropertiesForKeys = - _CFURLSetResourcePropertiesForKeysPtr.asFunction< - int Function(CFURLRef, CFDictionaryRef, ffi.Pointer)>(); - - late final ffi.Pointer _kCFURLKeysOfUnsetValuesKey = - _lookup('kCFURLKeysOfUnsetValuesKey'); - - CFStringRef get kCFURLKeysOfUnsetValuesKey => - _kCFURLKeysOfUnsetValuesKey.value; + late final _os_workgroup_testcancelPtr = + _lookup>( + 'os_workgroup_testcancel'); + late final _os_workgroup_testcancel = + _os_workgroup_testcancelPtr.asFunction(); - void CFURLClearResourcePropertyCacheForKey( - CFURLRef url, - CFStringRef key, + int os_workgroup_max_parallel_threads( + Dartos_workgroup_t wg, + os_workgroup_mpt_attr_t attr, ) { - return _CFURLClearResourcePropertyCacheForKey( - url, - key, + return _os_workgroup_max_parallel_threads( + wg.ref.pointer, + attr, ); } - late final _CFURLClearResourcePropertyCacheForKeyPtr = - _lookup>( - 'CFURLClearResourcePropertyCacheForKey'); - late final _CFURLClearResourcePropertyCacheForKey = - _CFURLClearResourcePropertyCacheForKeyPtr.asFunction< - void Function(CFURLRef, CFStringRef)>(); + late final _os_workgroup_max_parallel_threadsPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(os_workgroup_t, + os_workgroup_mpt_attr_t)>>('os_workgroup_max_parallel_threads'); + late final _os_workgroup_max_parallel_threads = + _os_workgroup_max_parallel_threadsPtr + .asFunction(); - void CFURLClearResourcePropertyCache( - CFURLRef url, + int os_workgroup_interval_start( + Dartos_workgroup_interval_t wg, + int start, + int deadline, + os_workgroup_interval_data_t data, ) { - return _CFURLClearResourcePropertyCache( - url, + return _os_workgroup_interval_start( + wg.ref.pointer, + start, + deadline, + data, ); } - late final _CFURLClearResourcePropertyCachePtr = - _lookup>( - 'CFURLClearResourcePropertyCache'); - late final _CFURLClearResourcePropertyCache = - _CFURLClearResourcePropertyCachePtr.asFunction(); + late final _os_workgroup_interval_startPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(os_workgroup_interval_t, ffi.Uint64, ffi.Uint64, + os_workgroup_interval_data_t)>>('os_workgroup_interval_start'); + late final _os_workgroup_interval_start = + _os_workgroup_interval_startPtr.asFunction< + int Function(os_workgroup_interval_t, int, int, + os_workgroup_interval_data_t)>(); - void CFURLSetTemporaryResourcePropertyForKey( - CFURLRef url, - CFStringRef key, - CFTypeRef propertyValue, + int os_workgroup_interval_update( + Dartos_workgroup_interval_t wg, + int deadline, + os_workgroup_interval_data_t data, ) { - return _CFURLSetTemporaryResourcePropertyForKey( - url, - key, - propertyValue, + return _os_workgroup_interval_update( + wg.ref.pointer, + deadline, + data, ); } - late final _CFURLSetTemporaryResourcePropertyForKeyPtr = _lookup< - ffi - .NativeFunction>( - 'CFURLSetTemporaryResourcePropertyForKey'); - late final _CFURLSetTemporaryResourcePropertyForKey = - _CFURLSetTemporaryResourcePropertyForKeyPtr.asFunction< - void Function(CFURLRef, CFStringRef, CFTypeRef)>(); + late final _os_workgroup_interval_updatePtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(os_workgroup_interval_t, ffi.Uint64, + os_workgroup_interval_data_t)>>('os_workgroup_interval_update'); + late final _os_workgroup_interval_update = + _os_workgroup_interval_updatePtr.asFunction< + int Function( + os_workgroup_interval_t, int, os_workgroup_interval_data_t)>(); - int CFURLResourceIsReachable( - CFURLRef url, - ffi.Pointer error, + int os_workgroup_interval_finish( + Dartos_workgroup_interval_t wg, + os_workgroup_interval_data_t data, ) { - return _CFURLResourceIsReachable( - url, - error, + return _os_workgroup_interval_finish( + wg.ref.pointer, + data, ); } - late final _CFURLResourceIsReachablePtr = _lookup< - ffi - .NativeFunction)>>( - 'CFURLResourceIsReachable'); - late final _CFURLResourceIsReachable = _CFURLResourceIsReachablePtr - .asFunction)>(); - - late final ffi.Pointer _kCFURLNameKey = - _lookup('kCFURLNameKey'); + late final _os_workgroup_interval_finishPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(os_workgroup_interval_t, + os_workgroup_interval_data_t)>>('os_workgroup_interval_finish'); + late final _os_workgroup_interval_finish = + _os_workgroup_interval_finishPtr.asFunction< + int Function( + os_workgroup_interval_t, os_workgroup_interval_data_t)>(); - CFStringRef get kCFURLNameKey => _kCFURLNameKey.value; + Dartos_workgroup_parallel_t os_workgroup_parallel_create( + ffi.Pointer name, + os_workgroup_attr_t attr, + ) { + return OS_os_workgroup.castFromPointer( + _os_workgroup_parallel_create( + name, + attr, + ), + retain: false, + release: true); + } - late final ffi.Pointer _kCFURLLocalizedNameKey = - _lookup('kCFURLLocalizedNameKey'); + late final _os_workgroup_parallel_createPtr = _lookup< + ffi.NativeFunction< + os_workgroup_parallel_t Function(ffi.Pointer, + os_workgroup_attr_t)>>('os_workgroup_parallel_create'); + late final _os_workgroup_parallel_create = + _os_workgroup_parallel_createPtr.asFunction< + os_workgroup_parallel_t Function( + ffi.Pointer, os_workgroup_attr_t)>(); - CFStringRef get kCFURLLocalizedNameKey => _kCFURLLocalizedNameKey.value; + int dispatch_time( + int when, + int delta, + ) { + return _dispatch_time( + when, + delta, + ); + } - late final ffi.Pointer _kCFURLIsRegularFileKey = - _lookup('kCFURLIsRegularFileKey'); + late final _dispatch_timePtr = _lookup< + ffi.NativeFunction< + dispatch_time_t Function( + dispatch_time_t, ffi.Int64)>>('dispatch_time'); + late final _dispatch_time = + _dispatch_timePtr.asFunction(); - CFStringRef get kCFURLIsRegularFileKey => _kCFURLIsRegularFileKey.value; + int dispatch_walltime( + ffi.Pointer when, + int delta, + ) { + return _dispatch_walltime( + when, + delta, + ); + } - late final ffi.Pointer _kCFURLIsDirectoryKey = - _lookup('kCFURLIsDirectoryKey'); + late final _dispatch_walltimePtr = _lookup< + ffi.NativeFunction< + dispatch_time_t Function( + ffi.Pointer, ffi.Int64)>>('dispatch_walltime'); + late final _dispatch_walltime = _dispatch_walltimePtr + .asFunction, int)>(); - CFStringRef get kCFURLIsDirectoryKey => _kCFURLIsDirectoryKey.value; + qos_class_t qos_class_self() { + return qos_class_t.fromValue(_qos_class_self()); + } - late final ffi.Pointer _kCFURLIsSymbolicLinkKey = - _lookup('kCFURLIsSymbolicLinkKey'); + late final _qos_class_selfPtr = + _lookup>('qos_class_self'); + late final _qos_class_self = _qos_class_selfPtr.asFunction(); - CFStringRef get kCFURLIsSymbolicLinkKey => _kCFURLIsSymbolicLinkKey.value; + qos_class_t qos_class_main() { + return qos_class_t.fromValue(_qos_class_main()); + } - late final ffi.Pointer _kCFURLIsVolumeKey = - _lookup('kCFURLIsVolumeKey'); + late final _qos_class_mainPtr = + _lookup>('qos_class_main'); + late final _qos_class_main = _qos_class_mainPtr.asFunction(); - CFStringRef get kCFURLIsVolumeKey => _kCFURLIsVolumeKey.value; + void dispatch_retain( + Dartdispatch_object_t object, + ) { + return _dispatch_retain( + object.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLIsPackageKey = - _lookup('kCFURLIsPackageKey'); + late final _dispatch_retainPtr = + _lookup>( + 'dispatch_retain'); + late final _dispatch_retain = + _dispatch_retainPtr.asFunction(); - CFStringRef get kCFURLIsPackageKey => _kCFURLIsPackageKey.value; + void dispatch_release( + Dartdispatch_object_t object, + ) { + return _dispatch_release( + object.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLIsApplicationKey = - _lookup('kCFURLIsApplicationKey'); + late final _dispatch_releasePtr = + _lookup>( + 'dispatch_release'); + late final _dispatch_release = + _dispatch_releasePtr.asFunction(); - CFStringRef get kCFURLIsApplicationKey => _kCFURLIsApplicationKey.value; + ffi.Pointer dispatch_get_context( + Dartdispatch_object_t object, + ) { + return _dispatch_get_context( + object.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLApplicationIsScriptableKey = - _lookup('kCFURLApplicationIsScriptableKey'); + late final _dispatch_get_contextPtr = _lookup< + ffi + .NativeFunction Function(dispatch_object_t)>>( + 'dispatch_get_context'); + late final _dispatch_get_context = _dispatch_get_contextPtr + .asFunction Function(dispatch_object_t)>(); - CFStringRef get kCFURLApplicationIsScriptableKey => - _kCFURLApplicationIsScriptableKey.value; + void dispatch_set_context( + Dartdispatch_object_t object, + ffi.Pointer context, + ) { + return _dispatch_set_context( + object.ref.pointer, + context, + ); + } - late final ffi.Pointer _kCFURLIsSystemImmutableKey = - _lookup('kCFURLIsSystemImmutableKey'); + late final _dispatch_set_contextPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_object_t, + ffi.Pointer)>>('dispatch_set_context'); + late final _dispatch_set_context = _dispatch_set_contextPtr + .asFunction)>(); - CFStringRef get kCFURLIsSystemImmutableKey => - _kCFURLIsSystemImmutableKey.value; + void dispatch_set_finalizer_f( + Dartdispatch_object_t object, + dispatch_function_t finalizer, + ) { + return _dispatch_set_finalizer_f( + object.ref.pointer, + finalizer, + ); + } - late final ffi.Pointer _kCFURLIsUserImmutableKey = - _lookup('kCFURLIsUserImmutableKey'); + late final _dispatch_set_finalizer_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_object_t, + dispatch_function_t)>>('dispatch_set_finalizer_f'); + late final _dispatch_set_finalizer_f = _dispatch_set_finalizer_fPtr + .asFunction(); - CFStringRef get kCFURLIsUserImmutableKey => _kCFURLIsUserImmutableKey.value; - - late final ffi.Pointer _kCFURLIsHiddenKey = - _lookup('kCFURLIsHiddenKey'); - - CFStringRef get kCFURLIsHiddenKey => _kCFURLIsHiddenKey.value; + void dispatch_activate( + Dartdispatch_object_t object, + ) { + return _dispatch_activate( + object.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLHasHiddenExtensionKey = - _lookup('kCFURLHasHiddenExtensionKey'); + late final _dispatch_activatePtr = + _lookup>( + 'dispatch_activate'); + late final _dispatch_activate = + _dispatch_activatePtr.asFunction(); - CFStringRef get kCFURLHasHiddenExtensionKey => - _kCFURLHasHiddenExtensionKey.value; + void dispatch_suspend( + Dartdispatch_object_t object, + ) { + return _dispatch_suspend( + object.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLCreationDateKey = - _lookup('kCFURLCreationDateKey'); + late final _dispatch_suspendPtr = + _lookup>( + 'dispatch_suspend'); + late final _dispatch_suspend = + _dispatch_suspendPtr.asFunction(); - CFStringRef get kCFURLCreationDateKey => _kCFURLCreationDateKey.value; + void dispatch_resume( + Dartdispatch_object_t object, + ) { + return _dispatch_resume( + object.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLContentAccessDateKey = - _lookup('kCFURLContentAccessDateKey'); + late final _dispatch_resumePtr = + _lookup>( + 'dispatch_resume'); + late final _dispatch_resume = + _dispatch_resumePtr.asFunction(); - CFStringRef get kCFURLContentAccessDateKey => - _kCFURLContentAccessDateKey.value; + void dispatch_set_qos_class_floor( + Dartdispatch_object_t object, + qos_class_t qos_class, + int relative_priority, + ) { + return _dispatch_set_qos_class_floor( + object.ref.pointer, + qos_class.value, + relative_priority, + ); + } - late final ffi.Pointer _kCFURLContentModificationDateKey = - _lookup('kCFURLContentModificationDateKey'); + late final _dispatch_set_qos_class_floorPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_object_t, ffi.UnsignedInt, + ffi.Int)>>('dispatch_set_qos_class_floor'); + late final _dispatch_set_qos_class_floor = _dispatch_set_qos_class_floorPtr + .asFunction(); - CFStringRef get kCFURLContentModificationDateKey => - _kCFURLContentModificationDateKey.value; + int dispatch_wait( + ffi.Pointer object, + int timeout, + ) { + return _dispatch_wait( + object, + timeout, + ); + } - late final ffi.Pointer _kCFURLAttributeModificationDateKey = - _lookup('kCFURLAttributeModificationDateKey'); + late final _dispatch_waitPtr = _lookup< + ffi.NativeFunction< + ffi.IntPtr Function( + ffi.Pointer, dispatch_time_t)>>('dispatch_wait'); + late final _dispatch_wait = + _dispatch_waitPtr.asFunction, int)>(); - CFStringRef get kCFURLAttributeModificationDateKey => - _kCFURLAttributeModificationDateKey.value; + void dispatch_notify( + ffi.Pointer object, + Dartdispatch_object_t queue, + Dartdispatch_block_t notification_block, + ) { + return _dispatch_notify( + object, + queue.ref.pointer, + notification_block.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLFileIdentifierKey = - _lookup('kCFURLFileIdentifierKey'); + late final _dispatch_notifyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, dispatch_object_t, + dispatch_block_t)>>('dispatch_notify'); + late final _dispatch_notify = _dispatch_notifyPtr.asFunction< + void Function( + ffi.Pointer, dispatch_object_t, dispatch_block_t)>(); - CFStringRef get kCFURLFileIdentifierKey => _kCFURLFileIdentifierKey.value; + void dispatch_cancel( + ffi.Pointer object, + ) { + return _dispatch_cancel( + object, + ); + } - late final ffi.Pointer _kCFURLFileContentIdentifierKey = - _lookup('kCFURLFileContentIdentifierKey'); + late final _dispatch_cancelPtr = + _lookup)>>( + 'dispatch_cancel'); + late final _dispatch_cancel = + _dispatch_cancelPtr.asFunction)>(); - CFStringRef get kCFURLFileContentIdentifierKey => - _kCFURLFileContentIdentifierKey.value; + int dispatch_testcancel( + ffi.Pointer object, + ) { + return _dispatch_testcancel( + object, + ); + } - late final ffi.Pointer _kCFURLMayShareFileContentKey = - _lookup('kCFURLMayShareFileContentKey'); + late final _dispatch_testcancelPtr = + _lookup)>>( + 'dispatch_testcancel'); + late final _dispatch_testcancel = + _dispatch_testcancelPtr.asFunction)>(); - CFStringRef get kCFURLMayShareFileContentKey => - _kCFURLMayShareFileContentKey.value; + void dispatch_debug( + Dartdispatch_object_t object, + ffi.Pointer message, + ) { + return _dispatch_debug( + object.ref.pointer, + message, + ); + } - late final ffi.Pointer _kCFURLMayHaveExtendedAttributesKey = - _lookup('kCFURLMayHaveExtendedAttributesKey'); + late final _dispatch_debugPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_object_t, ffi.Pointer)>>('dispatch_debug'); + late final _dispatch_debug = _dispatch_debugPtr + .asFunction)>(); - CFStringRef get kCFURLMayHaveExtendedAttributesKey => - _kCFURLMayHaveExtendedAttributesKey.value; + void dispatch_debugv( + Dartdispatch_object_t object, + ffi.Pointer message, + va_list ap, + ) { + return _dispatch_debugv( + object.ref.pointer, + message, + ap, + ); + } - late final ffi.Pointer _kCFURLIsPurgeableKey = - _lookup('kCFURLIsPurgeableKey'); + late final _dispatch_debugvPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_object_t, ffi.Pointer, + va_list)>>('dispatch_debugv'); + late final _dispatch_debugv = _dispatch_debugvPtr.asFunction< + void Function(dispatch_object_t, ffi.Pointer, va_list)>(); - CFStringRef get kCFURLIsPurgeableKey => _kCFURLIsPurgeableKey.value; + void dispatch_async( + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_async( + queue.ref.pointer, + block.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLIsSparseKey = - _lookup('kCFURLIsSparseKey'); + late final _dispatch_asyncPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_queue_t, dispatch_block_t)>>('dispatch_async'); + late final _dispatch_async = _dispatch_asyncPtr + .asFunction(); - CFStringRef get kCFURLIsSparseKey => _kCFURLIsSparseKey.value; + void dispatch_async_f( + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_async_f( + queue.ref.pointer, + context, + work, + ); + } - late final ffi.Pointer _kCFURLLinkCountKey = - _lookup('kCFURLLinkCountKey'); + late final _dispatch_async_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>>('dispatch_async_f'); + late final _dispatch_async_f = _dispatch_async_fPtr.asFunction< + void Function( + dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); - CFStringRef get kCFURLLinkCountKey => _kCFURLLinkCountKey.value; + void dispatch_sync( + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_sync( + queue.ref.pointer, + block.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLParentDirectoryURLKey = - _lookup('kCFURLParentDirectoryURLKey'); + late final _dispatch_syncPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_queue_t, dispatch_block_t)>>('dispatch_sync'); + late final _dispatch_sync = _dispatch_syncPtr + .asFunction(); - CFStringRef get kCFURLParentDirectoryURLKey => - _kCFURLParentDirectoryURLKey.value; + void dispatch_sync_f( + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_sync_f( + queue.ref.pointer, + context, + work, + ); + } - late final ffi.Pointer _kCFURLVolumeURLKey = - _lookup('kCFURLVolumeURLKey'); + late final _dispatch_sync_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>>('dispatch_sync_f'); + late final _dispatch_sync_f = _dispatch_sync_fPtr.asFunction< + void Function( + dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); - CFStringRef get kCFURLVolumeURLKey => _kCFURLVolumeURLKey.value; + void dispatch_async_and_wait( + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_async_and_wait( + queue.ref.pointer, + block.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLTypeIdentifierKey = - _lookup('kCFURLTypeIdentifierKey'); + late final _dispatch_async_and_waitPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_queue_t, dispatch_block_t)>>('dispatch_async_and_wait'); + late final _dispatch_async_and_wait = _dispatch_async_and_waitPtr + .asFunction(); - CFStringRef get kCFURLTypeIdentifierKey => _kCFURLTypeIdentifierKey.value; + void dispatch_async_and_wait_f( + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_async_and_wait_f( + queue.ref.pointer, + context, + work, + ); + } - late final ffi.Pointer _kCFURLLocalizedTypeDescriptionKey = - _lookup('kCFURLLocalizedTypeDescriptionKey'); + late final _dispatch_async_and_wait_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>>('dispatch_async_and_wait_f'); + late final _dispatch_async_and_wait_f = + _dispatch_async_and_wait_fPtr.asFunction< + void Function( + dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); - CFStringRef get kCFURLLocalizedTypeDescriptionKey => - _kCFURLLocalizedTypeDescriptionKey.value; + void dispatch_apply( + int iterations, + Dartdispatch_queue_t queue, + objc.ObjCBlock block, + ) { + return _dispatch_apply( + iterations, + queue.ref.pointer, + block.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLLabelNumberKey = - _lookup('kCFURLLabelNumberKey'); + late final _dispatch_applyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Size, dispatch_queue_t, + ffi.Pointer)>>('dispatch_apply'); + late final _dispatch_apply = _dispatch_applyPtr.asFunction< + void Function(int, dispatch_queue_t, ffi.Pointer)>(); - CFStringRef get kCFURLLabelNumberKey => _kCFURLLabelNumberKey.value; + void dispatch_apply_f( + int iterations, + Dartdispatch_queue_t queue, + ffi.Pointer context, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer context, ffi.Size iteration)>> + work, + ) { + return _dispatch_apply_f( + iterations, + queue.ref.pointer, + context, + work, + ); + } - late final ffi.Pointer _kCFURLLabelColorKey = - _lookup('kCFURLLabelColorKey'); + late final _dispatch_apply_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Size, + dispatch_queue_t, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer context, + ffi.Size iteration)>>)>>('dispatch_apply_f'); + late final _dispatch_apply_f = _dispatch_apply_fPtr.asFunction< + void Function( + int, + dispatch_queue_t, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer context, ffi.Size iteration)>>)>(); - CFStringRef get kCFURLLabelColorKey => _kCFURLLabelColorKey.value; + Dartdispatch_queue_t dispatch_get_current_queue() { + return objc.NSObject.castFromPointer(_dispatch_get_current_queue(), + retain: true, release: true); + } - late final ffi.Pointer _kCFURLLocalizedLabelKey = - _lookup('kCFURLLocalizedLabelKey'); + late final _dispatch_get_current_queuePtr = + _lookup>( + 'dispatch_get_current_queue'); + late final _dispatch_get_current_queue = + _dispatch_get_current_queuePtr.asFunction(); - CFStringRef get kCFURLLocalizedLabelKey => _kCFURLLocalizedLabelKey.value; + late final ffi.Pointer __dispatch_main_q = + _lookup('_dispatch_main_q'); - late final ffi.Pointer _kCFURLEffectiveIconKey = - _lookup('kCFURLEffectiveIconKey'); + ffi.Pointer get _dispatch_main_q => __dispatch_main_q; - CFStringRef get kCFURLEffectiveIconKey => _kCFURLEffectiveIconKey.value; + Dartdispatch_queue_global_t dispatch_get_global_queue( + int identifier, + int flags, + ) { + return objc.NSObject.castFromPointer( + _dispatch_get_global_queue( + identifier, + flags, + ), + retain: true, + release: true); + } - late final ffi.Pointer _kCFURLCustomIconKey = - _lookup('kCFURLCustomIconKey'); + late final _dispatch_get_global_queuePtr = _lookup< + ffi.NativeFunction< + dispatch_queue_global_t Function( + ffi.IntPtr, ffi.UintPtr)>>('dispatch_get_global_queue'); + late final _dispatch_get_global_queue = _dispatch_get_global_queuePtr + .asFunction(); - CFStringRef get kCFURLCustomIconKey => _kCFURLCustomIconKey.value; + late final ffi.Pointer + __dispatch_queue_attr_concurrent = + _lookup('_dispatch_queue_attr_concurrent'); - late final ffi.Pointer _kCFURLFileResourceIdentifierKey = - _lookup('kCFURLFileResourceIdentifierKey'); + ffi.Pointer get _dispatch_queue_attr_concurrent => + __dispatch_queue_attr_concurrent; - CFStringRef get kCFURLFileResourceIdentifierKey => - _kCFURLFileResourceIdentifierKey.value; + Dartdispatch_queue_attr_t dispatch_queue_attr_make_initially_inactive( + Dartdispatch_queue_attr_t attr, + ) { + return objc.NSObject.castFromPointer( + _dispatch_queue_attr_make_initially_inactive( + attr.ref.pointer, + ), + retain: true, + release: true); + } - late final ffi.Pointer _kCFURLVolumeIdentifierKey = - _lookup('kCFURLVolumeIdentifierKey'); + late final _dispatch_queue_attr_make_initially_inactivePtr = _lookup< + ffi.NativeFunction< + dispatch_queue_attr_t Function(dispatch_queue_attr_t)>>( + 'dispatch_queue_attr_make_initially_inactive'); + late final _dispatch_queue_attr_make_initially_inactive = + _dispatch_queue_attr_make_initially_inactivePtr + .asFunction(); - CFStringRef get kCFURLVolumeIdentifierKey => _kCFURLVolumeIdentifierKey.value; + Dartdispatch_queue_attr_t dispatch_queue_attr_make_with_autorelease_frequency( + Dartdispatch_queue_attr_t attr, + dispatch_autorelease_frequency_t frequency, + ) { + return objc.NSObject.castFromPointer( + _dispatch_queue_attr_make_with_autorelease_frequency( + attr.ref.pointer, + frequency.value, + ), + retain: true, + release: true); + } - late final ffi.Pointer _kCFURLPreferredIOBlockSizeKey = - _lookup('kCFURLPreferredIOBlockSizeKey'); + late final _dispatch_queue_attr_make_with_autorelease_frequencyPtr = _lookup< + ffi.NativeFunction< + dispatch_queue_attr_t Function( + dispatch_queue_attr_t, ffi.UnsignedLong)>>( + 'dispatch_queue_attr_make_with_autorelease_frequency'); + late final _dispatch_queue_attr_make_with_autorelease_frequency = + _dispatch_queue_attr_make_with_autorelease_frequencyPtr.asFunction< + dispatch_queue_attr_t Function(dispatch_queue_attr_t, int)>(); - CFStringRef get kCFURLPreferredIOBlockSizeKey => - _kCFURLPreferredIOBlockSizeKey.value; + Dartdispatch_queue_attr_t dispatch_queue_attr_make_with_qos_class( + Dartdispatch_queue_attr_t attr, + qos_class_t qos_class, + int relative_priority, + ) { + return objc.NSObject.castFromPointer( + _dispatch_queue_attr_make_with_qos_class( + attr.ref.pointer, + qos_class.value, + relative_priority, + ), + retain: true, + release: true); + } - late final ffi.Pointer _kCFURLIsReadableKey = - _lookup('kCFURLIsReadableKey'); + late final _dispatch_queue_attr_make_with_qos_classPtr = _lookup< + ffi.NativeFunction< + dispatch_queue_attr_t Function(dispatch_queue_attr_t, ffi.UnsignedInt, + ffi.Int)>>('dispatch_queue_attr_make_with_qos_class'); + late final _dispatch_queue_attr_make_with_qos_class = + _dispatch_queue_attr_make_with_qos_classPtr.asFunction< + dispatch_queue_attr_t Function(dispatch_queue_attr_t, int, int)>(); - CFStringRef get kCFURLIsReadableKey => _kCFURLIsReadableKey.value; + Dartdispatch_queue_t dispatch_queue_create_with_target( + ffi.Pointer label, + Dartdispatch_queue_attr_t attr, + Dartdispatch_queue_t target, + ) { + return objc.NSObject.castFromPointer( + _dispatch_queue_create_with_target( + label, + attr.ref.pointer, + target.ref.pointer, + ), + retain: false, + release: true); + } - late final ffi.Pointer _kCFURLIsWritableKey = - _lookup('kCFURLIsWritableKey'); + late final _dispatch_queue_create_with_targetPtr = _lookup< + ffi.NativeFunction< + dispatch_queue_t Function( + ffi.Pointer, + dispatch_queue_attr_t, + dispatch_queue_t)>>('dispatch_queue_create_with_target'); + late final _dispatch_queue_create_with_target = + _dispatch_queue_create_with_targetPtr.asFunction< + dispatch_queue_t Function(ffi.Pointer, + dispatch_queue_attr_t, dispatch_queue_t)>(); - CFStringRef get kCFURLIsWritableKey => _kCFURLIsWritableKey.value; + Dartdispatch_queue_t dispatch_queue_create( + ffi.Pointer label, + Dartdispatch_queue_attr_t attr, + ) { + return objc.NSObject.castFromPointer( + _dispatch_queue_create( + label, + attr.ref.pointer, + ), + retain: false, + release: true); + } - late final ffi.Pointer _kCFURLIsExecutableKey = - _lookup('kCFURLIsExecutableKey'); + late final _dispatch_queue_createPtr = _lookup< + ffi.NativeFunction< + dispatch_queue_t Function(ffi.Pointer, + dispatch_queue_attr_t)>>('dispatch_queue_create'); + late final _dispatch_queue_create = _dispatch_queue_createPtr.asFunction< + dispatch_queue_t Function( + ffi.Pointer, dispatch_queue_attr_t)>(); - CFStringRef get kCFURLIsExecutableKey => _kCFURLIsExecutableKey.value; + ffi.Pointer dispatch_queue_get_label( + Dartdispatch_queue_t queue, + ) { + return _dispatch_queue_get_label( + queue.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLFileSecurityKey = - _lookup('kCFURLFileSecurityKey'); + late final _dispatch_queue_get_labelPtr = _lookup< + ffi.NativeFunction Function(dispatch_queue_t)>>( + 'dispatch_queue_get_label'); + late final _dispatch_queue_get_label = _dispatch_queue_get_labelPtr + .asFunction Function(dispatch_queue_t)>(); - CFStringRef get kCFURLFileSecurityKey => _kCFURLFileSecurityKey.value; + qos_class_t dispatch_queue_get_qos_class( + Dartdispatch_queue_t queue, + ffi.Pointer relative_priority_ptr, + ) { + return qos_class_t.fromValue(_dispatch_queue_get_qos_class( + queue.ref.pointer, + relative_priority_ptr, + )); + } - late final ffi.Pointer _kCFURLIsExcludedFromBackupKey = - _lookup('kCFURLIsExcludedFromBackupKey'); + late final _dispatch_queue_get_qos_classPtr = _lookup< + ffi.NativeFunction< + ffi.UnsignedInt Function(dispatch_queue_t, + ffi.Pointer)>>('dispatch_queue_get_qos_class'); + late final _dispatch_queue_get_qos_class = _dispatch_queue_get_qos_classPtr + .asFunction)>(); - CFStringRef get kCFURLIsExcludedFromBackupKey => - _kCFURLIsExcludedFromBackupKey.value; + void dispatch_set_target_queue( + Dartdispatch_object_t object, + Dartdispatch_queue_t queue, + ) { + return _dispatch_set_target_queue( + object.ref.pointer, + queue.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLTagNamesKey = - _lookup('kCFURLTagNamesKey'); + late final _dispatch_set_target_queuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_object_t, + dispatch_queue_t)>>('dispatch_set_target_queue'); + late final _dispatch_set_target_queue = _dispatch_set_target_queuePtr + .asFunction(); - CFStringRef get kCFURLTagNamesKey => _kCFURLTagNamesKey.value; + void dispatch_main() { + return _dispatch_main(); + } - late final ffi.Pointer _kCFURLPathKey = - _lookup('kCFURLPathKey'); + late final _dispatch_mainPtr = + _lookup>('dispatch_main'); + late final _dispatch_main = _dispatch_mainPtr.asFunction(); - CFStringRef get kCFURLPathKey => _kCFURLPathKey.value; + void dispatch_after( + Dartdispatch_time_t when, + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_after( + when, + queue.ref.pointer, + block.ref.pointer, + ); + } - late final ffi.Pointer _kCFURLCanonicalPathKey = - _lookup('kCFURLCanonicalPathKey'); + late final _dispatch_afterPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_time_t, dispatch_queue_t, + dispatch_block_t)>>('dispatch_after'); + late final _dispatch_after = _dispatch_afterPtr + .asFunction(); - CFStringRef get kCFURLCanonicalPathKey => _kCFURLCanonicalPathKey.value; - - late final ffi.Pointer _kCFURLIsMountTriggerKey = - _lookup('kCFURLIsMountTriggerKey'); + void dispatch_after_f( + Dartdispatch_time_t when, + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_after_f( + when, + queue.ref.pointer, + context, + work, + ); + } - CFStringRef get kCFURLIsMountTriggerKey => _kCFURLIsMountTriggerKey.value; + late final _dispatch_after_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_time_t, dispatch_queue_t, + ffi.Pointer, dispatch_function_t)>>('dispatch_after_f'); + late final _dispatch_after_f = _dispatch_after_fPtr.asFunction< + void Function( + int, dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); - late final ffi.Pointer _kCFURLGenerationIdentifierKey = - _lookup('kCFURLGenerationIdentifierKey'); + void dispatch_barrier_async( + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_barrier_async( + queue.ref.pointer, + block.ref.pointer, + ); + } - CFStringRef get kCFURLGenerationIdentifierKey => - _kCFURLGenerationIdentifierKey.value; + late final _dispatch_barrier_asyncPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_queue_t, dispatch_block_t)>>('dispatch_barrier_async'); + late final _dispatch_barrier_async = _dispatch_barrier_asyncPtr + .asFunction(); - late final ffi.Pointer _kCFURLDocumentIdentifierKey = - _lookup('kCFURLDocumentIdentifierKey'); + void dispatch_barrier_async_f( + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_barrier_async_f( + queue.ref.pointer, + context, + work, + ); + } - CFStringRef get kCFURLDocumentIdentifierKey => - _kCFURLDocumentIdentifierKey.value; + late final _dispatch_barrier_async_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>>('dispatch_barrier_async_f'); + late final _dispatch_barrier_async_f = + _dispatch_barrier_async_fPtr.asFunction< + void Function( + dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); - late final ffi.Pointer _kCFURLAddedToDirectoryDateKey = - _lookup('kCFURLAddedToDirectoryDateKey'); + void dispatch_barrier_sync( + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_barrier_sync( + queue.ref.pointer, + block.ref.pointer, + ); + } - CFStringRef get kCFURLAddedToDirectoryDateKey => - _kCFURLAddedToDirectoryDateKey.value; + late final _dispatch_barrier_syncPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_queue_t, dispatch_block_t)>>('dispatch_barrier_sync'); + late final _dispatch_barrier_sync = _dispatch_barrier_syncPtr + .asFunction(); - late final ffi.Pointer _kCFURLQuarantinePropertiesKey = - _lookup('kCFURLQuarantinePropertiesKey'); + void dispatch_barrier_sync_f( + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_barrier_sync_f( + queue.ref.pointer, + context, + work, + ); + } - CFStringRef get kCFURLQuarantinePropertiesKey => - _kCFURLQuarantinePropertiesKey.value; + late final _dispatch_barrier_sync_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>>('dispatch_barrier_sync_f'); + late final _dispatch_barrier_sync_f = _dispatch_barrier_sync_fPtr.asFunction< + void Function( + dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); - late final ffi.Pointer _kCFURLFileResourceTypeKey = - _lookup('kCFURLFileResourceTypeKey'); + void dispatch_barrier_async_and_wait( + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_barrier_async_and_wait( + queue.ref.pointer, + block.ref.pointer, + ); + } - CFStringRef get kCFURLFileResourceTypeKey => _kCFURLFileResourceTypeKey.value; + late final _dispatch_barrier_async_and_waitPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_queue_t, + dispatch_block_t)>>('dispatch_barrier_async_and_wait'); + late final _dispatch_barrier_async_and_wait = + _dispatch_barrier_async_and_waitPtr + .asFunction(); - late final ffi.Pointer _kCFURLFileResourceTypeNamedPipe = - _lookup('kCFURLFileResourceTypeNamedPipe'); + void dispatch_barrier_async_and_wait_f( + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_barrier_async_and_wait_f( + queue.ref.pointer, + context, + work, + ); + } - CFStringRef get kCFURLFileResourceTypeNamedPipe => - _kCFURLFileResourceTypeNamedPipe.value; + late final _dispatch_barrier_async_and_wait_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>>('dispatch_barrier_async_and_wait_f'); + late final _dispatch_barrier_async_and_wait_f = + _dispatch_barrier_async_and_wait_fPtr.asFunction< + void Function( + dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); - late final ffi.Pointer _kCFURLFileResourceTypeCharacterSpecial = - _lookup('kCFURLFileResourceTypeCharacterSpecial'); + void dispatch_queue_set_specific( + Dartdispatch_queue_t queue, + ffi.Pointer key, + ffi.Pointer context, + dispatch_function_t destructor, + ) { + return _dispatch_queue_set_specific( + queue.ref.pointer, + key, + context, + destructor, + ); + } - CFStringRef get kCFURLFileResourceTypeCharacterSpecial => - _kCFURLFileResourceTypeCharacterSpecial.value; + late final _dispatch_queue_set_specificPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_queue_t, + ffi.Pointer, + ffi.Pointer, + dispatch_function_t)>>('dispatch_queue_set_specific'); + late final _dispatch_queue_set_specific = + _dispatch_queue_set_specificPtr.asFunction< + void Function(dispatch_queue_t, ffi.Pointer, + ffi.Pointer, dispatch_function_t)>(); - late final ffi.Pointer _kCFURLFileResourceTypeDirectory = - _lookup('kCFURLFileResourceTypeDirectory'); + ffi.Pointer dispatch_queue_get_specific( + Dartdispatch_queue_t queue, + ffi.Pointer key, + ) { + return _dispatch_queue_get_specific( + queue.ref.pointer, + key, + ); + } - CFStringRef get kCFURLFileResourceTypeDirectory => - _kCFURLFileResourceTypeDirectory.value; + late final _dispatch_queue_get_specificPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(dispatch_queue_t, + ffi.Pointer)>>('dispatch_queue_get_specific'); + late final _dispatch_queue_get_specific = + _dispatch_queue_get_specificPtr.asFunction< + ffi.Pointer Function( + dispatch_queue_t, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLFileResourceTypeBlockSpecial = - _lookup('kCFURLFileResourceTypeBlockSpecial'); + ffi.Pointer dispatch_get_specific( + ffi.Pointer key, + ) { + return _dispatch_get_specific( + key, + ); + } - CFStringRef get kCFURLFileResourceTypeBlockSpecial => - _kCFURLFileResourceTypeBlockSpecial.value; + late final _dispatch_get_specificPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('dispatch_get_specific'); + late final _dispatch_get_specific = _dispatch_get_specificPtr + .asFunction Function(ffi.Pointer)>(); - late final ffi.Pointer _kCFURLFileResourceTypeRegular = - _lookup('kCFURLFileResourceTypeRegular'); + void dispatch_assert_queue( + Dartdispatch_queue_t queue, + ) { + return _dispatch_assert_queue( + queue.ref.pointer, + ); + } - CFStringRef get kCFURLFileResourceTypeRegular => - _kCFURLFileResourceTypeRegular.value; + late final _dispatch_assert_queuePtr = + _lookup>( + 'dispatch_assert_queue'); + late final _dispatch_assert_queue = + _dispatch_assert_queuePtr.asFunction(); - late final ffi.Pointer _kCFURLFileResourceTypeSymbolicLink = - _lookup('kCFURLFileResourceTypeSymbolicLink'); + void dispatch_assert_queue_barrier( + Dartdispatch_queue_t queue, + ) { + return _dispatch_assert_queue_barrier( + queue.ref.pointer, + ); + } - CFStringRef get kCFURLFileResourceTypeSymbolicLink => - _kCFURLFileResourceTypeSymbolicLink.value; + late final _dispatch_assert_queue_barrierPtr = + _lookup>( + 'dispatch_assert_queue_barrier'); + late final _dispatch_assert_queue_barrier = _dispatch_assert_queue_barrierPtr + .asFunction(); - late final ffi.Pointer _kCFURLFileResourceTypeSocket = - _lookup('kCFURLFileResourceTypeSocket'); + void dispatch_assert_queue_not( + Dartdispatch_queue_t queue, + ) { + return _dispatch_assert_queue_not( + queue.ref.pointer, + ); + } - CFStringRef get kCFURLFileResourceTypeSocket => - _kCFURLFileResourceTypeSocket.value; + late final _dispatch_assert_queue_notPtr = + _lookup>( + 'dispatch_assert_queue_not'); + late final _dispatch_assert_queue_not = _dispatch_assert_queue_notPtr + .asFunction(); - late final ffi.Pointer _kCFURLFileResourceTypeUnknown = - _lookup('kCFURLFileResourceTypeUnknown'); + int dispatch_allow_send_signals( + int preserve_signum, + ) { + return _dispatch_allow_send_signals( + preserve_signum, + ); + } - CFStringRef get kCFURLFileResourceTypeUnknown => - _kCFURLFileResourceTypeUnknown.value; + late final _dispatch_allow_send_signalsPtr = + _lookup>( + 'dispatch_allow_send_signals'); + late final _dispatch_allow_send_signals = + _dispatch_allow_send_signalsPtr.asFunction(); - late final ffi.Pointer _kCFURLFileSizeKey = - _lookup('kCFURLFileSizeKey'); + Dartdispatch_block_t dispatch_block_create( + dispatch_block_flags_t flags, + Dartdispatch_block_t block, + ) { + return ObjCBlock_ffiVoid.castFromPointer( + _dispatch_block_create( + flags.value, + block.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLFileSizeKey => _kCFURLFileSizeKey.value; + late final _dispatch_block_createPtr = _lookup< + ffi.NativeFunction< + dispatch_block_t Function( + ffi.UnsignedLong, dispatch_block_t)>>('dispatch_block_create'); + late final _dispatch_block_create = _dispatch_block_createPtr + .asFunction(); - late final ffi.Pointer _kCFURLFileAllocatedSizeKey = - _lookup('kCFURLFileAllocatedSizeKey'); + Dartdispatch_block_t dispatch_block_create_with_qos_class( + dispatch_block_flags_t flags, + qos_class_t qos_class, + int relative_priority, + Dartdispatch_block_t block, + ) { + return ObjCBlock_ffiVoid.castFromPointer( + _dispatch_block_create_with_qos_class( + flags.value, + qos_class.value, + relative_priority, + block.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLFileAllocatedSizeKey => - _kCFURLFileAllocatedSizeKey.value; + late final _dispatch_block_create_with_qos_classPtr = _lookup< + ffi.NativeFunction< + dispatch_block_t Function(ffi.UnsignedLong, ffi.UnsignedInt, ffi.Int, + dispatch_block_t)>>('dispatch_block_create_with_qos_class'); + late final _dispatch_block_create_with_qos_class = + _dispatch_block_create_with_qos_classPtr.asFunction< + dispatch_block_t Function(int, int, int, dispatch_block_t)>(); - late final ffi.Pointer _kCFURLTotalFileSizeKey = - _lookup('kCFURLTotalFileSizeKey'); + void dispatch_block_perform( + dispatch_block_flags_t flags, + Dartdispatch_block_t block, + ) { + return _dispatch_block_perform( + flags.value, + block.ref.pointer, + ); + } - CFStringRef get kCFURLTotalFileSizeKey => _kCFURLTotalFileSizeKey.value; + late final _dispatch_block_performPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.UnsignedLong, dispatch_block_t)>>('dispatch_block_perform'); + late final _dispatch_block_perform = _dispatch_block_performPtr + .asFunction(); - late final ffi.Pointer _kCFURLTotalFileAllocatedSizeKey = - _lookup('kCFURLTotalFileAllocatedSizeKey'); + int dispatch_block_wait( + Dartdispatch_block_t block, + Dartdispatch_time_t timeout, + ) { + return _dispatch_block_wait( + block.ref.pointer, + timeout, + ); + } - CFStringRef get kCFURLTotalFileAllocatedSizeKey => - _kCFURLTotalFileAllocatedSizeKey.value; + late final _dispatch_block_waitPtr = _lookup< + ffi.NativeFunction< + ffi.IntPtr Function( + dispatch_block_t, dispatch_time_t)>>('dispatch_block_wait'); + late final _dispatch_block_wait = + _dispatch_block_waitPtr.asFunction(); - late final ffi.Pointer _kCFURLIsAliasFileKey = - _lookup('kCFURLIsAliasFileKey'); + void dispatch_block_notify( + Dartdispatch_block_t block, + Dartdispatch_queue_t queue, + Dartdispatch_block_t notification_block, + ) { + return _dispatch_block_notify( + block.ref.pointer, + queue.ref.pointer, + notification_block.ref.pointer, + ); + } - CFStringRef get kCFURLIsAliasFileKey => _kCFURLIsAliasFileKey.value; + late final _dispatch_block_notifyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_block_t, dispatch_queue_t, + dispatch_block_t)>>('dispatch_block_notify'); + late final _dispatch_block_notify = _dispatch_block_notifyPtr.asFunction< + void Function(dispatch_block_t, dispatch_queue_t, dispatch_block_t)>(); - late final ffi.Pointer _kCFURLFileProtectionKey = - _lookup('kCFURLFileProtectionKey'); + void dispatch_block_cancel( + Dartdispatch_block_t block, + ) { + return _dispatch_block_cancel( + block.ref.pointer, + ); + } - CFStringRef get kCFURLFileProtectionKey => _kCFURLFileProtectionKey.value; + late final _dispatch_block_cancelPtr = + _lookup>( + 'dispatch_block_cancel'); + late final _dispatch_block_cancel = + _dispatch_block_cancelPtr.asFunction(); - late final ffi.Pointer _kCFURLFileProtectionNone = - _lookup('kCFURLFileProtectionNone'); + int dispatch_block_testcancel( + Dartdispatch_block_t block, + ) { + return _dispatch_block_testcancel( + block.ref.pointer, + ); + } - CFStringRef get kCFURLFileProtectionNone => _kCFURLFileProtectionNone.value; + late final _dispatch_block_testcancelPtr = + _lookup>( + 'dispatch_block_testcancel'); + late final _dispatch_block_testcancel = _dispatch_block_testcancelPtr + .asFunction(); - late final ffi.Pointer _kCFURLFileProtectionComplete = - _lookup('kCFURLFileProtectionComplete'); + late final ffi.Pointer _KERNEL_SECURITY_TOKEN = + _lookup('KERNEL_SECURITY_TOKEN'); - CFStringRef get kCFURLFileProtectionComplete => - _kCFURLFileProtectionComplete.value; + security_token_t get KERNEL_SECURITY_TOKEN => _KERNEL_SECURITY_TOKEN.ref; - late final ffi.Pointer _kCFURLFileProtectionCompleteUnlessOpen = - _lookup('kCFURLFileProtectionCompleteUnlessOpen'); + late final ffi.Pointer _KERNEL_AUDIT_TOKEN = + _lookup('KERNEL_AUDIT_TOKEN'); - CFStringRef get kCFURLFileProtectionCompleteUnlessOpen => - _kCFURLFileProtectionCompleteUnlessOpen.value; + audit_token_t get KERNEL_AUDIT_TOKEN => _KERNEL_AUDIT_TOKEN.ref; - late final ffi.Pointer - _kCFURLFileProtectionCompleteUntilFirstUserAuthentication = - _lookup( - 'kCFURLFileProtectionCompleteUntilFirstUserAuthentication'); + int mach_msg_overwrite( + ffi.Pointer msg, + int option, + int send_size, + int rcv_size, + int rcv_name, + int timeout, + int notify, + ffi.Pointer rcv_msg, + int rcv_limit, + ) { + return _mach_msg_overwrite( + msg, + option, + send_size, + rcv_size, + rcv_name, + timeout, + notify, + rcv_msg, + rcv_limit, + ); + } - CFStringRef get kCFURLFileProtectionCompleteUntilFirstUserAuthentication => - _kCFURLFileProtectionCompleteUntilFirstUserAuthentication.value; + late final _mach_msg_overwritePtr = _lookup< + ffi.NativeFunction< + mach_msg_return_t Function( + ffi.Pointer, + mach_msg_option_t, + mach_msg_size_t, + mach_msg_size_t, + mach_port_name_t, + mach_msg_timeout_t, + mach_port_name_t, + ffi.Pointer, + mach_msg_size_t)>>('mach_msg_overwrite'); + late final _mach_msg_overwrite = _mach_msg_overwritePtr.asFunction< + int Function(ffi.Pointer, int, int, int, int, int, int, + ffi.Pointer, int)>(); - late final ffi.Pointer - _kCFURLFileProtectionCompleteWhenUserInactive = - _lookup('kCFURLFileProtectionCompleteWhenUserInactive'); + int mach_msg( + ffi.Pointer msg, + int option, + int send_size, + int rcv_size, + int rcv_name, + int timeout, + int notify, + ) { + return _mach_msg( + msg, + option, + send_size, + rcv_size, + rcv_name, + timeout, + notify, + ); + } - CFStringRef get kCFURLFileProtectionCompleteWhenUserInactive => - _kCFURLFileProtectionCompleteWhenUserInactive.value; + late final _mach_msgPtr = _lookup< + ffi.NativeFunction< + mach_msg_return_t Function( + ffi.Pointer, + mach_msg_option_t, + mach_msg_size_t, + mach_msg_size_t, + mach_port_name_t, + mach_msg_timeout_t, + mach_port_name_t)>>('mach_msg'); + late final _mach_msg = _mach_msgPtr.asFunction< + int Function( + ffi.Pointer, int, int, int, int, int, int)>(); - late final ffi.Pointer _kCFURLDirectoryEntryCountKey = - _lookup('kCFURLDirectoryEntryCountKey'); + int mach_voucher_deallocate( + int voucher, + ) { + return _mach_voucher_deallocate( + voucher, + ); + } - CFStringRef get kCFURLDirectoryEntryCountKey => - _kCFURLDirectoryEntryCountKey.value; + late final _mach_voucher_deallocatePtr = + _lookup>( + 'mach_voucher_deallocate'); + late final _mach_voucher_deallocate = + _mach_voucher_deallocatePtr.asFunction(); - late final ffi.Pointer - _kCFURLVolumeLocalizedFormatDescriptionKey = - _lookup('kCFURLVolumeLocalizedFormatDescriptionKey'); + late final ffi.Pointer + __dispatch_source_type_data_add = + _lookup('_dispatch_source_type_data_add'); - CFStringRef get kCFURLVolumeLocalizedFormatDescriptionKey => - _kCFURLVolumeLocalizedFormatDescriptionKey.value; + ffi.Pointer get _dispatch_source_type_data_add => + __dispatch_source_type_data_add; - late final ffi.Pointer _kCFURLVolumeTotalCapacityKey = - _lookup('kCFURLVolumeTotalCapacityKey'); + late final ffi.Pointer + __dispatch_source_type_data_or = + _lookup('_dispatch_source_type_data_or'); - CFStringRef get kCFURLVolumeTotalCapacityKey => - _kCFURLVolumeTotalCapacityKey.value; + ffi.Pointer get _dispatch_source_type_data_or => + __dispatch_source_type_data_or; - late final ffi.Pointer _kCFURLVolumeAvailableCapacityKey = - _lookup('kCFURLVolumeAvailableCapacityKey'); + late final ffi.Pointer + __dispatch_source_type_data_replace = + _lookup('_dispatch_source_type_data_replace'); - CFStringRef get kCFURLVolumeAvailableCapacityKey => - _kCFURLVolumeAvailableCapacityKey.value; + ffi.Pointer get _dispatch_source_type_data_replace => + __dispatch_source_type_data_replace; - late final ffi.Pointer - _kCFURLVolumeAvailableCapacityForImportantUsageKey = - _lookup('kCFURLVolumeAvailableCapacityForImportantUsageKey'); + late final ffi.Pointer + __dispatch_source_type_mach_send = + _lookup('_dispatch_source_type_mach_send'); - CFStringRef get kCFURLVolumeAvailableCapacityForImportantUsageKey => - _kCFURLVolumeAvailableCapacityForImportantUsageKey.value; + ffi.Pointer get _dispatch_source_type_mach_send => + __dispatch_source_type_mach_send; - late final ffi.Pointer - _kCFURLVolumeAvailableCapacityForOpportunisticUsageKey = - _lookup( - 'kCFURLVolumeAvailableCapacityForOpportunisticUsageKey'); + late final ffi.Pointer + __dispatch_source_type_mach_recv = + _lookup('_dispatch_source_type_mach_recv'); - CFStringRef get kCFURLVolumeAvailableCapacityForOpportunisticUsageKey => - _kCFURLVolumeAvailableCapacityForOpportunisticUsageKey.value; + ffi.Pointer get _dispatch_source_type_mach_recv => + __dispatch_source_type_mach_recv; - late final ffi.Pointer _kCFURLVolumeResourceCountKey = - _lookup('kCFURLVolumeResourceCountKey'); + late final ffi.Pointer + __dispatch_source_type_memorypressure = + _lookup('_dispatch_source_type_memorypressure'); - CFStringRef get kCFURLVolumeResourceCountKey => - _kCFURLVolumeResourceCountKey.value; + ffi.Pointer + get _dispatch_source_type_memorypressure => + __dispatch_source_type_memorypressure; - late final ffi.Pointer _kCFURLVolumeSupportsPersistentIDsKey = - _lookup('kCFURLVolumeSupportsPersistentIDsKey'); + late final ffi.Pointer __dispatch_source_type_proc = + _lookup('_dispatch_source_type_proc'); - CFStringRef get kCFURLVolumeSupportsPersistentIDsKey => - _kCFURLVolumeSupportsPersistentIDsKey.value; + ffi.Pointer get _dispatch_source_type_proc => + __dispatch_source_type_proc; - late final ffi.Pointer _kCFURLVolumeSupportsSymbolicLinksKey = - _lookup('kCFURLVolumeSupportsSymbolicLinksKey'); + late final ffi.Pointer __dispatch_source_type_read = + _lookup('_dispatch_source_type_read'); - CFStringRef get kCFURLVolumeSupportsSymbolicLinksKey => - _kCFURLVolumeSupportsSymbolicLinksKey.value; + ffi.Pointer get _dispatch_source_type_read => + __dispatch_source_type_read; - late final ffi.Pointer _kCFURLVolumeSupportsHardLinksKey = - _lookup('kCFURLVolumeSupportsHardLinksKey'); + late final ffi.Pointer __dispatch_source_type_signal = + _lookup('_dispatch_source_type_signal'); - CFStringRef get kCFURLVolumeSupportsHardLinksKey => - _kCFURLVolumeSupportsHardLinksKey.value; + ffi.Pointer get _dispatch_source_type_signal => + __dispatch_source_type_signal; - late final ffi.Pointer _kCFURLVolumeSupportsJournalingKey = - _lookup('kCFURLVolumeSupportsJournalingKey'); + late final ffi.Pointer __dispatch_source_type_timer = + _lookup('_dispatch_source_type_timer'); - CFStringRef get kCFURLVolumeSupportsJournalingKey => - _kCFURLVolumeSupportsJournalingKey.value; + ffi.Pointer get _dispatch_source_type_timer => + __dispatch_source_type_timer; - late final ffi.Pointer _kCFURLVolumeIsJournalingKey = - _lookup('kCFURLVolumeIsJournalingKey'); + late final ffi.Pointer __dispatch_source_type_vnode = + _lookup('_dispatch_source_type_vnode'); - CFStringRef get kCFURLVolumeIsJournalingKey => - _kCFURLVolumeIsJournalingKey.value; + ffi.Pointer get _dispatch_source_type_vnode => + __dispatch_source_type_vnode; - late final ffi.Pointer _kCFURLVolumeSupportsSparseFilesKey = - _lookup('kCFURLVolumeSupportsSparseFilesKey'); + late final ffi.Pointer __dispatch_source_type_write = + _lookup('_dispatch_source_type_write'); - CFStringRef get kCFURLVolumeSupportsSparseFilesKey => - _kCFURLVolumeSupportsSparseFilesKey.value; + ffi.Pointer get _dispatch_source_type_write => + __dispatch_source_type_write; - late final ffi.Pointer _kCFURLVolumeSupportsZeroRunsKey = - _lookup('kCFURLVolumeSupportsZeroRunsKey'); + Dartdispatch_source_t dispatch_source_create( + dispatch_source_type_t type, + int handle, + int mask, + Dartdispatch_queue_t queue, + ) { + return objc.NSObject.castFromPointer( + _dispatch_source_create( + type, + handle, + mask, + queue.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLVolumeSupportsZeroRunsKey => - _kCFURLVolumeSupportsZeroRunsKey.value; + late final _dispatch_source_createPtr = _lookup< + ffi.NativeFunction< + dispatch_source_t Function(dispatch_source_type_t, ffi.UintPtr, + ffi.UintPtr, dispatch_queue_t)>>('dispatch_source_create'); + late final _dispatch_source_create = _dispatch_source_createPtr.asFunction< + dispatch_source_t Function( + dispatch_source_type_t, int, int, dispatch_queue_t)>(); - late final ffi.Pointer - _kCFURLVolumeSupportsCaseSensitiveNamesKey = - _lookup('kCFURLVolumeSupportsCaseSensitiveNamesKey'); + void dispatch_source_set_event_handler( + Dartdispatch_source_t source, + Dartdispatch_block_t handler, + ) { + return _dispatch_source_set_event_handler( + source.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeSupportsCaseSensitiveNamesKey => - _kCFURLVolumeSupportsCaseSensitiveNamesKey.value; + late final _dispatch_source_set_event_handlerPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_source_t, + dispatch_block_t)>>('dispatch_source_set_event_handler'); + late final _dispatch_source_set_event_handler = + _dispatch_source_set_event_handlerPtr + .asFunction(); - late final ffi.Pointer - _kCFURLVolumeSupportsCasePreservedNamesKey = - _lookup('kCFURLVolumeSupportsCasePreservedNamesKey'); + void dispatch_source_set_event_handler_f( + Dartdispatch_source_t source, + dispatch_function_t handler, + ) { + return _dispatch_source_set_event_handler_f( + source.ref.pointer, + handler, + ); + } - CFStringRef get kCFURLVolumeSupportsCasePreservedNamesKey => - _kCFURLVolumeSupportsCasePreservedNamesKey.value; + late final _dispatch_source_set_event_handler_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_source_t, + dispatch_function_t)>>('dispatch_source_set_event_handler_f'); + late final _dispatch_source_set_event_handler_f = + _dispatch_source_set_event_handler_fPtr + .asFunction(); - late final ffi.Pointer - _kCFURLVolumeSupportsRootDirectoryDatesKey = - _lookup('kCFURLVolumeSupportsRootDirectoryDatesKey'); + void dispatch_source_set_cancel_handler( + Dartdispatch_source_t source, + Dartdispatch_block_t handler, + ) { + return _dispatch_source_set_cancel_handler( + source.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeSupportsRootDirectoryDatesKey => - _kCFURLVolumeSupportsRootDirectoryDatesKey.value; + late final _dispatch_source_set_cancel_handlerPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_source_t, + dispatch_block_t)>>('dispatch_source_set_cancel_handler'); + late final _dispatch_source_set_cancel_handler = + _dispatch_source_set_cancel_handlerPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeSupportsVolumeSizesKey = - _lookup('kCFURLVolumeSupportsVolumeSizesKey'); + void dispatch_source_set_cancel_handler_f( + Dartdispatch_source_t source, + dispatch_function_t handler, + ) { + return _dispatch_source_set_cancel_handler_f( + source.ref.pointer, + handler, + ); + } - CFStringRef get kCFURLVolumeSupportsVolumeSizesKey => - _kCFURLVolumeSupportsVolumeSizesKey.value; + late final _dispatch_source_set_cancel_handler_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_source_t, + dispatch_function_t)>>('dispatch_source_set_cancel_handler_f'); + late final _dispatch_source_set_cancel_handler_f = + _dispatch_source_set_cancel_handler_fPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeSupportsRenamingKey = - _lookup('kCFURLVolumeSupportsRenamingKey'); + void dispatch_source_cancel( + Dartdispatch_source_t source, + ) { + return _dispatch_source_cancel( + source.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeSupportsRenamingKey => - _kCFURLVolumeSupportsRenamingKey.value; + late final _dispatch_source_cancelPtr = + _lookup>( + 'dispatch_source_cancel'); + late final _dispatch_source_cancel = + _dispatch_source_cancelPtr.asFunction(); - late final ffi.Pointer - _kCFURLVolumeSupportsAdvisoryFileLockingKey = - _lookup('kCFURLVolumeSupportsAdvisoryFileLockingKey'); + int dispatch_source_testcancel( + Dartdispatch_source_t source, + ) { + return _dispatch_source_testcancel( + source.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeSupportsAdvisoryFileLockingKey => - _kCFURLVolumeSupportsAdvisoryFileLockingKey.value; + late final _dispatch_source_testcancelPtr = + _lookup>( + 'dispatch_source_testcancel'); + late final _dispatch_source_testcancel = _dispatch_source_testcancelPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeSupportsExtendedSecurityKey = - _lookup('kCFURLVolumeSupportsExtendedSecurityKey'); + int dispatch_source_get_handle( + Dartdispatch_source_t source, + ) { + return _dispatch_source_get_handle( + source.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeSupportsExtendedSecurityKey => - _kCFURLVolumeSupportsExtendedSecurityKey.value; + late final _dispatch_source_get_handlePtr = + _lookup>( + 'dispatch_source_get_handle'); + late final _dispatch_source_get_handle = _dispatch_source_get_handlePtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeIsBrowsableKey = - _lookup('kCFURLVolumeIsBrowsableKey'); + int dispatch_source_get_mask( + Dartdispatch_source_t source, + ) { + return _dispatch_source_get_mask( + source.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeIsBrowsableKey => - _kCFURLVolumeIsBrowsableKey.value; + late final _dispatch_source_get_maskPtr = + _lookup>( + 'dispatch_source_get_mask'); + late final _dispatch_source_get_mask = _dispatch_source_get_maskPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeMaximumFileSizeKey = - _lookup('kCFURLVolumeMaximumFileSizeKey'); + int dispatch_source_get_data( + Dartdispatch_source_t source, + ) { + return _dispatch_source_get_data( + source.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeMaximumFileSizeKey => - _kCFURLVolumeMaximumFileSizeKey.value; + late final _dispatch_source_get_dataPtr = + _lookup>( + 'dispatch_source_get_data'); + late final _dispatch_source_get_data = _dispatch_source_get_dataPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeIsEjectableKey = - _lookup('kCFURLVolumeIsEjectableKey'); + void dispatch_source_merge_data( + Dartdispatch_source_t source, + int value, + ) { + return _dispatch_source_merge_data( + source.ref.pointer, + value, + ); + } - CFStringRef get kCFURLVolumeIsEjectableKey => - _kCFURLVolumeIsEjectableKey.value; + late final _dispatch_source_merge_dataPtr = _lookup< + ffi + .NativeFunction>( + 'dispatch_source_merge_data'); + late final _dispatch_source_merge_data = _dispatch_source_merge_dataPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeIsRemovableKey = - _lookup('kCFURLVolumeIsRemovableKey'); + void dispatch_source_set_timer( + Dartdispatch_source_t source, + Dartdispatch_time_t start, + int interval, + int leeway, + ) { + return _dispatch_source_set_timer( + source.ref.pointer, + start, + interval, + leeway, + ); + } - CFStringRef get kCFURLVolumeIsRemovableKey => - _kCFURLVolumeIsRemovableKey.value; + late final _dispatch_source_set_timerPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_source_t, dispatch_time_t, ffi.Uint64, + ffi.Uint64)>>('dispatch_source_set_timer'); + late final _dispatch_source_set_timer = _dispatch_source_set_timerPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeIsInternalKey = - _lookup('kCFURLVolumeIsInternalKey'); + void dispatch_source_set_registration_handler( + Dartdispatch_source_t source, + Dartdispatch_block_t handler, + ) { + return _dispatch_source_set_registration_handler( + source.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeIsInternalKey => _kCFURLVolumeIsInternalKey.value; + late final _dispatch_source_set_registration_handlerPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_source_t, + dispatch_block_t)>>('dispatch_source_set_registration_handler'); + late final _dispatch_source_set_registration_handler = + _dispatch_source_set_registration_handlerPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeIsAutomountedKey = - _lookup('kCFURLVolumeIsAutomountedKey'); + void dispatch_source_set_registration_handler_f( + Dartdispatch_source_t source, + dispatch_function_t handler, + ) { + return _dispatch_source_set_registration_handler_f( + source.ref.pointer, + handler, + ); + } - CFStringRef get kCFURLVolumeIsAutomountedKey => - _kCFURLVolumeIsAutomountedKey.value; + late final _dispatch_source_set_registration_handler_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_source_t, dispatch_function_t)>>( + 'dispatch_source_set_registration_handler_f'); + late final _dispatch_source_set_registration_handler_f = + _dispatch_source_set_registration_handler_fPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeIsLocalKey = - _lookup('kCFURLVolumeIsLocalKey'); + Dartdispatch_group_t dispatch_group_create() { + return objc.NSObject.castFromPointer(_dispatch_group_create(), + retain: false, release: true); + } - CFStringRef get kCFURLVolumeIsLocalKey => _kCFURLVolumeIsLocalKey.value; + late final _dispatch_group_createPtr = + _lookup>( + 'dispatch_group_create'); + late final _dispatch_group_create = + _dispatch_group_createPtr.asFunction(); - late final ffi.Pointer _kCFURLVolumeIsReadOnlyKey = - _lookup('kCFURLVolumeIsReadOnlyKey'); + void dispatch_group_async( + Dartdispatch_group_t group, + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_group_async( + group.ref.pointer, + queue.ref.pointer, + block.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeIsReadOnlyKey => _kCFURLVolumeIsReadOnlyKey.value; + late final _dispatch_group_asyncPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_group_t, dispatch_queue_t, + dispatch_block_t)>>('dispatch_group_async'); + late final _dispatch_group_async = _dispatch_group_asyncPtr.asFunction< + void Function(dispatch_group_t, dispatch_queue_t, dispatch_block_t)>(); - late final ffi.Pointer _kCFURLVolumeCreationDateKey = - _lookup('kCFURLVolumeCreationDateKey'); + void dispatch_group_async_f( + Dartdispatch_group_t group, + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_group_async_f( + group.ref.pointer, + queue.ref.pointer, + context, + work, + ); + } - CFStringRef get kCFURLVolumeCreationDateKey => - _kCFURLVolumeCreationDateKey.value; + late final _dispatch_group_async_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_group_t, + dispatch_queue_t, + ffi.Pointer, + dispatch_function_t)>>('dispatch_group_async_f'); + late final _dispatch_group_async_f = _dispatch_group_async_fPtr.asFunction< + void Function(dispatch_group_t, dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>(); - late final ffi.Pointer _kCFURLVolumeURLForRemountingKey = - _lookup('kCFURLVolumeURLForRemountingKey'); + int dispatch_group_wait( + Dartdispatch_group_t group, + Dartdispatch_time_t timeout, + ) { + return _dispatch_group_wait( + group.ref.pointer, + timeout, + ); + } - CFStringRef get kCFURLVolumeURLForRemountingKey => - _kCFURLVolumeURLForRemountingKey.value; + late final _dispatch_group_waitPtr = _lookup< + ffi.NativeFunction< + ffi.IntPtr Function( + dispatch_group_t, dispatch_time_t)>>('dispatch_group_wait'); + late final _dispatch_group_wait = + _dispatch_group_waitPtr.asFunction(); - late final ffi.Pointer _kCFURLVolumeUUIDStringKey = - _lookup('kCFURLVolumeUUIDStringKey'); + void dispatch_group_notify( + Dartdispatch_group_t group, + Dartdispatch_queue_t queue, + Dartdispatch_block_t block, + ) { + return _dispatch_group_notify( + group.ref.pointer, + queue.ref.pointer, + block.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeUUIDStringKey => _kCFURLVolumeUUIDStringKey.value; + late final _dispatch_group_notifyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_group_t, dispatch_queue_t, + dispatch_block_t)>>('dispatch_group_notify'); + late final _dispatch_group_notify = _dispatch_group_notifyPtr.asFunction< + void Function(dispatch_group_t, dispatch_queue_t, dispatch_block_t)>(); - late final ffi.Pointer _kCFURLVolumeNameKey = - _lookup('kCFURLVolumeNameKey'); + void dispatch_group_notify_f( + Dartdispatch_group_t group, + Dartdispatch_queue_t queue, + ffi.Pointer context, + dispatch_function_t work, + ) { + return _dispatch_group_notify_f( + group.ref.pointer, + queue.ref.pointer, + context, + work, + ); + } - CFStringRef get kCFURLVolumeNameKey => _kCFURLVolumeNameKey.value; + late final _dispatch_group_notify_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + dispatch_group_t, + dispatch_queue_t, + ffi.Pointer, + dispatch_function_t)>>('dispatch_group_notify_f'); + late final _dispatch_group_notify_f = _dispatch_group_notify_fPtr.asFunction< + void Function(dispatch_group_t, dispatch_queue_t, ffi.Pointer, + dispatch_function_t)>(); - late final ffi.Pointer _kCFURLVolumeLocalizedNameKey = - _lookup('kCFURLVolumeLocalizedNameKey'); + void dispatch_group_enter( + Dartdispatch_group_t group, + ) { + return _dispatch_group_enter( + group.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeLocalizedNameKey => - _kCFURLVolumeLocalizedNameKey.value; + late final _dispatch_group_enterPtr = + _lookup>( + 'dispatch_group_enter'); + late final _dispatch_group_enter = + _dispatch_group_enterPtr.asFunction(); - late final ffi.Pointer _kCFURLVolumeIsEncryptedKey = - _lookup('kCFURLVolumeIsEncryptedKey'); + void dispatch_group_leave( + Dartdispatch_group_t group, + ) { + return _dispatch_group_leave( + group.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeIsEncryptedKey => - _kCFURLVolumeIsEncryptedKey.value; + late final _dispatch_group_leavePtr = + _lookup>( + 'dispatch_group_leave'); + late final _dispatch_group_leave = + _dispatch_group_leavePtr.asFunction(); - late final ffi.Pointer _kCFURLVolumeIsRootFileSystemKey = - _lookup('kCFURLVolumeIsRootFileSystemKey'); + Dartdispatch_semaphore_t dispatch_semaphore_create( + int value, + ) { + return objc.NSObject.castFromPointer( + _dispatch_semaphore_create( + value, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLVolumeIsRootFileSystemKey => - _kCFURLVolumeIsRootFileSystemKey.value; + late final _dispatch_semaphore_createPtr = + _lookup>( + 'dispatch_semaphore_create'); + late final _dispatch_semaphore_create = _dispatch_semaphore_createPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeSupportsCompressionKey = - _lookup('kCFURLVolumeSupportsCompressionKey'); + int dispatch_semaphore_wait( + Dartdispatch_semaphore_t dsema, + Dartdispatch_time_t timeout, + ) { + return _dispatch_semaphore_wait( + dsema.ref.pointer, + timeout, + ); + } - CFStringRef get kCFURLVolumeSupportsCompressionKey => - _kCFURLVolumeSupportsCompressionKey.value; + late final _dispatch_semaphore_waitPtr = _lookup< + ffi.NativeFunction< + ffi.IntPtr Function(dispatch_semaphore_t, + dispatch_time_t)>>('dispatch_semaphore_wait'); + late final _dispatch_semaphore_wait = _dispatch_semaphore_waitPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeSupportsFileCloningKey = - _lookup('kCFURLVolumeSupportsFileCloningKey'); + int dispatch_semaphore_signal( + Dartdispatch_semaphore_t dsema, + ) { + return _dispatch_semaphore_signal( + dsema.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeSupportsFileCloningKey => - _kCFURLVolumeSupportsFileCloningKey.value; + late final _dispatch_semaphore_signalPtr = + _lookup>( + 'dispatch_semaphore_signal'); + late final _dispatch_semaphore_signal = _dispatch_semaphore_signalPtr + .asFunction(); - late final ffi.Pointer _kCFURLVolumeSupportsSwapRenamingKey = - _lookup('kCFURLVolumeSupportsSwapRenamingKey'); + void dispatch_once( + ffi.Pointer predicate, + Dartdispatch_block_t block, + ) { + return _dispatch_once( + predicate, + block.ref.pointer, + ); + } - CFStringRef get kCFURLVolumeSupportsSwapRenamingKey => - _kCFURLVolumeSupportsSwapRenamingKey.value; + late final _dispatch_oncePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + dispatch_block_t)>>('dispatch_once'); + late final _dispatch_once = _dispatch_oncePtr.asFunction< + void Function(ffi.Pointer, dispatch_block_t)>(); - late final ffi.Pointer - _kCFURLVolumeSupportsExclusiveRenamingKey = - _lookup('kCFURLVolumeSupportsExclusiveRenamingKey'); + void dispatch_once_f( + ffi.Pointer predicate, + ffi.Pointer context, + dispatch_function_t function, + ) { + return _dispatch_once_f( + predicate, + context, + function, + ); + } - CFStringRef get kCFURLVolumeSupportsExclusiveRenamingKey => - _kCFURLVolumeSupportsExclusiveRenamingKey.value; + late final _dispatch_once_fPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + dispatch_function_t)>>('dispatch_once_f'); + late final _dispatch_once_f = _dispatch_once_fPtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, + dispatch_function_t)>(); - late final ffi.Pointer _kCFURLVolumeSupportsImmutableFilesKey = - _lookup('kCFURLVolumeSupportsImmutableFilesKey'); - - CFStringRef get kCFURLVolumeSupportsImmutableFilesKey => - _kCFURLVolumeSupportsImmutableFilesKey.value; - - late final ffi.Pointer - _kCFURLVolumeSupportsAccessPermissionsKey = - _lookup('kCFURLVolumeSupportsAccessPermissionsKey'); - - CFStringRef get kCFURLVolumeSupportsAccessPermissionsKey => - _kCFURLVolumeSupportsAccessPermissionsKey.value; - - late final ffi.Pointer _kCFURLVolumeSupportsFileProtectionKey = - _lookup('kCFURLVolumeSupportsFileProtectionKey'); - - CFStringRef get kCFURLVolumeSupportsFileProtectionKey => - _kCFURLVolumeSupportsFileProtectionKey.value; - - late final ffi.Pointer _kCFURLVolumeTypeNameKey = - _lookup('kCFURLVolumeTypeNameKey'); + late final ffi.Pointer __dispatch_data_empty = + _lookup('_dispatch_data_empty'); - CFStringRef get kCFURLVolumeTypeNameKey => _kCFURLVolumeTypeNameKey.value; + ffi.Pointer get _dispatch_data_empty => + __dispatch_data_empty; - late final ffi.Pointer _kCFURLVolumeSubtypeKey = - _lookup('kCFURLVolumeSubtypeKey'); + late final ffi.Pointer __dispatch_data_destructor_free = + _lookup('_dispatch_data_destructor_free'); - CFStringRef get kCFURLVolumeSubtypeKey => _kCFURLVolumeSubtypeKey.value; + Dartdispatch_block_t get _dispatch_data_destructor_free => + ObjCBlock_ffiVoid.castFromPointer(__dispatch_data_destructor_free.value, + retain: true, release: true); - late final ffi.Pointer _kCFURLVolumeMountFromLocationKey = - _lookup('kCFURLVolumeMountFromLocationKey'); + set _dispatch_data_destructor_free(Dartdispatch_block_t value) { + ObjCBlock_ffiVoid.castFromPointer(__dispatch_data_destructor_free.value, + retain: false, release: true) + .ref + .release(); + __dispatch_data_destructor_free.value = value.ref.retainAndReturnPointer(); + } - CFStringRef get kCFURLVolumeMountFromLocationKey => - _kCFURLVolumeMountFromLocationKey.value; + late final ffi.Pointer __dispatch_data_destructor_munmap = + _lookup('_dispatch_data_destructor_munmap'); - late final ffi.Pointer _kCFURLIsUbiquitousItemKey = - _lookup('kCFURLIsUbiquitousItemKey'); + Dartdispatch_block_t get _dispatch_data_destructor_munmap => + ObjCBlock_ffiVoid.castFromPointer(__dispatch_data_destructor_munmap.value, + retain: true, release: true); - CFStringRef get kCFURLIsUbiquitousItemKey => _kCFURLIsUbiquitousItemKey.value; + set _dispatch_data_destructor_munmap(Dartdispatch_block_t value) { + ObjCBlock_ffiVoid.castFromPointer(__dispatch_data_destructor_munmap.value, + retain: false, release: true) + .ref + .release(); + __dispatch_data_destructor_munmap.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer - _kCFURLUbiquitousItemHasUnresolvedConflictsKey = - _lookup('kCFURLUbiquitousItemHasUnresolvedConflictsKey'); + Dartdispatch_data_t dispatch_data_create( + ffi.Pointer buffer, + int size, + Dartdispatch_queue_t queue, + Dartdispatch_block_t destructor, + ) { + return objc.NSObject.castFromPointer( + _dispatch_data_create( + buffer, + size, + queue.ref.pointer, + destructor.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemHasUnresolvedConflictsKey => - _kCFURLUbiquitousItemHasUnresolvedConflictsKey.value; + late final _dispatch_data_createPtr = _lookup< + ffi.NativeFunction< + dispatch_data_t Function(ffi.Pointer, ffi.Size, + dispatch_queue_t, dispatch_block_t)>>('dispatch_data_create'); + late final _dispatch_data_create = _dispatch_data_createPtr.asFunction< + dispatch_data_t Function( + ffi.Pointer, int, dispatch_queue_t, dispatch_block_t)>(); - late final ffi.Pointer _kCFURLUbiquitousItemIsDownloadedKey = - _lookup('kCFURLUbiquitousItemIsDownloadedKey'); + int dispatch_data_get_size( + Dartdispatch_data_t data, + ) { + return _dispatch_data_get_size( + data.ref.pointer, + ); + } - CFStringRef get kCFURLUbiquitousItemIsDownloadedKey => - _kCFURLUbiquitousItemIsDownloadedKey.value; + late final _dispatch_data_get_sizePtr = + _lookup>( + 'dispatch_data_get_size'); + late final _dispatch_data_get_size = + _dispatch_data_get_sizePtr.asFunction(); - late final ffi.Pointer _kCFURLUbiquitousItemIsDownloadingKey = - _lookup('kCFURLUbiquitousItemIsDownloadingKey'); + Dartdispatch_data_t dispatch_data_create_map( + Dartdispatch_data_t data, + ffi.Pointer> buffer_ptr, + ffi.Pointer size_ptr, + ) { + return objc.NSObject.castFromPointer( + _dispatch_data_create_map( + data.ref.pointer, + buffer_ptr, + size_ptr, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemIsDownloadingKey => - _kCFURLUbiquitousItemIsDownloadingKey.value; + late final _dispatch_data_create_mapPtr = _lookup< + ffi.NativeFunction< + dispatch_data_t Function( + dispatch_data_t, + ffi.Pointer>, + ffi.Pointer)>>('dispatch_data_create_map'); + late final _dispatch_data_create_map = + _dispatch_data_create_mapPtr.asFunction< + dispatch_data_t Function(dispatch_data_t, + ffi.Pointer>, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLUbiquitousItemIsUploadedKey = - _lookup('kCFURLUbiquitousItemIsUploadedKey'); + Dartdispatch_data_t dispatch_data_create_concat( + Dartdispatch_data_t data1, + Dartdispatch_data_t data2, + ) { + return objc.NSObject.castFromPointer( + _dispatch_data_create_concat( + data1.ref.pointer, + data2.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemIsUploadedKey => - _kCFURLUbiquitousItemIsUploadedKey.value; + late final _dispatch_data_create_concatPtr = _lookup< + ffi.NativeFunction< + dispatch_data_t Function(dispatch_data_t, + dispatch_data_t)>>('dispatch_data_create_concat'); + late final _dispatch_data_create_concat = _dispatch_data_create_concatPtr + .asFunction(); - late final ffi.Pointer _kCFURLUbiquitousItemIsUploadingKey = - _lookup('kCFURLUbiquitousItemIsUploadingKey'); + Dartdispatch_data_t dispatch_data_create_subrange( + Dartdispatch_data_t data, + int offset, + int length, + ) { + return objc.NSObject.castFromPointer( + _dispatch_data_create_subrange( + data.ref.pointer, + offset, + length, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemIsUploadingKey => - _kCFURLUbiquitousItemIsUploadingKey.value; + late final _dispatch_data_create_subrangePtr = _lookup< + ffi.NativeFunction< + dispatch_data_t Function(dispatch_data_t, ffi.Size, + ffi.Size)>>('dispatch_data_create_subrange'); + late final _dispatch_data_create_subrange = _dispatch_data_create_subrangePtr + .asFunction(); - late final ffi.Pointer - _kCFURLUbiquitousItemPercentDownloadedKey = - _lookup('kCFURLUbiquitousItemPercentDownloadedKey'); + bool dispatch_data_apply( + Dartdispatch_data_t data, + Dartdispatch_data_applier_t applier, + ) { + return _dispatch_data_apply( + data.ref.pointer, + applier.ref.pointer, + ); + } - CFStringRef get kCFURLUbiquitousItemPercentDownloadedKey => - _kCFURLUbiquitousItemPercentDownloadedKey.value; + late final _dispatch_data_applyPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(dispatch_data_t, + dispatch_data_applier_t)>>('dispatch_data_apply'); + late final _dispatch_data_apply = _dispatch_data_applyPtr + .asFunction(); - late final ffi.Pointer _kCFURLUbiquitousItemPercentUploadedKey = - _lookup('kCFURLUbiquitousItemPercentUploadedKey'); + Dartdispatch_data_t dispatch_data_copy_region( + Dartdispatch_data_t data, + int location, + ffi.Pointer offset_ptr, + ) { + return objc.NSObject.castFromPointer( + _dispatch_data_copy_region( + data.ref.pointer, + location, + offset_ptr, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemPercentUploadedKey => - _kCFURLUbiquitousItemPercentUploadedKey.value; + late final _dispatch_data_copy_regionPtr = _lookup< + ffi.NativeFunction< + dispatch_data_t Function(dispatch_data_t, ffi.Size, + ffi.Pointer)>>('dispatch_data_copy_region'); + late final _dispatch_data_copy_region = + _dispatch_data_copy_regionPtr.asFunction< + dispatch_data_t Function( + dispatch_data_t, int, ffi.Pointer)>(); - late final ffi.Pointer - _kCFURLUbiquitousItemDownloadingStatusKey = - _lookup('kCFURLUbiquitousItemDownloadingStatusKey'); + void dispatch_read( + Dartdispatch_fd_t fd, + int length, + Dartdispatch_queue_t queue, + objc.ObjCBlock handler, + ) { + return _dispatch_read( + fd, + length, + queue.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLUbiquitousItemDownloadingStatusKey => - _kCFURLUbiquitousItemDownloadingStatusKey.value; + late final _dispatch_readPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_fd_t, ffi.Size, dispatch_queue_t, + ffi.Pointer)>>('dispatch_read'); + late final _dispatch_read = _dispatch_readPtr.asFunction< + void Function( + int, int, dispatch_queue_t, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLUbiquitousItemDownloadingErrorKey = - _lookup('kCFURLUbiquitousItemDownloadingErrorKey'); + void dispatch_write( + Dartdispatch_fd_t fd, + Dartdispatch_data_t data, + Dartdispatch_queue_t queue, + objc.ObjCBlock handler, + ) { + return _dispatch_write( + fd, + data.ref.pointer, + queue.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLUbiquitousItemDownloadingErrorKey => - _kCFURLUbiquitousItemDownloadingErrorKey.value; + late final _dispatch_writePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_fd_t, dispatch_data_t, dispatch_queue_t, + ffi.Pointer)>>('dispatch_write'); + late final _dispatch_write = _dispatch_writePtr.asFunction< + void Function(int, dispatch_data_t, dispatch_queue_t, + ffi.Pointer)>(); - late final ffi.Pointer _kCFURLUbiquitousItemUploadingErrorKey = - _lookup('kCFURLUbiquitousItemUploadingErrorKey'); + Dartdispatch_io_t dispatch_io_create( + Dartdispatch_io_type_t type, + Dartdispatch_fd_t fd, + Dartdispatch_queue_t queue, + objc.ObjCBlock cleanup_handler, + ) { + return objc.NSObject.castFromPointer( + _dispatch_io_create( + type, + fd, + queue.ref.pointer, + cleanup_handler.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemUploadingErrorKey => - _kCFURLUbiquitousItemUploadingErrorKey.value; + late final _dispatch_io_createPtr = _lookup< + ffi.NativeFunction< + dispatch_io_t Function( + dispatch_io_type_t, + dispatch_fd_t, + dispatch_queue_t, + ffi.Pointer)>>('dispatch_io_create'); + late final _dispatch_io_create = _dispatch_io_createPtr.asFunction< + dispatch_io_t Function( + int, int, dispatch_queue_t, ffi.Pointer)>(); - late final ffi.Pointer - _kCFURLUbiquitousItemIsExcludedFromSyncKey = - _lookup('kCFURLUbiquitousItemIsExcludedFromSyncKey'); + Dartdispatch_io_t dispatch_io_create_with_path( + Dartdispatch_io_type_t type, + ffi.Pointer path, + int oflag, + Dart__uint16_t mode, + Dartdispatch_queue_t queue, + objc.ObjCBlock cleanup_handler, + ) { + return objc.NSObject.castFromPointer( + _dispatch_io_create_with_path( + type, + path, + oflag, + mode, + queue.ref.pointer, + cleanup_handler.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemIsExcludedFromSyncKey => - _kCFURLUbiquitousItemIsExcludedFromSyncKey.value; + late final _dispatch_io_create_with_pathPtr = _lookup< + ffi.NativeFunction< + dispatch_io_t Function( + dispatch_io_type_t, + ffi.Pointer, + ffi.Int, + mode_t, + dispatch_queue_t, + ffi.Pointer)>>( + 'dispatch_io_create_with_path'); + late final _dispatch_io_create_with_path = + _dispatch_io_create_with_pathPtr.asFunction< + dispatch_io_t Function(int, ffi.Pointer, int, int, + dispatch_queue_t, ffi.Pointer)>(); - late final ffi.Pointer - _kCFURLUbiquitousItemDownloadingStatusNotDownloaded = - _lookup( - 'kCFURLUbiquitousItemDownloadingStatusNotDownloaded'); + Dartdispatch_io_t dispatch_io_create_with_io( + Dartdispatch_io_type_t type, + Dartdispatch_io_t io, + Dartdispatch_queue_t queue, + objc.ObjCBlock cleanup_handler, + ) { + return objc.NSObject.castFromPointer( + _dispatch_io_create_with_io( + type, + io.ref.pointer, + queue.ref.pointer, + cleanup_handler.ref.pointer, + ), + retain: false, + release: true); + } - CFStringRef get kCFURLUbiquitousItemDownloadingStatusNotDownloaded => - _kCFURLUbiquitousItemDownloadingStatusNotDownloaded.value; + late final _dispatch_io_create_with_ioPtr = _lookup< + ffi.NativeFunction< + dispatch_io_t Function( + dispatch_io_type_t, + dispatch_io_t, + dispatch_queue_t, + ffi.Pointer)>>('dispatch_io_create_with_io'); + late final _dispatch_io_create_with_io = + _dispatch_io_create_with_ioPtr.asFunction< + dispatch_io_t Function(int, dispatch_io_t, dispatch_queue_t, + ffi.Pointer)>(); - late final ffi.Pointer - _kCFURLUbiquitousItemDownloadingStatusDownloaded = - _lookup('kCFURLUbiquitousItemDownloadingStatusDownloaded'); + void dispatch_io_read( + Dartdispatch_io_t channel, + Dart__int64_t offset, + int length, + Dartdispatch_queue_t queue, + Dartdispatch_io_handler_t io_handler, + ) { + return _dispatch_io_read( + channel.ref.pointer, + offset, + length, + queue.ref.pointer, + io_handler.ref.pointer, + ); + } - CFStringRef get kCFURLUbiquitousItemDownloadingStatusDownloaded => - _kCFURLUbiquitousItemDownloadingStatusDownloaded.value; + late final _dispatch_io_readPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_io_t, off_t, ffi.Size, dispatch_queue_t, + dispatch_io_handler_t)>>('dispatch_io_read'); + late final _dispatch_io_read = _dispatch_io_readPtr.asFunction< + void Function( + dispatch_io_t, int, int, dispatch_queue_t, dispatch_io_handler_t)>(); - late final ffi.Pointer - _kCFURLUbiquitousItemDownloadingStatusCurrent = - _lookup('kCFURLUbiquitousItemDownloadingStatusCurrent'); + void dispatch_io_write( + Dartdispatch_io_t channel, + Dart__int64_t offset, + Dartdispatch_data_t data, + Dartdispatch_queue_t queue, + Dartdispatch_io_handler_t io_handler, + ) { + return _dispatch_io_write( + channel.ref.pointer, + offset, + data.ref.pointer, + queue.ref.pointer, + io_handler.ref.pointer, + ); + } - CFStringRef get kCFURLUbiquitousItemDownloadingStatusCurrent => - _kCFURLUbiquitousItemDownloadingStatusCurrent.value; + late final _dispatch_io_writePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_io_t, off_t, dispatch_data_t, + dispatch_queue_t, dispatch_io_handler_t)>>('dispatch_io_write'); + late final _dispatch_io_write = _dispatch_io_writePtr.asFunction< + void Function(dispatch_io_t, int, dispatch_data_t, dispatch_queue_t, + dispatch_io_handler_t)>(); - CFDataRef CFURLCreateBookmarkData( - CFAllocatorRef allocator, - CFURLRef url, - int options, - CFArrayRef resourcePropertiesToInclude, - CFURLRef relativeToURL, - ffi.Pointer error, + void dispatch_io_close( + Dartdispatch_io_t channel, + Dartdispatch_io_close_flags_t flags, ) { - return _CFURLCreateBookmarkData( - allocator, - url, - options, - resourcePropertiesToInclude, - relativeToURL, - error, + return _dispatch_io_close( + channel.ref.pointer, + flags, ); } - late final _CFURLCreateBookmarkDataPtr = _lookup< + late final _dispatch_io_closePtr = _lookup< ffi.NativeFunction< - CFDataRef Function(CFAllocatorRef, CFURLRef, ffi.Int32, CFArrayRef, - CFURLRef, ffi.Pointer)>>('CFURLCreateBookmarkData'); - late final _CFURLCreateBookmarkData = _CFURLCreateBookmarkDataPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFURLRef, int, CFArrayRef, CFURLRef, - ffi.Pointer)>(); + ffi.Void Function( + dispatch_io_t, dispatch_io_close_flags_t)>>('dispatch_io_close'); + late final _dispatch_io_close = + _dispatch_io_closePtr.asFunction(); - CFURLRef CFURLCreateByResolvingBookmarkData( - CFAllocatorRef allocator, - CFDataRef bookmark, - int options, - CFURLRef relativeToURL, - CFArrayRef resourcePropertiesToInclude, - ffi.Pointer isStale, - ffi.Pointer error, + void dispatch_io_barrier( + Dartdispatch_io_t channel, + Dartdispatch_block_t barrier, ) { - return _CFURLCreateByResolvingBookmarkData( - allocator, - bookmark, - options, - relativeToURL, - resourcePropertiesToInclude, - isStale, - error, + return _dispatch_io_barrier( + channel.ref.pointer, + barrier.ref.pointer, ); } - late final _CFURLCreateByResolvingBookmarkDataPtr = _lookup< - ffi.NativeFunction< - CFURLRef Function( - CFAllocatorRef, - CFDataRef, - ffi.Int32, - CFURLRef, - CFArrayRef, - ffi.Pointer, - ffi.Pointer)>>('CFURLCreateByResolvingBookmarkData'); - late final _CFURLCreateByResolvingBookmarkData = - _CFURLCreateByResolvingBookmarkDataPtr.asFunction< - CFURLRef Function(CFAllocatorRef, CFDataRef, int, CFURLRef, - CFArrayRef, ffi.Pointer, ffi.Pointer)>(); + late final _dispatch_io_barrierPtr = _lookup< + ffi + .NativeFunction>( + 'dispatch_io_barrier'); + late final _dispatch_io_barrier = _dispatch_io_barrierPtr + .asFunction(); - CFDictionaryRef CFURLCreateResourcePropertiesForKeysFromBookmarkData( - CFAllocatorRef allocator, - CFArrayRef resourcePropertiesToReturn, - CFDataRef bookmark, + Dartdispatch_fd_t dispatch_io_get_descriptor( + Dartdispatch_io_t channel, ) { - return _CFURLCreateResourcePropertiesForKeysFromBookmarkData( - allocator, - resourcePropertiesToReturn, - bookmark, + return _dispatch_io_get_descriptor( + channel.ref.pointer, ); } - late final _CFURLCreateResourcePropertiesForKeysFromBookmarkDataPtr = _lookup< - ffi.NativeFunction< - CFDictionaryRef Function(CFAllocatorRef, CFArrayRef, CFDataRef)>>( - 'CFURLCreateResourcePropertiesForKeysFromBookmarkData'); - late final _CFURLCreateResourcePropertiesForKeysFromBookmarkData = - _CFURLCreateResourcePropertiesForKeysFromBookmarkDataPtr.asFunction< - CFDictionaryRef Function(CFAllocatorRef, CFArrayRef, CFDataRef)>(); + late final _dispatch_io_get_descriptorPtr = + _lookup>( + 'dispatch_io_get_descriptor'); + late final _dispatch_io_get_descriptor = + _dispatch_io_get_descriptorPtr.asFunction(); - CFTypeRef CFURLCreateResourcePropertyForKeyFromBookmarkData( - CFAllocatorRef allocator, - CFStringRef resourcePropertyKey, - CFDataRef bookmark, + void dispatch_io_set_high_water( + Dartdispatch_io_t channel, + int high_water, ) { - return _CFURLCreateResourcePropertyForKeyFromBookmarkData( - allocator, - resourcePropertyKey, - bookmark, + return _dispatch_io_set_high_water( + channel.ref.pointer, + high_water, ); } - late final _CFURLCreateResourcePropertyForKeyFromBookmarkDataPtr = _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFAllocatorRef, CFStringRef, - CFDataRef)>>('CFURLCreateResourcePropertyForKeyFromBookmarkData'); - late final _CFURLCreateResourcePropertyForKeyFromBookmarkData = - _CFURLCreateResourcePropertyForKeyFromBookmarkDataPtr.asFunction< - CFTypeRef Function(CFAllocatorRef, CFStringRef, CFDataRef)>(); + late final _dispatch_io_set_high_waterPtr = + _lookup>( + 'dispatch_io_set_high_water'); + late final _dispatch_io_set_high_water = _dispatch_io_set_high_waterPtr + .asFunction(); - CFDataRef CFURLCreateBookmarkDataFromFile( - CFAllocatorRef allocator, - CFURLRef fileURL, - ffi.Pointer errorRef, + void dispatch_io_set_low_water( + Dartdispatch_io_t channel, + int low_water, ) { - return _CFURLCreateBookmarkDataFromFile( - allocator, - fileURL, - errorRef, + return _dispatch_io_set_low_water( + channel.ref.pointer, + low_water, ); } - late final _CFURLCreateBookmarkDataFromFilePtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(CFAllocatorRef, CFURLRef, - ffi.Pointer)>>('CFURLCreateBookmarkDataFromFile'); - late final _CFURLCreateBookmarkDataFromFile = - _CFURLCreateBookmarkDataFromFilePtr.asFunction< - CFDataRef Function( - CFAllocatorRef, CFURLRef, ffi.Pointer)>(); + late final _dispatch_io_set_low_waterPtr = + _lookup>( + 'dispatch_io_set_low_water'); + late final _dispatch_io_set_low_water = _dispatch_io_set_low_waterPtr + .asFunction(); - int CFURLWriteBookmarkDataToFile( - CFDataRef bookmarkRef, - CFURLRef fileURL, - int options, - ffi.Pointer errorRef, + void dispatch_io_set_interval( + Dartdispatch_io_t channel, + int interval, + Dartdispatch_io_interval_flags_t flags, ) { - return _CFURLWriteBookmarkDataToFile( - bookmarkRef, - fileURL, - options, - errorRef, + return _dispatch_io_set_interval( + channel.ref.pointer, + interval, + flags, ); } - late final _CFURLWriteBookmarkDataToFilePtr = _lookup< + late final _dispatch_io_set_intervalPtr = _lookup< ffi.NativeFunction< - Boolean Function( - CFDataRef, - CFURLRef, - CFURLBookmarkFileCreationOptions, - ffi.Pointer)>>('CFURLWriteBookmarkDataToFile'); - late final _CFURLWriteBookmarkDataToFile = - _CFURLWriteBookmarkDataToFilePtr.asFunction< - int Function(CFDataRef, CFURLRef, int, ffi.Pointer)>(); + ffi.Void Function(dispatch_io_t, ffi.Uint64, + dispatch_io_interval_flags_t)>>('dispatch_io_set_interval'); + late final _dispatch_io_set_interval = _dispatch_io_set_intervalPtr + .asFunction(); - CFDataRef CFURLCreateBookmarkDataFromAliasRecord( - CFAllocatorRef allocatorRef, - CFDataRef aliasRecordDataRef, + Dartdispatch_workloop_t dispatch_workloop_create( + ffi.Pointer label, ) { - return _CFURLCreateBookmarkDataFromAliasRecord( - allocatorRef, - aliasRecordDataRef, - ); + return objc.NSObject.castFromPointer( + _dispatch_workloop_create( + label, + ), + retain: false, + release: true); } - late final _CFURLCreateBookmarkDataFromAliasRecordPtr = _lookup< - ffi.NativeFunction>( - 'CFURLCreateBookmarkDataFromAliasRecord'); - late final _CFURLCreateBookmarkDataFromAliasRecord = - _CFURLCreateBookmarkDataFromAliasRecordPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFDataRef)>(); + late final _dispatch_workloop_createPtr = _lookup< + ffi + .NativeFunction)>>( + 'dispatch_workloop_create'); + late final _dispatch_workloop_create = _dispatch_workloop_createPtr + .asFunction)>(); - int CFURLStartAccessingSecurityScopedResource( - CFURLRef url, + Dartdispatch_workloop_t dispatch_workloop_create_inactive( + ffi.Pointer label, ) { - return _CFURLStartAccessingSecurityScopedResource( - url, - ); + return objc.NSObject.castFromPointer( + _dispatch_workloop_create_inactive( + label, + ), + retain: false, + release: true); } - late final _CFURLStartAccessingSecurityScopedResourcePtr = - _lookup>( - 'CFURLStartAccessingSecurityScopedResource'); - late final _CFURLStartAccessingSecurityScopedResource = - _CFURLStartAccessingSecurityScopedResourcePtr.asFunction< - int Function(CFURLRef)>(); + late final _dispatch_workloop_create_inactivePtr = _lookup< + ffi + .NativeFunction)>>( + 'dispatch_workloop_create_inactive'); + late final _dispatch_workloop_create_inactive = + _dispatch_workloop_create_inactivePtr + .asFunction)>(); - void CFURLStopAccessingSecurityScopedResource( - CFURLRef url, + void dispatch_workloop_set_autorelease_frequency( + Dartdispatch_workloop_t workloop, + dispatch_autorelease_frequency_t frequency, ) { - return _CFURLStopAccessingSecurityScopedResource( - url, + return _dispatch_workloop_set_autorelease_frequency( + workloop.ref.pointer, + frequency.value, ); } - late final _CFURLStopAccessingSecurityScopedResourcePtr = - _lookup>( - 'CFURLStopAccessingSecurityScopedResource'); - late final _CFURLStopAccessingSecurityScopedResource = - _CFURLStopAccessingSecurityScopedResourcePtr.asFunction< - void Function(CFURLRef)>(); - - late final ffi.Pointer _kCFRunLoopDefaultMode = - _lookup('kCFRunLoopDefaultMode'); - - CFRunLoopMode get kCFRunLoopDefaultMode => _kCFRunLoopDefaultMode.value; - - late final ffi.Pointer _kCFRunLoopCommonModes = - _lookup('kCFRunLoopCommonModes'); - - CFRunLoopMode get kCFRunLoopCommonModes => _kCFRunLoopCommonModes.value; + late final _dispatch_workloop_set_autorelease_frequencyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_workloop_t, ffi.UnsignedLong)>>( + 'dispatch_workloop_set_autorelease_frequency'); + late final _dispatch_workloop_set_autorelease_frequency = + _dispatch_workloop_set_autorelease_frequencyPtr + .asFunction(); - int CFRunLoopGetTypeID() { - return _CFRunLoopGetTypeID(); + void dispatch_workloop_set_os_workgroup( + Dartdispatch_workloop_t workloop, + Dartos_workgroup_t workgroup, + ) { + return _dispatch_workloop_set_os_workgroup( + workloop.ref.pointer, + workgroup.ref.pointer, + ); } - late final _CFRunLoopGetTypeIDPtr = - _lookup>('CFRunLoopGetTypeID'); - late final _CFRunLoopGetTypeID = - _CFRunLoopGetTypeIDPtr.asFunction(); + late final _dispatch_workloop_set_os_workgroupPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(dispatch_workloop_t, + os_workgroup_t)>>('dispatch_workloop_set_os_workgroup'); + late final _dispatch_workloop_set_os_workgroup = + _dispatch_workloop_set_os_workgroupPtr + .asFunction(); - CFRunLoopRef CFRunLoopGetCurrent() { - return _CFRunLoopGetCurrent(); + int CFReadStreamGetTypeID() { + return _CFReadStreamGetTypeID(); } - late final _CFRunLoopGetCurrentPtr = - _lookup>( - 'CFRunLoopGetCurrent'); - late final _CFRunLoopGetCurrent = - _CFRunLoopGetCurrentPtr.asFunction(); + late final _CFReadStreamGetTypeIDPtr = + _lookup>('CFReadStreamGetTypeID'); + late final _CFReadStreamGetTypeID = + _CFReadStreamGetTypeIDPtr.asFunction(); - CFRunLoopRef CFRunLoopGetMain() { - return _CFRunLoopGetMain(); + int CFWriteStreamGetTypeID() { + return _CFWriteStreamGetTypeID(); } - late final _CFRunLoopGetMainPtr = - _lookup>('CFRunLoopGetMain'); - late final _CFRunLoopGetMain = - _CFRunLoopGetMainPtr.asFunction(); + late final _CFWriteStreamGetTypeIDPtr = + _lookup>( + 'CFWriteStreamGetTypeID'); + late final _CFWriteStreamGetTypeID = + _CFWriteStreamGetTypeIDPtr.asFunction(); - CFRunLoopMode CFRunLoopCopyCurrentMode( - CFRunLoopRef rl, - ) { - return _CFRunLoopCopyCurrentMode( - rl, - ); - } + late final ffi.Pointer _kCFStreamPropertyDataWritten = + _lookup('kCFStreamPropertyDataWritten'); - late final _CFRunLoopCopyCurrentModePtr = - _lookup>( - 'CFRunLoopCopyCurrentMode'); - late final _CFRunLoopCopyCurrentMode = _CFRunLoopCopyCurrentModePtr - .asFunction(); + CFStreamPropertyKey get kCFStreamPropertyDataWritten => + _kCFStreamPropertyDataWritten.value; - CFArrayRef CFRunLoopCopyAllModes( - CFRunLoopRef rl, + CFReadStreamRef CFReadStreamCreateWithBytesNoCopy( + CFAllocatorRef alloc, + ffi.Pointer bytes, + int length, + CFAllocatorRef bytesDeallocator, ) { - return _CFRunLoopCopyAllModes( - rl, + return _CFReadStreamCreateWithBytesNoCopy( + alloc, + bytes, + length, + bytesDeallocator, ); } - late final _CFRunLoopCopyAllModesPtr = - _lookup>( - 'CFRunLoopCopyAllModes'); - late final _CFRunLoopCopyAllModes = - _CFRunLoopCopyAllModesPtr.asFunction(); + late final _CFReadStreamCreateWithBytesNoCopyPtr = _lookup< + ffi.NativeFunction< + CFReadStreamRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, + CFAllocatorRef)>>('CFReadStreamCreateWithBytesNoCopy'); + late final _CFReadStreamCreateWithBytesNoCopy = + _CFReadStreamCreateWithBytesNoCopyPtr.asFunction< + CFReadStreamRef Function( + CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); - void CFRunLoopAddCommonMode( - CFRunLoopRef rl, - CFRunLoopMode mode, + CFWriteStreamRef CFWriteStreamCreateWithBuffer( + CFAllocatorRef alloc, + ffi.Pointer buffer, + int bufferCapacity, ) { - return _CFRunLoopAddCommonMode( - rl, - mode, + return _CFWriteStreamCreateWithBuffer( + alloc, + buffer, + bufferCapacity, ); } - late final _CFRunLoopAddCommonModePtr = _lookup< - ffi.NativeFunction>( - 'CFRunLoopAddCommonMode'); - late final _CFRunLoopAddCommonMode = _CFRunLoopAddCommonModePtr.asFunction< - void Function(CFRunLoopRef, CFRunLoopMode)>(); + late final _CFWriteStreamCreateWithBufferPtr = _lookup< + ffi.NativeFunction< + CFWriteStreamRef Function(CFAllocatorRef, ffi.Pointer, + CFIndex)>>('CFWriteStreamCreateWithBuffer'); + late final _CFWriteStreamCreateWithBuffer = + _CFWriteStreamCreateWithBufferPtr.asFunction< + CFWriteStreamRef Function(CFAllocatorRef, ffi.Pointer, int)>(); - double CFRunLoopGetNextTimerFireDate( - CFRunLoopRef rl, - CFRunLoopMode mode, + CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers( + CFAllocatorRef alloc, + CFAllocatorRef bufferAllocator, ) { - return _CFRunLoopGetNextTimerFireDate( - rl, - mode, + return _CFWriteStreamCreateWithAllocatedBuffers( + alloc, + bufferAllocator, ); } - late final _CFRunLoopGetNextTimerFireDatePtr = _lookup< + late final _CFWriteStreamCreateWithAllocatedBuffersPtr = _lookup< ffi.NativeFunction< - CFAbsoluteTime Function( - CFRunLoopRef, CFRunLoopMode)>>('CFRunLoopGetNextTimerFireDate'); - late final _CFRunLoopGetNextTimerFireDate = _CFRunLoopGetNextTimerFireDatePtr - .asFunction(); - - void CFRunLoopRun() { - return _CFRunLoopRun(); - } - - late final _CFRunLoopRunPtr = - _lookup>('CFRunLoopRun'); - late final _CFRunLoopRun = _CFRunLoopRunPtr.asFunction(); + CFWriteStreamRef Function(CFAllocatorRef, + CFAllocatorRef)>>('CFWriteStreamCreateWithAllocatedBuffers'); + late final _CFWriteStreamCreateWithAllocatedBuffers = + _CFWriteStreamCreateWithAllocatedBuffersPtr.asFunction< + CFWriteStreamRef Function(CFAllocatorRef, CFAllocatorRef)>(); - int CFRunLoopRunInMode( - CFRunLoopMode mode, - double seconds, - int returnAfterSourceHandled, + CFReadStreamRef CFReadStreamCreateWithFile( + CFAllocatorRef alloc, + CFURLRef fileURL, ) { - return _CFRunLoopRunInMode( - mode, - seconds, - returnAfterSourceHandled, + return _CFReadStreamCreateWithFile( + alloc, + fileURL, ); } - late final _CFRunLoopRunInModePtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - CFRunLoopMode, CFTimeInterval, Boolean)>>('CFRunLoopRunInMode'); - late final _CFRunLoopRunInMode = _CFRunLoopRunInModePtr.asFunction< - int Function(CFRunLoopMode, double, int)>(); + late final _CFReadStreamCreateWithFilePtr = _lookup< + ffi + .NativeFunction>( + 'CFReadStreamCreateWithFile'); + late final _CFReadStreamCreateWithFile = _CFReadStreamCreateWithFilePtr + .asFunction(); - int CFRunLoopIsWaiting( - CFRunLoopRef rl, + CFWriteStreamRef CFWriteStreamCreateWithFile( + CFAllocatorRef alloc, + CFURLRef fileURL, ) { - return _CFRunLoopIsWaiting( - rl, + return _CFWriteStreamCreateWithFile( + alloc, + fileURL, ); } - late final _CFRunLoopIsWaitingPtr = - _lookup>( - 'CFRunLoopIsWaiting'); - late final _CFRunLoopIsWaiting = - _CFRunLoopIsWaitingPtr.asFunction(); + late final _CFWriteStreamCreateWithFilePtr = _lookup< + ffi + .NativeFunction>( + 'CFWriteStreamCreateWithFile'); + late final _CFWriteStreamCreateWithFile = _CFWriteStreamCreateWithFilePtr + .asFunction(); - void CFRunLoopWakeUp( - CFRunLoopRef rl, + void CFStreamCreateBoundPair( + CFAllocatorRef alloc, + ffi.Pointer readStream, + ffi.Pointer writeStream, + int transferBufferSize, ) { - return _CFRunLoopWakeUp( - rl, + return _CFStreamCreateBoundPair( + alloc, + readStream, + writeStream, + transferBufferSize, ); } - late final _CFRunLoopWakeUpPtr = - _lookup>( - 'CFRunLoopWakeUp'); - late final _CFRunLoopWakeUp = - _CFRunLoopWakeUpPtr.asFunction(); + late final _CFStreamCreateBoundPairPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFAllocatorRef, + ffi.Pointer, + ffi.Pointer, + CFIndex)>>('CFStreamCreateBoundPair'); + late final _CFStreamCreateBoundPair = _CFStreamCreateBoundPairPtr.asFunction< + void Function(CFAllocatorRef, ffi.Pointer, + ffi.Pointer, int)>(); - void CFRunLoopStop( - CFRunLoopRef rl, - ) { - return _CFRunLoopStop( - rl, - ); - } + late final ffi.Pointer _kCFStreamPropertyAppendToFile = + _lookup('kCFStreamPropertyAppendToFile'); - late final _CFRunLoopStopPtr = - _lookup>( - 'CFRunLoopStop'); - late final _CFRunLoopStop = - _CFRunLoopStopPtr.asFunction(); + CFStreamPropertyKey get kCFStreamPropertyAppendToFile => + _kCFStreamPropertyAppendToFile.value; - void CFRunLoopPerformBlock( - CFRunLoopRef rl, - CFTypeRef mode, - ObjCBlock_ffiVoid block, - ) { - return _CFRunLoopPerformBlock( - rl, - mode, - block._id, - ); - } + late final ffi.Pointer + _kCFStreamPropertyFileCurrentOffset = + _lookup('kCFStreamPropertyFileCurrentOffset'); - late final _CFRunLoopPerformBlockPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopRef, CFTypeRef, - ffi.Pointer<_ObjCBlock>)>>('CFRunLoopPerformBlock'); - late final _CFRunLoopPerformBlock = _CFRunLoopPerformBlockPtr.asFunction< - void Function(CFRunLoopRef, CFTypeRef, ffi.Pointer<_ObjCBlock>)>(); + CFStreamPropertyKey get kCFStreamPropertyFileCurrentOffset => + _kCFStreamPropertyFileCurrentOffset.value; - int CFRunLoopContainsSource( - CFRunLoopRef rl, - CFRunLoopSourceRef source, - CFRunLoopMode mode, - ) { - return _CFRunLoopContainsSource( - rl, - source, - mode, - ); - } + late final ffi.Pointer + _kCFStreamPropertySocketNativeHandle = + _lookup('kCFStreamPropertySocketNativeHandle'); - late final _CFRunLoopContainsSourcePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFRunLoopRef, CFRunLoopSourceRef, - CFRunLoopMode)>>('CFRunLoopContainsSource'); - late final _CFRunLoopContainsSource = _CFRunLoopContainsSourcePtr.asFunction< - int Function(CFRunLoopRef, CFRunLoopSourceRef, CFRunLoopMode)>(); + CFStreamPropertyKey get kCFStreamPropertySocketNativeHandle => + _kCFStreamPropertySocketNativeHandle.value; - void CFRunLoopAddSource( - CFRunLoopRef rl, - CFRunLoopSourceRef source, - CFRunLoopMode mode, - ) { - return _CFRunLoopAddSource( - rl, - source, - mode, - ); - } + late final ffi.Pointer + _kCFStreamPropertySocketRemoteHostName = + _lookup('kCFStreamPropertySocketRemoteHostName'); - late final _CFRunLoopAddSourcePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopRef, CFRunLoopSourceRef, - CFRunLoopMode)>>('CFRunLoopAddSource'); - late final _CFRunLoopAddSource = _CFRunLoopAddSourcePtr.asFunction< - void Function(CFRunLoopRef, CFRunLoopSourceRef, CFRunLoopMode)>(); + CFStreamPropertyKey get kCFStreamPropertySocketRemoteHostName => + _kCFStreamPropertySocketRemoteHostName.value; - void CFRunLoopRemoveSource( - CFRunLoopRef rl, - CFRunLoopSourceRef source, - CFRunLoopMode mode, - ) { - return _CFRunLoopRemoveSource( - rl, - source, - mode, - ); - } + late final ffi.Pointer + _kCFStreamPropertySocketRemotePortNumber = + _lookup('kCFStreamPropertySocketRemotePortNumber'); - late final _CFRunLoopRemoveSourcePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopRef, CFRunLoopSourceRef, - CFRunLoopMode)>>('CFRunLoopRemoveSource'); - late final _CFRunLoopRemoveSource = _CFRunLoopRemoveSourcePtr.asFunction< - void Function(CFRunLoopRef, CFRunLoopSourceRef, CFRunLoopMode)>(); + CFStreamPropertyKey get kCFStreamPropertySocketRemotePortNumber => + _kCFStreamPropertySocketRemotePortNumber.value; - int CFRunLoopContainsObserver( - CFRunLoopRef rl, - CFRunLoopObserverRef observer, - CFRunLoopMode mode, - ) { - return _CFRunLoopContainsObserver( - rl, - observer, - mode, - ); - } + late final ffi.Pointer _kCFStreamErrorDomainSOCKS = + _lookup('kCFStreamErrorDomainSOCKS'); - late final _CFRunLoopContainsObserverPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFRunLoopRef, CFRunLoopObserverRef, - CFRunLoopMode)>>('CFRunLoopContainsObserver'); - late final _CFRunLoopContainsObserver = - _CFRunLoopContainsObserverPtr.asFunction< - int Function(CFRunLoopRef, CFRunLoopObserverRef, CFRunLoopMode)>(); + int get kCFStreamErrorDomainSOCKS => _kCFStreamErrorDomainSOCKS.value; - void CFRunLoopAddObserver( - CFRunLoopRef rl, - CFRunLoopObserverRef observer, - CFRunLoopMode mode, - ) { - return _CFRunLoopAddObserver( - rl, - observer, - mode, - ); - } + late final ffi.Pointer _kCFStreamPropertySOCKSProxy = + _lookup('kCFStreamPropertySOCKSProxy'); - late final _CFRunLoopAddObserverPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopRef, CFRunLoopObserverRef, - CFRunLoopMode)>>('CFRunLoopAddObserver'); - late final _CFRunLoopAddObserver = _CFRunLoopAddObserverPtr.asFunction< - void Function(CFRunLoopRef, CFRunLoopObserverRef, CFRunLoopMode)>(); + CFStringRef get kCFStreamPropertySOCKSProxy => + _kCFStreamPropertySOCKSProxy.value; - void CFRunLoopRemoveObserver( - CFRunLoopRef rl, - CFRunLoopObserverRef observer, - CFRunLoopMode mode, - ) { - return _CFRunLoopRemoveObserver( - rl, - observer, - mode, - ); - } + set kCFStreamPropertySOCKSProxy(CFStringRef value) => + _kCFStreamPropertySOCKSProxy.value = value; - late final _CFRunLoopRemoveObserverPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopRef, CFRunLoopObserverRef, - CFRunLoopMode)>>('CFRunLoopRemoveObserver'); - late final _CFRunLoopRemoveObserver = _CFRunLoopRemoveObserverPtr.asFunction< - void Function(CFRunLoopRef, CFRunLoopObserverRef, CFRunLoopMode)>(); + late final ffi.Pointer _kCFStreamPropertySOCKSProxyHost = + _lookup('kCFStreamPropertySOCKSProxyHost'); - int CFRunLoopContainsTimer( - CFRunLoopRef rl, - CFRunLoopTimerRef timer, - CFRunLoopMode mode, - ) { - return _CFRunLoopContainsTimer( - rl, - timer, - mode, - ); - } + CFStringRef get kCFStreamPropertySOCKSProxyHost => + _kCFStreamPropertySOCKSProxyHost.value; - late final _CFRunLoopContainsTimerPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFRunLoopRef, CFRunLoopTimerRef, - CFRunLoopMode)>>('CFRunLoopContainsTimer'); - late final _CFRunLoopContainsTimer = _CFRunLoopContainsTimerPtr.asFunction< - int Function(CFRunLoopRef, CFRunLoopTimerRef, CFRunLoopMode)>(); + set kCFStreamPropertySOCKSProxyHost(CFStringRef value) => + _kCFStreamPropertySOCKSProxyHost.value = value; - void CFRunLoopAddTimer( - CFRunLoopRef rl, - CFRunLoopTimerRef timer, - CFRunLoopMode mode, - ) { - return _CFRunLoopAddTimer( - rl, - timer, - mode, - ); - } + late final ffi.Pointer _kCFStreamPropertySOCKSProxyPort = + _lookup('kCFStreamPropertySOCKSProxyPort'); - late final _CFRunLoopAddTimerPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopRef, CFRunLoopTimerRef, - CFRunLoopMode)>>('CFRunLoopAddTimer'); - late final _CFRunLoopAddTimer = _CFRunLoopAddTimerPtr.asFunction< - void Function(CFRunLoopRef, CFRunLoopTimerRef, CFRunLoopMode)>(); + CFStringRef get kCFStreamPropertySOCKSProxyPort => + _kCFStreamPropertySOCKSProxyPort.value; - void CFRunLoopRemoveTimer( - CFRunLoopRef rl, - CFRunLoopTimerRef timer, - CFRunLoopMode mode, - ) { - return _CFRunLoopRemoveTimer( - rl, - timer, - mode, - ); - } + set kCFStreamPropertySOCKSProxyPort(CFStringRef value) => + _kCFStreamPropertySOCKSProxyPort.value = value; - late final _CFRunLoopRemoveTimerPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopRef, CFRunLoopTimerRef, - CFRunLoopMode)>>('CFRunLoopRemoveTimer'); - late final _CFRunLoopRemoveTimer = _CFRunLoopRemoveTimerPtr.asFunction< - void Function(CFRunLoopRef, CFRunLoopTimerRef, CFRunLoopMode)>(); + late final ffi.Pointer _kCFStreamPropertySOCKSVersion = + _lookup('kCFStreamPropertySOCKSVersion'); - int CFRunLoopSourceGetTypeID() { - return _CFRunLoopSourceGetTypeID(); - } + CFStringRef get kCFStreamPropertySOCKSVersion => + _kCFStreamPropertySOCKSVersion.value; - late final _CFRunLoopSourceGetTypeIDPtr = - _lookup>( - 'CFRunLoopSourceGetTypeID'); - late final _CFRunLoopSourceGetTypeID = - _CFRunLoopSourceGetTypeIDPtr.asFunction(); + set kCFStreamPropertySOCKSVersion(CFStringRef value) => + _kCFStreamPropertySOCKSVersion.value = value; - CFRunLoopSourceRef CFRunLoopSourceCreate( - CFAllocatorRef allocator, - int order, - ffi.Pointer context, - ) { - return _CFRunLoopSourceCreate( - allocator, - order, - context, - ); - } + late final ffi.Pointer _kCFStreamSocketSOCKSVersion4 = + _lookup('kCFStreamSocketSOCKSVersion4'); - late final _CFRunLoopSourceCreatePtr = _lookup< - ffi.NativeFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFIndex, - ffi.Pointer)>>('CFRunLoopSourceCreate'); - late final _CFRunLoopSourceCreate = _CFRunLoopSourceCreatePtr.asFunction< - CFRunLoopSourceRef Function( - CFAllocatorRef, int, ffi.Pointer)>(); + CFStringRef get kCFStreamSocketSOCKSVersion4 => + _kCFStreamSocketSOCKSVersion4.value; - int CFRunLoopSourceGetOrder( - CFRunLoopSourceRef source, - ) { - return _CFRunLoopSourceGetOrder( - source, - ); - } + set kCFStreamSocketSOCKSVersion4(CFStringRef value) => + _kCFStreamSocketSOCKSVersion4.value = value; - late final _CFRunLoopSourceGetOrderPtr = - _lookup>( - 'CFRunLoopSourceGetOrder'); - late final _CFRunLoopSourceGetOrder = _CFRunLoopSourceGetOrderPtr.asFunction< - int Function(CFRunLoopSourceRef)>(); + late final ffi.Pointer _kCFStreamSocketSOCKSVersion5 = + _lookup('kCFStreamSocketSOCKSVersion5'); - void CFRunLoopSourceInvalidate( - CFRunLoopSourceRef source, - ) { - return _CFRunLoopSourceInvalidate( - source, - ); - } + CFStringRef get kCFStreamSocketSOCKSVersion5 => + _kCFStreamSocketSOCKSVersion5.value; - late final _CFRunLoopSourceInvalidatePtr = - _lookup>( - 'CFRunLoopSourceInvalidate'); - late final _CFRunLoopSourceInvalidate = _CFRunLoopSourceInvalidatePtr - .asFunction(); + set kCFStreamSocketSOCKSVersion5(CFStringRef value) => + _kCFStreamSocketSOCKSVersion5.value = value; - int CFRunLoopSourceIsValid( - CFRunLoopSourceRef source, + late final ffi.Pointer _kCFStreamPropertySOCKSUser = + _lookup('kCFStreamPropertySOCKSUser'); + + CFStringRef get kCFStreamPropertySOCKSUser => + _kCFStreamPropertySOCKSUser.value; + + set kCFStreamPropertySOCKSUser(CFStringRef value) => + _kCFStreamPropertySOCKSUser.value = value; + + late final ffi.Pointer _kCFStreamPropertySOCKSPassword = + _lookup('kCFStreamPropertySOCKSPassword'); + + CFStringRef get kCFStreamPropertySOCKSPassword => + _kCFStreamPropertySOCKSPassword.value; + + set kCFStreamPropertySOCKSPassword(CFStringRef value) => + _kCFStreamPropertySOCKSPassword.value = value; + + late final ffi.Pointer _kCFStreamErrorDomainSSL = + _lookup('kCFStreamErrorDomainSSL'); + + int get kCFStreamErrorDomainSSL => _kCFStreamErrorDomainSSL.value; + + late final ffi.Pointer _kCFStreamPropertySocketSecurityLevel = + _lookup('kCFStreamPropertySocketSecurityLevel'); + + CFStringRef get kCFStreamPropertySocketSecurityLevel => + _kCFStreamPropertySocketSecurityLevel.value; + + set kCFStreamPropertySocketSecurityLevel(CFStringRef value) => + _kCFStreamPropertySocketSecurityLevel.value = value; + + late final ffi.Pointer _kCFStreamSocketSecurityLevelNone = + _lookup('kCFStreamSocketSecurityLevelNone'); + + CFStringRef get kCFStreamSocketSecurityLevelNone => + _kCFStreamSocketSecurityLevelNone.value; + + set kCFStreamSocketSecurityLevelNone(CFStringRef value) => + _kCFStreamSocketSecurityLevelNone.value = value; + + late final ffi.Pointer _kCFStreamSocketSecurityLevelSSLv2 = + _lookup('kCFStreamSocketSecurityLevelSSLv2'); + + CFStringRef get kCFStreamSocketSecurityLevelSSLv2 => + _kCFStreamSocketSecurityLevelSSLv2.value; + + set kCFStreamSocketSecurityLevelSSLv2(CFStringRef value) => + _kCFStreamSocketSecurityLevelSSLv2.value = value; + + late final ffi.Pointer _kCFStreamSocketSecurityLevelSSLv3 = + _lookup('kCFStreamSocketSecurityLevelSSLv3'); + + CFStringRef get kCFStreamSocketSecurityLevelSSLv3 => + _kCFStreamSocketSecurityLevelSSLv3.value; + + set kCFStreamSocketSecurityLevelSSLv3(CFStringRef value) => + _kCFStreamSocketSecurityLevelSSLv3.value = value; + + late final ffi.Pointer _kCFStreamSocketSecurityLevelTLSv1 = + _lookup('kCFStreamSocketSecurityLevelTLSv1'); + + CFStringRef get kCFStreamSocketSecurityLevelTLSv1 => + _kCFStreamSocketSecurityLevelTLSv1.value; + + set kCFStreamSocketSecurityLevelTLSv1(CFStringRef value) => + _kCFStreamSocketSecurityLevelTLSv1.value = value; + + late final ffi.Pointer + _kCFStreamSocketSecurityLevelNegotiatedSSL = + _lookup('kCFStreamSocketSecurityLevelNegotiatedSSL'); + + CFStringRef get kCFStreamSocketSecurityLevelNegotiatedSSL => + _kCFStreamSocketSecurityLevelNegotiatedSSL.value; + + set kCFStreamSocketSecurityLevelNegotiatedSSL(CFStringRef value) => + _kCFStreamSocketSecurityLevelNegotiatedSSL.value = value; + + late final ffi.Pointer + _kCFStreamPropertyShouldCloseNativeSocket = + _lookup('kCFStreamPropertyShouldCloseNativeSocket'); + + CFStringRef get kCFStreamPropertyShouldCloseNativeSocket => + _kCFStreamPropertyShouldCloseNativeSocket.value; + + set kCFStreamPropertyShouldCloseNativeSocket(CFStringRef value) => + _kCFStreamPropertyShouldCloseNativeSocket.value = value; + + void CFStreamCreatePairWithSocket( + CFAllocatorRef alloc, + int sock, + ffi.Pointer readStream, + ffi.Pointer writeStream, ) { - return _CFRunLoopSourceIsValid( - source, + return _CFStreamCreatePairWithSocket( + alloc, + sock, + readStream, + writeStream, ); } - late final _CFRunLoopSourceIsValidPtr = - _lookup>( - 'CFRunLoopSourceIsValid'); - late final _CFRunLoopSourceIsValid = - _CFRunLoopSourceIsValidPtr.asFunction(); + late final _CFStreamCreatePairWithSocketPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFAllocatorRef, + CFSocketNativeHandle, + ffi.Pointer, + ffi.Pointer)>>('CFStreamCreatePairWithSocket'); + late final _CFStreamCreatePairWithSocket = + _CFStreamCreatePairWithSocketPtr.asFunction< + void Function(CFAllocatorRef, int, ffi.Pointer, + ffi.Pointer)>(); - void CFRunLoopSourceGetContext( - CFRunLoopSourceRef source, - ffi.Pointer context, + void CFStreamCreatePairWithSocketToHost( + CFAllocatorRef alloc, + CFStringRef host, + int port, + ffi.Pointer readStream, + ffi.Pointer writeStream, ) { - return _CFRunLoopSourceGetContext( - source, - context, + return _CFStreamCreatePairWithSocketToHost( + alloc, + host, + port, + readStream, + writeStream, ); } - late final _CFRunLoopSourceGetContextPtr = _lookup< + late final _CFStreamCreatePairWithSocketToHostPtr = _lookup< ffi.NativeFunction< ffi.Void Function( - CFRunLoopSourceRef, ffi.Pointer)>>( - 'CFRunLoopSourceGetContext'); - late final _CFRunLoopSourceGetContext = - _CFRunLoopSourceGetContextPtr.asFunction< - void Function( - CFRunLoopSourceRef, ffi.Pointer)>(); + CFAllocatorRef, + CFStringRef, + UInt32, + ffi.Pointer, + ffi.Pointer)>>( + 'CFStreamCreatePairWithSocketToHost'); + late final _CFStreamCreatePairWithSocketToHost = + _CFStreamCreatePairWithSocketToHostPtr.asFunction< + void Function(CFAllocatorRef, CFStringRef, int, + ffi.Pointer, ffi.Pointer)>(); - void CFRunLoopSourceSignal( - CFRunLoopSourceRef source, + void CFStreamCreatePairWithPeerSocketSignature( + CFAllocatorRef alloc, + ffi.Pointer signature, + ffi.Pointer readStream, + ffi.Pointer writeStream, ) { - return _CFRunLoopSourceSignal( - source, + return _CFStreamCreatePairWithPeerSocketSignature( + alloc, + signature, + readStream, + writeStream, ); } - late final _CFRunLoopSourceSignalPtr = - _lookup>( - 'CFRunLoopSourceSignal'); - late final _CFRunLoopSourceSignal = - _CFRunLoopSourceSignalPtr.asFunction(); + late final _CFStreamCreatePairWithPeerSocketSignaturePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFAllocatorRef, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>( + 'CFStreamCreatePairWithPeerSocketSignature'); + late final _CFStreamCreatePairWithPeerSocketSignature = + _CFStreamCreatePairWithPeerSocketSignaturePtr.asFunction< + void Function(CFAllocatorRef, ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); - int CFRunLoopObserverGetTypeID() { - return _CFRunLoopObserverGetTypeID(); + CFStreamStatus CFReadStreamGetStatus( + CFReadStreamRef stream, + ) { + return CFStreamStatus.fromValue(_CFReadStreamGetStatus( + stream, + )); } - late final _CFRunLoopObserverGetTypeIDPtr = - _lookup>( - 'CFRunLoopObserverGetTypeID'); - late final _CFRunLoopObserverGetTypeID = - _CFRunLoopObserverGetTypeIDPtr.asFunction(); + late final _CFReadStreamGetStatusPtr = + _lookup>( + 'CFReadStreamGetStatus'); + late final _CFReadStreamGetStatus = + _CFReadStreamGetStatusPtr.asFunction(); - CFRunLoopObserverRef CFRunLoopObserverCreate( - CFAllocatorRef allocator, - int activities, - int repeats, - int order, - CFRunLoopObserverCallBack callout, - ffi.Pointer context, + CFStreamStatus CFWriteStreamGetStatus( + CFWriteStreamRef stream, ) { - return _CFRunLoopObserverCreate( - allocator, - activities, - repeats, - order, - callout, - context, - ); + return CFStreamStatus.fromValue(_CFWriteStreamGetStatus( + stream, + )); } - late final _CFRunLoopObserverCreatePtr = _lookup< - ffi.NativeFunction< - CFRunLoopObserverRef Function( - CFAllocatorRef, - CFOptionFlags, - Boolean, - CFIndex, - CFRunLoopObserverCallBack, - ffi.Pointer)>>( - 'CFRunLoopObserverCreate'); - late final _CFRunLoopObserverCreate = _CFRunLoopObserverCreatePtr.asFunction< - CFRunLoopObserverRef Function(CFAllocatorRef, int, int, int, - CFRunLoopObserverCallBack, ffi.Pointer)>(); + late final _CFWriteStreamGetStatusPtr = + _lookup>( + 'CFWriteStreamGetStatus'); + late final _CFWriteStreamGetStatus = + _CFWriteStreamGetStatusPtr.asFunction(); - CFRunLoopObserverRef CFRunLoopObserverCreateWithHandler( - CFAllocatorRef allocator, - DartCFOptionFlags activities, - DartBoolean repeats, - DartCFIndex order, - ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity block, + CFErrorRef CFReadStreamCopyError( + CFReadStreamRef stream, ) { - return _CFRunLoopObserverCreateWithHandler( - allocator, - activities, - repeats, - order, - block._id, + return _CFReadStreamCopyError( + stream, ); } - late final _CFRunLoopObserverCreateWithHandlerPtr = _lookup< - ffi.NativeFunction< - CFRunLoopObserverRef Function( - CFAllocatorRef, - CFOptionFlags, - Boolean, - CFIndex, - ffi.Pointer<_ObjCBlock>)>>('CFRunLoopObserverCreateWithHandler'); - late final _CFRunLoopObserverCreateWithHandler = - _CFRunLoopObserverCreateWithHandlerPtr.asFunction< - CFRunLoopObserverRef Function( - CFAllocatorRef, int, int, int, ffi.Pointer<_ObjCBlock>)>(); + late final _CFReadStreamCopyErrorPtr = + _lookup>( + 'CFReadStreamCopyError'); + late final _CFReadStreamCopyError = _CFReadStreamCopyErrorPtr.asFunction< + CFErrorRef Function(CFReadStreamRef)>(); - int CFRunLoopObserverGetActivities( - CFRunLoopObserverRef observer, + CFErrorRef CFWriteStreamCopyError( + CFWriteStreamRef stream, ) { - return _CFRunLoopObserverGetActivities( - observer, + return _CFWriteStreamCopyError( + stream, ); } - late final _CFRunLoopObserverGetActivitiesPtr = - _lookup>( - 'CFRunLoopObserverGetActivities'); - late final _CFRunLoopObserverGetActivities = - _CFRunLoopObserverGetActivitiesPtr.asFunction< - int Function(CFRunLoopObserverRef)>(); + late final _CFWriteStreamCopyErrorPtr = + _lookup>( + 'CFWriteStreamCopyError'); + late final _CFWriteStreamCopyError = _CFWriteStreamCopyErrorPtr.asFunction< + CFErrorRef Function(CFWriteStreamRef)>(); - int CFRunLoopObserverDoesRepeat( - CFRunLoopObserverRef observer, + int CFReadStreamOpen( + CFReadStreamRef stream, ) { - return _CFRunLoopObserverDoesRepeat( - observer, + return _CFReadStreamOpen( + stream, ); } - late final _CFRunLoopObserverDoesRepeatPtr = - _lookup>( - 'CFRunLoopObserverDoesRepeat'); - late final _CFRunLoopObserverDoesRepeat = _CFRunLoopObserverDoesRepeatPtr - .asFunction(); + late final _CFReadStreamOpenPtr = + _lookup>( + 'CFReadStreamOpen'); + late final _CFReadStreamOpen = + _CFReadStreamOpenPtr.asFunction(); - int CFRunLoopObserverGetOrder( - CFRunLoopObserverRef observer, + int CFWriteStreamOpen( + CFWriteStreamRef stream, ) { - return _CFRunLoopObserverGetOrder( - observer, + return _CFWriteStreamOpen( + stream, ); } - late final _CFRunLoopObserverGetOrderPtr = - _lookup>( - 'CFRunLoopObserverGetOrder'); - late final _CFRunLoopObserverGetOrder = _CFRunLoopObserverGetOrderPtr - .asFunction(); + late final _CFWriteStreamOpenPtr = + _lookup>( + 'CFWriteStreamOpen'); + late final _CFWriteStreamOpen = + _CFWriteStreamOpenPtr.asFunction(); - void CFRunLoopObserverInvalidate( - CFRunLoopObserverRef observer, + void CFReadStreamClose( + CFReadStreamRef stream, ) { - return _CFRunLoopObserverInvalidate( - observer, + return _CFReadStreamClose( + stream, ); } - late final _CFRunLoopObserverInvalidatePtr = - _lookup>( - 'CFRunLoopObserverInvalidate'); - late final _CFRunLoopObserverInvalidate = _CFRunLoopObserverInvalidatePtr - .asFunction(); + late final _CFReadStreamClosePtr = + _lookup>( + 'CFReadStreamClose'); + late final _CFReadStreamClose = + _CFReadStreamClosePtr.asFunction(); - int CFRunLoopObserverIsValid( - CFRunLoopObserverRef observer, + void CFWriteStreamClose( + CFWriteStreamRef stream, ) { - return _CFRunLoopObserverIsValid( - observer, + return _CFWriteStreamClose( + stream, ); } - late final _CFRunLoopObserverIsValidPtr = - _lookup>( - 'CFRunLoopObserverIsValid'); - late final _CFRunLoopObserverIsValid = _CFRunLoopObserverIsValidPtr - .asFunction(); + late final _CFWriteStreamClosePtr = + _lookup>( + 'CFWriteStreamClose'); + late final _CFWriteStreamClose = + _CFWriteStreamClosePtr.asFunction(); - void CFRunLoopObserverGetContext( - CFRunLoopObserverRef observer, - ffi.Pointer context, + int CFReadStreamHasBytesAvailable( + CFReadStreamRef stream, ) { - return _CFRunLoopObserverGetContext( - observer, - context, + return _CFReadStreamHasBytesAvailable( + stream, ); } - late final _CFRunLoopObserverGetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopObserverRef, - ffi.Pointer)>>( - 'CFRunLoopObserverGetContext'); - late final _CFRunLoopObserverGetContext = - _CFRunLoopObserverGetContextPtr.asFunction< - void Function( - CFRunLoopObserverRef, ffi.Pointer)>(); - - int CFRunLoopTimerGetTypeID() { - return _CFRunLoopTimerGetTypeID(); - } - - late final _CFRunLoopTimerGetTypeIDPtr = - _lookup>( - 'CFRunLoopTimerGetTypeID'); - late final _CFRunLoopTimerGetTypeID = - _CFRunLoopTimerGetTypeIDPtr.asFunction(); + late final _CFReadStreamHasBytesAvailablePtr = + _lookup>( + 'CFReadStreamHasBytesAvailable'); + late final _CFReadStreamHasBytesAvailable = _CFReadStreamHasBytesAvailablePtr + .asFunction(); - CFRunLoopTimerRef CFRunLoopTimerCreate( - CFAllocatorRef allocator, - double fireDate, - double interval, - int flags, - int order, - CFRunLoopTimerCallBack callout, - ffi.Pointer context, + int CFReadStreamRead( + CFReadStreamRef stream, + ffi.Pointer buffer, + int bufferLength, ) { - return _CFRunLoopTimerCreate( - allocator, - fireDate, - interval, - flags, - order, - callout, - context, + return _CFReadStreamRead( + stream, + buffer, + bufferLength, ); } - late final _CFRunLoopTimerCreatePtr = _lookup< + late final _CFReadStreamReadPtr = _lookup< ffi.NativeFunction< - CFRunLoopTimerRef Function( - CFAllocatorRef, - CFAbsoluteTime, - CFTimeInterval, - CFOptionFlags, - CFIndex, - CFRunLoopTimerCallBack, - ffi.Pointer)>>('CFRunLoopTimerCreate'); - late final _CFRunLoopTimerCreate = _CFRunLoopTimerCreatePtr.asFunction< - CFRunLoopTimerRef Function(CFAllocatorRef, double, double, int, int, - CFRunLoopTimerCallBack, ffi.Pointer)>(); + CFIndex Function(CFReadStreamRef, ffi.Pointer, + CFIndex)>>('CFReadStreamRead'); + late final _CFReadStreamRead = _CFReadStreamReadPtr.asFunction< + int Function(CFReadStreamRef, ffi.Pointer, int)>(); - CFRunLoopTimerRef CFRunLoopTimerCreateWithHandler( - CFAllocatorRef allocator, - DartCFTimeInterval fireDate, - DartCFTimeInterval interval, - DartCFOptionFlags flags, - DartCFIndex order, - ObjCBlock_ffiVoid_CFRunLoopTimerRef block, + ffi.Pointer CFReadStreamGetBuffer( + CFReadStreamRef stream, + int maxBytesToRead, + ffi.Pointer numBytesRead, ) { - return _CFRunLoopTimerCreateWithHandler( - allocator, - fireDate, - interval, - flags, - order, - block._id, + return _CFReadStreamGetBuffer( + stream, + maxBytesToRead, + numBytesRead, ); } - late final _CFRunLoopTimerCreateWithHandlerPtr = _lookup< + late final _CFReadStreamGetBufferPtr = _lookup< ffi.NativeFunction< - CFRunLoopTimerRef Function( - CFAllocatorRef, - CFAbsoluteTime, - CFTimeInterval, - CFOptionFlags, - CFIndex, - ffi.Pointer<_ObjCBlock>)>>('CFRunLoopTimerCreateWithHandler'); - late final _CFRunLoopTimerCreateWithHandler = - _CFRunLoopTimerCreateWithHandlerPtr.asFunction< - CFRunLoopTimerRef Function(CFAllocatorRef, double, double, int, int, - ffi.Pointer<_ObjCBlock>)>(); + ffi.Pointer Function(CFReadStreamRef, CFIndex, + ffi.Pointer)>>('CFReadStreamGetBuffer'); + late final _CFReadStreamGetBuffer = _CFReadStreamGetBufferPtr.asFunction< + ffi.Pointer Function( + CFReadStreamRef, int, ffi.Pointer)>(); - double CFRunLoopTimerGetNextFireDate( - CFRunLoopTimerRef timer, + int CFWriteStreamCanAcceptBytes( + CFWriteStreamRef stream, ) { - return _CFRunLoopTimerGetNextFireDate( - timer, + return _CFWriteStreamCanAcceptBytes( + stream, ); } - late final _CFRunLoopTimerGetNextFireDatePtr = - _lookup>( - 'CFRunLoopTimerGetNextFireDate'); - late final _CFRunLoopTimerGetNextFireDate = _CFRunLoopTimerGetNextFireDatePtr - .asFunction(); + late final _CFWriteStreamCanAcceptBytesPtr = + _lookup>( + 'CFWriteStreamCanAcceptBytes'); + late final _CFWriteStreamCanAcceptBytes = _CFWriteStreamCanAcceptBytesPtr + .asFunction(); - void CFRunLoopTimerSetNextFireDate( - CFRunLoopTimerRef timer, - double fireDate, + int CFWriteStreamWrite( + CFWriteStreamRef stream, + ffi.Pointer buffer, + int bufferLength, ) { - return _CFRunLoopTimerSetNextFireDate( - timer, - fireDate, + return _CFWriteStreamWrite( + stream, + buffer, + bufferLength, ); } - late final _CFRunLoopTimerSetNextFireDatePtr = _lookup< + late final _CFWriteStreamWritePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFRunLoopTimerRef, - CFAbsoluteTime)>>('CFRunLoopTimerSetNextFireDate'); - late final _CFRunLoopTimerSetNextFireDate = _CFRunLoopTimerSetNextFireDatePtr - .asFunction(); + CFIndex Function(CFWriteStreamRef, ffi.Pointer, + CFIndex)>>('CFWriteStreamWrite'); + late final _CFWriteStreamWrite = _CFWriteStreamWritePtr.asFunction< + int Function(CFWriteStreamRef, ffi.Pointer, int)>(); - double CFRunLoopTimerGetInterval( - CFRunLoopTimerRef timer, + CFTypeRef CFReadStreamCopyProperty( + CFReadStreamRef stream, + CFStreamPropertyKey propertyName, ) { - return _CFRunLoopTimerGetInterval( - timer, + return _CFReadStreamCopyProperty( + stream, + propertyName, ); } - late final _CFRunLoopTimerGetIntervalPtr = - _lookup>( - 'CFRunLoopTimerGetInterval'); - late final _CFRunLoopTimerGetInterval = _CFRunLoopTimerGetIntervalPtr - .asFunction(); + late final _CFReadStreamCopyPropertyPtr = _lookup< + ffi.NativeFunction< + CFTypeRef Function(CFReadStreamRef, + CFStreamPropertyKey)>>('CFReadStreamCopyProperty'); + late final _CFReadStreamCopyProperty = _CFReadStreamCopyPropertyPtr + .asFunction(); - int CFRunLoopTimerDoesRepeat( - CFRunLoopTimerRef timer, + CFTypeRef CFWriteStreamCopyProperty( + CFWriteStreamRef stream, + CFStreamPropertyKey propertyName, ) { - return _CFRunLoopTimerDoesRepeat( - timer, + return _CFWriteStreamCopyProperty( + stream, + propertyName, ); } - late final _CFRunLoopTimerDoesRepeatPtr = - _lookup>( - 'CFRunLoopTimerDoesRepeat'); - late final _CFRunLoopTimerDoesRepeat = _CFRunLoopTimerDoesRepeatPtr - .asFunction(); + late final _CFWriteStreamCopyPropertyPtr = _lookup< + ffi.NativeFunction< + CFTypeRef Function(CFWriteStreamRef, + CFStreamPropertyKey)>>('CFWriteStreamCopyProperty'); + late final _CFWriteStreamCopyProperty = _CFWriteStreamCopyPropertyPtr + .asFunction(); - int CFRunLoopTimerGetOrder( - CFRunLoopTimerRef timer, + int CFReadStreamSetProperty( + CFReadStreamRef stream, + CFStreamPropertyKey propertyName, + CFTypeRef propertyValue, ) { - return _CFRunLoopTimerGetOrder( - timer, + return _CFReadStreamSetProperty( + stream, + propertyName, + propertyValue, ); } - late final _CFRunLoopTimerGetOrderPtr = - _lookup>( - 'CFRunLoopTimerGetOrder'); - late final _CFRunLoopTimerGetOrder = - _CFRunLoopTimerGetOrderPtr.asFunction(); + late final _CFReadStreamSetPropertyPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFReadStreamRef, CFStreamPropertyKey, + CFTypeRef)>>('CFReadStreamSetProperty'); + late final _CFReadStreamSetProperty = _CFReadStreamSetPropertyPtr.asFunction< + int Function(CFReadStreamRef, CFStreamPropertyKey, CFTypeRef)>(); - void CFRunLoopTimerInvalidate( - CFRunLoopTimerRef timer, + int CFWriteStreamSetProperty( + CFWriteStreamRef stream, + CFStreamPropertyKey propertyName, + CFTypeRef propertyValue, ) { - return _CFRunLoopTimerInvalidate( - timer, + return _CFWriteStreamSetProperty( + stream, + propertyName, + propertyValue, ); } - late final _CFRunLoopTimerInvalidatePtr = - _lookup>( - 'CFRunLoopTimerInvalidate'); - late final _CFRunLoopTimerInvalidate = _CFRunLoopTimerInvalidatePtr - .asFunction(); + late final _CFWriteStreamSetPropertyPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFWriteStreamRef, CFStreamPropertyKey, + CFTypeRef)>>('CFWriteStreamSetProperty'); + late final _CFWriteStreamSetProperty = + _CFWriteStreamSetPropertyPtr.asFunction< + int Function(CFWriteStreamRef, CFStreamPropertyKey, CFTypeRef)>(); - int CFRunLoopTimerIsValid( - CFRunLoopTimerRef timer, + int CFReadStreamSetClient( + CFReadStreamRef stream, + int streamEvents, + CFReadStreamClientCallBack clientCB, + ffi.Pointer clientContext, ) { - return _CFRunLoopTimerIsValid( - timer, + return _CFReadStreamSetClient( + stream, + streamEvents, + clientCB, + clientContext, ); } - late final _CFRunLoopTimerIsValidPtr = - _lookup>( - 'CFRunLoopTimerIsValid'); - late final _CFRunLoopTimerIsValid = - _CFRunLoopTimerIsValidPtr.asFunction(); + late final _CFReadStreamSetClientPtr = _lookup< + ffi.NativeFunction< + Boolean Function( + CFReadStreamRef, + CFOptionFlags, + CFReadStreamClientCallBack, + ffi.Pointer)>>('CFReadStreamSetClient'); + late final _CFReadStreamSetClient = _CFReadStreamSetClientPtr.asFunction< + int Function(CFReadStreamRef, int, CFReadStreamClientCallBack, + ffi.Pointer)>(); - void CFRunLoopTimerGetContext( - CFRunLoopTimerRef timer, - ffi.Pointer context, + int CFWriteStreamSetClient( + CFWriteStreamRef stream, + int streamEvents, + CFWriteStreamClientCallBack clientCB, + ffi.Pointer clientContext, ) { - return _CFRunLoopTimerGetContext( - timer, - context, + return _CFWriteStreamSetClient( + stream, + streamEvents, + clientCB, + clientContext, ); } - late final _CFRunLoopTimerGetContextPtr = _lookup< + late final _CFWriteStreamSetClientPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFRunLoopTimerRef, - ffi.Pointer)>>('CFRunLoopTimerGetContext'); - late final _CFRunLoopTimerGetContext = - _CFRunLoopTimerGetContextPtr.asFunction< - void Function( - CFRunLoopTimerRef, ffi.Pointer)>(); + Boolean Function( + CFWriteStreamRef, + CFOptionFlags, + CFWriteStreamClientCallBack, + ffi.Pointer)>>('CFWriteStreamSetClient'); + late final _CFWriteStreamSetClient = _CFWriteStreamSetClientPtr.asFunction< + int Function(CFWriteStreamRef, int, CFWriteStreamClientCallBack, + ffi.Pointer)>(); - double CFRunLoopTimerGetTolerance( - CFRunLoopTimerRef timer, + void CFReadStreamScheduleWithRunLoop( + CFReadStreamRef stream, + CFRunLoopRef runLoop, + CFRunLoopMode runLoopMode, ) { - return _CFRunLoopTimerGetTolerance( - timer, + return _CFReadStreamScheduleWithRunLoop( + stream, + runLoop, + runLoopMode, ); } - late final _CFRunLoopTimerGetTolerancePtr = - _lookup>( - 'CFRunLoopTimerGetTolerance'); - late final _CFRunLoopTimerGetTolerance = _CFRunLoopTimerGetTolerancePtr - .asFunction(); + late final _CFReadStreamScheduleWithRunLoopPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFReadStreamRef, CFRunLoopRef, + CFRunLoopMode)>>('CFReadStreamScheduleWithRunLoop'); + late final _CFReadStreamScheduleWithRunLoop = + _CFReadStreamScheduleWithRunLoopPtr.asFunction< + void Function(CFReadStreamRef, CFRunLoopRef, CFRunLoopMode)>(); - void CFRunLoopTimerSetTolerance( - CFRunLoopTimerRef timer, - double tolerance, + void CFWriteStreamScheduleWithRunLoop( + CFWriteStreamRef stream, + CFRunLoopRef runLoop, + CFRunLoopMode runLoopMode, ) { - return _CFRunLoopTimerSetTolerance( - timer, - tolerance, + return _CFWriteStreamScheduleWithRunLoop( + stream, + runLoop, + runLoopMode, ); } - late final _CFRunLoopTimerSetTolerancePtr = _lookup< + late final _CFWriteStreamScheduleWithRunLoopPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFRunLoopTimerRef, - CFTimeInterval)>>('CFRunLoopTimerSetTolerance'); - late final _CFRunLoopTimerSetTolerance = _CFRunLoopTimerSetTolerancePtr - .asFunction(); - - int CFSocketGetTypeID() { - return _CFSocketGetTypeID(); - } - - late final _CFSocketGetTypeIDPtr = - _lookup>('CFSocketGetTypeID'); - late final _CFSocketGetTypeID = - _CFSocketGetTypeIDPtr.asFunction(); + ffi.Void Function(CFWriteStreamRef, CFRunLoopRef, + CFRunLoopMode)>>('CFWriteStreamScheduleWithRunLoop'); + late final _CFWriteStreamScheduleWithRunLoop = + _CFWriteStreamScheduleWithRunLoopPtr.asFunction< + void Function(CFWriteStreamRef, CFRunLoopRef, CFRunLoopMode)>(); - CFSocketRef CFSocketCreate( - CFAllocatorRef allocator, - int protocolFamily, - int socketType, - int protocol, - int callBackTypes, - CFSocketCallBack callout, - ffi.Pointer context, + void CFReadStreamUnscheduleFromRunLoop( + CFReadStreamRef stream, + CFRunLoopRef runLoop, + CFRunLoopMode runLoopMode, ) { - return _CFSocketCreate( - allocator, - protocolFamily, - socketType, - protocol, - callBackTypes, - callout, - context, + return _CFReadStreamUnscheduleFromRunLoop( + stream, + runLoop, + runLoopMode, ); } - late final _CFSocketCreatePtr = _lookup< + late final _CFReadStreamUnscheduleFromRunLoopPtr = _lookup< ffi.NativeFunction< - CFSocketRef Function( - CFAllocatorRef, - SInt32, - SInt32, - SInt32, - CFOptionFlags, - CFSocketCallBack, - ffi.Pointer)>>('CFSocketCreate'); - late final _CFSocketCreate = _CFSocketCreatePtr.asFunction< - CFSocketRef Function(CFAllocatorRef, int, int, int, int, CFSocketCallBack, - ffi.Pointer)>(); + ffi.Void Function(CFReadStreamRef, CFRunLoopRef, + CFRunLoopMode)>>('CFReadStreamUnscheduleFromRunLoop'); + late final _CFReadStreamUnscheduleFromRunLoop = + _CFReadStreamUnscheduleFromRunLoopPtr.asFunction< + void Function(CFReadStreamRef, CFRunLoopRef, CFRunLoopMode)>(); - CFSocketRef CFSocketCreateWithNative( - CFAllocatorRef allocator, - int sock, - int callBackTypes, - CFSocketCallBack callout, - ffi.Pointer context, + void CFWriteStreamUnscheduleFromRunLoop( + CFWriteStreamRef stream, + CFRunLoopRef runLoop, + CFRunLoopMode runLoopMode, ) { - return _CFSocketCreateWithNative( - allocator, - sock, - callBackTypes, - callout, - context, + return _CFWriteStreamUnscheduleFromRunLoop( + stream, + runLoop, + runLoopMode, ); } - late final _CFSocketCreateWithNativePtr = _lookup< + late final _CFWriteStreamUnscheduleFromRunLoopPtr = _lookup< ffi.NativeFunction< - CFSocketRef Function( - CFAllocatorRef, - CFSocketNativeHandle, - CFOptionFlags, - CFSocketCallBack, - ffi.Pointer)>>('CFSocketCreateWithNative'); - late final _CFSocketCreateWithNative = - _CFSocketCreateWithNativePtr.asFunction< - CFSocketRef Function(CFAllocatorRef, int, int, CFSocketCallBack, - ffi.Pointer)>(); + ffi.Void Function(CFWriteStreamRef, CFRunLoopRef, + CFRunLoopMode)>>('CFWriteStreamUnscheduleFromRunLoop'); + late final _CFWriteStreamUnscheduleFromRunLoop = + _CFWriteStreamUnscheduleFromRunLoopPtr.asFunction< + void Function(CFWriteStreamRef, CFRunLoopRef, CFRunLoopMode)>(); - CFSocketRef CFSocketCreateWithSocketSignature( - CFAllocatorRef allocator, - ffi.Pointer signature, - int callBackTypes, - CFSocketCallBack callout, - ffi.Pointer context, + void CFReadStreamSetDispatchQueue( + CFReadStreamRef stream, + Dartdispatch_queue_t q, ) { - return _CFSocketCreateWithSocketSignature( - allocator, - signature, - callBackTypes, - callout, - context, + return _CFReadStreamSetDispatchQueue( + stream, + q.ref.pointer, ); } - late final _CFSocketCreateWithSocketSignaturePtr = _lookup< - ffi.NativeFunction< - CFSocketRef Function( - CFAllocatorRef, - ffi.Pointer, - CFOptionFlags, - CFSocketCallBack, - ffi.Pointer)>>( - 'CFSocketCreateWithSocketSignature'); - late final _CFSocketCreateWithSocketSignature = - _CFSocketCreateWithSocketSignaturePtr.asFunction< - CFSocketRef Function(CFAllocatorRef, ffi.Pointer, - int, CFSocketCallBack, ffi.Pointer)>(); + late final _CFReadStreamSetDispatchQueuePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFReadStreamRef, + dispatch_queue_t)>>('CFReadStreamSetDispatchQueue'); + late final _CFReadStreamSetDispatchQueue = _CFReadStreamSetDispatchQueuePtr + .asFunction(); - CFSocketRef CFSocketCreateConnectedToSocketSignature( - CFAllocatorRef allocator, - ffi.Pointer signature, - int callBackTypes, - CFSocketCallBack callout, - ffi.Pointer context, - double timeout, + void CFWriteStreamSetDispatchQueue( + CFWriteStreamRef stream, + Dartdispatch_queue_t q, ) { - return _CFSocketCreateConnectedToSocketSignature( - allocator, - signature, - callBackTypes, - callout, - context, - timeout, + return _CFWriteStreamSetDispatchQueue( + stream, + q.ref.pointer, ); } - late final _CFSocketCreateConnectedToSocketSignaturePtr = _lookup< + late final _CFWriteStreamSetDispatchQueuePtr = _lookup< ffi.NativeFunction< - CFSocketRef Function( - CFAllocatorRef, - ffi.Pointer, - CFOptionFlags, - CFSocketCallBack, - ffi.Pointer, - CFTimeInterval)>>('CFSocketCreateConnectedToSocketSignature'); - late final _CFSocketCreateConnectedToSocketSignature = - _CFSocketCreateConnectedToSocketSignaturePtr.asFunction< - CFSocketRef Function(CFAllocatorRef, ffi.Pointer, - int, CFSocketCallBack, ffi.Pointer, double)>(); + ffi.Void Function(CFWriteStreamRef, + dispatch_queue_t)>>('CFWriteStreamSetDispatchQueue'); + late final _CFWriteStreamSetDispatchQueue = _CFWriteStreamSetDispatchQueuePtr + .asFunction(); - int CFSocketSetAddress( - CFSocketRef s, - CFDataRef address, + Dartdispatch_queue_t CFReadStreamCopyDispatchQueue( + CFReadStreamRef stream, ) { - return _CFSocketSetAddress( - s, - address, - ); + return objc.NSObject.castFromPointer( + _CFReadStreamCopyDispatchQueue( + stream, + ), + retain: true, + release: true); } - late final _CFSocketSetAddressPtr = - _lookup>( - 'CFSocketSetAddress'); - late final _CFSocketSetAddress = - _CFSocketSetAddressPtr.asFunction(); + late final _CFReadStreamCopyDispatchQueuePtr = + _lookup>( + 'CFReadStreamCopyDispatchQueue'); + late final _CFReadStreamCopyDispatchQueue = _CFReadStreamCopyDispatchQueuePtr + .asFunction(); - int CFSocketConnectToAddress( - CFSocketRef s, - CFDataRef address, - double timeout, + Dartdispatch_queue_t CFWriteStreamCopyDispatchQueue( + CFWriteStreamRef stream, ) { - return _CFSocketConnectToAddress( - s, - address, - timeout, - ); + return objc.NSObject.castFromPointer( + _CFWriteStreamCopyDispatchQueue( + stream, + ), + retain: true, + release: true); } - late final _CFSocketConnectToAddressPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(CFSocketRef, CFDataRef, - CFTimeInterval)>>('CFSocketConnectToAddress'); - late final _CFSocketConnectToAddress = _CFSocketConnectToAddressPtr - .asFunction(); + late final _CFWriteStreamCopyDispatchQueuePtr = + _lookup>( + 'CFWriteStreamCopyDispatchQueue'); + late final _CFWriteStreamCopyDispatchQueue = + _CFWriteStreamCopyDispatchQueuePtr.asFunction< + dispatch_queue_t Function(CFWriteStreamRef)>(); - void CFSocketInvalidate( - CFSocketRef s, + CFStreamError CFReadStreamGetError( + CFReadStreamRef stream, ) { - return _CFSocketInvalidate( - s, + return _CFReadStreamGetError( + stream, ); } - late final _CFSocketInvalidatePtr = - _lookup>( - 'CFSocketInvalidate'); - late final _CFSocketInvalidate = - _CFSocketInvalidatePtr.asFunction(); + late final _CFReadStreamGetErrorPtr = + _lookup>( + 'CFReadStreamGetError'); + late final _CFReadStreamGetError = _CFReadStreamGetErrorPtr.asFunction< + CFStreamError Function(CFReadStreamRef)>(); - int CFSocketIsValid( - CFSocketRef s, + CFStreamError CFWriteStreamGetError( + CFWriteStreamRef stream, ) { - return _CFSocketIsValid( - s, + return _CFWriteStreamGetError( + stream, ); } - late final _CFSocketIsValidPtr = - _lookup>( - 'CFSocketIsValid'); - late final _CFSocketIsValid = - _CFSocketIsValidPtr.asFunction(); + late final _CFWriteStreamGetErrorPtr = + _lookup>( + 'CFWriteStreamGetError'); + late final _CFWriteStreamGetError = _CFWriteStreamGetErrorPtr.asFunction< + CFStreamError Function(CFWriteStreamRef)>(); - CFDataRef CFSocketCopyAddress( - CFSocketRef s, + CFPropertyListRef CFPropertyListCreateFromXMLData( + CFAllocatorRef allocator, + CFDataRef xmlData, + int mutabilityOption, + ffi.Pointer errorString, ) { - return _CFSocketCopyAddress( - s, + return _CFPropertyListCreateFromXMLData( + allocator, + xmlData, + mutabilityOption, + errorString, ); } - late final _CFSocketCopyAddressPtr = - _lookup>( - 'CFSocketCopyAddress'); - late final _CFSocketCopyAddress = - _CFSocketCopyAddressPtr.asFunction(); + late final _CFPropertyListCreateFromXMLDataPtr = _lookup< + ffi.NativeFunction< + CFPropertyListRef Function(CFAllocatorRef, CFDataRef, CFOptionFlags, + ffi.Pointer)>>('CFPropertyListCreateFromXMLData'); + late final _CFPropertyListCreateFromXMLData = + _CFPropertyListCreateFromXMLDataPtr.asFunction< + CFPropertyListRef Function( + CFAllocatorRef, CFDataRef, int, ffi.Pointer)>(); - CFDataRef CFSocketCopyPeerAddress( - CFSocketRef s, + CFDataRef CFPropertyListCreateXMLData( + CFAllocatorRef allocator, + CFPropertyListRef propertyList, ) { - return _CFSocketCopyPeerAddress( - s, + return _CFPropertyListCreateXMLData( + allocator, + propertyList, ); } - late final _CFSocketCopyPeerAddressPtr = - _lookup>( - 'CFSocketCopyPeerAddress'); - late final _CFSocketCopyPeerAddress = - _CFSocketCopyPeerAddressPtr.asFunction(); + late final _CFPropertyListCreateXMLDataPtr = _lookup< + ffi.NativeFunction< + CFDataRef Function(CFAllocatorRef, + CFPropertyListRef)>>('CFPropertyListCreateXMLData'); + late final _CFPropertyListCreateXMLData = _CFPropertyListCreateXMLDataPtr + .asFunction(); - void CFSocketGetContext( - CFSocketRef s, - ffi.Pointer context, + CFPropertyListRef CFPropertyListCreateDeepCopy( + CFAllocatorRef allocator, + CFPropertyListRef propertyList, + int mutabilityOption, ) { - return _CFSocketGetContext( - s, - context, + return _CFPropertyListCreateDeepCopy( + allocator, + propertyList, + mutabilityOption, ); } - late final _CFSocketGetContextPtr = _lookup< + late final _CFPropertyListCreateDeepCopyPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFSocketRef, - ffi.Pointer)>>('CFSocketGetContext'); - late final _CFSocketGetContext = _CFSocketGetContextPtr.asFunction< - void Function(CFSocketRef, ffi.Pointer)>(); - - int CFSocketGetNative( - CFSocketRef s, + CFPropertyListRef Function(CFAllocatorRef, CFPropertyListRef, + CFOptionFlags)>>('CFPropertyListCreateDeepCopy'); + late final _CFPropertyListCreateDeepCopy = + _CFPropertyListCreateDeepCopyPtr.asFunction< + CFPropertyListRef Function(CFAllocatorRef, CFPropertyListRef, int)>(); + + DartBoolean CFPropertyListIsValid( + CFPropertyListRef plist, + CFPropertyListFormat format, ) { - return _CFSocketGetNative( - s, + return _CFPropertyListIsValid( + plist, + format.value, ); } - late final _CFSocketGetNativePtr = - _lookup>( - 'CFSocketGetNative'); - late final _CFSocketGetNative = - _CFSocketGetNativePtr.asFunction(); + late final _CFPropertyListIsValidPtr = + _lookup>( + 'CFPropertyListIsValid'); + late final _CFPropertyListIsValid = _CFPropertyListIsValidPtr.asFunction< + int Function(CFPropertyListRef, int)>(); - CFRunLoopSourceRef CFSocketCreateRunLoopSource( - CFAllocatorRef allocator, - CFSocketRef s, - int order, + DartCFIndex CFPropertyListWriteToStream( + CFPropertyListRef propertyList, + CFWriteStreamRef stream, + CFPropertyListFormat format, + ffi.Pointer errorString, ) { - return _CFSocketCreateRunLoopSource( - allocator, - s, - order, + return _CFPropertyListWriteToStream( + propertyList, + stream, + format.value, + errorString, ); } - late final _CFSocketCreateRunLoopSourcePtr = _lookup< + late final _CFPropertyListWriteToStreamPtr = _lookup< ffi.NativeFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFSocketRef, - CFIndex)>>('CFSocketCreateRunLoopSource'); - late final _CFSocketCreateRunLoopSource = - _CFSocketCreateRunLoopSourcePtr.asFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFSocketRef, int)>(); + CFIndex Function(CFPropertyListRef, CFWriteStreamRef, CFIndex, + ffi.Pointer)>>('CFPropertyListWriteToStream'); + late final _CFPropertyListWriteToStream = + _CFPropertyListWriteToStreamPtr.asFunction< + int Function(CFPropertyListRef, CFWriteStreamRef, int, + ffi.Pointer)>(); - int CFSocketGetSocketFlags( - CFSocketRef s, + CFPropertyListRef CFPropertyListCreateFromStream( + CFAllocatorRef allocator, + CFReadStreamRef stream, + int streamLength, + int mutabilityOption, + ffi.Pointer format, + ffi.Pointer errorString, ) { - return _CFSocketGetSocketFlags( - s, + return _CFPropertyListCreateFromStream( + allocator, + stream, + streamLength, + mutabilityOption, + format, + errorString, ); } - late final _CFSocketGetSocketFlagsPtr = - _lookup>( - 'CFSocketGetSocketFlags'); - late final _CFSocketGetSocketFlags = - _CFSocketGetSocketFlagsPtr.asFunction(); + late final _CFPropertyListCreateFromStreamPtr = _lookup< + ffi.NativeFunction< + CFPropertyListRef Function( + CFAllocatorRef, + CFReadStreamRef, + CFIndex, + CFOptionFlags, + ffi.Pointer, + ffi.Pointer)>>('CFPropertyListCreateFromStream'); + late final _CFPropertyListCreateFromStream = + _CFPropertyListCreateFromStreamPtr.asFunction< + CFPropertyListRef Function(CFAllocatorRef, CFReadStreamRef, int, int, + ffi.Pointer, ffi.Pointer)>(); - void CFSocketSetSocketFlags( - CFSocketRef s, - int flags, + CFPropertyListRef CFPropertyListCreateWithData( + CFAllocatorRef allocator, + CFDataRef data, + int options, + ffi.Pointer format, + ffi.Pointer error, ) { - return _CFSocketSetSocketFlags( - s, - flags, + return _CFPropertyListCreateWithData( + allocator, + data, + options, + format, + error, ); } - late final _CFSocketSetSocketFlagsPtr = _lookup< - ffi.NativeFunction>( - 'CFSocketSetSocketFlags'); - late final _CFSocketSetSocketFlags = - _CFSocketSetSocketFlagsPtr.asFunction(); + late final _CFPropertyListCreateWithDataPtr = _lookup< + ffi.NativeFunction< + CFPropertyListRef Function( + CFAllocatorRef, + CFDataRef, + CFOptionFlags, + ffi.Pointer, + ffi.Pointer)>>('CFPropertyListCreateWithData'); + late final _CFPropertyListCreateWithData = + _CFPropertyListCreateWithDataPtr.asFunction< + CFPropertyListRef Function(CFAllocatorRef, CFDataRef, int, + ffi.Pointer, ffi.Pointer)>(); - void CFSocketDisableCallBacks( - CFSocketRef s, - int callBackTypes, + CFPropertyListRef CFPropertyListCreateWithStream( + CFAllocatorRef allocator, + CFReadStreamRef stream, + int streamLength, + int options, + ffi.Pointer format, + ffi.Pointer error, ) { - return _CFSocketDisableCallBacks( - s, - callBackTypes, + return _CFPropertyListCreateWithStream( + allocator, + stream, + streamLength, + options, + format, + error, ); } - late final _CFSocketDisableCallBacksPtr = _lookup< - ffi.NativeFunction>( - 'CFSocketDisableCallBacks'); - late final _CFSocketDisableCallBacks = _CFSocketDisableCallBacksPtr - .asFunction(); + late final _CFPropertyListCreateWithStreamPtr = _lookup< + ffi.NativeFunction< + CFPropertyListRef Function( + CFAllocatorRef, + CFReadStreamRef, + CFIndex, + CFOptionFlags, + ffi.Pointer, + ffi.Pointer)>>('CFPropertyListCreateWithStream'); + late final _CFPropertyListCreateWithStream = + _CFPropertyListCreateWithStreamPtr.asFunction< + CFPropertyListRef Function(CFAllocatorRef, CFReadStreamRef, int, int, + ffi.Pointer, ffi.Pointer)>(); - void CFSocketEnableCallBacks( - CFSocketRef s, - int callBackTypes, + DartCFIndex CFPropertyListWrite( + CFPropertyListRef propertyList, + CFWriteStreamRef stream, + CFPropertyListFormat format, + DartCFOptionFlags options, + ffi.Pointer error, ) { - return _CFSocketEnableCallBacks( - s, - callBackTypes, + return _CFPropertyListWrite( + propertyList, + stream, + format.value, + options, + error, ); } - late final _CFSocketEnableCallBacksPtr = _lookup< - ffi.NativeFunction>( - 'CFSocketEnableCallBacks'); - late final _CFSocketEnableCallBacks = - _CFSocketEnableCallBacksPtr.asFunction(); + late final _CFPropertyListWritePtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFPropertyListRef, CFWriteStreamRef, CFIndex, + CFOptionFlags, ffi.Pointer)>>('CFPropertyListWrite'); + late final _CFPropertyListWrite = _CFPropertyListWritePtr.asFunction< + int Function(CFPropertyListRef, CFWriteStreamRef, int, int, + ffi.Pointer)>(); - int CFSocketSendData( - CFSocketRef s, - CFDataRef address, - CFDataRef data, - double timeout, + CFDataRef CFPropertyListCreateData( + CFAllocatorRef allocator, + CFPropertyListRef propertyList, + CFPropertyListFormat format, + DartCFOptionFlags options, + ffi.Pointer error, ) { - return _CFSocketSendData( - s, - address, - data, - timeout, + return _CFPropertyListCreateData( + allocator, + propertyList, + format.value, + options, + error, ); } - late final _CFSocketSendDataPtr = _lookup< + late final _CFPropertyListCreateDataPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(CFSocketRef, CFDataRef, CFDataRef, - CFTimeInterval)>>('CFSocketSendData'); - late final _CFSocketSendData = _CFSocketSendDataPtr.asFunction< - int Function(CFSocketRef, CFDataRef, CFDataRef, double)>(); + CFDataRef Function( + CFAllocatorRef, + CFPropertyListRef, + CFIndex, + CFOptionFlags, + ffi.Pointer)>>('CFPropertyListCreateData'); + late final _CFPropertyListCreateData = + _CFPropertyListCreateDataPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFPropertyListRef, int, int, + ffi.Pointer)>(); - int CFSocketRegisterValue( - ffi.Pointer nameServerSignature, - double timeout, - CFStringRef name, - CFPropertyListRef value, - ) { - return _CFSocketRegisterValue( - nameServerSignature, - timeout, - name, - value, - ); + late final ffi.Pointer _kCFTypeSetCallBacks = + _lookup('kCFTypeSetCallBacks'); + + CFSetCallBacks get kCFTypeSetCallBacks => _kCFTypeSetCallBacks.ref; + + late final ffi.Pointer _kCFCopyStringSetCallBacks = + _lookup('kCFCopyStringSetCallBacks'); + + CFSetCallBacks get kCFCopyStringSetCallBacks => + _kCFCopyStringSetCallBacks.ref; + + int CFSetGetTypeID() { + return _CFSetGetTypeID(); } - late final _CFSocketRegisterValuePtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, CFTimeInterval, - CFStringRef, CFPropertyListRef)>>('CFSocketRegisterValue'); - late final _CFSocketRegisterValue = _CFSocketRegisterValuePtr.asFunction< - int Function(ffi.Pointer, double, CFStringRef, - CFPropertyListRef)>(); + late final _CFSetGetTypeIDPtr = + _lookup>('CFSetGetTypeID'); + late final _CFSetGetTypeID = _CFSetGetTypeIDPtr.asFunction(); - int CFSocketCopyRegisteredValue( - ffi.Pointer nameServerSignature, - double timeout, - CFStringRef name, - ffi.Pointer value, - ffi.Pointer nameServerAddress, + CFSetRef CFSetCreate( + CFAllocatorRef allocator, + ffi.Pointer> values, + int numValues, + ffi.Pointer callBacks, ) { - return _CFSocketCopyRegisteredValue( - nameServerSignature, - timeout, - name, - value, - nameServerAddress, + return _CFSetCreate( + allocator, + values, + numValues, + callBacks, ); } - late final _CFSocketCopyRegisteredValuePtr = _lookup< + late final _CFSetCreatePtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - CFTimeInterval, - CFStringRef, - ffi.Pointer, - ffi.Pointer)>>('CFSocketCopyRegisteredValue'); - late final _CFSocketCopyRegisteredValue = - _CFSocketCopyRegisteredValuePtr.asFunction< - int Function(ffi.Pointer, double, CFStringRef, - ffi.Pointer, ffi.Pointer)>(); + CFSetRef Function(CFAllocatorRef, ffi.Pointer>, + CFIndex, ffi.Pointer)>>('CFSetCreate'); + late final _CFSetCreate = _CFSetCreatePtr.asFunction< + CFSetRef Function(CFAllocatorRef, ffi.Pointer>, int, + ffi.Pointer)>(); - int CFSocketRegisterSocketSignature( - ffi.Pointer nameServerSignature, - double timeout, - CFStringRef name, - ffi.Pointer signature, + CFSetRef CFSetCreateCopy( + CFAllocatorRef allocator, + CFSetRef theSet, ) { - return _CFSocketRegisterSocketSignature( - nameServerSignature, - timeout, - name, - signature, + return _CFSetCreateCopy( + allocator, + theSet, ); } - late final _CFSocketRegisterSocketSignaturePtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, CFTimeInterval, - CFStringRef, ffi.Pointer)>>( - 'CFSocketRegisterSocketSignature'); - late final _CFSocketRegisterSocketSignature = - _CFSocketRegisterSocketSignaturePtr.asFunction< - int Function(ffi.Pointer, double, CFStringRef, - ffi.Pointer)>(); + late final _CFSetCreateCopyPtr = + _lookup>( + 'CFSetCreateCopy'); + late final _CFSetCreateCopy = _CFSetCreateCopyPtr.asFunction< + CFSetRef Function(CFAllocatorRef, CFSetRef)>(); - int CFSocketCopyRegisteredSocketSignature( - ffi.Pointer nameServerSignature, - double timeout, - CFStringRef name, - ffi.Pointer signature, - ffi.Pointer nameServerAddress, + CFMutableSetRef CFSetCreateMutable( + CFAllocatorRef allocator, + int capacity, + ffi.Pointer callBacks, ) { - return _CFSocketCopyRegisteredSocketSignature( - nameServerSignature, - timeout, - name, - signature, - nameServerAddress, + return _CFSetCreateMutable( + allocator, + capacity, + callBacks, ); } - late final _CFSocketCopyRegisteredSocketSignaturePtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, - CFTimeInterval, - CFStringRef, - ffi.Pointer, - ffi.Pointer)>>( - 'CFSocketCopyRegisteredSocketSignature'); - late final _CFSocketCopyRegisteredSocketSignature = - _CFSocketCopyRegisteredSocketSignaturePtr.asFunction< - int Function(ffi.Pointer, double, CFStringRef, - ffi.Pointer, ffi.Pointer)>(); + late final _CFSetCreateMutablePtr = _lookup< + ffi.NativeFunction< + CFMutableSetRef Function(CFAllocatorRef, CFIndex, + ffi.Pointer)>>('CFSetCreateMutable'); + late final _CFSetCreateMutable = _CFSetCreateMutablePtr.asFunction< + CFMutableSetRef Function( + CFAllocatorRef, int, ffi.Pointer)>(); - int CFSocketUnregister( - ffi.Pointer nameServerSignature, - double timeout, - CFStringRef name, + CFMutableSetRef CFSetCreateMutableCopy( + CFAllocatorRef allocator, + int capacity, + CFSetRef theSet, ) { - return _CFSocketUnregister( - nameServerSignature, - timeout, - name, + return _CFSetCreateMutableCopy( + allocator, + capacity, + theSet, ); } - late final _CFSocketUnregisterPtr = _lookup< + late final _CFSetCreateMutableCopyPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer, CFTimeInterval, - CFStringRef)>>('CFSocketUnregister'); - late final _CFSocketUnregister = _CFSocketUnregisterPtr.asFunction< - int Function(ffi.Pointer, double, CFStringRef)>(); + CFMutableSetRef Function( + CFAllocatorRef, CFIndex, CFSetRef)>>('CFSetCreateMutableCopy'); + late final _CFSetCreateMutableCopy = _CFSetCreateMutableCopyPtr.asFunction< + CFMutableSetRef Function(CFAllocatorRef, int, CFSetRef)>(); - void CFSocketSetDefaultNameRegistryPortNumber( - int port, + int CFSetGetCount( + CFSetRef theSet, ) { - return _CFSocketSetDefaultNameRegistryPortNumber( - port, + return _CFSetGetCount( + theSet, ); } - late final _CFSocketSetDefaultNameRegistryPortNumberPtr = - _lookup>( - 'CFSocketSetDefaultNameRegistryPortNumber'); - late final _CFSocketSetDefaultNameRegistryPortNumber = - _CFSocketSetDefaultNameRegistryPortNumberPtr.asFunction< - void Function(int)>(); + late final _CFSetGetCountPtr = + _lookup>('CFSetGetCount'); + late final _CFSetGetCount = + _CFSetGetCountPtr.asFunction(); - int CFSocketGetDefaultNameRegistryPortNumber() { - return _CFSocketGetDefaultNameRegistryPortNumber(); + int CFSetGetCountOfValue( + CFSetRef theSet, + ffi.Pointer value, + ) { + return _CFSetGetCountOfValue( + theSet, + value, + ); } - late final _CFSocketGetDefaultNameRegistryPortNumberPtr = - _lookup>( - 'CFSocketGetDefaultNameRegistryPortNumber'); - late final _CFSocketGetDefaultNameRegistryPortNumber = - _CFSocketGetDefaultNameRegistryPortNumberPtr.asFunction(); - - late final ffi.Pointer _kCFSocketCommandKey = - _lookup('kCFSocketCommandKey'); - - CFStringRef get kCFSocketCommandKey => _kCFSocketCommandKey.value; - - late final ffi.Pointer _kCFSocketNameKey = - _lookup('kCFSocketNameKey'); - - CFStringRef get kCFSocketNameKey => _kCFSocketNameKey.value; - - late final ffi.Pointer _kCFSocketValueKey = - _lookup('kCFSocketValueKey'); - - CFStringRef get kCFSocketValueKey => _kCFSocketValueKey.value; - - late final ffi.Pointer _kCFSocketResultKey = - _lookup('kCFSocketResultKey'); - - CFStringRef get kCFSocketResultKey => _kCFSocketResultKey.value; - - late final ffi.Pointer _kCFSocketErrorKey = - _lookup('kCFSocketErrorKey'); - - CFStringRef get kCFSocketErrorKey => _kCFSocketErrorKey.value; + late final _CFSetGetCountOfValuePtr = _lookup< + ffi + .NativeFunction)>>( + 'CFSetGetCountOfValue'); + late final _CFSetGetCountOfValue = _CFSetGetCountOfValuePtr.asFunction< + int Function(CFSetRef, ffi.Pointer)>(); - late final ffi.Pointer _kCFSocketRegisterCommand = - _lookup('kCFSocketRegisterCommand'); + int CFSetContainsValue( + CFSetRef theSet, + ffi.Pointer value, + ) { + return _CFSetContainsValue( + theSet, + value, + ); + } - CFStringRef get kCFSocketRegisterCommand => _kCFSocketRegisterCommand.value; + late final _CFSetContainsValuePtr = _lookup< + ffi + .NativeFunction)>>( + 'CFSetContainsValue'); + late final _CFSetContainsValue = _CFSetContainsValuePtr.asFunction< + int Function(CFSetRef, ffi.Pointer)>(); - late final ffi.Pointer _kCFSocketRetrieveCommand = - _lookup('kCFSocketRetrieveCommand'); + ffi.Pointer CFSetGetValue( + CFSetRef theSet, + ffi.Pointer value, + ) { + return _CFSetGetValue( + theSet, + value, + ); + } - CFStringRef get kCFSocketRetrieveCommand => _kCFSocketRetrieveCommand.value; + late final _CFSetGetValuePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + CFSetRef, ffi.Pointer)>>('CFSetGetValue'); + late final _CFSetGetValue = _CFSetGetValuePtr.asFunction< + ffi.Pointer Function(CFSetRef, ffi.Pointer)>(); - int getattrlistbulk( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, + int CFSetGetValueIfPresent( + CFSetRef theSet, + ffi.Pointer candidate, + ffi.Pointer> value, ) { - return _getattrlistbulk( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFSetGetValueIfPresent( + theSet, + candidate, + value, ); } - late final _getattrlistbulkPtr = _lookup< + late final _CFSetGetValueIfPresentPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, - ffi.Pointer, ffi.Size, ffi.Uint64)>>('getattrlistbulk'); - late final _getattrlistbulk = _getattrlistbulkPtr.asFunction< - int Function( - int, ffi.Pointer, ffi.Pointer, int, int)>(); + Boolean Function(CFSetRef, ffi.Pointer, + ffi.Pointer>)>>('CFSetGetValueIfPresent'); + late final _CFSetGetValueIfPresent = _CFSetGetValueIfPresentPtr.asFunction< + int Function(CFSetRef, ffi.Pointer, + ffi.Pointer>)>(); - int getattrlistat( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - int arg4, - int arg5, + void CFSetGetValues( + CFSetRef theSet, + ffi.Pointer> values, ) { - return _getattrlistat( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, + return _CFSetGetValues( + theSet, + values, ); } - late final _getattrlistatPtr = _lookup< + late final _CFSetGetValuesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.UnsignedLong)>>('getattrlistat'); - late final _getattrlistat = _getattrlistatPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + ffi.Void Function( + CFSetRef, ffi.Pointer>)>>('CFSetGetValues'); + late final _CFSetGetValues = _CFSetGetValuesPtr.asFunction< + void Function(CFSetRef, ffi.Pointer>)>(); - int setattrlistat( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - int arg4, - int arg5, + void CFSetApplyFunction( + CFSetRef theSet, + CFSetApplierFunction applier, + ffi.Pointer context, ) { - return _setattrlistat( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, + return _CFSetApplyFunction( + theSet, + applier, + context, ); } - late final _setattrlistatPtr = _lookup< + late final _CFSetApplyFunctionPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Uint32)>>('setattrlistat'); - late final _setattrlistat = _setattrlistatPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + ffi.Void Function(CFSetRef, CFSetApplierFunction, + ffi.Pointer)>>('CFSetApplyFunction'); + late final _CFSetApplyFunction = _CFSetApplyFunctionPtr.asFunction< + void Function(CFSetRef, CFSetApplierFunction, ffi.Pointer)>(); - int freadlink( - int arg0, - ffi.Pointer arg1, - int arg2, + void CFSetAddValue( + CFMutableSetRef theSet, + ffi.Pointer value, ) { - return _freadlink( - arg0, - arg1, - arg2, + return _CFSetAddValue( + theSet, + value, ); } - late final _freadlinkPtr = _lookup< + late final _CFSetAddValuePtr = _lookup< ffi.NativeFunction< - ssize_t Function( - ffi.Int, ffi.Pointer, ffi.Size)>>('freadlink'); - late final _freadlink = - _freadlinkPtr.asFunction, int)>(); + ffi.Void Function( + CFMutableSetRef, ffi.Pointer)>>('CFSetAddValue'); + late final _CFSetAddValue = _CFSetAddValuePtr.asFunction< + void Function(CFMutableSetRef, ffi.Pointer)>(); - int faccessat( - int arg0, - ffi.Pointer arg1, - int arg2, - int arg3, + void CFSetReplaceValue( + CFMutableSetRef theSet, + ffi.Pointer value, ) { - return _faccessat( - arg0, - arg1, - arg2, - arg3, + return _CFSetReplaceValue( + theSet, + value, ); } - late final _faccessatPtr = _lookup< + late final _CFSetReplaceValuePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Int, ffi.Int)>>('faccessat'); - late final _faccessat = _faccessatPtr - .asFunction, int, int)>(); + ffi.Void Function( + CFMutableSetRef, ffi.Pointer)>>('CFSetReplaceValue'); + late final _CFSetReplaceValue = _CFSetReplaceValuePtr.asFunction< + void Function(CFMutableSetRef, ffi.Pointer)>(); - int fchownat( - int arg0, - ffi.Pointer arg1, - int arg2, - int arg3, - int arg4, + void CFSetSetValue( + CFMutableSetRef theSet, + ffi.Pointer value, ) { - return _fchownat( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFSetSetValue( + theSet, + value, ); } - late final _fchownatPtr = _lookup< + late final _CFSetSetValuePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, uid_t, gid_t, - ffi.Int)>>('fchownat'); - late final _fchownat = _fchownatPtr - .asFunction, int, int, int)>(); + ffi.Void Function( + CFMutableSetRef, ffi.Pointer)>>('CFSetSetValue'); + late final _CFSetSetValue = _CFSetSetValuePtr.asFunction< + void Function(CFMutableSetRef, ffi.Pointer)>(); - int linkat( - int arg0, - ffi.Pointer arg1, - int arg2, - ffi.Pointer arg3, - int arg4, + void CFSetRemoveValue( + CFMutableSetRef theSet, + ffi.Pointer value, ) { - return _linkat( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFSetRemoveValue( + theSet, + value, ); } - late final _linkatPtr = _lookup< + late final _CFSetRemoveValuePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, - ffi.Pointer, ffi.Int)>>('linkat'); - late final _linkat = _linkatPtr.asFunction< - int Function( - int, ffi.Pointer, int, ffi.Pointer, int)>(); + ffi.Void Function( + CFMutableSetRef, ffi.Pointer)>>('CFSetRemoveValue'); + late final _CFSetRemoveValue = _CFSetRemoveValuePtr.asFunction< + void Function(CFMutableSetRef, ffi.Pointer)>(); - int readlinkat( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, + void CFSetRemoveAllValues( + CFMutableSetRef theSet, ) { - return _readlinkat( - arg0, - arg1, - arg2, - arg3, + return _CFSetRemoveAllValues( + theSet, ); } - late final _readlinkatPtr = _lookup< - ffi.NativeFunction< - ssize_t Function(ffi.Int, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('readlinkat'); - late final _readlinkat = _readlinkatPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer, int)>(); + late final _CFSetRemoveAllValuesPtr = + _lookup>( + 'CFSetRemoveAllValues'); + late final _CFSetRemoveAllValues = + _CFSetRemoveAllValuesPtr.asFunction(); - int symlinkat( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ) { - return _symlinkat( - arg0, - arg1, - arg2, - ); + int CFTreeGetTypeID() { + return _CFTreeGetTypeID(); } - late final _symlinkatPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, - ffi.Pointer)>>('symlinkat'); - late final _symlinkat = _symlinkatPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer)>(); + late final _CFTreeGetTypeIDPtr = + _lookup>('CFTreeGetTypeID'); + late final _CFTreeGetTypeID = + _CFTreeGetTypeIDPtr.asFunction(); - int unlinkat( - int arg0, - ffi.Pointer arg1, - int arg2, + CFTreeRef CFTreeCreate( + CFAllocatorRef allocator, + ffi.Pointer context, ) { - return _unlinkat( - arg0, - arg1, - arg2, + return _CFTreeCreate( + allocator, + context, ); } - late final _unlinkatPtr = _lookup< + late final _CFTreeCreatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Int)>>('unlinkat'); - late final _unlinkat = - _unlinkatPtr.asFunction, int)>(); - - void _exit( - int arg0, - ) { - return __exit( - arg0, - ); - } - - late final __exitPtr = - _lookup>('_exit'); - late final __exit = __exitPtr.asFunction(); + CFTreeRef Function( + CFAllocatorRef, ffi.Pointer)>>('CFTreeCreate'); + late final _CFTreeCreate = _CFTreeCreatePtr.asFunction< + CFTreeRef Function(CFAllocatorRef, ffi.Pointer)>(); - int access( - ffi.Pointer arg0, - int arg1, + CFTreeRef CFTreeGetParent( + CFTreeRef tree, ) { - return _access( - arg0, - arg1, + return _CFTreeGetParent( + tree, ); } - late final _accessPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'access'); - late final _access = - _accessPtr.asFunction, int)>(); + late final _CFTreeGetParentPtr = + _lookup>( + 'CFTreeGetParent'); + late final _CFTreeGetParent = + _CFTreeGetParentPtr.asFunction(); - int alarm( - int arg0, + CFTreeRef CFTreeGetNextSibling( + CFTreeRef tree, ) { - return _alarm( - arg0, + return _CFTreeGetNextSibling( + tree, ); } - late final _alarmPtr = - _lookup>( - 'alarm'); - late final _alarm = _alarmPtr.asFunction(); + late final _CFTreeGetNextSiblingPtr = + _lookup>( + 'CFTreeGetNextSibling'); + late final _CFTreeGetNextSibling = + _CFTreeGetNextSiblingPtr.asFunction(); - int chdir( - ffi.Pointer arg0, + CFTreeRef CFTreeGetFirstChild( + CFTreeRef tree, ) { - return _chdir( - arg0, + return _CFTreeGetFirstChild( + tree, ); } - late final _chdirPtr = - _lookup)>>( - 'chdir'); - late final _chdir = - _chdirPtr.asFunction)>(); + late final _CFTreeGetFirstChildPtr = + _lookup>( + 'CFTreeGetFirstChild'); + late final _CFTreeGetFirstChild = + _CFTreeGetFirstChildPtr.asFunction(); - int chown( - ffi.Pointer arg0, - int arg1, - int arg2, + void CFTreeGetContext( + CFTreeRef tree, + ffi.Pointer context, ) { - return _chown( - arg0, - arg1, - arg2, + return _CFTreeGetContext( + tree, + context, ); } - late final _chownPtr = _lookup< + late final _CFTreeGetContextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, uid_t, gid_t)>>('chown'); - late final _chown = - _chownPtr.asFunction, int, int)>(); + ffi.Void Function( + CFTreeRef, ffi.Pointer)>>('CFTreeGetContext'); + late final _CFTreeGetContext = _CFTreeGetContextPtr.asFunction< + void Function(CFTreeRef, ffi.Pointer)>(); - int close( - int arg0, + int CFTreeGetChildCount( + CFTreeRef tree, ) { - return _close( - arg0, + return _CFTreeGetChildCount( + tree, ); } - late final _closePtr = - _lookup>('close'); - late final _close = _closePtr.asFunction(); + late final _CFTreeGetChildCountPtr = + _lookup>( + 'CFTreeGetChildCount'); + late final _CFTreeGetChildCount = + _CFTreeGetChildCountPtr.asFunction(); - int dup( - int arg0, + CFTreeRef CFTreeGetChildAtIndex( + CFTreeRef tree, + int idx, ) { - return _dup( - arg0, + return _CFTreeGetChildAtIndex( + tree, + idx, ); } - late final _dupPtr = - _lookup>('dup'); - late final _dup = _dupPtr.asFunction(); + late final _CFTreeGetChildAtIndexPtr = + _lookup>( + 'CFTreeGetChildAtIndex'); + late final _CFTreeGetChildAtIndex = _CFTreeGetChildAtIndexPtr.asFunction< + CFTreeRef Function(CFTreeRef, int)>(); - int dup2( - int arg0, - int arg1, + void CFTreeGetChildren( + CFTreeRef tree, + ffi.Pointer children, ) { - return _dup2( - arg0, - arg1, + return _CFTreeGetChildren( + tree, + children, ); } - late final _dup2Ptr = - _lookup>('dup2'); - late final _dup2 = _dup2Ptr.asFunction(); + late final _CFTreeGetChildrenPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFTreeRef, ffi.Pointer)>>('CFTreeGetChildren'); + late final _CFTreeGetChildren = _CFTreeGetChildrenPtr.asFunction< + void Function(CFTreeRef, ffi.Pointer)>(); - int execl( - ffi.Pointer __path, - ffi.Pointer __arg0, + void CFTreeApplyFunctionToChildren( + CFTreeRef tree, + CFTreeApplierFunction applier, + ffi.Pointer context, ) { - return _execl( - __path, - __arg0, + return _CFTreeApplyFunctionToChildren( + tree, + applier, + context, ); } - late final _execlPtr = _lookup< + late final _CFTreeApplyFunctionToChildrenPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('execl'); - late final _execl = _execlPtr - .asFunction, ffi.Pointer)>(); + ffi.Void Function(CFTreeRef, CFTreeApplierFunction, + ffi.Pointer)>>('CFTreeApplyFunctionToChildren'); + late final _CFTreeApplyFunctionToChildren = + _CFTreeApplyFunctionToChildrenPtr.asFunction< + void Function( + CFTreeRef, CFTreeApplierFunction, ffi.Pointer)>(); - int execle( - ffi.Pointer __path, - ffi.Pointer __arg0, + CFTreeRef CFTreeFindRoot( + CFTreeRef tree, ) { - return _execle( - __path, - __arg0, + return _CFTreeFindRoot( + tree, ); } - late final _execlePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('execle'); - late final _execle = _execlePtr - .asFunction, ffi.Pointer)>(); + late final _CFTreeFindRootPtr = + _lookup>( + 'CFTreeFindRoot'); + late final _CFTreeFindRoot = + _CFTreeFindRootPtr.asFunction(); - int execlp( - ffi.Pointer __file, - ffi.Pointer __arg0, + void CFTreeSetContext( + CFTreeRef tree, + ffi.Pointer context, ) { - return _execlp( - __file, - __arg0, + return _CFTreeSetContext( + tree, + context, ); } - late final _execlpPtr = _lookup< + late final _CFTreeSetContextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('execlp'); - late final _execlp = _execlpPtr - .asFunction, ffi.Pointer)>(); + ffi.Void Function( + CFTreeRef, ffi.Pointer)>>('CFTreeSetContext'); + late final _CFTreeSetContext = _CFTreeSetContextPtr.asFunction< + void Function(CFTreeRef, ffi.Pointer)>(); - int execv( - ffi.Pointer __path, - ffi.Pointer> __argv, + void CFTreePrependChild( + CFTreeRef tree, + CFTreeRef newChild, ) { - return _execv( - __path, - __argv, + return _CFTreePrependChild( + tree, + newChild, ); } - late final _execvPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer>)>>('execv'); - late final _execv = _execvPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>)>(); + late final _CFTreePrependChildPtr = + _lookup>( + 'CFTreePrependChild'); + late final _CFTreePrependChild = + _CFTreePrependChildPtr.asFunction(); - int execve( - ffi.Pointer __file, - ffi.Pointer> __argv, - ffi.Pointer> __envp, + void CFTreeAppendChild( + CFTreeRef tree, + CFTreeRef newChild, ) { - return _execve( - __file, - __argv, - __envp, + return _CFTreeAppendChild( + tree, + newChild, ); } - late final _execvePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer>)>>('execve'); - late final _execve = _execvePtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - ffi.Pointer>)>(); + late final _CFTreeAppendChildPtr = + _lookup>( + 'CFTreeAppendChild'); + late final _CFTreeAppendChild = + _CFTreeAppendChildPtr.asFunction(); - int execvp( - ffi.Pointer __file, - ffi.Pointer> __argv, + void CFTreeInsertSibling( + CFTreeRef tree, + CFTreeRef newSibling, ) { - return _execvp( - __file, - __argv, + return _CFTreeInsertSibling( + tree, + newSibling, ); } - late final _execvpPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer>)>>('execvp'); - late final _execvp = _execvpPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>)>(); + late final _CFTreeInsertSiblingPtr = + _lookup>( + 'CFTreeInsertSibling'); + late final _CFTreeInsertSibling = + _CFTreeInsertSiblingPtr.asFunction(); - int fork() { - return _fork(); + void CFTreeRemove( + CFTreeRef tree, + ) { + return _CFTreeRemove( + tree, + ); } - late final _forkPtr = _lookup>('fork'); - late final _fork = _forkPtr.asFunction(); + late final _CFTreeRemovePtr = + _lookup>('CFTreeRemove'); + late final _CFTreeRemove = + _CFTreeRemovePtr.asFunction(); - int fpathconf( - int arg0, - int arg1, + void CFTreeRemoveAllChildren( + CFTreeRef tree, ) { - return _fpathconf( - arg0, - arg1, + return _CFTreeRemoveAllChildren( + tree, ); } - late final _fpathconfPtr = - _lookup>( - 'fpathconf'); - late final _fpathconf = _fpathconfPtr.asFunction(); + late final _CFTreeRemoveAllChildrenPtr = + _lookup>( + 'CFTreeRemoveAllChildren'); + late final _CFTreeRemoveAllChildren = + _CFTreeRemoveAllChildrenPtr.asFunction(); - ffi.Pointer getcwd( - ffi.Pointer arg0, - int arg1, + void CFTreeSortChildren( + CFTreeRef tree, + CFComparatorFunction comparator, + ffi.Pointer context, ) { - return _getcwd( - arg0, - arg1, + return _CFTreeSortChildren( + tree, + comparator, + context, ); } - late final _getcwdPtr = _lookup< + late final _CFTreeSortChildrenPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('getcwd'); - late final _getcwd = _getcwdPtr - .asFunction Function(ffi.Pointer, int)>(); + ffi.Void Function(CFTreeRef, CFComparatorFunction, + ffi.Pointer)>>('CFTreeSortChildren'); + late final _CFTreeSortChildren = _CFTreeSortChildrenPtr.asFunction< + void Function(CFTreeRef, CFComparatorFunction, ffi.Pointer)>(); - int getegid() { - return _getegid(); + int CFURLCreateDataAndPropertiesFromResource( + CFAllocatorRef alloc, + CFURLRef url, + ffi.Pointer resourceData, + ffi.Pointer properties, + CFArrayRef desiredProperties, + ffi.Pointer errorCode, + ) { + return _CFURLCreateDataAndPropertiesFromResource( + alloc, + url, + resourceData, + properties, + desiredProperties, + errorCode, + ); } - late final _getegidPtr = - _lookup>('getegid'); - late final _getegid = _getegidPtr.asFunction(); + late final _CFURLCreateDataAndPropertiesFromResourcePtr = _lookup< + ffi.NativeFunction< + Boolean Function( + CFAllocatorRef, + CFURLRef, + ffi.Pointer, + ffi.Pointer, + CFArrayRef, + ffi.Pointer)>>( + 'CFURLCreateDataAndPropertiesFromResource'); + late final _CFURLCreateDataAndPropertiesFromResource = + _CFURLCreateDataAndPropertiesFromResourcePtr.asFunction< + int Function(CFAllocatorRef, CFURLRef, ffi.Pointer, + ffi.Pointer, CFArrayRef, ffi.Pointer)>(); - int geteuid() { - return _geteuid(); + int CFURLWriteDataAndPropertiesToResource( + CFURLRef url, + CFDataRef dataToWrite, + CFDictionaryRef propertiesToWrite, + ffi.Pointer errorCode, + ) { + return _CFURLWriteDataAndPropertiesToResource( + url, + dataToWrite, + propertiesToWrite, + errorCode, + ); } - late final _geteuidPtr = - _lookup>('geteuid'); - late final _geteuid = _geteuidPtr.asFunction(); + late final _CFURLWriteDataAndPropertiesToResourcePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFURLRef, CFDataRef, CFDictionaryRef, + ffi.Pointer)>>('CFURLWriteDataAndPropertiesToResource'); + late final _CFURLWriteDataAndPropertiesToResource = + _CFURLWriteDataAndPropertiesToResourcePtr.asFunction< + int Function( + CFURLRef, CFDataRef, CFDictionaryRef, ffi.Pointer)>(); - int getgid() { - return _getgid(); + int CFURLDestroyResource( + CFURLRef url, + ffi.Pointer errorCode, + ) { + return _CFURLDestroyResource( + url, + errorCode, + ); } - late final _getgidPtr = - _lookup>('getgid'); - late final _getgid = _getgidPtr.asFunction(); + late final _CFURLDestroyResourcePtr = _lookup< + ffi.NativeFunction)>>( + 'CFURLDestroyResource'); + late final _CFURLDestroyResource = _CFURLDestroyResourcePtr.asFunction< + int Function(CFURLRef, ffi.Pointer)>(); - int getgroups( - int arg0, - ffi.Pointer arg1, + CFTypeRef CFURLCreatePropertyFromResource( + CFAllocatorRef alloc, + CFURLRef url, + CFStringRef property, + ffi.Pointer errorCode, ) { - return _getgroups( - arg0, - arg1, + return _CFURLCreatePropertyFromResource( + alloc, + url, + property, + errorCode, ); } - late final _getgroupsPtr = _lookup< - ffi.NativeFunction)>>( - 'getgroups'); - late final _getgroups = - _getgroupsPtr.asFunction)>(); + late final _CFURLCreatePropertyFromResourcePtr = _lookup< + ffi.NativeFunction< + CFTypeRef Function(CFAllocatorRef, CFURLRef, CFStringRef, + ffi.Pointer)>>('CFURLCreatePropertyFromResource'); + late final _CFURLCreatePropertyFromResource = + _CFURLCreatePropertyFromResourcePtr.asFunction< + CFTypeRef Function( + CFAllocatorRef, CFURLRef, CFStringRef, ffi.Pointer)>(); - ffi.Pointer getlogin() { - return _getlogin(); - } + late final ffi.Pointer _kCFURLFileExists = + _lookup('kCFURLFileExists'); - late final _getloginPtr = - _lookup Function()>>('getlogin'); - late final _getlogin = - _getloginPtr.asFunction Function()>(); + CFStringRef get kCFURLFileExists => _kCFURLFileExists.value; - int getpgrp() { - return _getpgrp(); - } + late final ffi.Pointer _kCFURLFileDirectoryContents = + _lookup('kCFURLFileDirectoryContents'); - late final _getpgrpPtr = - _lookup>('getpgrp'); - late final _getpgrp = _getpgrpPtr.asFunction(); + CFStringRef get kCFURLFileDirectoryContents => + _kCFURLFileDirectoryContents.value; - int getpid() { - return _getpid(); - } + late final ffi.Pointer _kCFURLFileLength = + _lookup('kCFURLFileLength'); - late final _getpidPtr = - _lookup>('getpid'); - late final _getpid = _getpidPtr.asFunction(); + CFStringRef get kCFURLFileLength => _kCFURLFileLength.value; - int getppid() { - return _getppid(); - } + late final ffi.Pointer _kCFURLFileLastModificationTime = + _lookup('kCFURLFileLastModificationTime'); - late final _getppidPtr = - _lookup>('getppid'); - late final _getppid = _getppidPtr.asFunction(); + CFStringRef get kCFURLFileLastModificationTime => + _kCFURLFileLastModificationTime.value; - int getuid() { - return _getuid(); - } + late final ffi.Pointer _kCFURLFilePOSIXMode = + _lookup('kCFURLFilePOSIXMode'); - late final _getuidPtr = - _lookup>('getuid'); - late final _getuid = _getuidPtr.asFunction(); + CFStringRef get kCFURLFilePOSIXMode => _kCFURLFilePOSIXMode.value; - int isatty( - int arg0, - ) { - return _isatty( - arg0, - ); - } + late final ffi.Pointer _kCFURLFileOwnerID = + _lookup('kCFURLFileOwnerID'); - late final _isattyPtr = - _lookup>('isatty'); - late final _isatty = _isattyPtr.asFunction(); + CFStringRef get kCFURLFileOwnerID => _kCFURLFileOwnerID.value; - int link( - ffi.Pointer arg0, - ffi.Pointer arg1, - ) { - return _link( - arg0, - arg1, - ); + late final ffi.Pointer _kCFURLHTTPStatusCode = + _lookup('kCFURLHTTPStatusCode'); + + CFStringRef get kCFURLHTTPStatusCode => _kCFURLHTTPStatusCode.value; + + late final ffi.Pointer _kCFURLHTTPStatusLine = + _lookup('kCFURLHTTPStatusLine'); + + CFStringRef get kCFURLHTTPStatusLine => _kCFURLHTTPStatusLine.value; + + int CFUUIDGetTypeID() { + return _CFUUIDGetTypeID(); } - late final _linkPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('link'); - late final _link = _linkPtr - .asFunction, ffi.Pointer)>(); + late final _CFUUIDGetTypeIDPtr = + _lookup>('CFUUIDGetTypeID'); + late final _CFUUIDGetTypeID = + _CFUUIDGetTypeIDPtr.asFunction(); - int lseek( - int arg0, - int arg1, - int arg2, + CFUUIDRef CFUUIDCreate( + CFAllocatorRef alloc, ) { - return _lseek( - arg0, - arg1, - arg2, + return _CFUUIDCreate( + alloc, ); } - late final _lseekPtr = - _lookup>( - 'lseek'); - late final _lseek = _lseekPtr.asFunction(); + late final _CFUUIDCreatePtr = + _lookup>( + 'CFUUIDCreate'); + late final _CFUUIDCreate = + _CFUUIDCreatePtr.asFunction(); - int pathconf( - ffi.Pointer arg0, - int arg1, + CFUUIDRef CFUUIDCreateWithBytes( + CFAllocatorRef alloc, + int byte0, + int byte1, + int byte2, + int byte3, + int byte4, + int byte5, + int byte6, + int byte7, + int byte8, + int byte9, + int byte10, + int byte11, + int byte12, + int byte13, + int byte14, + int byte15, ) { - return _pathconf( - arg0, - arg1, + return _CFUUIDCreateWithBytes( + alloc, + byte0, + byte1, + byte2, + byte3, + byte4, + byte5, + byte6, + byte7, + byte8, + byte9, + byte10, + byte11, + byte12, + byte13, + byte14, + byte15, ); } - late final _pathconfPtr = _lookup< + late final _CFUUIDCreateWithBytesPtr = _lookup< ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, ffi.Int)>>('pathconf'); - late final _pathconf = - _pathconfPtr.asFunction, int)>(); + CFUUIDRef Function( + CFAllocatorRef, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8)>>('CFUUIDCreateWithBytes'); + late final _CFUUIDCreateWithBytes = _CFUUIDCreateWithBytesPtr.asFunction< + CFUUIDRef Function(CFAllocatorRef, int, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int)>(); - int pause() { - return _pause(); + CFUUIDRef CFUUIDCreateFromString( + CFAllocatorRef alloc, + CFStringRef uuidStr, + ) { + return _CFUUIDCreateFromString( + alloc, + uuidStr, + ); } - late final _pausePtr = - _lookup>('pause'); - late final _pause = _pausePtr.asFunction(); + late final _CFUUIDCreateFromStringPtr = _lookup< + ffi.NativeFunction>( + 'CFUUIDCreateFromString'); + late final _CFUUIDCreateFromString = _CFUUIDCreateFromStringPtr.asFunction< + CFUUIDRef Function(CFAllocatorRef, CFStringRef)>(); - int pipe( - ffi.Pointer arg0, + CFStringRef CFUUIDCreateString( + CFAllocatorRef alloc, + CFUUIDRef uuid, ) { - return _pipe( - arg0, + return _CFUUIDCreateString( + alloc, + uuid, ); } - late final _pipePtr = - _lookup)>>( - 'pipe'); - late final _pipe = _pipePtr.asFunction)>(); + late final _CFUUIDCreateStringPtr = _lookup< + ffi.NativeFunction>( + 'CFUUIDCreateString'); + late final _CFUUIDCreateString = _CFUUIDCreateStringPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFUUIDRef)>(); - int read( - int arg0, - ffi.Pointer arg1, - int arg2, + CFUUIDRef CFUUIDGetConstantUUIDWithBytes( + CFAllocatorRef alloc, + int byte0, + int byte1, + int byte2, + int byte3, + int byte4, + int byte5, + int byte6, + int byte7, + int byte8, + int byte9, + int byte10, + int byte11, + int byte12, + int byte13, + int byte14, + int byte15, ) { - return _read( - arg0, - arg1, - arg2, + return _CFUUIDGetConstantUUIDWithBytes( + alloc, + byte0, + byte1, + byte2, + byte3, + byte4, + byte5, + byte6, + byte7, + byte8, + byte9, + byte10, + byte11, + byte12, + byte13, + byte14, + byte15, ); } - late final _readPtr = _lookup< + late final _CFUUIDGetConstantUUIDWithBytesPtr = _lookup< ffi.NativeFunction< - ssize_t Function(ffi.Int, ffi.Pointer, ffi.Size)>>('read'); - late final _read = - _readPtr.asFunction, int)>(); + CFUUIDRef Function( + CFAllocatorRef, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8, + UInt8)>>('CFUUIDGetConstantUUIDWithBytes'); + late final _CFUUIDGetConstantUUIDWithBytes = + _CFUUIDGetConstantUUIDWithBytesPtr.asFunction< + CFUUIDRef Function(CFAllocatorRef, int, int, int, int, int, int, int, + int, int, int, int, int, int, int, int, int)>(); - int rmdir( - ffi.Pointer arg0, + CFUUIDBytes CFUUIDGetUUIDBytes( + CFUUIDRef uuid, ) { - return _rmdir( - arg0, + return _CFUUIDGetUUIDBytes( + uuid, ); } - late final _rmdirPtr = - _lookup)>>( - 'rmdir'); - late final _rmdir = - _rmdirPtr.asFunction)>(); + late final _CFUUIDGetUUIDBytesPtr = + _lookup>( + 'CFUUIDGetUUIDBytes'); + late final _CFUUIDGetUUIDBytes = + _CFUUIDGetUUIDBytesPtr.asFunction(); - int setgid( - int arg0, + CFUUIDRef CFUUIDCreateFromUUIDBytes( + CFAllocatorRef alloc, + CFUUIDBytes bytes, ) { - return _setgid( - arg0, + return _CFUUIDCreateFromUUIDBytes( + alloc, + bytes, ); } - late final _setgidPtr = - _lookup>('setgid'); - late final _setgid = _setgidPtr.asFunction(); + late final _CFUUIDCreateFromUUIDBytesPtr = _lookup< + ffi.NativeFunction>( + 'CFUUIDCreateFromUUIDBytes'); + late final _CFUUIDCreateFromUUIDBytes = _CFUUIDCreateFromUUIDBytesPtr + .asFunction(); - int setpgid( - int arg0, - int arg1, - ) { - return _setpgid( - arg0, - arg1, - ); + CFURLRef CFCopyHomeDirectoryURL() { + return _CFCopyHomeDirectoryURL(); } - late final _setpgidPtr = - _lookup>('setpgid'); - late final _setpgid = _setpgidPtr.asFunction(); - - int setsid() { - return _setsid(); - } + late final _CFCopyHomeDirectoryURLPtr = + _lookup>( + 'CFCopyHomeDirectoryURL'); + late final _CFCopyHomeDirectoryURL = + _CFCopyHomeDirectoryURLPtr.asFunction(); - late final _setsidPtr = - _lookup>('setsid'); - late final _setsid = _setsidPtr.asFunction(); + late final ffi.Pointer _kCFBundleInfoDictionaryVersionKey = + _lookup('kCFBundleInfoDictionaryVersionKey'); - int setuid( - int arg0, - ) { - return _setuid( - arg0, - ); - } + CFStringRef get kCFBundleInfoDictionaryVersionKey => + _kCFBundleInfoDictionaryVersionKey.value; - late final _setuidPtr = - _lookup>('setuid'); - late final _setuid = _setuidPtr.asFunction(); + late final ffi.Pointer _kCFBundleExecutableKey = + _lookup('kCFBundleExecutableKey'); - int sleep( - int arg0, - ) { - return _sleep( - arg0, - ); + CFStringRef get kCFBundleExecutableKey => _kCFBundleExecutableKey.value; + + late final ffi.Pointer _kCFBundleIdentifierKey = + _lookup('kCFBundleIdentifierKey'); + + CFStringRef get kCFBundleIdentifierKey => _kCFBundleIdentifierKey.value; + + late final ffi.Pointer _kCFBundleVersionKey = + _lookup('kCFBundleVersionKey'); + + CFStringRef get kCFBundleVersionKey => _kCFBundleVersionKey.value; + + late final ffi.Pointer _kCFBundleDevelopmentRegionKey = + _lookup('kCFBundleDevelopmentRegionKey'); + + CFStringRef get kCFBundleDevelopmentRegionKey => + _kCFBundleDevelopmentRegionKey.value; + + late final ffi.Pointer _kCFBundleNameKey = + _lookup('kCFBundleNameKey'); + + CFStringRef get kCFBundleNameKey => _kCFBundleNameKey.value; + + late final ffi.Pointer _kCFBundleLocalizationsKey = + _lookup('kCFBundleLocalizationsKey'); + + CFStringRef get kCFBundleLocalizationsKey => _kCFBundleLocalizationsKey.value; + + CFBundleRef CFBundleGetMainBundle() { + return _CFBundleGetMainBundle(); } - late final _sleepPtr = - _lookup>( - 'sleep'); - late final _sleep = _sleepPtr.asFunction(); + late final _CFBundleGetMainBundlePtr = + _lookup>( + 'CFBundleGetMainBundle'); + late final _CFBundleGetMainBundle = + _CFBundleGetMainBundlePtr.asFunction(); - int sysconf( - int arg0, + CFBundleRef CFBundleGetBundleWithIdentifier( + CFStringRef bundleID, ) { - return _sysconf( - arg0, + return _CFBundleGetBundleWithIdentifier( + bundleID, ); } - late final _sysconfPtr = - _lookup>('sysconf'); - late final _sysconf = _sysconfPtr.asFunction(); + late final _CFBundleGetBundleWithIdentifierPtr = + _lookup>( + 'CFBundleGetBundleWithIdentifier'); + late final _CFBundleGetBundleWithIdentifier = + _CFBundleGetBundleWithIdentifierPtr.asFunction< + CFBundleRef Function(CFStringRef)>(); - int tcgetpgrp( - int arg0, - ) { - return _tcgetpgrp( - arg0, - ); + CFArrayRef CFBundleGetAllBundles() { + return _CFBundleGetAllBundles(); } - late final _tcgetpgrpPtr = - _lookup>('tcgetpgrp'); - late final _tcgetpgrp = _tcgetpgrpPtr.asFunction(); + late final _CFBundleGetAllBundlesPtr = + _lookup>( + 'CFBundleGetAllBundles'); + late final _CFBundleGetAllBundles = + _CFBundleGetAllBundlesPtr.asFunction(); - int tcsetpgrp( - int arg0, - int arg1, - ) { - return _tcsetpgrp( - arg0, - arg1, - ); + int CFBundleGetTypeID() { + return _CFBundleGetTypeID(); } - late final _tcsetpgrpPtr = - _lookup>( - 'tcsetpgrp'); - late final _tcsetpgrp = _tcsetpgrpPtr.asFunction(); + late final _CFBundleGetTypeIDPtr = + _lookup>('CFBundleGetTypeID'); + late final _CFBundleGetTypeID = + _CFBundleGetTypeIDPtr.asFunction(); - ffi.Pointer ttyname( - int arg0, + CFBundleRef CFBundleCreate( + CFAllocatorRef allocator, + CFURLRef bundleURL, ) { - return _ttyname( - arg0, + return _CFBundleCreate( + allocator, + bundleURL, ); } - late final _ttynamePtr = - _lookup Function(ffi.Int)>>( - 'ttyname'); - late final _ttyname = - _ttynamePtr.asFunction Function(int)>(); + late final _CFBundleCreatePtr = _lookup< + ffi.NativeFunction>( + 'CFBundleCreate'); + late final _CFBundleCreate = _CFBundleCreatePtr.asFunction< + CFBundleRef Function(CFAllocatorRef, CFURLRef)>(); - int ttyname_r( - int arg0, - ffi.Pointer arg1, - int arg2, + CFArrayRef CFBundleCreateBundlesFromDirectory( + CFAllocatorRef allocator, + CFURLRef directoryURL, + CFStringRef bundleType, ) { - return _ttyname_r( - arg0, - arg1, - arg2, + return _CFBundleCreateBundlesFromDirectory( + allocator, + directoryURL, + bundleType, ); } - late final _ttyname_rPtr = _lookup< + late final _CFBundleCreateBundlesFromDirectoryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Size)>>('ttyname_r'); - late final _ttyname_r = - _ttyname_rPtr.asFunction, int)>(); + CFArrayRef Function(CFAllocatorRef, CFURLRef, + CFStringRef)>>('CFBundleCreateBundlesFromDirectory'); + late final _CFBundleCreateBundlesFromDirectory = + _CFBundleCreateBundlesFromDirectoryPtr.asFunction< + CFArrayRef Function(CFAllocatorRef, CFURLRef, CFStringRef)>(); - int unlink( - ffi.Pointer arg0, + CFURLRef CFBundleCopyBundleURL( + CFBundleRef bundle, ) { - return _unlink( - arg0, + return _CFBundleCopyBundleURL( + bundle, ); } - late final _unlinkPtr = - _lookup)>>( - 'unlink'); - late final _unlink = - _unlinkPtr.asFunction)>(); + late final _CFBundleCopyBundleURLPtr = + _lookup>( + 'CFBundleCopyBundleURL'); + late final _CFBundleCopyBundleURL = + _CFBundleCopyBundleURLPtr.asFunction(); - int write( - int __fd, - ffi.Pointer __buf, - int __nbyte, + CFTypeRef CFBundleGetValueForInfoDictionaryKey( + CFBundleRef bundle, + CFStringRef key, ) { - return _write( - __fd, - __buf, - __nbyte, + return _CFBundleGetValueForInfoDictionaryKey( + bundle, + key, ); } - late final _writePtr = _lookup< - ffi.NativeFunction< - ssize_t Function(ffi.Int, ffi.Pointer, ffi.Size)>>('write'); - late final _write = - _writePtr.asFunction, int)>(); + late final _CFBundleGetValueForInfoDictionaryKeyPtr = + _lookup>( + 'CFBundleGetValueForInfoDictionaryKey'); + late final _CFBundleGetValueForInfoDictionaryKey = + _CFBundleGetValueForInfoDictionaryKeyPtr.asFunction< + CFTypeRef Function(CFBundleRef, CFStringRef)>(); - int confstr( - int arg0, - ffi.Pointer arg1, - int arg2, + CFDictionaryRef CFBundleGetInfoDictionary( + CFBundleRef bundle, ) { - return _confstr( - arg0, - arg1, - arg2, + return _CFBundleGetInfoDictionary( + bundle, ); } - late final _confstrPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function( - ffi.Int, ffi.Pointer, ffi.Size)>>('confstr'); - late final _confstr = - _confstrPtr.asFunction, int)>(); + late final _CFBundleGetInfoDictionaryPtr = + _lookup>( + 'CFBundleGetInfoDictionary'); + late final _CFBundleGetInfoDictionary = _CFBundleGetInfoDictionaryPtr + .asFunction(); - int getopt( - int arg0, - ffi.Pointer> arg1, - ffi.Pointer arg2, + CFDictionaryRef CFBundleGetLocalInfoDictionary( + CFBundleRef bundle, ) { - return _getopt( - arg0, - arg1, - arg2, + return _CFBundleGetLocalInfoDictionary( + bundle, ); } - late final _getoptPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer>, - ffi.Pointer)>>('getopt'); - late final _getopt = _getoptPtr.asFunction< - int Function( - int, ffi.Pointer>, ffi.Pointer)>(); - - late final ffi.Pointer> _optarg = - _lookup>('optarg'); - - ffi.Pointer get optarg => _optarg.value; - - set optarg(ffi.Pointer value) => _optarg.value = value; - - late final ffi.Pointer _optind = _lookup('optind'); - - int get optind => _optind.value; - - set optind(int value) => _optind.value = value; - - late final ffi.Pointer _opterr = _lookup('opterr'); - - int get opterr => _opterr.value; - - set opterr(int value) => _opterr.value = value; - - late final ffi.Pointer _optopt = _lookup('optopt'); - - int get optopt => _optopt.value; - - set optopt(int value) => _optopt.value = value; + late final _CFBundleGetLocalInfoDictionaryPtr = + _lookup>( + 'CFBundleGetLocalInfoDictionary'); + late final _CFBundleGetLocalInfoDictionary = + _CFBundleGetLocalInfoDictionaryPtr.asFunction< + CFDictionaryRef Function(CFBundleRef)>(); - ffi.Pointer brk( - ffi.Pointer arg0, + void CFBundleGetPackageInfo( + CFBundleRef bundle, + ffi.Pointer packageType, + ffi.Pointer packageCreator, ) { - return _brk( - arg0, + return _CFBundleGetPackageInfo( + bundle, + packageType, + packageCreator, ); } - late final _brkPtr = _lookup< + late final _CFBundleGetPackageInfoPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('brk'); - late final _brk = _brkPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Void Function(CFBundleRef, ffi.Pointer, + ffi.Pointer)>>('CFBundleGetPackageInfo'); + late final _CFBundleGetPackageInfo = _CFBundleGetPackageInfoPtr.asFunction< + void Function(CFBundleRef, ffi.Pointer, ffi.Pointer)>(); - int chroot( - ffi.Pointer arg0, + CFStringRef CFBundleGetIdentifier( + CFBundleRef bundle, ) { - return _chroot( - arg0, + return _CFBundleGetIdentifier( + bundle, ); } - late final _chrootPtr = - _lookup)>>( - 'chroot'); - late final _chroot = - _chrootPtr.asFunction)>(); + late final _CFBundleGetIdentifierPtr = + _lookup>( + 'CFBundleGetIdentifier'); + late final _CFBundleGetIdentifier = + _CFBundleGetIdentifierPtr.asFunction(); - ffi.Pointer crypt( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFBundleGetVersionNumber( + CFBundleRef bundle, ) { - return _crypt( - arg0, - arg1, + return _CFBundleGetVersionNumber( + bundle, ); } - late final _cryptPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('crypt'); - late final _crypt = _cryptPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); + late final _CFBundleGetVersionNumberPtr = + _lookup>( + 'CFBundleGetVersionNumber'); + late final _CFBundleGetVersionNumber = + _CFBundleGetVersionNumberPtr.asFunction(); - void encrypt( - ffi.Pointer arg0, - int arg1, + CFStringRef CFBundleGetDevelopmentRegion( + CFBundleRef bundle, ) { - return _encrypt( - arg0, - arg1, + return _CFBundleGetDevelopmentRegion( + bundle, ); } - late final _encryptPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int)>>('encrypt'); - late final _encrypt = - _encryptPtr.asFunction, int)>(); + late final _CFBundleGetDevelopmentRegionPtr = + _lookup>( + 'CFBundleGetDevelopmentRegion'); + late final _CFBundleGetDevelopmentRegion = _CFBundleGetDevelopmentRegionPtr + .asFunction(); - int fchdir( - int arg0, + CFURLRef CFBundleCopySupportFilesDirectoryURL( + CFBundleRef bundle, ) { - return _fchdir( - arg0, + return _CFBundleCopySupportFilesDirectoryURL( + bundle, ); } - late final _fchdirPtr = - _lookup>('fchdir'); - late final _fchdir = _fchdirPtr.asFunction(); - - int gethostid() { - return _gethostid(); - } - - late final _gethostidPtr = - _lookup>('gethostid'); - late final _gethostid = _gethostidPtr.asFunction(); + late final _CFBundleCopySupportFilesDirectoryURLPtr = + _lookup>( + 'CFBundleCopySupportFilesDirectoryURL'); + late final _CFBundleCopySupportFilesDirectoryURL = + _CFBundleCopySupportFilesDirectoryURLPtr.asFunction< + CFURLRef Function(CFBundleRef)>(); - int getpgid( - int arg0, + CFURLRef CFBundleCopyResourcesDirectoryURL( + CFBundleRef bundle, ) { - return _getpgid( - arg0, + return _CFBundleCopyResourcesDirectoryURL( + bundle, ); } - late final _getpgidPtr = - _lookup>('getpgid'); - late final _getpgid = _getpgidPtr.asFunction(); + late final _CFBundleCopyResourcesDirectoryURLPtr = + _lookup>( + 'CFBundleCopyResourcesDirectoryURL'); + late final _CFBundleCopyResourcesDirectoryURL = + _CFBundleCopyResourcesDirectoryURLPtr.asFunction< + CFURLRef Function(CFBundleRef)>(); - int getsid( - int arg0, + CFURLRef CFBundleCopyPrivateFrameworksURL( + CFBundleRef bundle, ) { - return _getsid( - arg0, + return _CFBundleCopyPrivateFrameworksURL( + bundle, ); } - late final _getsidPtr = - _lookup>('getsid'); - late final _getsid = _getsidPtr.asFunction(); + late final _CFBundleCopyPrivateFrameworksURLPtr = + _lookup>( + 'CFBundleCopyPrivateFrameworksURL'); + late final _CFBundleCopyPrivateFrameworksURL = + _CFBundleCopyPrivateFrameworksURLPtr.asFunction< + CFURLRef Function(CFBundleRef)>(); - int getdtablesize() { - return _getdtablesize(); + CFURLRef CFBundleCopySharedFrameworksURL( + CFBundleRef bundle, + ) { + return _CFBundleCopySharedFrameworksURL( + bundle, + ); } - late final _getdtablesizePtr = - _lookup>('getdtablesize'); - late final _getdtablesize = _getdtablesizePtr.asFunction(); + late final _CFBundleCopySharedFrameworksURLPtr = + _lookup>( + 'CFBundleCopySharedFrameworksURL'); + late final _CFBundleCopySharedFrameworksURL = + _CFBundleCopySharedFrameworksURLPtr.asFunction< + CFURLRef Function(CFBundleRef)>(); - int getpagesize() { - return _getpagesize(); + CFURLRef CFBundleCopySharedSupportURL( + CFBundleRef bundle, + ) { + return _CFBundleCopySharedSupportURL( + bundle, + ); } - late final _getpagesizePtr = - _lookup>('getpagesize'); - late final _getpagesize = _getpagesizePtr.asFunction(); + late final _CFBundleCopySharedSupportURLPtr = + _lookup>( + 'CFBundleCopySharedSupportURL'); + late final _CFBundleCopySharedSupportURL = _CFBundleCopySharedSupportURLPtr + .asFunction(); - ffi.Pointer getpass( - ffi.Pointer arg0, + CFURLRef CFBundleCopyBuiltInPlugInsURL( + CFBundleRef bundle, ) { - return _getpass( - arg0, + return _CFBundleCopyBuiltInPlugInsURL( + bundle, ); } - late final _getpassPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('getpass'); - late final _getpass = _getpassPtr - .asFunction Function(ffi.Pointer)>(); + late final _CFBundleCopyBuiltInPlugInsURLPtr = + _lookup>( + 'CFBundleCopyBuiltInPlugInsURL'); + late final _CFBundleCopyBuiltInPlugInsURL = _CFBundleCopyBuiltInPlugInsURLPtr + .asFunction(); - ffi.Pointer getwd( - ffi.Pointer arg0, + CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory( + CFURLRef bundleURL, ) { - return _getwd( - arg0, + return _CFBundleCopyInfoDictionaryInDirectory( + bundleURL, ); } - late final _getwdPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('getwd'); - late final _getwd = _getwdPtr - .asFunction Function(ffi.Pointer)>(); + late final _CFBundleCopyInfoDictionaryInDirectoryPtr = + _lookup>( + 'CFBundleCopyInfoDictionaryInDirectory'); + late final _CFBundleCopyInfoDictionaryInDirectory = + _CFBundleCopyInfoDictionaryInDirectoryPtr.asFunction< + CFDictionaryRef Function(CFURLRef)>(); - int lchown( - ffi.Pointer arg0, - int arg1, - int arg2, + int CFBundleGetPackageInfoInDirectory( + CFURLRef url, + ffi.Pointer packageType, + ffi.Pointer packageCreator, ) { - return _lchown( - arg0, - arg1, - arg2, + return _CFBundleGetPackageInfoInDirectory( + url, + packageType, + packageCreator, ); } - late final _lchownPtr = _lookup< + late final _CFBundleGetPackageInfoInDirectoryPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, uid_t, gid_t)>>('lchown'); - late final _lchown = - _lchownPtr.asFunction, int, int)>(); + Boolean Function(CFURLRef, ffi.Pointer, + ffi.Pointer)>>('CFBundleGetPackageInfoInDirectory'); + late final _CFBundleGetPackageInfoInDirectory = + _CFBundleGetPackageInfoInDirectoryPtr.asFunction< + int Function(CFURLRef, ffi.Pointer, ffi.Pointer)>(); - int lockf( - int arg0, - int arg1, - int arg2, + CFURLRef CFBundleCopyResourceURL( + CFBundleRef bundle, + CFStringRef resourceName, + CFStringRef resourceType, + CFStringRef subDirName, ) { - return _lockf( - arg0, - arg1, - arg2, + return _CFBundleCopyResourceURL( + bundle, + resourceName, + resourceType, + subDirName, ); } - late final _lockfPtr = - _lookup>( - 'lockf'); - late final _lockf = _lockfPtr.asFunction(); + late final _CFBundleCopyResourceURLPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, + CFStringRef)>>('CFBundleCopyResourceURL'); + late final _CFBundleCopyResourceURL = _CFBundleCopyResourceURLPtr.asFunction< + CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, CFStringRef)>(); - int nice( - int arg0, + CFArrayRef CFBundleCopyResourceURLsOfType( + CFBundleRef bundle, + CFStringRef resourceType, + CFStringRef subDirName, ) { - return _nice( - arg0, + return _CFBundleCopyResourceURLsOfType( + bundle, + resourceType, + subDirName, ); } - late final _nicePtr = - _lookup>('nice'); - late final _nice = _nicePtr.asFunction(); + late final _CFBundleCopyResourceURLsOfTypePtr = _lookup< + ffi.NativeFunction< + CFArrayRef Function(CFBundleRef, CFStringRef, + CFStringRef)>>('CFBundleCopyResourceURLsOfType'); + late final _CFBundleCopyResourceURLsOfType = + _CFBundleCopyResourceURLsOfTypePtr.asFunction< + CFArrayRef Function(CFBundleRef, CFStringRef, CFStringRef)>(); - int pread( - int __fd, - ffi.Pointer __buf, - int __nbyte, - int __offset, + CFStringRef CFBundleCopyLocalizedString( + CFBundleRef bundle, + CFStringRef key, + CFStringRef value, + CFStringRef tableName, ) { - return _pread( - __fd, - __buf, - __nbyte, - __offset, + return _CFBundleCopyLocalizedString( + bundle, + key, + value, + tableName, ); } - late final _preadPtr = _lookup< + late final _CFBundleCopyLocalizedStringPtr = _lookup< ffi.NativeFunction< - ssize_t Function( - ffi.Int, ffi.Pointer, ffi.Size, off_t)>>('pread'); - late final _pread = _preadPtr - .asFunction, int, int)>(); + CFStringRef Function(CFBundleRef, CFStringRef, CFStringRef, + CFStringRef)>>('CFBundleCopyLocalizedString'); + late final _CFBundleCopyLocalizedString = + _CFBundleCopyLocalizedStringPtr.asFunction< + CFStringRef Function( + CFBundleRef, CFStringRef, CFStringRef, CFStringRef)>(); - int pwrite( - int __fd, - ffi.Pointer __buf, - int __nbyte, - int __offset, + CFURLRef CFBundleCopyResourceURLInDirectory( + CFURLRef bundleURL, + CFStringRef resourceName, + CFStringRef resourceType, + CFStringRef subDirName, ) { - return _pwrite( - __fd, - __buf, - __nbyte, - __offset, + return _CFBundleCopyResourceURLInDirectory( + bundleURL, + resourceName, + resourceType, + subDirName, ); } - late final _pwritePtr = _lookup< + late final _CFBundleCopyResourceURLInDirectoryPtr = _lookup< ffi.NativeFunction< - ssize_t Function( - ffi.Int, ffi.Pointer, ffi.Size, off_t)>>('pwrite'); - late final _pwrite = _pwritePtr - .asFunction, int, int)>(); + CFURLRef Function(CFURLRef, CFStringRef, CFStringRef, + CFStringRef)>>('CFBundleCopyResourceURLInDirectory'); + late final _CFBundleCopyResourceURLInDirectory = + _CFBundleCopyResourceURLInDirectoryPtr.asFunction< + CFURLRef Function(CFURLRef, CFStringRef, CFStringRef, CFStringRef)>(); - ffi.Pointer sbrk( - int arg0, + CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory( + CFURLRef bundleURL, + CFStringRef resourceType, + CFStringRef subDirName, ) { - return _sbrk( - arg0, + return _CFBundleCopyResourceURLsOfTypeInDirectory( + bundleURL, + resourceType, + subDirName, ); } - late final _sbrkPtr = - _lookup Function(ffi.Int)>>( - 'sbrk'); - late final _sbrk = _sbrkPtr.asFunction Function(int)>(); - - int setpgrp() { - return _setpgrp(); - } - - late final _setpgrpPtr = - _lookup>('setpgrp'); - late final _setpgrp = _setpgrpPtr.asFunction(); + late final _CFBundleCopyResourceURLsOfTypeInDirectoryPtr = _lookup< + ffi.NativeFunction< + CFArrayRef Function(CFURLRef, CFStringRef, + CFStringRef)>>('CFBundleCopyResourceURLsOfTypeInDirectory'); + late final _CFBundleCopyResourceURLsOfTypeInDirectory = + _CFBundleCopyResourceURLsOfTypeInDirectoryPtr.asFunction< + CFArrayRef Function(CFURLRef, CFStringRef, CFStringRef)>(); - int setregid( - int arg0, - int arg1, + CFArrayRef CFBundleCopyBundleLocalizations( + CFBundleRef bundle, ) { - return _setregid( - arg0, - arg1, + return _CFBundleCopyBundleLocalizations( + bundle, ); } - late final _setregidPtr = - _lookup>('setregid'); - late final _setregid = _setregidPtr.asFunction(); + late final _CFBundleCopyBundleLocalizationsPtr = + _lookup>( + 'CFBundleCopyBundleLocalizations'); + late final _CFBundleCopyBundleLocalizations = + _CFBundleCopyBundleLocalizationsPtr.asFunction< + CFArrayRef Function(CFBundleRef)>(); - int setreuid( - int arg0, - int arg1, + CFArrayRef CFBundleCopyPreferredLocalizationsFromArray( + CFArrayRef locArray, ) { - return _setreuid( - arg0, - arg1, + return _CFBundleCopyPreferredLocalizationsFromArray( + locArray, ); } - late final _setreuidPtr = - _lookup>('setreuid'); - late final _setreuid = _setreuidPtr.asFunction(); + late final _CFBundleCopyPreferredLocalizationsFromArrayPtr = + _lookup>( + 'CFBundleCopyPreferredLocalizationsFromArray'); + late final _CFBundleCopyPreferredLocalizationsFromArray = + _CFBundleCopyPreferredLocalizationsFromArrayPtr.asFunction< + CFArrayRef Function(CFArrayRef)>(); - void sync1() { - return _sync1(); + CFArrayRef CFBundleCopyLocalizationsForPreferences( + CFArrayRef locArray, + CFArrayRef prefArray, + ) { + return _CFBundleCopyLocalizationsForPreferences( + locArray, + prefArray, + ); } - late final _sync1Ptr = - _lookup>('sync'); - late final _sync1 = _sync1Ptr.asFunction(); + late final _CFBundleCopyLocalizationsForPreferencesPtr = + _lookup>( + 'CFBundleCopyLocalizationsForPreferences'); + late final _CFBundleCopyLocalizationsForPreferences = + _CFBundleCopyLocalizationsForPreferencesPtr.asFunction< + CFArrayRef Function(CFArrayRef, CFArrayRef)>(); - int truncate( - ffi.Pointer arg0, - int arg1, + CFURLRef CFBundleCopyResourceURLForLocalization( + CFBundleRef bundle, + CFStringRef resourceName, + CFStringRef resourceType, + CFStringRef subDirName, + CFStringRef localizationName, ) { - return _truncate( - arg0, - arg1, + return _CFBundleCopyResourceURLForLocalization( + bundle, + resourceName, + resourceType, + subDirName, + localizationName, ); } - late final _truncatePtr = _lookup< - ffi.NativeFunction, off_t)>>( - 'truncate'); - late final _truncate = - _truncatePtr.asFunction, int)>(); + late final _CFBundleCopyResourceURLForLocalizationPtr = _lookup< + ffi.NativeFunction< + CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, CFStringRef, + CFStringRef)>>('CFBundleCopyResourceURLForLocalization'); + late final _CFBundleCopyResourceURLForLocalization = + _CFBundleCopyResourceURLForLocalizationPtr.asFunction< + CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, CFStringRef, + CFStringRef)>(); - int ualarm( - int arg0, - int arg1, + CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization( + CFBundleRef bundle, + CFStringRef resourceType, + CFStringRef subDirName, + CFStringRef localizationName, ) { - return _ualarm( - arg0, - arg1, + return _CFBundleCopyResourceURLsOfTypeForLocalization( + bundle, + resourceType, + subDirName, + localizationName, ); } - late final _ualarmPtr = - _lookup>( - 'ualarm'); - late final _ualarm = _ualarmPtr.asFunction(); + late final _CFBundleCopyResourceURLsOfTypeForLocalizationPtr = _lookup< + ffi.NativeFunction< + CFArrayRef Function(CFBundleRef, CFStringRef, CFStringRef, + CFStringRef)>>('CFBundleCopyResourceURLsOfTypeForLocalization'); + late final _CFBundleCopyResourceURLsOfTypeForLocalization = + _CFBundleCopyResourceURLsOfTypeForLocalizationPtr.asFunction< + CFArrayRef Function( + CFBundleRef, CFStringRef, CFStringRef, CFStringRef)>(); - int usleep( - int arg0, + CFDictionaryRef CFBundleCopyInfoDictionaryForURL( + CFURLRef url, ) { - return _usleep( - arg0, + return _CFBundleCopyInfoDictionaryForURL( + url, ); } - late final _usleepPtr = - _lookup>('usleep'); - late final _usleep = _usleepPtr.asFunction(); + late final _CFBundleCopyInfoDictionaryForURLPtr = + _lookup>( + 'CFBundleCopyInfoDictionaryForURL'); + late final _CFBundleCopyInfoDictionaryForURL = + _CFBundleCopyInfoDictionaryForURLPtr.asFunction< + CFDictionaryRef Function(CFURLRef)>(); - int vfork() { - return _vfork(); + CFArrayRef CFBundleCopyLocalizationsForURL( + CFURLRef url, + ) { + return _CFBundleCopyLocalizationsForURL( + url, + ); } - late final _vforkPtr = - _lookup>('vfork'); - late final _vfork = _vforkPtr.asFunction(); + late final _CFBundleCopyLocalizationsForURLPtr = + _lookup>( + 'CFBundleCopyLocalizationsForURL'); + late final _CFBundleCopyLocalizationsForURL = + _CFBundleCopyLocalizationsForURLPtr.asFunction< + CFArrayRef Function(CFURLRef)>(); - int fsync( - int arg0, + CFArrayRef CFBundleCopyExecutableArchitecturesForURL( + CFURLRef url, ) { - return _fsync( - arg0, + return _CFBundleCopyExecutableArchitecturesForURL( + url, ); } - late final _fsyncPtr = - _lookup>('fsync'); - late final _fsync = _fsyncPtr.asFunction(); + late final _CFBundleCopyExecutableArchitecturesForURLPtr = + _lookup>( + 'CFBundleCopyExecutableArchitecturesForURL'); + late final _CFBundleCopyExecutableArchitecturesForURL = + _CFBundleCopyExecutableArchitecturesForURLPtr.asFunction< + CFArrayRef Function(CFURLRef)>(); - int ftruncate( - int arg0, - int arg1, + CFURLRef CFBundleCopyExecutableURL( + CFBundleRef bundle, ) { - return _ftruncate( - arg0, - arg1, + return _CFBundleCopyExecutableURL( + bundle, ); } - late final _ftruncatePtr = - _lookup>( - 'ftruncate'); - late final _ftruncate = _ftruncatePtr.asFunction(); + late final _CFBundleCopyExecutableURLPtr = + _lookup>( + 'CFBundleCopyExecutableURL'); + late final _CFBundleCopyExecutableURL = _CFBundleCopyExecutableURLPtr + .asFunction(); - int getlogin_r( - ffi.Pointer arg0, - int arg1, + CFArrayRef CFBundleCopyExecutableArchitectures( + CFBundleRef bundle, ) { - return _getlogin_r( - arg0, - arg1, + return _CFBundleCopyExecutableArchitectures( + bundle, ); } - late final _getlogin_rPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size)>>('getlogin_r'); - late final _getlogin_r = - _getlogin_rPtr.asFunction, int)>(); + late final _CFBundleCopyExecutableArchitecturesPtr = + _lookup>( + 'CFBundleCopyExecutableArchitectures'); + late final _CFBundleCopyExecutableArchitectures = + _CFBundleCopyExecutableArchitecturesPtr.asFunction< + CFArrayRef Function(CFBundleRef)>(); - int fchown( - int arg0, - int arg1, - int arg2, + int CFBundlePreflightExecutable( + CFBundleRef bundle, + ffi.Pointer error, ) { - return _fchown( - arg0, - arg1, - arg2, + return _CFBundlePreflightExecutable( + bundle, + error, ); } - late final _fchownPtr = - _lookup>( - 'fchown'); - late final _fchown = _fchownPtr.asFunction(); + late final _CFBundlePreflightExecutablePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFBundleRef, + ffi.Pointer)>>('CFBundlePreflightExecutable'); + late final _CFBundlePreflightExecutable = _CFBundlePreflightExecutablePtr + .asFunction)>(); - int gethostname( - ffi.Pointer arg0, - int arg1, + int CFBundleLoadExecutableAndReturnError( + CFBundleRef bundle, + ffi.Pointer error, ) { - return _gethostname( - arg0, - arg1, + return _CFBundleLoadExecutableAndReturnError( + bundle, + error, ); } - late final _gethostnamePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size)>>('gethostname'); - late final _gethostname = - _gethostnamePtr.asFunction, int)>(); + late final _CFBundleLoadExecutableAndReturnErrorPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFBundleRef, ffi.Pointer)>>( + 'CFBundleLoadExecutableAndReturnError'); + late final _CFBundleLoadExecutableAndReturnError = + _CFBundleLoadExecutableAndReturnErrorPtr.asFunction< + int Function(CFBundleRef, ffi.Pointer)>(); - int readlink( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + int CFBundleLoadExecutable( + CFBundleRef bundle, ) { - return _readlink( - arg0, - arg1, - arg2, + return _CFBundleLoadExecutable( + bundle, ); } - late final _readlinkPtr = _lookup< - ffi.NativeFunction< - ssize_t Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('readlink'); - late final _readlink = _readlinkPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _CFBundleLoadExecutablePtr = + _lookup>( + 'CFBundleLoadExecutable'); + late final _CFBundleLoadExecutable = + _CFBundleLoadExecutablePtr.asFunction(); - int setegid( - int arg0, + int CFBundleIsExecutableLoaded( + CFBundleRef bundle, ) { - return _setegid( - arg0, + return _CFBundleIsExecutableLoaded( + bundle, ); } - late final _setegidPtr = - _lookup>('setegid'); - late final _setegid = _setegidPtr.asFunction(); + late final _CFBundleIsExecutableLoadedPtr = + _lookup>( + 'CFBundleIsExecutableLoaded'); + late final _CFBundleIsExecutableLoaded = + _CFBundleIsExecutableLoadedPtr.asFunction(); - int seteuid( - int arg0, + void CFBundleUnloadExecutable( + CFBundleRef bundle, ) { - return _seteuid( - arg0, + return _CFBundleUnloadExecutable( + bundle, ); } - late final _seteuidPtr = - _lookup>('seteuid'); - late final _seteuid = _seteuidPtr.asFunction(); + late final _CFBundleUnloadExecutablePtr = + _lookup>( + 'CFBundleUnloadExecutable'); + late final _CFBundleUnloadExecutable = + _CFBundleUnloadExecutablePtr.asFunction(); - int symlink( - ffi.Pointer arg0, - ffi.Pointer arg1, + ffi.Pointer CFBundleGetFunctionPointerForName( + CFBundleRef bundle, + CFStringRef functionName, ) { - return _symlink( - arg0, - arg1, + return _CFBundleGetFunctionPointerForName( + bundle, + functionName, ); } - late final _symlinkPtr = _lookup< + late final _CFBundleGetFunctionPointerForNamePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('symlink'); - late final _symlink = _symlinkPtr - .asFunction, ffi.Pointer)>(); + ffi.Pointer Function( + CFBundleRef, CFStringRef)>>('CFBundleGetFunctionPointerForName'); + late final _CFBundleGetFunctionPointerForName = + _CFBundleGetFunctionPointerForNamePtr.asFunction< + ffi.Pointer Function(CFBundleRef, CFStringRef)>(); - int pselect( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, + void CFBundleGetFunctionPointersForNames( + CFBundleRef bundle, + CFArrayRef functionNames, + ffi.Pointer> ftbl, ) { - return _pselect( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, + return _CFBundleGetFunctionPointersForNames( + bundle, + functionNames, + ftbl, ); } - late final _pselectPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('pselect'); - late final _pselect = _pselectPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer, ffi.Pointer)>(); + late final _CFBundleGetFunctionPointersForNamesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFBundleRef, CFArrayRef, + ffi.Pointer>)>>( + 'CFBundleGetFunctionPointersForNames'); + late final _CFBundleGetFunctionPointersForNames = + _CFBundleGetFunctionPointersForNamesPtr.asFunction< + void Function( + CFBundleRef, CFArrayRef, ffi.Pointer>)>(); - int select( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + ffi.Pointer CFBundleGetDataPointerForName( + CFBundleRef bundle, + CFStringRef symbolName, ) { - return _select( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFBundleGetDataPointerForName( + bundle, + symbolName, ); } - late final _selectPtr = _lookup< + late final _CFBundleGetDataPointerForNamePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('select'); - late final _select = _selectPtr.asFunction< - int Function(int, ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + ffi.Pointer Function( + CFBundleRef, CFStringRef)>>('CFBundleGetDataPointerForName'); + late final _CFBundleGetDataPointerForName = _CFBundleGetDataPointerForNamePtr + .asFunction Function(CFBundleRef, CFStringRef)>(); - int accessx_np( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, + void CFBundleGetDataPointersForNames( + CFBundleRef bundle, + CFArrayRef symbolNames, + ffi.Pointer> stbl, ) { - return _accessx_np( - arg0, - arg1, - arg2, - arg3, + return _CFBundleGetDataPointersForNames( + bundle, + symbolNames, + stbl, ); } - late final _accessx_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, - ffi.Pointer, uid_t)>>('accessx_np'); - late final _accessx_np = _accessx_npPtr.asFunction< - int Function( - ffi.Pointer, int, ffi.Pointer, int)>(); + late final _CFBundleGetDataPointersForNamesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFBundleRef, CFArrayRef, + ffi.Pointer>)>>( + 'CFBundleGetDataPointersForNames'); + late final _CFBundleGetDataPointersForNames = + _CFBundleGetDataPointersForNamesPtr.asFunction< + void Function( + CFBundleRef, CFArrayRef, ffi.Pointer>)>(); - int acct( - ffi.Pointer arg0, + CFURLRef CFBundleCopyAuxiliaryExecutableURL( + CFBundleRef bundle, + CFStringRef executableName, ) { - return _acct( - arg0, + return _CFBundleCopyAuxiliaryExecutableURL( + bundle, + executableName, ); } - late final _acctPtr = - _lookup)>>( - 'acct'); - late final _acct = _acctPtr.asFunction)>(); + late final _CFBundleCopyAuxiliaryExecutableURLPtr = + _lookup>( + 'CFBundleCopyAuxiliaryExecutableURL'); + late final _CFBundleCopyAuxiliaryExecutableURL = + _CFBundleCopyAuxiliaryExecutableURLPtr.asFunction< + CFURLRef Function(CFBundleRef, CFStringRef)>(); - int add_profil( - ffi.Pointer arg0, - int arg1, - int arg2, - int arg3, + int CFBundleIsExecutableLoadable( + CFBundleRef bundle, ) { - return _add_profil( - arg0, - arg1, - arg2, - arg3, + return _CFBundleIsExecutableLoadable( + bundle, ); } - late final _add_profilPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, ffi.UnsignedLong, - ffi.UnsignedInt)>>('add_profil'); - late final _add_profil = _add_profilPtr - .asFunction, int, int, int)>(); + late final _CFBundleIsExecutableLoadablePtr = + _lookup>( + 'CFBundleIsExecutableLoadable'); + late final _CFBundleIsExecutableLoadable = + _CFBundleIsExecutableLoadablePtr.asFunction(); - void endusershell() { - return _endusershell(); + int CFBundleIsExecutableLoadableForURL( + CFURLRef url, + ) { + return _CFBundleIsExecutableLoadableForURL( + url, + ); } - late final _endusershellPtr = - _lookup>('endusershell'); - late final _endusershell = _endusershellPtr.asFunction(); + late final _CFBundleIsExecutableLoadableForURLPtr = + _lookup>( + 'CFBundleIsExecutableLoadableForURL'); + late final _CFBundleIsExecutableLoadableForURL = + _CFBundleIsExecutableLoadableForURLPtr.asFunction< + int Function(CFURLRef)>(); - int execvP( - ffi.Pointer __file, - ffi.Pointer __searchpath, - ffi.Pointer> __argv, + int CFBundleIsArchitectureLoadable( + int arch, ) { - return _execvP( - __file, - __searchpath, - __argv, + return _CFBundleIsArchitectureLoadable( + arch, ); } - late final _execvPPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>>('execvP'); - late final _execvP = _execvPPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); + late final _CFBundleIsArchitectureLoadablePtr = + _lookup>( + 'CFBundleIsArchitectureLoadable'); + late final _CFBundleIsArchitectureLoadable = + _CFBundleIsArchitectureLoadablePtr.asFunction(); - ffi.Pointer fflagstostr( - int arg0, + CFPlugInRef CFBundleGetPlugIn( + CFBundleRef bundle, ) { - return _fflagstostr( - arg0, + return _CFBundleGetPlugIn( + bundle, ); } - late final _fflagstostrPtr = _lookup< - ffi.NativeFunction Function(ffi.UnsignedLong)>>( - 'fflagstostr'); - late final _fflagstostr = - _fflagstostrPtr.asFunction Function(int)>(); + late final _CFBundleGetPlugInPtr = + _lookup>( + 'CFBundleGetPlugIn'); + late final _CFBundleGetPlugIn = + _CFBundleGetPlugInPtr.asFunction(); - int getdomainname( - ffi.Pointer arg0, - int arg1, + int CFBundleOpenBundleResourceMap( + CFBundleRef bundle, ) { - return _getdomainname( - arg0, - arg1, + return _CFBundleOpenBundleResourceMap( + bundle, ); } - late final _getdomainnamePtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'getdomainname'); - late final _getdomainname = - _getdomainnamePtr.asFunction, int)>(); + late final _CFBundleOpenBundleResourceMapPtr = + _lookup>( + 'CFBundleOpenBundleResourceMap'); + late final _CFBundleOpenBundleResourceMap = + _CFBundleOpenBundleResourceMapPtr.asFunction(); - int getgrouplist( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + int CFBundleOpenBundleResourceFiles( + CFBundleRef bundle, + ffi.Pointer refNum, + ffi.Pointer localizedRefNum, ) { - return _getgrouplist( - arg0, - arg1, - arg2, - arg3, + return _CFBundleOpenBundleResourceFiles( + bundle, + refNum, + localizedRefNum, ); } - late final _getgrouplistPtr = _lookup< + late final _CFBundleOpenBundleResourceFilesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Pointer, - ffi.Pointer)>>('getgrouplist'); - late final _getgrouplist = _getgrouplistPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, - ffi.Pointer)>(); + SInt32 Function(CFBundleRef, ffi.Pointer, + ffi.Pointer)>>('CFBundleOpenBundleResourceFiles'); + late final _CFBundleOpenBundleResourceFiles = + _CFBundleOpenBundleResourceFilesPtr.asFunction< + int Function(CFBundleRef, ffi.Pointer, + ffi.Pointer)>(); - int gethostuuid( - ffi.Pointer arg0, - ffi.Pointer arg1, + void CFBundleCloseBundleResourceMap( + CFBundleRef bundle, + int refNum, ) { - return _gethostuuid( - arg0, - arg1, + return _CFBundleCloseBundleResourceMap( + bundle, + refNum, ); } - late final _gethostuuidPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('gethostuuid'); - late final _gethostuuid = _gethostuuidPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final _CFBundleCloseBundleResourceMapPtr = _lookup< + ffi.NativeFunction>( + 'CFBundleCloseBundleResourceMap'); + late final _CFBundleCloseBundleResourceMap = + _CFBundleCloseBundleResourceMapPtr.asFunction< + void Function(CFBundleRef, int)>(); - int getmode( - ffi.Pointer arg0, - int arg1, - ) { - return _getmode( - arg0, - arg1, - ); + int CFMessagePortGetTypeID() { + return _CFMessagePortGetTypeID(); } - late final _getmodePtr = _lookup< - ffi.NativeFunction, mode_t)>>( - 'getmode'); - late final _getmode = - _getmodePtr.asFunction, int)>(); + late final _CFMessagePortGetTypeIDPtr = + _lookup>( + 'CFMessagePortGetTypeID'); + late final _CFMessagePortGetTypeID = + _CFMessagePortGetTypeIDPtr.asFunction(); - int getpeereid( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + CFMessagePortRef CFMessagePortCreateLocal( + CFAllocatorRef allocator, + CFStringRef name, + CFMessagePortCallBack callout, + ffi.Pointer context, + ffi.Pointer shouldFreeInfo, ) { - return _getpeereid( - arg0, - arg1, - arg2, + return _CFMessagePortCreateLocal( + allocator, + name, + callout, + context, + shouldFreeInfo, ); } - late final _getpeereidPtr = _lookup< + late final _CFMessagePortCreateLocalPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Pointer)>>('getpeereid'); - late final _getpeereid = _getpeereidPtr - .asFunction, ffi.Pointer)>(); + CFMessagePortRef Function( + CFAllocatorRef, + CFStringRef, + CFMessagePortCallBack, + ffi.Pointer, + ffi.Pointer)>>('CFMessagePortCreateLocal'); + late final _CFMessagePortCreateLocal = + _CFMessagePortCreateLocalPtr.asFunction< + CFMessagePortRef Function( + CFAllocatorRef, + CFStringRef, + CFMessagePortCallBack, + ffi.Pointer, + ffi.Pointer)>(); - int getsgroups_np( - ffi.Pointer arg0, - ffi.Pointer arg1, + CFMessagePortRef CFMessagePortCreateRemote( + CFAllocatorRef allocator, + CFStringRef name, ) { - return _getsgroups_np( - arg0, - arg1, + return _CFMessagePortCreateRemote( + allocator, + name, ); } - late final _getsgroups_npPtr = _lookup< + late final _CFMessagePortCreateRemotePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('getsgroups_np'); - late final _getsgroups_np = _getsgroups_npPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer getusershell() { - return _getusershell(); - } - - late final _getusershellPtr = - _lookup Function()>>( - 'getusershell'); - late final _getusershell = - _getusershellPtr.asFunction Function()>(); + CFMessagePortRef Function( + CFAllocatorRef, CFStringRef)>>('CFMessagePortCreateRemote'); + late final _CFMessagePortCreateRemote = _CFMessagePortCreateRemotePtr + .asFunction(); - int getwgroups_np( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFMessagePortIsRemote( + CFMessagePortRef ms, ) { - return _getwgroups_np( - arg0, - arg1, + return _CFMessagePortIsRemote( + ms, ); } - late final _getwgroups_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('getwgroups_np'); - late final _getwgroups_np = _getwgroups_npPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + late final _CFMessagePortIsRemotePtr = + _lookup>( + 'CFMessagePortIsRemote'); + late final _CFMessagePortIsRemote = + _CFMessagePortIsRemotePtr.asFunction(); - int initgroups( - ffi.Pointer arg0, - int arg1, + CFStringRef CFMessagePortGetName( + CFMessagePortRef ms, ) { - return _initgroups( - arg0, - arg1, + return _CFMessagePortGetName( + ms, ); } - late final _initgroupsPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'initgroups'); - late final _initgroups = - _initgroupsPtr.asFunction, int)>(); + late final _CFMessagePortGetNamePtr = + _lookup>( + 'CFMessagePortGetName'); + late final _CFMessagePortGetName = _CFMessagePortGetNamePtr.asFunction< + CFStringRef Function(CFMessagePortRef)>(); - int issetugid() { - return _issetugid(); + int CFMessagePortSetName( + CFMessagePortRef ms, + CFStringRef newName, + ) { + return _CFMessagePortSetName( + ms, + newName, + ); } - late final _issetugidPtr = - _lookup>('issetugid'); - late final _issetugid = _issetugidPtr.asFunction(); + late final _CFMessagePortSetNamePtr = _lookup< + ffi.NativeFunction>( + 'CFMessagePortSetName'); + late final _CFMessagePortSetName = _CFMessagePortSetNamePtr.asFunction< + int Function(CFMessagePortRef, CFStringRef)>(); - ffi.Pointer mkdtemp( - ffi.Pointer arg0, + void CFMessagePortGetContext( + CFMessagePortRef ms, + ffi.Pointer context, ) { - return _mkdtemp( - arg0, + return _CFMessagePortGetContext( + ms, + context, ); } - late final _mkdtempPtr = _lookup< + late final _CFMessagePortGetContextPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('mkdtemp'); - late final _mkdtemp = _mkdtempPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Void Function(CFMessagePortRef, + ffi.Pointer)>>('CFMessagePortGetContext'); + late final _CFMessagePortGetContext = _CFMessagePortGetContextPtr.asFunction< + void Function(CFMessagePortRef, ffi.Pointer)>(); - int mknod( - ffi.Pointer arg0, - int arg1, - int arg2, + void CFMessagePortInvalidate( + CFMessagePortRef ms, ) { - return _mknod( - arg0, - arg1, - arg2, + return _CFMessagePortInvalidate( + ms, ); } - late final _mknodPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, mode_t, dev_t)>>('mknod'); - late final _mknod = - _mknodPtr.asFunction, int, int)>(); + late final _CFMessagePortInvalidatePtr = + _lookup>( + 'CFMessagePortInvalidate'); + late final _CFMessagePortInvalidate = + _CFMessagePortInvalidatePtr.asFunction(); - int mkpath_np( - ffi.Pointer path, - int omode, + int CFMessagePortIsValid( + CFMessagePortRef ms, ) { - return _mkpath_np( - path, - omode, + return _CFMessagePortIsValid( + ms, ); } - late final _mkpath_npPtr = _lookup< - ffi.NativeFunction, mode_t)>>( - 'mkpath_np'); - late final _mkpath_np = - _mkpath_npPtr.asFunction, int)>(); + late final _CFMessagePortIsValidPtr = + _lookup>( + 'CFMessagePortIsValid'); + late final _CFMessagePortIsValid = + _CFMessagePortIsValidPtr.asFunction(); - int mkpathat_np( - int dfd, - ffi.Pointer path, - int omode, + CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack( + CFMessagePortRef ms, ) { - return _mkpathat_np( - dfd, - path, - omode, + return _CFMessagePortGetInvalidationCallBack( + ms, ); } - late final _mkpathat_npPtr = _lookup< + late final _CFMessagePortGetInvalidationCallBackPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, mode_t)>>('mkpathat_np'); - late final _mkpathat_np = _mkpathat_npPtr - .asFunction, int)>(); + CFMessagePortInvalidationCallBack Function( + CFMessagePortRef)>>('CFMessagePortGetInvalidationCallBack'); + late final _CFMessagePortGetInvalidationCallBack = + _CFMessagePortGetInvalidationCallBackPtr.asFunction< + CFMessagePortInvalidationCallBack Function(CFMessagePortRef)>(); - int mkstemps( - ffi.Pointer arg0, - int arg1, + void CFMessagePortSetInvalidationCallBack( + CFMessagePortRef ms, + CFMessagePortInvalidationCallBack callout, ) { - return _mkstemps( - arg0, - arg1, + return _CFMessagePortSetInvalidationCallBack( + ms, + callout, ); } - late final _mkstempsPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'mkstemps'); - late final _mkstemps = - _mkstempsPtr.asFunction, int)>(); + late final _CFMessagePortSetInvalidationCallBackPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFMessagePortRef, CFMessagePortInvalidationCallBack)>>( + 'CFMessagePortSetInvalidationCallBack'); + late final _CFMessagePortSetInvalidationCallBack = + _CFMessagePortSetInvalidationCallBackPtr.asFunction< + void Function(CFMessagePortRef, CFMessagePortInvalidationCallBack)>(); - int mkostemp( - ffi.Pointer path, - int oflags, + int CFMessagePortSendRequest( + CFMessagePortRef remote, + int msgid, + CFDataRef data, + double sendTimeout, + double rcvTimeout, + CFStringRef replyMode, + ffi.Pointer returnData, ) { - return _mkostemp( - path, - oflags, + return _CFMessagePortSendRequest( + remote, + msgid, + data, + sendTimeout, + rcvTimeout, + replyMode, + returnData, ); } - late final _mkostempPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'mkostemp'); - late final _mkostemp = - _mkostempPtr.asFunction, int)>(); + late final _CFMessagePortSendRequestPtr = _lookup< + ffi.NativeFunction< + SInt32 Function( + CFMessagePortRef, + SInt32, + CFDataRef, + CFTimeInterval, + CFTimeInterval, + CFStringRef, + ffi.Pointer)>>('CFMessagePortSendRequest'); + late final _CFMessagePortSendRequest = + _CFMessagePortSendRequestPtr.asFunction< + int Function(CFMessagePortRef, int, CFDataRef, double, double, + CFStringRef, ffi.Pointer)>(); - int mkostemps( - ffi.Pointer path, - int slen, - int oflags, + CFRunLoopSourceRef CFMessagePortCreateRunLoopSource( + CFAllocatorRef allocator, + CFMessagePortRef local, + int order, ) { - return _mkostemps( - path, - slen, - oflags, + return _CFMessagePortCreateRunLoopSource( + allocator, + local, + order, ); } - late final _mkostempsPtr = _lookup< + late final _CFMessagePortCreateRunLoopSourcePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int, ffi.Int)>>('mkostemps'); - late final _mkostemps = - _mkostempsPtr.asFunction, int, int)>(); + CFRunLoopSourceRef Function(CFAllocatorRef, CFMessagePortRef, + CFIndex)>>('CFMessagePortCreateRunLoopSource'); + late final _CFMessagePortCreateRunLoopSource = + _CFMessagePortCreateRunLoopSourcePtr.asFunction< + CFRunLoopSourceRef Function(CFAllocatorRef, CFMessagePortRef, int)>(); - int mkstemp_dprotected_np( - ffi.Pointer path, - int dpclass, - int dpflags, + void CFMessagePortSetDispatchQueue( + CFMessagePortRef ms, + Dartdispatch_queue_t queue, ) { - return _mkstemp_dprotected_np( - path, - dpclass, - dpflags, + return _CFMessagePortSetDispatchQueue( + ms, + queue.ref.pointer, ); } - late final _mkstemp_dprotected_npPtr = _lookup< + late final _CFMessagePortSetDispatchQueuePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, - ffi.Int)>>('mkstemp_dprotected_np'); - late final _mkstemp_dprotected_np = _mkstemp_dprotected_npPtr - .asFunction, int, int)>(); + ffi.Void Function(CFMessagePortRef, + dispatch_queue_t)>>('CFMessagePortSetDispatchQueue'); + late final _CFMessagePortSetDispatchQueue = _CFMessagePortSetDispatchQueuePtr + .asFunction(); - ffi.Pointer mkdtempat_np( - int dfd, - ffi.Pointer path, - ) { - return _mkdtempat_np( - dfd, - path, - ); - } + late final ffi.Pointer _kCFPlugInDynamicRegistrationKey = + _lookup('kCFPlugInDynamicRegistrationKey'); - late final _mkdtempat_npPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, ffi.Pointer)>>('mkdtempat_np'); - late final _mkdtempat_np = _mkdtempat_npPtr - .asFunction Function(int, ffi.Pointer)>(); + CFStringRef get kCFPlugInDynamicRegistrationKey => + _kCFPlugInDynamicRegistrationKey.value; - int mkstempsat_np( - int dfd, - ffi.Pointer path, - int slen, - ) { - return _mkstempsat_np( - dfd, - path, - slen, - ); - } + late final ffi.Pointer _kCFPlugInDynamicRegisterFunctionKey = + _lookup('kCFPlugInDynamicRegisterFunctionKey'); - late final _mkstempsat_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer, ffi.Int)>>('mkstempsat_np'); - late final _mkstempsat_np = _mkstempsat_npPtr - .asFunction, int)>(); + CFStringRef get kCFPlugInDynamicRegisterFunctionKey => + _kCFPlugInDynamicRegisterFunctionKey.value; - int mkostempsat_np( - int dfd, - ffi.Pointer path, - int slen, - int oflags, - ) { - return _mkostempsat_np( - dfd, - path, - slen, - oflags, - ); + late final ffi.Pointer _kCFPlugInUnloadFunctionKey = + _lookup('kCFPlugInUnloadFunctionKey'); + + CFStringRef get kCFPlugInUnloadFunctionKey => + _kCFPlugInUnloadFunctionKey.value; + + late final ffi.Pointer _kCFPlugInFactoriesKey = + _lookup('kCFPlugInFactoriesKey'); + + CFStringRef get kCFPlugInFactoriesKey => _kCFPlugInFactoriesKey.value; + + late final ffi.Pointer _kCFPlugInTypesKey = + _lookup('kCFPlugInTypesKey'); + + CFStringRef get kCFPlugInTypesKey => _kCFPlugInTypesKey.value; + + int CFPlugInGetTypeID() { + return _CFPlugInGetTypeID(); } - late final _mkostempsat_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, - ffi.Int)>>('mkostempsat_np'); - late final _mkostempsat_np = _mkostempsat_npPtr - .asFunction, int, int)>(); + late final _CFPlugInGetTypeIDPtr = + _lookup>('CFPlugInGetTypeID'); + late final _CFPlugInGetTypeID = + _CFPlugInGetTypeIDPtr.asFunction(); - int nfssvc( - int arg0, - ffi.Pointer arg1, + CFPlugInRef CFPlugInCreate( + CFAllocatorRef allocator, + CFURLRef plugInURL, ) { - return _nfssvc( - arg0, - arg1, + return _CFPlugInCreate( + allocator, + plugInURL, ); } - late final _nfssvcPtr = _lookup< - ffi.NativeFunction)>>( - 'nfssvc'); - late final _nfssvc = - _nfssvcPtr.asFunction)>(); + late final _CFPlugInCreatePtr = _lookup< + ffi.NativeFunction>( + 'CFPlugInCreate'); + late final _CFPlugInCreate = _CFPlugInCreatePtr.asFunction< + CFPlugInRef Function(CFAllocatorRef, CFURLRef)>(); - int profil( - ffi.Pointer arg0, - int arg1, - int arg2, - int arg3, + CFBundleRef CFPlugInGetBundle( + CFPlugInRef plugIn, ) { - return _profil( - arg0, - arg1, - arg2, - arg3, + return _CFPlugInGetBundle( + plugIn, ); } - late final _profilPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size, ffi.UnsignedLong, - ffi.UnsignedInt)>>('profil'); - late final _profil = _profilPtr - .asFunction, int, int, int)>(); + late final _CFPlugInGetBundlePtr = + _lookup>( + 'CFPlugInGetBundle'); + late final _CFPlugInGetBundle = + _CFPlugInGetBundlePtr.asFunction(); - int pthread_setugid_np( - int arg0, - int arg1, + void CFPlugInSetLoadOnDemand( + CFPlugInRef plugIn, + int flag, ) { - return _pthread_setugid_np( - arg0, - arg1, + return _CFPlugInSetLoadOnDemand( + plugIn, + flag, ); } - late final _pthread_setugid_npPtr = - _lookup>( - 'pthread_setugid_np'); - late final _pthread_setugid_np = - _pthread_setugid_npPtr.asFunction(); + late final _CFPlugInSetLoadOnDemandPtr = + _lookup>( + 'CFPlugInSetLoadOnDemand'); + late final _CFPlugInSetLoadOnDemand = + _CFPlugInSetLoadOnDemandPtr.asFunction(); - int pthread_getugid_np( - ffi.Pointer arg0, - ffi.Pointer arg1, + int CFPlugInIsLoadOnDemand( + CFPlugInRef plugIn, ) { - return _pthread_getugid_np( - arg0, - arg1, + return _CFPlugInIsLoadOnDemand( + plugIn, ); } - late final _pthread_getugid_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer)>>('pthread_getugid_np'); - late final _pthread_getugid_np = _pthread_getugid_npPtr - .asFunction, ffi.Pointer)>(); + late final _CFPlugInIsLoadOnDemandPtr = + _lookup>( + 'CFPlugInIsLoadOnDemand'); + late final _CFPlugInIsLoadOnDemand = + _CFPlugInIsLoadOnDemandPtr.asFunction(); - int reboot( - int arg0, + CFArrayRef CFPlugInFindFactoriesForPlugInType( + CFUUIDRef typeUUID, ) { - return _reboot( - arg0, + return _CFPlugInFindFactoriesForPlugInType( + typeUUID, ); } - late final _rebootPtr = - _lookup>('reboot'); - late final _reboot = _rebootPtr.asFunction(); + late final _CFPlugInFindFactoriesForPlugInTypePtr = + _lookup>( + 'CFPlugInFindFactoriesForPlugInType'); + late final _CFPlugInFindFactoriesForPlugInType = + _CFPlugInFindFactoriesForPlugInTypePtr.asFunction< + CFArrayRef Function(CFUUIDRef)>(); - int revoke( - ffi.Pointer arg0, + CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn( + CFUUIDRef typeUUID, + CFPlugInRef plugIn, ) { - return _revoke( - arg0, + return _CFPlugInFindFactoriesForPlugInTypeInPlugIn( + typeUUID, + plugIn, ); } - late final _revokePtr = - _lookup)>>( - 'revoke'); - late final _revoke = - _revokePtr.asFunction)>(); + late final _CFPlugInFindFactoriesForPlugInTypeInPlugInPtr = + _lookup>( + 'CFPlugInFindFactoriesForPlugInTypeInPlugIn'); + late final _CFPlugInFindFactoriesForPlugInTypeInPlugIn = + _CFPlugInFindFactoriesForPlugInTypeInPlugInPtr.asFunction< + CFArrayRef Function(CFUUIDRef, CFPlugInRef)>(); - int rcmd( - ffi.Pointer> arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, + ffi.Pointer CFPlugInInstanceCreate( + CFAllocatorRef allocator, + CFUUIDRef factoryUUID, + CFUUIDRef typeUUID, ) { - return _rcmd( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, + return _CFPlugInInstanceCreate( + allocator, + factoryUUID, + typeUUID, ); } - late final _rcmdPtr = _lookup< + late final _CFPlugInInstanceCreatePtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('rcmd'); - late final _rcmd = _rcmdPtr.asFunction< - int Function( - ffi.Pointer>, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); + ffi.Pointer Function( + CFAllocatorRef, CFUUIDRef, CFUUIDRef)>>('CFPlugInInstanceCreate'); + late final _CFPlugInInstanceCreate = _CFPlugInInstanceCreatePtr.asFunction< + ffi.Pointer Function(CFAllocatorRef, CFUUIDRef, CFUUIDRef)>(); - int rcmd_af( - ffi.Pointer> arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, - int arg6, + int CFPlugInRegisterFactoryFunction( + CFUUIDRef factoryUUID, + CFPlugInFactoryFunction func, ) { - return _rcmd_af( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, - arg6, + return _CFPlugInRegisterFactoryFunction( + factoryUUID, + func, ); } - late final _rcmd_afPtr = _lookup< + late final _CFPlugInRegisterFactoryFunctionPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int)>>('rcmd_af'); - late final _rcmd_af = _rcmd_afPtr.asFunction< - int Function( - ffi.Pointer>, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); + Boolean Function(CFUUIDRef, + CFPlugInFactoryFunction)>>('CFPlugInRegisterFactoryFunction'); + late final _CFPlugInRegisterFactoryFunction = + _CFPlugInRegisterFactoryFunctionPtr.asFunction< + int Function(CFUUIDRef, CFPlugInFactoryFunction)>(); - int rresvport( - ffi.Pointer arg0, + int CFPlugInRegisterFactoryFunctionByName( + CFUUIDRef factoryUUID, + CFPlugInRef plugIn, + CFStringRef functionName, ) { - return _rresvport( - arg0, + return _CFPlugInRegisterFactoryFunctionByName( + factoryUUID, + plugIn, + functionName, ); } - late final _rresvportPtr = - _lookup)>>( - 'rresvport'); - late final _rresvport = - _rresvportPtr.asFunction)>(); + late final _CFPlugInRegisterFactoryFunctionByNamePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFUUIDRef, CFPlugInRef, + CFStringRef)>>('CFPlugInRegisterFactoryFunctionByName'); + late final _CFPlugInRegisterFactoryFunctionByName = + _CFPlugInRegisterFactoryFunctionByNamePtr.asFunction< + int Function(CFUUIDRef, CFPlugInRef, CFStringRef)>(); - int rresvport_af( - ffi.Pointer arg0, - int arg1, + int CFPlugInUnregisterFactory( + CFUUIDRef factoryUUID, ) { - return _rresvport_af( - arg0, - arg1, + return _CFPlugInUnregisterFactory( + factoryUUID, ); } - late final _rresvport_afPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'rresvport_af'); - late final _rresvport_af = - _rresvport_afPtr.asFunction, int)>(); + late final _CFPlugInUnregisterFactoryPtr = + _lookup>( + 'CFPlugInUnregisterFactory'); + late final _CFPlugInUnregisterFactory = + _CFPlugInUnregisterFactoryPtr.asFunction(); - int iruserok( - int arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + int CFPlugInRegisterPlugInType( + CFUUIDRef factoryUUID, + CFUUIDRef typeUUID, ) { - return _iruserok( - arg0, - arg1, - arg2, - arg3, + return _CFPlugInRegisterPlugInType( + factoryUUID, + typeUUID, ); } - late final _iruserokPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.UnsignedLong, ffi.Int, ffi.Pointer, - ffi.Pointer)>>('iruserok'); - late final _iruserok = _iruserokPtr.asFunction< - int Function(int, int, ffi.Pointer, ffi.Pointer)>(); + late final _CFPlugInRegisterPlugInTypePtr = + _lookup>( + 'CFPlugInRegisterPlugInType'); + late final _CFPlugInRegisterPlugInType = _CFPlugInRegisterPlugInTypePtr + .asFunction(); - int iruserok_sa( - ffi.Pointer arg0, - int arg1, - int arg2, - ffi.Pointer arg3, - ffi.Pointer arg4, + int CFPlugInUnregisterPlugInType( + CFUUIDRef factoryUUID, + CFUUIDRef typeUUID, ) { - return _iruserok_sa( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFPlugInUnregisterPlugInType( + factoryUUID, + typeUUID, ); } - late final _iruserok_saPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('iruserok_sa'); - late final _iruserok_sa = _iruserok_saPtr.asFunction< - int Function(ffi.Pointer, int, int, ffi.Pointer, - ffi.Pointer)>(); + late final _CFPlugInUnregisterPlugInTypePtr = + _lookup>( + 'CFPlugInUnregisterPlugInType'); + late final _CFPlugInUnregisterPlugInType = _CFPlugInUnregisterPlugInTypePtr + .asFunction(); - int ruserok( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - ffi.Pointer arg3, + void CFPlugInAddInstanceForFactory( + CFUUIDRef factoryID, ) { - return _ruserok( - arg0, - arg1, - arg2, - arg3, + return _CFPlugInAddInstanceForFactory( + factoryID, ); } - late final _ruserokPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('ruserok'); - late final _ruserok = _ruserokPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, - ffi.Pointer)>(); + late final _CFPlugInAddInstanceForFactoryPtr = + _lookup>( + 'CFPlugInAddInstanceForFactory'); + late final _CFPlugInAddInstanceForFactory = + _CFPlugInAddInstanceForFactoryPtr.asFunction(); - int setdomainname( - ffi.Pointer arg0, - int arg1, + void CFPlugInRemoveInstanceForFactory( + CFUUIDRef factoryID, ) { - return _setdomainname( - arg0, - arg1, + return _CFPlugInRemoveInstanceForFactory( + factoryID, ); } - late final _setdomainnamePtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'setdomainname'); - late final _setdomainname = - _setdomainnamePtr.asFunction, int)>(); + late final _CFPlugInRemoveInstanceForFactoryPtr = + _lookup>( + 'CFPlugInRemoveInstanceForFactory'); + late final _CFPlugInRemoveInstanceForFactory = + _CFPlugInRemoveInstanceForFactoryPtr.asFunction< + void Function(CFUUIDRef)>(); - int setgroups( - int arg0, - ffi.Pointer arg1, + int CFPlugInInstanceGetInterfaceFunctionTable( + CFPlugInInstanceRef instance, + CFStringRef interfaceName, + ffi.Pointer> ftbl, ) { - return _setgroups( - arg0, - arg1, + return _CFPlugInInstanceGetInterfaceFunctionTable( + instance, + interfaceName, + ftbl, ); } - late final _setgroupsPtr = _lookup< - ffi.NativeFunction)>>( - 'setgroups'); - late final _setgroups = - _setgroupsPtr.asFunction)>(); + late final _CFPlugInInstanceGetInterfaceFunctionTablePtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFPlugInInstanceRef, CFStringRef, + ffi.Pointer>)>>( + 'CFPlugInInstanceGetInterfaceFunctionTable'); + late final _CFPlugInInstanceGetInterfaceFunctionTable = + _CFPlugInInstanceGetInterfaceFunctionTablePtr.asFunction< + int Function(CFPlugInInstanceRef, CFStringRef, + ffi.Pointer>)>(); - void sethostid( - int arg0, + CFStringRef CFPlugInInstanceGetFactoryName( + CFPlugInInstanceRef instance, ) { - return _sethostid( - arg0, + return _CFPlugInInstanceGetFactoryName( + instance, ); } - late final _sethostidPtr = - _lookup>('sethostid'); - late final _sethostid = _sethostidPtr.asFunction(); + late final _CFPlugInInstanceGetFactoryNamePtr = + _lookup>( + 'CFPlugInInstanceGetFactoryName'); + late final _CFPlugInInstanceGetFactoryName = + _CFPlugInInstanceGetFactoryNamePtr.asFunction< + CFStringRef Function(CFPlugInInstanceRef)>(); - int sethostname( - ffi.Pointer arg0, - int arg1, + ffi.Pointer CFPlugInInstanceGetInstanceData( + CFPlugInInstanceRef instance, ) { - return _sethostname( - arg0, - arg1, + return _CFPlugInInstanceGetInstanceData( + instance, ); } - late final _sethostnamePtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'sethostname'); - late final _sethostname = - _sethostnamePtr.asFunction, int)>(); + late final _CFPlugInInstanceGetInstanceDataPtr = _lookup< + ffi + .NativeFunction Function(CFPlugInInstanceRef)>>( + 'CFPlugInInstanceGetInstanceData'); + late final _CFPlugInInstanceGetInstanceData = + _CFPlugInInstanceGetInstanceDataPtr.asFunction< + ffi.Pointer Function(CFPlugInInstanceRef)>(); - int setlogin( - ffi.Pointer arg0, + int CFPlugInInstanceGetTypeID() { + return _CFPlugInInstanceGetTypeID(); + } + + late final _CFPlugInInstanceGetTypeIDPtr = + _lookup>( + 'CFPlugInInstanceGetTypeID'); + late final _CFPlugInInstanceGetTypeID = + _CFPlugInInstanceGetTypeIDPtr.asFunction(); + + CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize( + CFAllocatorRef allocator, + int instanceDataSize, + CFPlugInInstanceDeallocateInstanceDataFunction deallocateInstanceFunction, + CFStringRef factoryName, + CFPlugInInstanceGetInterfaceFunction getInterfaceFunction, ) { - return _setlogin( - arg0, + return _CFPlugInInstanceCreateWithInstanceDataSize( + allocator, + instanceDataSize, + deallocateInstanceFunction, + factoryName, + getInterfaceFunction, ); } - late final _setloginPtr = - _lookup)>>( - 'setlogin'); - late final _setlogin = - _setloginPtr.asFunction)>(); + late final _CFPlugInInstanceCreateWithInstanceDataSizePtr = _lookup< + ffi.NativeFunction< + CFPlugInInstanceRef Function( + CFAllocatorRef, + CFIndex, + CFPlugInInstanceDeallocateInstanceDataFunction, + CFStringRef, + CFPlugInInstanceGetInterfaceFunction)>>( + 'CFPlugInInstanceCreateWithInstanceDataSize'); + late final _CFPlugInInstanceCreateWithInstanceDataSize = + _CFPlugInInstanceCreateWithInstanceDataSizePtr.asFunction< + CFPlugInInstanceRef Function( + CFAllocatorRef, + int, + CFPlugInInstanceDeallocateInstanceDataFunction, + CFStringRef, + CFPlugInInstanceGetInterfaceFunction)>(); - ffi.Pointer setmode( - ffi.Pointer arg0, + int CFMachPortGetTypeID() { + return _CFMachPortGetTypeID(); + } + + late final _CFMachPortGetTypeIDPtr = + _lookup>('CFMachPortGetTypeID'); + late final _CFMachPortGetTypeID = + _CFMachPortGetTypeIDPtr.asFunction(); + + CFMachPortRef CFMachPortCreate( + CFAllocatorRef allocator, + CFMachPortCallBack callout, + ffi.Pointer context, + ffi.Pointer shouldFreeInfo, ) { - return _setmode( - arg0, + return _CFMachPortCreate( + allocator, + callout, + context, + shouldFreeInfo, ); } - late final _setmodePtr = _lookup< + late final _CFMachPortCreatePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('setmode'); - late final _setmode = _setmodePtr - .asFunction Function(ffi.Pointer)>(); + CFMachPortRef Function( + CFAllocatorRef, + CFMachPortCallBack, + ffi.Pointer, + ffi.Pointer)>>('CFMachPortCreate'); + late final _CFMachPortCreate = _CFMachPortCreatePtr.asFunction< + CFMachPortRef Function(CFAllocatorRef, CFMachPortCallBack, + ffi.Pointer, ffi.Pointer)>(); - int setrgid( - int arg0, + CFMachPortRef CFMachPortCreateWithPort( + CFAllocatorRef allocator, + int portNum, + CFMachPortCallBack callout, + ffi.Pointer context, + ffi.Pointer shouldFreeInfo, ) { - return _setrgid( - arg0, + return _CFMachPortCreateWithPort( + allocator, + portNum, + callout, + context, + shouldFreeInfo, ); } - late final _setrgidPtr = - _lookup>('setrgid'); - late final _setrgid = _setrgidPtr.asFunction(); + late final _CFMachPortCreateWithPortPtr = _lookup< + ffi.NativeFunction< + CFMachPortRef Function( + CFAllocatorRef, + mach_port_t, + CFMachPortCallBack, + ffi.Pointer, + ffi.Pointer)>>('CFMachPortCreateWithPort'); + late final _CFMachPortCreateWithPort = + _CFMachPortCreateWithPortPtr.asFunction< + CFMachPortRef Function(CFAllocatorRef, int, CFMachPortCallBack, + ffi.Pointer, ffi.Pointer)>(); - int setruid( - int arg0, + int CFMachPortGetPort( + CFMachPortRef port, ) { - return _setruid( - arg0, + return _CFMachPortGetPort( + port, ); } - late final _setruidPtr = - _lookup>('setruid'); - late final _setruid = _setruidPtr.asFunction(); + late final _CFMachPortGetPortPtr = + _lookup>( + 'CFMachPortGetPort'); + late final _CFMachPortGetPort = + _CFMachPortGetPortPtr.asFunction(); - int setsgroups_np( - int arg0, - ffi.Pointer arg1, + void CFMachPortGetContext( + CFMachPortRef port, + ffi.Pointer context, ) { - return _setsgroups_np( - arg0, - arg1, + return _CFMachPortGetContext( + port, + context, ); } - late final _setsgroups_npPtr = _lookup< + late final _CFMachPortGetContextPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer)>>('setsgroups_np'); - late final _setsgroups_np = _setsgroups_npPtr - .asFunction)>(); + ffi.Void Function(CFMachPortRef, + ffi.Pointer)>>('CFMachPortGetContext'); + late final _CFMachPortGetContext = _CFMachPortGetContextPtr.asFunction< + void Function(CFMachPortRef, ffi.Pointer)>(); - void setusershell() { - return _setusershell(); + void CFMachPortInvalidate( + CFMachPortRef port, + ) { + return _CFMachPortInvalidate( + port, + ); } - late final _setusershellPtr = - _lookup>('setusershell'); - late final _setusershell = _setusershellPtr.asFunction(); + late final _CFMachPortInvalidatePtr = + _lookup>( + 'CFMachPortInvalidate'); + late final _CFMachPortInvalidate = + _CFMachPortInvalidatePtr.asFunction(); - int setwgroups_np( - int arg0, - ffi.Pointer arg1, + int CFMachPortIsValid( + CFMachPortRef port, ) { - return _setwgroups_np( - arg0, - arg1, + return _CFMachPortIsValid( + port, ); } - late final _setwgroups_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, ffi.Pointer)>>('setwgroups_np'); - late final _setwgroups_np = _setwgroups_npPtr - .asFunction)>(); + late final _CFMachPortIsValidPtr = + _lookup>( + 'CFMachPortIsValid'); + late final _CFMachPortIsValid = + _CFMachPortIsValidPtr.asFunction(); - int strtofflags( - ffi.Pointer> arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, + CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack( + CFMachPortRef port, ) { - return _strtofflags( - arg0, - arg1, - arg2, + return _CFMachPortGetInvalidationCallBack( + port, ); } - late final _strtofflagsPtr = _lookup< + late final _CFMachPortGetInvalidationCallBackPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer)>>('strtofflags'); - late final _strtofflags = _strtofflagsPtr.asFunction< - int Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>(); + CFMachPortInvalidationCallBack Function( + CFMachPortRef)>>('CFMachPortGetInvalidationCallBack'); + late final _CFMachPortGetInvalidationCallBack = + _CFMachPortGetInvalidationCallBackPtr.asFunction< + CFMachPortInvalidationCallBack Function(CFMachPortRef)>(); - int swapon( - ffi.Pointer arg0, + void CFMachPortSetInvalidationCallBack( + CFMachPortRef port, + CFMachPortInvalidationCallBack callout, ) { - return _swapon( - arg0, + return _CFMachPortSetInvalidationCallBack( + port, + callout, ); } - late final _swaponPtr = - _lookup)>>( - 'swapon'); - late final _swapon = - _swaponPtr.asFunction)>(); + late final _CFMachPortSetInvalidationCallBackPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFMachPortRef, CFMachPortInvalidationCallBack)>>( + 'CFMachPortSetInvalidationCallBack'); + late final _CFMachPortSetInvalidationCallBack = + _CFMachPortSetInvalidationCallBackPtr.asFunction< + void Function(CFMachPortRef, CFMachPortInvalidationCallBack)>(); - int ttyslot() { - return _ttyslot(); + CFRunLoopSourceRef CFMachPortCreateRunLoopSource( + CFAllocatorRef allocator, + CFMachPortRef port, + int order, + ) { + return _CFMachPortCreateRunLoopSource( + allocator, + port, + order, + ); } - late final _ttyslotPtr = - _lookup>('ttyslot'); - late final _ttyslot = _ttyslotPtr.asFunction(); + late final _CFMachPortCreateRunLoopSourcePtr = _lookup< + ffi.NativeFunction< + CFRunLoopSourceRef Function(CFAllocatorRef, CFMachPortRef, + CFIndex)>>('CFMachPortCreateRunLoopSource'); + late final _CFMachPortCreateRunLoopSource = + _CFMachPortCreateRunLoopSourcePtr.asFunction< + CFRunLoopSourceRef Function(CFAllocatorRef, CFMachPortRef, int)>(); - int undelete( - ffi.Pointer arg0, - ) { - return _undelete( - arg0, - ); + int CFAttributedStringGetTypeID() { + return _CFAttributedStringGetTypeID(); } - late final _undeletePtr = - _lookup)>>( - 'undelete'); - late final _undelete = - _undeletePtr.asFunction)>(); + late final _CFAttributedStringGetTypeIDPtr = + _lookup>( + 'CFAttributedStringGetTypeID'); + late final _CFAttributedStringGetTypeID = + _CFAttributedStringGetTypeIDPtr.asFunction(); - int unwhiteout( - ffi.Pointer arg0, + CFAttributedStringRef CFAttributedStringCreate( + CFAllocatorRef alloc, + CFStringRef str, + CFDictionaryRef attributes, ) { - return _unwhiteout( - arg0, + return _CFAttributedStringCreate( + alloc, + str, + attributes, ); } - late final _unwhiteoutPtr = - _lookup)>>( - 'unwhiteout'); - late final _unwhiteout = - _unwhiteoutPtr.asFunction)>(); + late final _CFAttributedStringCreatePtr = _lookup< + ffi.NativeFunction< + CFAttributedStringRef Function(CFAllocatorRef, CFStringRef, + CFDictionaryRef)>>('CFAttributedStringCreate'); + late final _CFAttributedStringCreate = + _CFAttributedStringCreatePtr.asFunction< + CFAttributedStringRef Function( + CFAllocatorRef, CFStringRef, CFDictionaryRef)>(); - int syscall( - int arg0, + CFAttributedStringRef CFAttributedStringCreateWithSubstring( + CFAllocatorRef alloc, + CFAttributedStringRef aStr, + CFRange range, ) { - return _syscall( - arg0, + return _CFAttributedStringCreateWithSubstring( + alloc, + aStr, + range, ); } - late final _syscallPtr = - _lookup>('syscall'); - late final _syscall = _syscallPtr.asFunction(); + late final _CFAttributedStringCreateWithSubstringPtr = _lookup< + ffi.NativeFunction< + CFAttributedStringRef Function(CFAllocatorRef, CFAttributedStringRef, + CFRange)>>('CFAttributedStringCreateWithSubstring'); + late final _CFAttributedStringCreateWithSubstring = + _CFAttributedStringCreateWithSubstringPtr.asFunction< + CFAttributedStringRef Function( + CFAllocatorRef, CFAttributedStringRef, CFRange)>(); - int fgetattrlist( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, + CFAttributedStringRef CFAttributedStringCreateCopy( + CFAllocatorRef alloc, + CFAttributedStringRef aStr, ) { - return _fgetattrlist( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFAttributedStringCreateCopy( + alloc, + aStr, ); } - late final _fgetattrlistPtr = _lookup< + late final _CFAttributedStringCreateCopyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.UnsignedInt)>>('fgetattrlist'); - late final _fgetattrlist = _fgetattrlistPtr.asFunction< - int Function( - int, ffi.Pointer, ffi.Pointer, int, int)>(); + CFAttributedStringRef Function(CFAllocatorRef, + CFAttributedStringRef)>>('CFAttributedStringCreateCopy'); + late final _CFAttributedStringCreateCopy = + _CFAttributedStringCreateCopyPtr.asFunction< + CFAttributedStringRef Function( + CFAllocatorRef, CFAttributedStringRef)>(); - int fsetattrlist( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, + CFStringRef CFAttributedStringGetString( + CFAttributedStringRef aStr, ) { - return _fsetattrlist( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFAttributedStringGetString( + aStr, ); } - late final _fsetattrlistPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.UnsignedInt)>>('fsetattrlist'); - late final _fsetattrlist = _fsetattrlistPtr.asFunction< - int Function( - int, ffi.Pointer, ffi.Pointer, int, int)>(); + late final _CFAttributedStringGetStringPtr = + _lookup>( + 'CFAttributedStringGetString'); + late final _CFAttributedStringGetString = _CFAttributedStringGetStringPtr + .asFunction(); - int getattrlist( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, + int CFAttributedStringGetLength( + CFAttributedStringRef aStr, ) { - return _getattrlist( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFAttributedStringGetLength( + aStr, ); } - late final _getattrlistPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.UnsignedInt)>>('getattrlist'); - late final _getattrlist = _getattrlistPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + late final _CFAttributedStringGetLengthPtr = + _lookup>( + 'CFAttributedStringGetLength'); + late final _CFAttributedStringGetLength = _CFAttributedStringGetLengthPtr + .asFunction(); - int setattrlist( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, + CFDictionaryRef CFAttributedStringGetAttributes( + CFAttributedStringRef aStr, + int loc, + ffi.Pointer effectiveRange, ) { - return _setattrlist( - arg0, - arg1, - arg2, - arg3, - arg4, + return _CFAttributedStringGetAttributes( + aStr, + loc, + effectiveRange, ); } - late final _setattrlistPtr = _lookup< + late final _CFAttributedStringGetAttributesPtr = _lookup< ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.UnsignedInt)>>('setattrlist'); - late final _setattrlist = _setattrlistPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + CFDictionaryRef Function(CFAttributedStringRef, CFIndex, + ffi.Pointer)>>('CFAttributedStringGetAttributes'); + late final _CFAttributedStringGetAttributes = + _CFAttributedStringGetAttributesPtr.asFunction< + CFDictionaryRef Function( + CFAttributedStringRef, int, ffi.Pointer)>(); - int exchangedata( - ffi.Pointer arg0, - ffi.Pointer arg1, - int arg2, + CFTypeRef CFAttributedStringGetAttribute( + CFAttributedStringRef aStr, + int loc, + CFStringRef attrName, + ffi.Pointer effectiveRange, ) { - return _exchangedata( - arg0, - arg1, - arg2, + return _CFAttributedStringGetAttribute( + aStr, + loc, + attrName, + effectiveRange, ); } - late final _exchangedataPtr = _lookup< + late final _CFAttributedStringGetAttributePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.UnsignedInt)>>('exchangedata'); - late final _exchangedata = _exchangedataPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + CFTypeRef Function(CFAttributedStringRef, CFIndex, CFStringRef, + ffi.Pointer)>>('CFAttributedStringGetAttribute'); + late final _CFAttributedStringGetAttribute = + _CFAttributedStringGetAttributePtr.asFunction< + CFTypeRef Function( + CFAttributedStringRef, int, CFStringRef, ffi.Pointer)>(); - int getdirentriesattr( - int arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - ffi.Pointer arg4, - ffi.Pointer arg5, - ffi.Pointer arg6, - int arg7, + CFDictionaryRef CFAttributedStringGetAttributesAndLongestEffectiveRange( + CFAttributedStringRef aStr, + int loc, + CFRange inRange, + ffi.Pointer longestEffectiveRange, ) { - return _getdirentriesattr( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, - arg6, - arg7, + return _CFAttributedStringGetAttributesAndLongestEffectiveRange( + aStr, + loc, + inRange, + longestEffectiveRange, ); } - late final _getdirentriesattrPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Int, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt)>>('getdirentriesattr'); - late final _getdirentriesattr = _getdirentriesattrPtr.asFunction< - int Function( - int, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); + late final _CFAttributedStringGetAttributesAndLongestEffectiveRangePtr = + _lookup< + ffi.NativeFunction< + CFDictionaryRef Function(CFAttributedStringRef, CFIndex, + CFRange, ffi.Pointer)>>( + 'CFAttributedStringGetAttributesAndLongestEffectiveRange'); + late final _CFAttributedStringGetAttributesAndLongestEffectiveRange = + _CFAttributedStringGetAttributesAndLongestEffectiveRangePtr.asFunction< + CFDictionaryRef Function( + CFAttributedStringRef, int, CFRange, ffi.Pointer)>(); - int searchfs( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2, - int arg3, - int arg4, - ffi.Pointer arg5, + CFTypeRef CFAttributedStringGetAttributeAndLongestEffectiveRange( + CFAttributedStringRef aStr, + int loc, + CFStringRef attrName, + CFRange inRange, + ffi.Pointer longestEffectiveRange, ) { - return _searchfs( - arg0, - arg1, - arg2, - arg3, - arg4, - arg5, + return _CFAttributedStringGetAttributeAndLongestEffectiveRange( + aStr, + loc, + attrName, + inRange, + longestEffectiveRange, ); } - late final _searchfsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.UnsignedInt, - ffi.Pointer)>>('searchfs'); - late final _searchfs = _searchfsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int, ffi.Pointer)>(); + late final _CFAttributedStringGetAttributeAndLongestEffectiveRangePtr = + _lookup< + ffi.NativeFunction< + CFTypeRef Function(CFAttributedStringRef, CFIndex, + CFStringRef, CFRange, ffi.Pointer)>>( + 'CFAttributedStringGetAttributeAndLongestEffectiveRange'); + late final _CFAttributedStringGetAttributeAndLongestEffectiveRange = + _CFAttributedStringGetAttributeAndLongestEffectiveRangePtr.asFunction< + CFTypeRef Function(CFAttributedStringRef, int, CFStringRef, CFRange, + ffi.Pointer)>(); - int fsctl( - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2, - int arg3, + CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy( + CFAllocatorRef alloc, + int maxLength, + CFAttributedStringRef aStr, ) { - return _fsctl( - arg0, - arg1, - arg2, - arg3, + return _CFAttributedStringCreateMutableCopy( + alloc, + maxLength, + aStr, ); } - late final _fsctlPtr = _lookup< + late final _CFAttributedStringCreateMutableCopyPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.UnsignedLong, - ffi.Pointer, ffi.UnsignedInt)>>('fsctl'); - late final _fsctl = _fsctlPtr.asFunction< - int Function(ffi.Pointer, int, ffi.Pointer, int)>(); + CFMutableAttributedStringRef Function(CFAllocatorRef, CFIndex, + CFAttributedStringRef)>>('CFAttributedStringCreateMutableCopy'); + late final _CFAttributedStringCreateMutableCopy = + _CFAttributedStringCreateMutableCopyPtr.asFunction< + CFMutableAttributedStringRef Function( + CFAllocatorRef, int, CFAttributedStringRef)>(); - int ffsctl( - int arg0, - int arg1, - ffi.Pointer arg2, - int arg3, + CFMutableAttributedStringRef CFAttributedStringCreateMutable( + CFAllocatorRef alloc, + int maxLength, ) { - return _ffsctl( - arg0, - arg1, - arg2, - arg3, + return _CFAttributedStringCreateMutable( + alloc, + maxLength, ); } - late final _ffsctlPtr = _lookup< + late final _CFAttributedStringCreateMutablePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.UnsignedLong, ffi.Pointer, - ffi.UnsignedInt)>>('ffsctl'); - late final _ffsctl = _ffsctlPtr - .asFunction, int)>(); + CFMutableAttributedStringRef Function( + CFAllocatorRef, CFIndex)>>('CFAttributedStringCreateMutable'); + late final _CFAttributedStringCreateMutable = + _CFAttributedStringCreateMutablePtr.asFunction< + CFMutableAttributedStringRef Function(CFAllocatorRef, int)>(); - int fsync_volume_np( - int arg0, - int arg1, + void CFAttributedStringReplaceString( + CFMutableAttributedStringRef aStr, + CFRange range, + CFStringRef replacement, ) { - return _fsync_volume_np( - arg0, - arg1, + return _CFAttributedStringReplaceString( + aStr, + range, + replacement, ); } - late final _fsync_volume_npPtr = - _lookup>( - 'fsync_volume_np'); - late final _fsync_volume_np = - _fsync_volume_npPtr.asFunction(); + late final _CFAttributedStringReplaceStringPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableAttributedStringRef, CFRange, + CFStringRef)>>('CFAttributedStringReplaceString'); + late final _CFAttributedStringReplaceString = + _CFAttributedStringReplaceStringPtr.asFunction< + void Function(CFMutableAttributedStringRef, CFRange, CFStringRef)>(); - int sync_volume_np( - ffi.Pointer arg0, - int arg1, + CFMutableStringRef CFAttributedStringGetMutableString( + CFMutableAttributedStringRef aStr, ) { - return _sync_volume_np( - arg0, - arg1, + return _CFAttributedStringGetMutableString( + aStr, ); } - late final _sync_volume_npPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'sync_volume_np'); - late final _sync_volume_np = - _sync_volume_npPtr.asFunction, int)>(); - - late final ffi.Pointer _optreset = _lookup('optreset'); - - int get optreset => _optreset.value; - - set optreset(int value) => _optreset.value = value; + late final _CFAttributedStringGetMutableStringPtr = _lookup< + ffi.NativeFunction< + CFMutableStringRef Function(CFMutableAttributedStringRef)>>( + 'CFAttributedStringGetMutableString'); + late final _CFAttributedStringGetMutableString = + _CFAttributedStringGetMutableStringPtr.asFunction< + CFMutableStringRef Function(CFMutableAttributedStringRef)>(); - int open( - ffi.Pointer arg0, - int arg1, + void CFAttributedStringSetAttributes( + CFMutableAttributedStringRef aStr, + CFRange range, + CFDictionaryRef replacement, + int clearOtherAttributes, ) { - return _open( - arg0, - arg1, + return _CFAttributedStringSetAttributes( + aStr, + range, + replacement, + clearOtherAttributes, ); } - late final _openPtr = _lookup< - ffi.NativeFunction, ffi.Int)>>( - 'open'); - late final _open = - _openPtr.asFunction, int)>(); + late final _CFAttributedStringSetAttributesPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableAttributedStringRef, CFRange, + CFDictionaryRef, Boolean)>>('CFAttributedStringSetAttributes'); + late final _CFAttributedStringSetAttributes = + _CFAttributedStringSetAttributesPtr.asFunction< + void Function( + CFMutableAttributedStringRef, CFRange, CFDictionaryRef, int)>(); - int openat( - int arg0, - ffi.Pointer arg1, - int arg2, + void CFAttributedStringSetAttribute( + CFMutableAttributedStringRef aStr, + CFRange range, + CFStringRef attrName, + CFTypeRef value, ) { - return _openat( - arg0, - arg1, - arg2, + return _CFAttributedStringSetAttribute( + aStr, + range, + attrName, + value, ); } - late final _openatPtr = _lookup< + late final _CFAttributedStringSetAttributePtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int)>>('openat'); - late final _openat = - _openatPtr.asFunction, int)>(); + ffi.Void Function(CFMutableAttributedStringRef, CFRange, CFStringRef, + CFTypeRef)>>('CFAttributedStringSetAttribute'); + late final _CFAttributedStringSetAttribute = + _CFAttributedStringSetAttributePtr.asFunction< + void Function( + CFMutableAttributedStringRef, CFRange, CFStringRef, CFTypeRef)>(); - int creat( - ffi.Pointer arg0, - int arg1, + void CFAttributedStringRemoveAttribute( + CFMutableAttributedStringRef aStr, + CFRange range, + CFStringRef attrName, ) { - return _creat( - arg0, - arg1, + return _CFAttributedStringRemoveAttribute( + aStr, + range, + attrName, ); } - late final _creatPtr = _lookup< - ffi.NativeFunction, mode_t)>>( - 'creat'); - late final _creat = - _creatPtr.asFunction, int)>(); + late final _CFAttributedStringRemoveAttributePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableAttributedStringRef, CFRange, + CFStringRef)>>('CFAttributedStringRemoveAttribute'); + late final _CFAttributedStringRemoveAttribute = + _CFAttributedStringRemoveAttributePtr.asFunction< + void Function(CFMutableAttributedStringRef, CFRange, CFStringRef)>(); - int fcntl( - int arg0, - int arg1, + void CFAttributedStringReplaceAttributedString( + CFMutableAttributedStringRef aStr, + CFRange range, + CFAttributedStringRef replacement, ) { - return _fcntl( - arg0, - arg1, + return _CFAttributedStringReplaceAttributedString( + aStr, + range, + replacement, ); } - late final _fcntlPtr = - _lookup>('fcntl'); - late final _fcntl = _fcntlPtr.asFunction(); + late final _CFAttributedStringReplaceAttributedStringPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFMutableAttributedStringRef, CFRange, + CFAttributedStringRef)>>( + 'CFAttributedStringReplaceAttributedString'); + late final _CFAttributedStringReplaceAttributedString = + _CFAttributedStringReplaceAttributedStringPtr.asFunction< + void Function( + CFMutableAttributedStringRef, CFRange, CFAttributedStringRef)>(); - int openx_np( - ffi.Pointer arg0, - int arg1, - filesec_t arg2, + void CFAttributedStringBeginEditing( + CFMutableAttributedStringRef aStr, ) { - return _openx_np( - arg0, - arg1, - arg2, + return _CFAttributedStringBeginEditing( + aStr, ); } - late final _openx_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int, filesec_t)>>('openx_np'); - late final _openx_np = _openx_npPtr - .asFunction, int, filesec_t)>(); + late final _CFAttributedStringBeginEditingPtr = _lookup< + ffi.NativeFunction>( + 'CFAttributedStringBeginEditing'); + late final _CFAttributedStringBeginEditing = + _CFAttributedStringBeginEditingPtr.asFunction< + void Function(CFMutableAttributedStringRef)>(); - int open_dprotected_np( - ffi.Pointer arg0, - int arg1, - int arg2, - int arg3, + void CFAttributedStringEndEditing( + CFMutableAttributedStringRef aStr, ) { - return _open_dprotected_np( - arg0, - arg1, - arg2, - arg3, + return _CFAttributedStringEndEditing( + aStr, ); } - late final _open_dprotected_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Int, ffi.Int, - ffi.Int)>>('open_dprotected_np'); - late final _open_dprotected_np = _open_dprotected_npPtr - .asFunction, int, int, int)>(); + late final _CFAttributedStringEndEditingPtr = _lookup< + ffi.NativeFunction>( + 'CFAttributedStringEndEditing'); + late final _CFAttributedStringEndEditing = _CFAttributedStringEndEditingPtr + .asFunction(); - int openat_dprotected_np( - int arg0, - ffi.Pointer arg1, - int arg2, - int arg3, - int arg4, - ) { - return _openat_dprotected_np( - arg0, - arg1, - arg2, - arg3, - arg4, - ); + int CFURLEnumeratorGetTypeID() { + return _CFURLEnumeratorGetTypeID(); } - late final _openat_dprotected_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, ffi.Int, - ffi.Int)>>('openat_dprotected_np'); - late final _openat_dprotected_np = _openat_dprotected_npPtr - .asFunction, int, int, int)>(); + late final _CFURLEnumeratorGetTypeIDPtr = + _lookup>( + 'CFURLEnumeratorGetTypeID'); + late final _CFURLEnumeratorGetTypeID = + _CFURLEnumeratorGetTypeIDPtr.asFunction(); - int openat_authenticated_np( - int arg0, - ffi.Pointer arg1, - int arg2, - int arg3, + CFURLEnumeratorRef CFURLEnumeratorCreateForDirectoryURL( + CFAllocatorRef alloc, + CFURLRef directoryURL, + CFURLEnumeratorOptions option, + CFArrayRef propertyKeys, ) { - return _openat_authenticated_np( - arg0, - arg1, - arg2, - arg3, + return _CFURLEnumeratorCreateForDirectoryURL( + alloc, + directoryURL, + option.value, + propertyKeys, ); } - late final _openat_authenticated_npPtr = _lookup< + late final _CFURLEnumeratorCreateForDirectoryURLPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Int, ffi.Pointer, ffi.Int, - ffi.Int)>>('openat_authenticated_np'); - late final _openat_authenticated_np = _openat_authenticated_npPtr - .asFunction, int, int)>(); + CFURLEnumeratorRef Function(CFAllocatorRef, CFURLRef, CFOptionFlags, + CFArrayRef)>>('CFURLEnumeratorCreateForDirectoryURL'); + late final _CFURLEnumeratorCreateForDirectoryURL = + _CFURLEnumeratorCreateForDirectoryURLPtr.asFunction< + CFURLEnumeratorRef Function( + CFAllocatorRef, CFURLRef, int, CFArrayRef)>(); - int flock1( - int arg0, - int arg1, + CFURLEnumeratorRef CFURLEnumeratorCreateForMountedVolumes( + CFAllocatorRef alloc, + CFURLEnumeratorOptions option, + CFArrayRef propertyKeys, ) { - return _flock1( - arg0, - arg1, + return _CFURLEnumeratorCreateForMountedVolumes( + alloc, + option.value, + propertyKeys, ); } - late final _flock1Ptr = - _lookup>('flock'); - late final _flock1 = _flock1Ptr.asFunction(); + late final _CFURLEnumeratorCreateForMountedVolumesPtr = _lookup< + ffi.NativeFunction< + CFURLEnumeratorRef Function(CFAllocatorRef, CFOptionFlags, + CFArrayRef)>>('CFURLEnumeratorCreateForMountedVolumes'); + late final _CFURLEnumeratorCreateForMountedVolumes = + _CFURLEnumeratorCreateForMountedVolumesPtr.asFunction< + CFURLEnumeratorRef Function(CFAllocatorRef, int, CFArrayRef)>(); - filesec_t filesec_init() { - return _filesec_init(); + CFURLEnumeratorResult CFURLEnumeratorGetNextURL( + CFURLEnumeratorRef enumerator, + ffi.Pointer url, + ffi.Pointer error, + ) { + return CFURLEnumeratorResult.fromValue(_CFURLEnumeratorGetNextURL( + enumerator, + url, + error, + )); } - late final _filesec_initPtr = - _lookup>('filesec_init'); - late final _filesec_init = - _filesec_initPtr.asFunction(); + late final _CFURLEnumeratorGetNextURLPtr = _lookup< + ffi.NativeFunction< + CFIndex Function(CFURLEnumeratorRef, ffi.Pointer, + ffi.Pointer)>>('CFURLEnumeratorGetNextURL'); + late final _CFURLEnumeratorGetNextURL = + _CFURLEnumeratorGetNextURLPtr.asFunction< + int Function(CFURLEnumeratorRef, ffi.Pointer, + ffi.Pointer)>(); - filesec_t filesec_dup( - filesec_t arg0, + void CFURLEnumeratorSkipDescendents( + CFURLEnumeratorRef enumerator, ) { - return _filesec_dup( - arg0, + return _CFURLEnumeratorSkipDescendents( + enumerator, ); } - late final _filesec_dupPtr = - _lookup>('filesec_dup'); - late final _filesec_dup = - _filesec_dupPtr.asFunction(); + late final _CFURLEnumeratorSkipDescendentsPtr = + _lookup>( + 'CFURLEnumeratorSkipDescendents'); + late final _CFURLEnumeratorSkipDescendents = + _CFURLEnumeratorSkipDescendentsPtr.asFunction< + void Function(CFURLEnumeratorRef)>(); - void filesec_free( - filesec_t arg0, + int CFURLEnumeratorGetDescendentLevel( + CFURLEnumeratorRef enumerator, ) { - return _filesec_free( - arg0, + return _CFURLEnumeratorGetDescendentLevel( + enumerator, ); } - late final _filesec_freePtr = - _lookup>('filesec_free'); - late final _filesec_free = - _filesec_freePtr.asFunction(); + late final _CFURLEnumeratorGetDescendentLevelPtr = + _lookup>( + 'CFURLEnumeratorGetDescendentLevel'); + late final _CFURLEnumeratorGetDescendentLevel = + _CFURLEnumeratorGetDescendentLevelPtr.asFunction< + int Function(CFURLEnumeratorRef)>(); - int filesec_get_property( - filesec_t arg0, - int arg1, - ffi.Pointer arg2, + int CFURLEnumeratorGetSourceDidChange( + CFURLEnumeratorRef enumerator, ) { - return _filesec_get_property( - arg0, - arg1, - arg2, + return _CFURLEnumeratorGetSourceDidChange( + enumerator, ); } - late final _filesec_get_propertyPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(filesec_t, ffi.Int32, - ffi.Pointer)>>('filesec_get_property'); - late final _filesec_get_property = _filesec_get_propertyPtr - .asFunction)>(); + late final _CFURLEnumeratorGetSourceDidChangePtr = + _lookup>( + 'CFURLEnumeratorGetSourceDidChange'); + late final _CFURLEnumeratorGetSourceDidChange = + _CFURLEnumeratorGetSourceDidChangePtr.asFunction< + int Function(CFURLEnumeratorRef)>(); - int filesec_query_property( - filesec_t arg0, - int arg1, - ffi.Pointer arg2, + acl_t acl_dup( + acl_t acl, ) { - return _filesec_query_property( - arg0, - arg1, - arg2, + return _acl_dup( + acl, ); } - late final _filesec_query_propertyPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(filesec_t, ffi.Int32, - ffi.Pointer)>>('filesec_query_property'); - late final _filesec_query_property = _filesec_query_propertyPtr - .asFunction)>(); + late final _acl_dupPtr = + _lookup>('acl_dup'); + late final _acl_dup = _acl_dupPtr.asFunction(); - int filesec_set_property( - filesec_t arg0, - int arg1, - ffi.Pointer arg2, + int acl_free( + ffi.Pointer obj_p, ) { - return _filesec_set_property( - arg0, - arg1, - arg2, + return _acl_free( + obj_p, ); } - late final _filesec_set_propertyPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(filesec_t, ffi.Int32, - ffi.Pointer)>>('filesec_set_property'); - late final _filesec_set_property = _filesec_set_propertyPtr - .asFunction)>(); + late final _acl_freePtr = + _lookup)>>( + 'acl_free'); + late final _acl_free = + _acl_freePtr.asFunction)>(); - int filesec_unset_property( - filesec_t arg0, - int arg1, + acl_t acl_init( + int count, ) { - return _filesec_unset_property( - arg0, - arg1, + return _acl_init( + count, ); } - late final _filesec_unset_propertyPtr = - _lookup>( - 'filesec_unset_property'); - late final _filesec_unset_property = - _filesec_unset_propertyPtr.asFunction(); + late final _acl_initPtr = + _lookup>('acl_init'); + late final _acl_init = _acl_initPtr.asFunction(); - int os_workgroup_copy_port( - os_workgroup_t wg, - ffi.Pointer mach_port_out, + int acl_copy_entry( + acl_entry_t dest_d, + acl_entry_t src_d, ) { - return _os_workgroup_copy_port( - wg, - mach_port_out, + return _acl_copy_entry( + dest_d, + src_d, ); } - late final _os_workgroup_copy_portPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(os_workgroup_t, - ffi.Pointer)>>('os_workgroup_copy_port'); - late final _os_workgroup_copy_port = _os_workgroup_copy_portPtr - .asFunction)>(); + late final _acl_copy_entryPtr = + _lookup>( + 'acl_copy_entry'); + late final _acl_copy_entry = + _acl_copy_entryPtr.asFunction(); - os_workgroup_t os_workgroup_create_with_port( - ffi.Pointer name, - int mach_port, + int acl_create_entry( + ffi.Pointer acl_p, + ffi.Pointer entry_p, ) { - return _os_workgroup_create_with_port( - name, - mach_port, + return _acl_create_entry( + acl_p, + entry_p, ); } - late final _os_workgroup_create_with_portPtr = _lookup< + late final _acl_create_entryPtr = _lookup< ffi.NativeFunction< - os_workgroup_t Function(ffi.Pointer, - mach_port_t)>>('os_workgroup_create_with_port'); - late final _os_workgroup_create_with_port = _os_workgroup_create_with_portPtr - .asFunction, int)>(); + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('acl_create_entry'); + late final _acl_create_entry = _acl_create_entryPtr + .asFunction, ffi.Pointer)>(); - os_workgroup_t os_workgroup_create_with_workgroup( - ffi.Pointer name, - os_workgroup_t wg, + int acl_create_entry_np( + ffi.Pointer acl_p, + ffi.Pointer entry_p, + int entry_index, ) { - return _os_workgroup_create_with_workgroup( - name, - wg, + return _acl_create_entry_np( + acl_p, + entry_p, + entry_index, ); } - late final _os_workgroup_create_with_workgroupPtr = _lookup< + late final _acl_create_entry_npPtr = _lookup< ffi.NativeFunction< - os_workgroup_t Function(ffi.Pointer, - os_workgroup_t)>>('os_workgroup_create_with_workgroup'); - late final _os_workgroup_create_with_workgroup = - _os_workgroup_create_with_workgroupPtr.asFunction< - os_workgroup_t Function(ffi.Pointer, os_workgroup_t)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('acl_create_entry_np'); + late final _acl_create_entry_np = _acl_create_entry_npPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - int os_workgroup_join( - os_workgroup_t wg, - os_workgroup_join_token_t token_out, + int acl_delete_entry( + acl_t acl, + acl_entry_t entry_d, ) { - return _os_workgroup_join( - wg, - token_out, + return _acl_delete_entry( + acl, + entry_d, ); } - late final _os_workgroup_joinPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - os_workgroup_t, os_workgroup_join_token_t)>>('os_workgroup_join'); - late final _os_workgroup_join = _os_workgroup_joinPtr - .asFunction(); + late final _acl_delete_entryPtr = + _lookup>( + 'acl_delete_entry'); + late final _acl_delete_entry = + _acl_delete_entryPtr.asFunction(); - void os_workgroup_leave( - os_workgroup_t wg, - os_workgroup_join_token_t token, + int acl_get_entry( + acl_t acl, + int entry_id, + ffi.Pointer entry_p, ) { - return _os_workgroup_leave( - wg, - token, + return _acl_get_entry( + acl, + entry_id, + entry_p, ); } - late final _os_workgroup_leavePtr = _lookup< + late final _acl_get_entryPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(os_workgroup_t, - os_workgroup_join_token_t)>>('os_workgroup_leave'); - late final _os_workgroup_leave = _os_workgroup_leavePtr - .asFunction(); + ffi.Int Function( + acl_t, ffi.Int, ffi.Pointer)>>('acl_get_entry'); + late final _acl_get_entry = _acl_get_entryPtr + .asFunction)>(); - int os_workgroup_set_working_arena( - os_workgroup_t wg, - ffi.Pointer arena, - int max_workers, - os_workgroup_working_arena_destructor_t destructor, + int acl_valid( + acl_t acl, ) { - return _os_workgroup_set_working_arena( - wg, - arena, - max_workers, - destructor, + return _acl_valid( + acl, ); } - late final _os_workgroup_set_working_arenaPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(os_workgroup_t, ffi.Pointer, - ffi.Uint32, os_workgroup_working_arena_destructor_t)>>( - 'os_workgroup_set_working_arena'); - late final _os_workgroup_set_working_arena = - _os_workgroup_set_working_arenaPtr.asFunction< - int Function(os_workgroup_t, ffi.Pointer, int, - os_workgroup_working_arena_destructor_t)>(); + late final _acl_validPtr = + _lookup>('acl_valid'); + late final _acl_valid = _acl_validPtr.asFunction(); - ffi.Pointer os_workgroup_get_working_arena( - os_workgroup_t wg, - ffi.Pointer index_out, + int acl_valid_fd_np( + int fd, + acl_type_t type, + acl_t acl, ) { - return _os_workgroup_get_working_arena( - wg, - index_out, + return _acl_valid_fd_np( + fd, + type.value, + acl, ); } - late final _os_workgroup_get_working_arenaPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - os_workgroup_t, ffi.Pointer)>>( - 'os_workgroup_get_working_arena'); - late final _os_workgroup_get_working_arena = - _os_workgroup_get_working_arenaPtr.asFunction< - ffi.Pointer Function( - os_workgroup_t, ffi.Pointer)>(); + late final _acl_valid_fd_npPtr = _lookup< + ffi + .NativeFunction>( + 'acl_valid_fd_np'); + late final _acl_valid_fd_np = + _acl_valid_fd_npPtr.asFunction(); - void os_workgroup_cancel( - os_workgroup_t wg, + int acl_valid_file_np( + ffi.Pointer path, + acl_type_t type, + acl_t acl, ) { - return _os_workgroup_cancel( - wg, + return _acl_valid_file_np( + path, + type.value, + acl, ); } - late final _os_workgroup_cancelPtr = - _lookup>( - 'os_workgroup_cancel'); - late final _os_workgroup_cancel = - _os_workgroup_cancelPtr.asFunction(); + late final _acl_valid_file_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.UnsignedInt, + acl_t)>>('acl_valid_file_np'); + late final _acl_valid_file_np = _acl_valid_file_npPtr + .asFunction, int, acl_t)>(); - bool os_workgroup_testcancel( - os_workgroup_t wg, + int acl_valid_link_np( + ffi.Pointer path, + acl_type_t type, + acl_t acl, ) { - return _os_workgroup_testcancel( - wg, + return _acl_valid_link_np( + path, + type.value, + acl, ); } - late final _os_workgroup_testcancelPtr = - _lookup>( - 'os_workgroup_testcancel'); - late final _os_workgroup_testcancel = - _os_workgroup_testcancelPtr.asFunction(); + late final _acl_valid_link_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.UnsignedInt, + acl_t)>>('acl_valid_link_np'); + late final _acl_valid_link_np = _acl_valid_link_npPtr + .asFunction, int, acl_t)>(); - int os_workgroup_max_parallel_threads( - os_workgroup_t wg, - os_workgroup_mpt_attr_t attr, + int acl_add_perm( + acl_permset_t permset_d, + acl_perm_t perm, ) { - return _os_workgroup_max_parallel_threads( - wg, - attr, + return _acl_add_perm( + permset_d, + perm.value, ); } - late final _os_workgroup_max_parallel_threadsPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(os_workgroup_t, - os_workgroup_mpt_attr_t)>>('os_workgroup_max_parallel_threads'); - late final _os_workgroup_max_parallel_threads = - _os_workgroup_max_parallel_threadsPtr - .asFunction(); + late final _acl_add_permPtr = _lookup< + ffi.NativeFunction>( + 'acl_add_perm'); + late final _acl_add_perm = + _acl_add_permPtr.asFunction(); - int os_workgroup_interval_start( - os_workgroup_interval_t wg, - int start, - int deadline, - os_workgroup_interval_data_t data, + int acl_calc_mask( + ffi.Pointer acl_p, ) { - return _os_workgroup_interval_start( - wg, - start, - deadline, - data, + return _acl_calc_mask( + acl_p, ); } - late final _os_workgroup_interval_startPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(os_workgroup_interval_t, ffi.Uint64, ffi.Uint64, - os_workgroup_interval_data_t)>>('os_workgroup_interval_start'); - late final _os_workgroup_interval_start = - _os_workgroup_interval_startPtr.asFunction< - int Function(os_workgroup_interval_t, int, int, - os_workgroup_interval_data_t)>(); + late final _acl_calc_maskPtr = + _lookup)>>( + 'acl_calc_mask'); + late final _acl_calc_mask = + _acl_calc_maskPtr.asFunction)>(); - int os_workgroup_interval_update( - os_workgroup_interval_t wg, - int deadline, - os_workgroup_interval_data_t data, + int acl_clear_perms( + acl_permset_t permset_d, ) { - return _os_workgroup_interval_update( - wg, - deadline, - data, + return _acl_clear_perms( + permset_d, ); } - late final _os_workgroup_interval_updatePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(os_workgroup_interval_t, ffi.Uint64, - os_workgroup_interval_data_t)>>('os_workgroup_interval_update'); - late final _os_workgroup_interval_update = - _os_workgroup_interval_updatePtr.asFunction< - int Function( - os_workgroup_interval_t, int, os_workgroup_interval_data_t)>(); + late final _acl_clear_permsPtr = + _lookup>( + 'acl_clear_perms'); + late final _acl_clear_perms = + _acl_clear_permsPtr.asFunction(); - int os_workgroup_interval_finish( - os_workgroup_interval_t wg, - os_workgroup_interval_data_t data, + int acl_delete_perm( + acl_permset_t permset_d, + acl_perm_t perm, ) { - return _os_workgroup_interval_finish( - wg, - data, + return _acl_delete_perm( + permset_d, + perm.value, ); } - late final _os_workgroup_interval_finishPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(os_workgroup_interval_t, - os_workgroup_interval_data_t)>>('os_workgroup_interval_finish'); - late final _os_workgroup_interval_finish = - _os_workgroup_interval_finishPtr.asFunction< - int Function( - os_workgroup_interval_t, os_workgroup_interval_data_t)>(); + late final _acl_delete_permPtr = _lookup< + ffi.NativeFunction>( + 'acl_delete_perm'); + late final _acl_delete_perm = + _acl_delete_permPtr.asFunction(); - os_workgroup_parallel_t os_workgroup_parallel_create( - ffi.Pointer name, - os_workgroup_attr_t attr, + int acl_get_perm_np( + acl_permset_t permset_d, + acl_perm_t perm, ) { - return _os_workgroup_parallel_create( - name, - attr, + return _acl_get_perm_np( + permset_d, + perm.value, ); } - late final _os_workgroup_parallel_createPtr = _lookup< - ffi.NativeFunction< - os_workgroup_parallel_t Function(ffi.Pointer, - os_workgroup_attr_t)>>('os_workgroup_parallel_create'); - late final _os_workgroup_parallel_create = - _os_workgroup_parallel_createPtr.asFunction< - os_workgroup_parallel_t Function( - ffi.Pointer, os_workgroup_attr_t)>(); + late final _acl_get_perm_npPtr = _lookup< + ffi.NativeFunction>( + 'acl_get_perm_np'); + late final _acl_get_perm_np = + _acl_get_perm_npPtr.asFunction(); - int dispatch_time( - int when, - int delta, + int acl_get_permset( + acl_entry_t entry_d, + ffi.Pointer permset_p, ) { - return _dispatch_time( - when, - delta, + return _acl_get_permset( + entry_d, + permset_p, ); } - late final _dispatch_timePtr = _lookup< + late final _acl_get_permsetPtr = _lookup< ffi.NativeFunction< - dispatch_time_t Function( - dispatch_time_t, ffi.Int64)>>('dispatch_time'); - late final _dispatch_time = - _dispatch_timePtr.asFunction(); + ffi.Int Function( + acl_entry_t, ffi.Pointer)>>('acl_get_permset'); + late final _acl_get_permset = _acl_get_permsetPtr + .asFunction)>(); - int dispatch_walltime( - ffi.Pointer when, - int delta, + int acl_set_permset( + acl_entry_t entry_d, + acl_permset_t permset_d, ) { - return _dispatch_walltime( - when, - delta, + return _acl_set_permset( + entry_d, + permset_d, ); } - late final _dispatch_walltimePtr = _lookup< - ffi.NativeFunction< - dispatch_time_t Function( - ffi.Pointer, ffi.Int64)>>('dispatch_walltime'); - late final _dispatch_walltime = _dispatch_walltimePtr - .asFunction, int)>(); + late final _acl_set_permsetPtr = + _lookup>( + 'acl_set_permset'); + late final _acl_set_permset = _acl_set_permsetPtr + .asFunction(); - int qos_class_self() { - return _qos_class_self(); + int acl_maximal_permset_mask_np( + ffi.Pointer mask_p, + ) { + return _acl_maximal_permset_mask_np( + mask_p, + ); } - late final _qos_class_selfPtr = - _lookup>('qos_class_self'); - late final _qos_class_self = _qos_class_selfPtr.asFunction(); + late final _acl_maximal_permset_mask_npPtr = _lookup< + ffi + .NativeFunction)>>( + 'acl_maximal_permset_mask_np'); + late final _acl_maximal_permset_mask_np = _acl_maximal_permset_mask_npPtr + .asFunction)>(); - int qos_class_main() { - return _qos_class_main(); + int acl_get_permset_mask_np( + acl_entry_t entry_d, + ffi.Pointer mask_p, + ) { + return _acl_get_permset_mask_np( + entry_d, + mask_p, + ); } - late final _qos_class_mainPtr = - _lookup>('qos_class_main'); - late final _qos_class_main = _qos_class_mainPtr.asFunction(); + late final _acl_get_permset_mask_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(acl_entry_t, + ffi.Pointer)>>('acl_get_permset_mask_np'); + late final _acl_get_permset_mask_np = _acl_get_permset_mask_npPtr + .asFunction)>(); - void dispatch_retain( - dispatch_object_t object, + int acl_set_permset_mask_np( + acl_entry_t entry_d, + int mask, ) { - return _dispatch_retain( - object, + return _acl_set_permset_mask_np( + entry_d, + mask, ); } - late final _dispatch_retainPtr = - _lookup>( - 'dispatch_retain'); - late final _dispatch_retain = - _dispatch_retainPtr.asFunction(); + late final _acl_set_permset_mask_npPtr = _lookup< + ffi + .NativeFunction>( + 'acl_set_permset_mask_np'); + late final _acl_set_permset_mask_np = + _acl_set_permset_mask_npPtr.asFunction(); - void dispatch_release( - dispatch_object_t object, + int acl_add_flag_np( + acl_flagset_t flagset_d, + acl_flag_t flag, ) { - return _dispatch_release( - object, + return _acl_add_flag_np( + flagset_d, + flag.value, ); } - late final _dispatch_releasePtr = - _lookup>( - 'dispatch_release'); - late final _dispatch_release = - _dispatch_releasePtr.asFunction(); + late final _acl_add_flag_npPtr = _lookup< + ffi.NativeFunction>( + 'acl_add_flag_np'); + late final _acl_add_flag_np = + _acl_add_flag_npPtr.asFunction(); - ffi.Pointer dispatch_get_context( - dispatch_object_t object, + int acl_clear_flags_np( + acl_flagset_t flagset_d, ) { - return _dispatch_get_context( - object, + return _acl_clear_flags_np( + flagset_d, ); } - late final _dispatch_get_contextPtr = _lookup< - ffi - .NativeFunction Function(dispatch_object_t)>>( - 'dispatch_get_context'); - late final _dispatch_get_context = _dispatch_get_contextPtr - .asFunction Function(dispatch_object_t)>(); + late final _acl_clear_flags_npPtr = + _lookup>( + 'acl_clear_flags_np'); + late final _acl_clear_flags_np = + _acl_clear_flags_npPtr.asFunction(); - void dispatch_set_context( - dispatch_object_t object, - ffi.Pointer context, + int acl_delete_flag_np( + acl_flagset_t flagset_d, + acl_flag_t flag, ) { - return _dispatch_set_context( - object, - context, + return _acl_delete_flag_np( + flagset_d, + flag.value, ); } - late final _dispatch_set_contextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_object_t, - ffi.Pointer)>>('dispatch_set_context'); - late final _dispatch_set_context = _dispatch_set_contextPtr - .asFunction)>(); + late final _acl_delete_flag_npPtr = _lookup< + ffi.NativeFunction>( + 'acl_delete_flag_np'); + late final _acl_delete_flag_np = + _acl_delete_flag_npPtr.asFunction(); - void dispatch_set_finalizer_f( - dispatch_object_t object, - dispatch_function_t finalizer, + int acl_get_flag_np( + acl_flagset_t flagset_d, + acl_flag_t flag, ) { - return _dispatch_set_finalizer_f( - object, - finalizer, + return _acl_get_flag_np( + flagset_d, + flag.value, ); } - late final _dispatch_set_finalizer_fPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_object_t, - dispatch_function_t)>>('dispatch_set_finalizer_f'); - late final _dispatch_set_finalizer_f = _dispatch_set_finalizer_fPtr - .asFunction(); + late final _acl_get_flag_npPtr = _lookup< + ffi.NativeFunction>( + 'acl_get_flag_np'); + late final _acl_get_flag_np = + _acl_get_flag_npPtr.asFunction(); - void dispatch_activate( - dispatch_object_t object, + int acl_get_flagset_np( + ffi.Pointer obj_p, + ffi.Pointer flagset_p, ) { - return _dispatch_activate( - object, + return _acl_get_flagset_np( + obj_p, + flagset_p, ); } - late final _dispatch_activatePtr = - _lookup>( - 'dispatch_activate'); - late final _dispatch_activate = - _dispatch_activatePtr.asFunction(); + late final _acl_get_flagset_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>('acl_get_flagset_np'); + late final _acl_get_flagset_np = _acl_get_flagset_npPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer)>(); - void dispatch_suspend( - dispatch_object_t object, + int acl_set_flagset_np( + ffi.Pointer obj_p, + acl_flagset_t flagset_d, ) { - return _dispatch_suspend( - object, + return _acl_set_flagset_np( + obj_p, + flagset_d, ); } - late final _dispatch_suspendPtr = - _lookup>( - 'dispatch_suspend'); - late final _dispatch_suspend = - _dispatch_suspendPtr.asFunction(); + late final _acl_set_flagset_npPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, acl_flagset_t)>>('acl_set_flagset_np'); + late final _acl_set_flagset_np = _acl_set_flagset_npPtr + .asFunction, acl_flagset_t)>(); - void dispatch_resume( - dispatch_object_t object, + ffi.Pointer acl_get_qualifier( + acl_entry_t entry_d, ) { - return _dispatch_resume( - object, + return _acl_get_qualifier( + entry_d, ); } - late final _dispatch_resumePtr = - _lookup>( - 'dispatch_resume'); - late final _dispatch_resume = - _dispatch_resumePtr.asFunction(); + late final _acl_get_qualifierPtr = + _lookup Function(acl_entry_t)>>( + 'acl_get_qualifier'); + late final _acl_get_qualifier = _acl_get_qualifierPtr + .asFunction Function(acl_entry_t)>(); - void dispatch_set_qos_class_floor( - dispatch_object_t object, - int qos_class, - int relative_priority, + int acl_get_tag_type( + acl_entry_t entry_d, + ffi.Pointer tag_type_p, ) { - return _dispatch_set_qos_class_floor( - object, - qos_class, - relative_priority, + return _acl_get_tag_type( + entry_d, + tag_type_p, ); } - late final _dispatch_set_qos_class_floorPtr = _lookup< + late final _acl_get_tag_typePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_object_t, ffi.Int32, - ffi.Int)>>('dispatch_set_qos_class_floor'); - late final _dispatch_set_qos_class_floor = _dispatch_set_qos_class_floorPtr - .asFunction(); + ffi.Int Function( + acl_entry_t, ffi.Pointer)>>('acl_get_tag_type'); + late final _acl_get_tag_type = _acl_get_tag_typePtr + .asFunction)>(); - int dispatch_wait( - ffi.Pointer object, - int timeout, + int acl_set_qualifier( + acl_entry_t entry_d, + ffi.Pointer tag_qualifier_p, ) { - return _dispatch_wait( - object, - timeout, + return _acl_set_qualifier( + entry_d, + tag_qualifier_p, ); } - late final _dispatch_waitPtr = _lookup< + late final _acl_set_qualifierPtr = _lookup< ffi.NativeFunction< - ffi.IntPtr Function( - ffi.Pointer, dispatch_time_t)>>('dispatch_wait'); - late final _dispatch_wait = - _dispatch_waitPtr.asFunction, int)>(); + ffi.Int Function( + acl_entry_t, ffi.Pointer)>>('acl_set_qualifier'); + late final _acl_set_qualifier = _acl_set_qualifierPtr + .asFunction)>(); - void dispatch_notify( - ffi.Pointer object, - dispatch_object_t queue, - Dartdispatch_block_t notification_block, + int acl_set_tag_type( + acl_entry_t entry_d, + acl_tag_t tag_type, ) { - return _dispatch_notify( - object, - queue, - notification_block._id, + return _acl_set_tag_type( + entry_d, + tag_type.value, ); } - late final _dispatch_notifyPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, dispatch_object_t, - dispatch_block_t)>>('dispatch_notify'); - late final _dispatch_notify = _dispatch_notifyPtr.asFunction< - void Function( - ffi.Pointer, dispatch_object_t, dispatch_block_t)>(); + late final _acl_set_tag_typePtr = _lookup< + ffi.NativeFunction>( + 'acl_set_tag_type'); + late final _acl_set_tag_type = + _acl_set_tag_typePtr.asFunction(); - void dispatch_cancel( - ffi.Pointer object, + int acl_delete_def_file( + ffi.Pointer path_p, ) { - return _dispatch_cancel( - object, + return _acl_delete_def_file( + path_p, ); } - late final _dispatch_cancelPtr = - _lookup)>>( - 'dispatch_cancel'); - late final _dispatch_cancel = - _dispatch_cancelPtr.asFunction)>(); + late final _acl_delete_def_filePtr = + _lookup)>>( + 'acl_delete_def_file'); + late final _acl_delete_def_file = + _acl_delete_def_filePtr.asFunction)>(); - int dispatch_testcancel( - ffi.Pointer object, + acl_t acl_get_fd( + int fd, ) { - return _dispatch_testcancel( - object, + return _acl_get_fd( + fd, ); } - late final _dispatch_testcancelPtr = - _lookup)>>( - 'dispatch_testcancel'); - late final _dispatch_testcancel = - _dispatch_testcancelPtr.asFunction)>(); + late final _acl_get_fdPtr = + _lookup>('acl_get_fd'); + late final _acl_get_fd = _acl_get_fdPtr.asFunction(); - void dispatch_debug( - dispatch_object_t object, - ffi.Pointer message, + acl_t acl_get_fd_np( + int fd, + acl_type_t type, ) { - return _dispatch_debug( - object, - message, + return _acl_get_fd_np( + fd, + type.value, ); } - late final _dispatch_debugPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - dispatch_object_t, ffi.Pointer)>>('dispatch_debug'); - late final _dispatch_debug = _dispatch_debugPtr - .asFunction)>(); + late final _acl_get_fd_npPtr = + _lookup>( + 'acl_get_fd_np'); + late final _acl_get_fd_np = + _acl_get_fd_npPtr.asFunction(); - void dispatch_debugv( - dispatch_object_t object, - ffi.Pointer message, - va_list ap, + acl_t acl_get_file( + ffi.Pointer path_p, + acl_type_t type, ) { - return _dispatch_debugv( - object, - message, - ap, + return _acl_get_file( + path_p, + type.value, ); } - late final _dispatch_debugvPtr = _lookup< + late final _acl_get_filePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_object_t, ffi.Pointer, - va_list)>>('dispatch_debugv'); - late final _dispatch_debugv = _dispatch_debugvPtr.asFunction< - void Function(dispatch_object_t, ffi.Pointer, va_list)>(); + acl_t Function( + ffi.Pointer, ffi.UnsignedInt)>>('acl_get_file'); + late final _acl_get_file = + _acl_get_filePtr.asFunction, int)>(); - void dispatch_async( - dispatch_queue_t queue, - Dartdispatch_block_t block, + acl_t acl_get_link_np( + ffi.Pointer path_p, + acl_type_t type, ) { - return _dispatch_async( - queue, - block._id, + return _acl_get_link_np( + path_p, + type.value, ); } - late final _dispatch_asyncPtr = _lookup< + late final _acl_get_link_npPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - dispatch_queue_t, dispatch_block_t)>>('dispatch_async'); - late final _dispatch_async = _dispatch_asyncPtr - .asFunction(); + acl_t Function( + ffi.Pointer, ffi.UnsignedInt)>>('acl_get_link_np'); + late final _acl_get_link_np = _acl_get_link_npPtr + .asFunction, int)>(); - void dispatch_async_f( - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + int acl_set_fd( + int fd, + acl_t acl, ) { - return _dispatch_async_f( - queue, - context, - work, + return _acl_set_fd( + fd, + acl, ); } - late final _dispatch_async_fPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>>('dispatch_async_f'); - late final _dispatch_async_f = _dispatch_async_fPtr.asFunction< - void Function( - dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); + late final _acl_set_fdPtr = + _lookup>( + 'acl_set_fd'); + late final _acl_set_fd = + _acl_set_fdPtr.asFunction(); - void dispatch_sync( - dispatch_queue_t queue, - Dartdispatch_block_t block, + int acl_set_fd_np( + int fd, + acl_t acl, + acl_type_t acl_type, ) { - return _dispatch_sync( - queue, - block._id, + return _acl_set_fd_np( + fd, + acl, + acl_type.value, ); } - late final _dispatch_syncPtr = _lookup< + late final _acl_set_fd_npPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - dispatch_queue_t, dispatch_block_t)>>('dispatch_sync'); - late final _dispatch_sync = _dispatch_syncPtr - .asFunction(); + ffi.Int Function(ffi.Int, acl_t, ffi.UnsignedInt)>>('acl_set_fd_np'); + late final _acl_set_fd_np = + _acl_set_fd_npPtr.asFunction(); - void dispatch_sync_f( - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + int acl_set_file( + ffi.Pointer path_p, + acl_type_t type, + acl_t acl, ) { - return _dispatch_sync_f( - queue, - context, - work, + return _acl_set_file( + path_p, + type.value, + acl, ); } - late final _dispatch_sync_fPtr = _lookup< + late final _acl_set_filePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>>('dispatch_sync_f'); - late final _dispatch_sync_f = _dispatch_sync_fPtr.asFunction< - void Function( - dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); + ffi.Int Function( + ffi.Pointer, ffi.UnsignedInt, acl_t)>>('acl_set_file'); + late final _acl_set_file = _acl_set_filePtr + .asFunction, int, acl_t)>(); - void dispatch_async_and_wait( - dispatch_queue_t queue, - Dartdispatch_block_t block, + int acl_set_link_np( + ffi.Pointer path_p, + acl_type_t type, + acl_t acl, ) { - return _dispatch_async_and_wait( - queue, - block._id, + return _acl_set_link_np( + path_p, + type.value, + acl, ); } - late final _dispatch_async_and_waitPtr = _lookup< + late final _acl_set_link_npPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - dispatch_queue_t, dispatch_block_t)>>('dispatch_async_and_wait'); - late final _dispatch_async_and_wait = _dispatch_async_and_waitPtr - .asFunction(); + ffi.Int Function(ffi.Pointer, ffi.UnsignedInt, + acl_t)>>('acl_set_link_np'); + late final _acl_set_link_np = _acl_set_link_npPtr + .asFunction, int, acl_t)>(); - void dispatch_async_and_wait_f( - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + int acl_copy_ext( + ffi.Pointer buf_p, + acl_t acl, + int size, ) { - return _dispatch_async_and_wait_f( - queue, - context, - work, + return _acl_copy_ext( + buf_p, + acl, + size, ); } - late final _dispatch_async_and_wait_fPtr = _lookup< + late final _acl_copy_extPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>>('dispatch_async_and_wait_f'); - late final _dispatch_async_and_wait_f = - _dispatch_async_and_wait_fPtr.asFunction< - void Function( - dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); + ssize_t Function( + ffi.Pointer, acl_t, ssize_t)>>('acl_copy_ext'); + late final _acl_copy_ext = _acl_copy_extPtr + .asFunction, acl_t, int)>(); - void dispatch_apply( - int iterations, - dispatch_queue_t queue, - ObjCBlock_ffiVoid_ffiSize block, + int acl_copy_ext_native( + ffi.Pointer buf_p, + acl_t acl, + int size, ) { - return _dispatch_apply( - iterations, - queue, - block._id, + return _acl_copy_ext_native( + buf_p, + acl, + size, ); } - late final _dispatch_applyPtr = _lookup< + late final _acl_copy_ext_nativePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(ffi.Size, dispatch_queue_t, - ffi.Pointer<_ObjCBlock>)>>('dispatch_apply'); - late final _dispatch_apply = _dispatch_applyPtr.asFunction< - void Function(int, dispatch_queue_t, ffi.Pointer<_ObjCBlock>)>(); + ssize_t Function( + ffi.Pointer, acl_t, ssize_t)>>('acl_copy_ext_native'); + late final _acl_copy_ext_native = _acl_copy_ext_nativePtr + .asFunction, acl_t, int)>(); - void dispatch_apply_f( - int iterations, - dispatch_queue_t queue, - ffi.Pointer context, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer context, ffi.Size iteration)>> - work, + acl_t acl_copy_int( + ffi.Pointer buf_p, ) { - return _dispatch_apply_f( - iterations, - queue, - context, - work, + return _acl_copy_int( + buf_p, ); } - late final _dispatch_apply_fPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Size, - dispatch_queue_t, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer context, - ffi.Size iteration)>>)>>('dispatch_apply_f'); - late final _dispatch_apply_f = _dispatch_apply_fPtr.asFunction< - void Function( - int, - dispatch_queue_t, - ffi.Pointer, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer context, ffi.Size iteration)>>)>(); + late final _acl_copy_intPtr = + _lookup)>>( + 'acl_copy_int'); + late final _acl_copy_int = + _acl_copy_intPtr.asFunction)>(); - dispatch_queue_t dispatch_get_current_queue() { - return _dispatch_get_current_queue(); + acl_t acl_copy_int_native( + ffi.Pointer buf_p, + ) { + return _acl_copy_int_native( + buf_p, + ); } - late final _dispatch_get_current_queuePtr = - _lookup>( - 'dispatch_get_current_queue'); - late final _dispatch_get_current_queue = - _dispatch_get_current_queuePtr.asFunction(); - - late final ffi.Pointer __dispatch_main_q = - _lookup('_dispatch_main_q'); - - ffi.Pointer get _dispatch_main_q => __dispatch_main_q; + late final _acl_copy_int_nativePtr = + _lookup)>>( + 'acl_copy_int_native'); + late final _acl_copy_int_native = _acl_copy_int_nativePtr + .asFunction)>(); - dispatch_queue_global_t dispatch_get_global_queue( - int identifier, - int flags, + acl_t acl_from_text( + ffi.Pointer buf_p, ) { - return _dispatch_get_global_queue( - identifier, - flags, + return _acl_from_text( + buf_p, ); } - late final _dispatch_get_global_queuePtr = _lookup< - ffi.NativeFunction< - dispatch_queue_global_t Function( - ffi.IntPtr, ffi.UintPtr)>>('dispatch_get_global_queue'); - late final _dispatch_get_global_queue = _dispatch_get_global_queuePtr - .asFunction(); - - late final ffi.Pointer - __dispatch_queue_attr_concurrent = - _lookup('_dispatch_queue_attr_concurrent'); - - ffi.Pointer get _dispatch_queue_attr_concurrent => - __dispatch_queue_attr_concurrent; + late final _acl_from_textPtr = + _lookup)>>( + 'acl_from_text'); + late final _acl_from_text = + _acl_from_textPtr.asFunction)>(); - dispatch_queue_attr_t dispatch_queue_attr_make_initially_inactive( - dispatch_queue_attr_t attr, + int acl_size( + acl_t acl, ) { - return _dispatch_queue_attr_make_initially_inactive( - attr, + return _acl_size( + acl, ); } - late final _dispatch_queue_attr_make_initially_inactivePtr = _lookup< - ffi.NativeFunction< - dispatch_queue_attr_t Function(dispatch_queue_attr_t)>>( - 'dispatch_queue_attr_make_initially_inactive'); - late final _dispatch_queue_attr_make_initially_inactive = - _dispatch_queue_attr_make_initially_inactivePtr - .asFunction(); + late final _acl_sizePtr = + _lookup>('acl_size'); + late final _acl_size = _acl_sizePtr.asFunction(); - dispatch_queue_attr_t dispatch_queue_attr_make_with_autorelease_frequency( - dispatch_queue_attr_t attr, - int frequency, + ffi.Pointer acl_to_text( + acl_t acl, + ffi.Pointer len_p, ) { - return _dispatch_queue_attr_make_with_autorelease_frequency( - attr, - frequency, + return _acl_to_text( + acl, + len_p, ); } - late final _dispatch_queue_attr_make_with_autorelease_frequencyPtr = _lookup< - ffi.NativeFunction< - dispatch_queue_attr_t Function( - dispatch_queue_attr_t, ffi.Int32)>>( - 'dispatch_queue_attr_make_with_autorelease_frequency'); - late final _dispatch_queue_attr_make_with_autorelease_frequency = - _dispatch_queue_attr_make_with_autorelease_frequencyPtr.asFunction< - dispatch_queue_attr_t Function(dispatch_queue_attr_t, int)>(); + late final _acl_to_textPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + acl_t, ffi.Pointer)>>('acl_to_text'); + late final _acl_to_text = _acl_to_textPtr.asFunction< + ffi.Pointer Function(acl_t, ffi.Pointer)>(); - dispatch_queue_attr_t dispatch_queue_attr_make_with_qos_class( - dispatch_queue_attr_t attr, - int qos_class, - int relative_priority, + int CFFileSecurityGetTypeID() { + return _CFFileSecurityGetTypeID(); + } + + late final _CFFileSecurityGetTypeIDPtr = + _lookup>( + 'CFFileSecurityGetTypeID'); + late final _CFFileSecurityGetTypeID = + _CFFileSecurityGetTypeIDPtr.asFunction(); + + CFFileSecurityRef CFFileSecurityCreate( + CFAllocatorRef allocator, ) { - return _dispatch_queue_attr_make_with_qos_class( - attr, - qos_class, - relative_priority, + return _CFFileSecurityCreate( + allocator, ); } - late final _dispatch_queue_attr_make_with_qos_classPtr = _lookup< - ffi.NativeFunction< - dispatch_queue_attr_t Function(dispatch_queue_attr_t, ffi.Int32, - ffi.Int)>>('dispatch_queue_attr_make_with_qos_class'); - late final _dispatch_queue_attr_make_with_qos_class = - _dispatch_queue_attr_make_with_qos_classPtr.asFunction< - dispatch_queue_attr_t Function(dispatch_queue_attr_t, int, int)>(); + late final _CFFileSecurityCreatePtr = + _lookup>( + 'CFFileSecurityCreate'); + late final _CFFileSecurityCreate = _CFFileSecurityCreatePtr.asFunction< + CFFileSecurityRef Function(CFAllocatorRef)>(); - dispatch_queue_t dispatch_queue_create_with_target( - ffi.Pointer label, - dispatch_queue_attr_t attr, - dispatch_queue_t target, + CFFileSecurityRef CFFileSecurityCreateCopy( + CFAllocatorRef allocator, + CFFileSecurityRef fileSec, ) { - return _dispatch_queue_create_with_target( - label, - attr, - target, + return _CFFileSecurityCreateCopy( + allocator, + fileSec, ); } - late final _dispatch_queue_create_with_targetPtr = _lookup< + late final _CFFileSecurityCreateCopyPtr = _lookup< ffi.NativeFunction< - dispatch_queue_t Function( - ffi.Pointer, - dispatch_queue_attr_t, - dispatch_queue_t)>>('dispatch_queue_create_with_target'); - late final _dispatch_queue_create_with_target = - _dispatch_queue_create_with_targetPtr.asFunction< - dispatch_queue_t Function(ffi.Pointer, - dispatch_queue_attr_t, dispatch_queue_t)>(); + CFFileSecurityRef Function( + CFAllocatorRef, CFFileSecurityRef)>>('CFFileSecurityCreateCopy'); + late final _CFFileSecurityCreateCopy = + _CFFileSecurityCreateCopyPtr.asFunction< + CFFileSecurityRef Function(CFAllocatorRef, CFFileSecurityRef)>(); - dispatch_queue_t dispatch_queue_create( - ffi.Pointer label, - dispatch_queue_attr_t attr, + int CFFileSecurityCopyOwnerUUID( + CFFileSecurityRef fileSec, + ffi.Pointer ownerUUID, ) { - return _dispatch_queue_create( - label, - attr, + return _CFFileSecurityCopyOwnerUUID( + fileSec, + ownerUUID, ); } - late final _dispatch_queue_createPtr = _lookup< + late final _CFFileSecurityCopyOwnerUUIDPtr = _lookup< ffi.NativeFunction< - dispatch_queue_t Function(ffi.Pointer, - dispatch_queue_attr_t)>>('dispatch_queue_create'); - late final _dispatch_queue_create = _dispatch_queue_createPtr.asFunction< - dispatch_queue_t Function( - ffi.Pointer, dispatch_queue_attr_t)>(); + Boolean Function(CFFileSecurityRef, + ffi.Pointer)>>('CFFileSecurityCopyOwnerUUID'); + late final _CFFileSecurityCopyOwnerUUID = _CFFileSecurityCopyOwnerUUIDPtr + .asFunction)>(); - ffi.Pointer dispatch_queue_get_label( - dispatch_queue_t queue, + int CFFileSecuritySetOwnerUUID( + CFFileSecurityRef fileSec, + CFUUIDRef ownerUUID, ) { - return _dispatch_queue_get_label( - queue, + return _CFFileSecuritySetOwnerUUID( + fileSec, + ownerUUID, ); } - late final _dispatch_queue_get_labelPtr = _lookup< - ffi.NativeFunction Function(dispatch_queue_t)>>( - 'dispatch_queue_get_label'); - late final _dispatch_queue_get_label = _dispatch_queue_get_labelPtr - .asFunction Function(dispatch_queue_t)>(); + late final _CFFileSecuritySetOwnerUUIDPtr = _lookup< + ffi.NativeFunction>( + 'CFFileSecuritySetOwnerUUID'); + late final _CFFileSecuritySetOwnerUUID = _CFFileSecuritySetOwnerUUIDPtr + .asFunction(); - int dispatch_queue_get_qos_class( - dispatch_queue_t queue, - ffi.Pointer relative_priority_ptr, + int CFFileSecurityCopyGroupUUID( + CFFileSecurityRef fileSec, + ffi.Pointer groupUUID, ) { - return _dispatch_queue_get_qos_class( - queue, - relative_priority_ptr, + return _CFFileSecurityCopyGroupUUID( + fileSec, + groupUUID, ); } - late final _dispatch_queue_get_qos_classPtr = _lookup< + late final _CFFileSecurityCopyGroupUUIDPtr = _lookup< ffi.NativeFunction< - ffi.Int32 Function(dispatch_queue_t, - ffi.Pointer)>>('dispatch_queue_get_qos_class'); - late final _dispatch_queue_get_qos_class = _dispatch_queue_get_qos_classPtr - .asFunction)>(); + Boolean Function(CFFileSecurityRef, + ffi.Pointer)>>('CFFileSecurityCopyGroupUUID'); + late final _CFFileSecurityCopyGroupUUID = _CFFileSecurityCopyGroupUUIDPtr + .asFunction)>(); - void dispatch_set_target_queue( - dispatch_object_t object, - dispatch_queue_t queue, + int CFFileSecuritySetGroupUUID( + CFFileSecurityRef fileSec, + CFUUIDRef groupUUID, ) { - return _dispatch_set_target_queue( - object, - queue, + return _CFFileSecuritySetGroupUUID( + fileSec, + groupUUID, ); } - late final _dispatch_set_target_queuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_object_t, - dispatch_queue_t)>>('dispatch_set_target_queue'); - late final _dispatch_set_target_queue = _dispatch_set_target_queuePtr - .asFunction(); + late final _CFFileSecuritySetGroupUUIDPtr = _lookup< + ffi.NativeFunction>( + 'CFFileSecuritySetGroupUUID'); + late final _CFFileSecuritySetGroupUUID = _CFFileSecuritySetGroupUUIDPtr + .asFunction(); - void dispatch_main() { - return _dispatch_main(); + int CFFileSecurityCopyAccessControlList( + CFFileSecurityRef fileSec, + ffi.Pointer accessControlList, + ) { + return _CFFileSecurityCopyAccessControlList( + fileSec, + accessControlList, + ); } - late final _dispatch_mainPtr = - _lookup>('dispatch_main'); - late final _dispatch_main = _dispatch_mainPtr.asFunction(); + late final _CFFileSecurityCopyAccessControlListPtr = _lookup< + ffi.NativeFunction< + Boolean Function(CFFileSecurityRef, + ffi.Pointer)>>('CFFileSecurityCopyAccessControlList'); + late final _CFFileSecurityCopyAccessControlList = + _CFFileSecurityCopyAccessControlListPtr.asFunction< + int Function(CFFileSecurityRef, ffi.Pointer)>(); - void dispatch_after( - Dartdispatch_time_t when, - dispatch_queue_t queue, - Dartdispatch_block_t block, + int CFFileSecuritySetAccessControlList( + CFFileSecurityRef fileSec, + acl_t accessControlList, ) { - return _dispatch_after( - when, - queue, - block._id, + return _CFFileSecuritySetAccessControlList( + fileSec, + accessControlList, ); } - late final _dispatch_afterPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_time_t, dispatch_queue_t, - dispatch_block_t)>>('dispatch_after'); - late final _dispatch_after = _dispatch_afterPtr - .asFunction(); + late final _CFFileSecuritySetAccessControlListPtr = + _lookup>( + 'CFFileSecuritySetAccessControlList'); + late final _CFFileSecuritySetAccessControlList = + _CFFileSecuritySetAccessControlListPtr.asFunction< + int Function(CFFileSecurityRef, acl_t)>(); - void dispatch_after_f( - int when, - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + int CFFileSecurityGetOwner( + CFFileSecurityRef fileSec, + ffi.Pointer owner, ) { - return _dispatch_after_f( - when, - queue, - context, - work, + return _CFFileSecurityGetOwner( + fileSec, + owner, ); } - late final _dispatch_after_fPtr = _lookup< + late final _CFFileSecurityGetOwnerPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_time_t, dispatch_queue_t, - ffi.Pointer, dispatch_function_t)>>('dispatch_after_f'); - late final _dispatch_after_f = _dispatch_after_fPtr.asFunction< - void Function( - int, dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); + Boolean Function(CFFileSecurityRef, + ffi.Pointer)>>('CFFileSecurityGetOwner'); + late final _CFFileSecurityGetOwner = _CFFileSecurityGetOwnerPtr.asFunction< + int Function(CFFileSecurityRef, ffi.Pointer)>(); - void dispatch_barrier_async( - dispatch_queue_t queue, - Dartdispatch_block_t block, + int CFFileSecuritySetOwner( + CFFileSecurityRef fileSec, + int owner, ) { - return _dispatch_barrier_async( - queue, - block._id, + return _CFFileSecuritySetOwner( + fileSec, + owner, ); } - late final _dispatch_barrier_asyncPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - dispatch_queue_t, dispatch_block_t)>>('dispatch_barrier_async'); - late final _dispatch_barrier_async = _dispatch_barrier_asyncPtr - .asFunction(); + late final _CFFileSecuritySetOwnerPtr = + _lookup>( + 'CFFileSecuritySetOwner'); + late final _CFFileSecuritySetOwner = _CFFileSecuritySetOwnerPtr.asFunction< + int Function(CFFileSecurityRef, int)>(); - void dispatch_barrier_async_f( - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + int CFFileSecurityGetGroup( + CFFileSecurityRef fileSec, + ffi.Pointer group, ) { - return _dispatch_barrier_async_f( - queue, - context, - work, + return _CFFileSecurityGetGroup( + fileSec, + group, ); } - late final _dispatch_barrier_async_fPtr = _lookup< + late final _CFFileSecurityGetGroupPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>>('dispatch_barrier_async_f'); - late final _dispatch_barrier_async_f = - _dispatch_barrier_async_fPtr.asFunction< - void Function( - dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); + Boolean Function(CFFileSecurityRef, + ffi.Pointer)>>('CFFileSecurityGetGroup'); + late final _CFFileSecurityGetGroup = _CFFileSecurityGetGroupPtr.asFunction< + int Function(CFFileSecurityRef, ffi.Pointer)>(); - void dispatch_barrier_sync( - dispatch_queue_t queue, - Dartdispatch_block_t block, + int CFFileSecuritySetGroup( + CFFileSecurityRef fileSec, + int group, ) { - return _dispatch_barrier_sync( - queue, - block._id, + return _CFFileSecuritySetGroup( + fileSec, + group, ); } - late final _dispatch_barrier_syncPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - dispatch_queue_t, dispatch_block_t)>>('dispatch_barrier_sync'); - late final _dispatch_barrier_sync = _dispatch_barrier_syncPtr - .asFunction(); + late final _CFFileSecuritySetGroupPtr = + _lookup>( + 'CFFileSecuritySetGroup'); + late final _CFFileSecuritySetGroup = _CFFileSecuritySetGroupPtr.asFunction< + int Function(CFFileSecurityRef, int)>(); - void dispatch_barrier_sync_f( - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + int CFFileSecurityGetMode( + CFFileSecurityRef fileSec, + ffi.Pointer mode, ) { - return _dispatch_barrier_sync_f( - queue, - context, - work, + return _CFFileSecurityGetMode( + fileSec, + mode, ); } - late final _dispatch_barrier_sync_fPtr = _lookup< + late final _CFFileSecurityGetModePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>>('dispatch_barrier_sync_f'); - late final _dispatch_barrier_sync_f = _dispatch_barrier_sync_fPtr.asFunction< - void Function( - dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); + Boolean Function(CFFileSecurityRef, + ffi.Pointer)>>('CFFileSecurityGetMode'); + late final _CFFileSecurityGetMode = _CFFileSecurityGetModePtr.asFunction< + int Function(CFFileSecurityRef, ffi.Pointer)>(); - void dispatch_barrier_async_and_wait( - dispatch_queue_t queue, - Dartdispatch_block_t block, + int CFFileSecuritySetMode( + CFFileSecurityRef fileSec, + int mode, ) { - return _dispatch_barrier_async_and_wait( - queue, - block._id, + return _CFFileSecuritySetMode( + fileSec, + mode, ); } - late final _dispatch_barrier_async_and_waitPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_queue_t, - dispatch_block_t)>>('dispatch_barrier_async_and_wait'); - late final _dispatch_barrier_async_and_wait = - _dispatch_barrier_async_and_waitPtr - .asFunction(); + late final _CFFileSecuritySetModePtr = + _lookup>( + 'CFFileSecuritySetMode'); + late final _CFFileSecuritySetMode = _CFFileSecuritySetModePtr.asFunction< + int Function(CFFileSecurityRef, int)>(); - void dispatch_barrier_async_and_wait_f( - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + DartBoolean CFFileSecurityClearProperties( + CFFileSecurityRef fileSec, + CFFileSecurityClearOptions clearPropertyMask, ) { - return _dispatch_barrier_async_and_wait_f( - queue, - context, - work, + return _CFFileSecurityClearProperties( + fileSec, + clearPropertyMask.value, ); } - late final _dispatch_barrier_async_and_wait_fPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>>('dispatch_barrier_async_and_wait_f'); - late final _dispatch_barrier_async_and_wait_f = - _dispatch_barrier_async_and_wait_fPtr.asFunction< - void Function( - dispatch_queue_t, ffi.Pointer, dispatch_function_t)>(); + late final _CFFileSecurityClearPropertiesPtr = _lookup< + ffi + .NativeFunction>( + 'CFFileSecurityClearProperties'); + late final _CFFileSecurityClearProperties = _CFFileSecurityClearPropertiesPtr + .asFunction(); - void dispatch_queue_set_specific( - dispatch_queue_t queue, - ffi.Pointer key, - ffi.Pointer context, - dispatch_function_t destructor, + CFStringRef CFStringTokenizerCopyBestStringLanguage( + CFStringRef string, + CFRange range, ) { - return _dispatch_queue_set_specific( - queue, - key, - context, - destructor, + return _CFStringTokenizerCopyBestStringLanguage( + string, + range, ); } - late final _dispatch_queue_set_specificPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - dispatch_queue_t, - ffi.Pointer, - ffi.Pointer, - dispatch_function_t)>>('dispatch_queue_set_specific'); - late final _dispatch_queue_set_specific = - _dispatch_queue_set_specificPtr.asFunction< - void Function(dispatch_queue_t, ffi.Pointer, - ffi.Pointer, dispatch_function_t)>(); + late final _CFStringTokenizerCopyBestStringLanguagePtr = + _lookup>( + 'CFStringTokenizerCopyBestStringLanguage'); + late final _CFStringTokenizerCopyBestStringLanguage = + _CFStringTokenizerCopyBestStringLanguagePtr.asFunction< + CFStringRef Function(CFStringRef, CFRange)>(); - ffi.Pointer dispatch_queue_get_specific( - dispatch_queue_t queue, - ffi.Pointer key, + int CFStringTokenizerGetTypeID() { + return _CFStringTokenizerGetTypeID(); + } + + late final _CFStringTokenizerGetTypeIDPtr = + _lookup>( + 'CFStringTokenizerGetTypeID'); + late final _CFStringTokenizerGetTypeID = + _CFStringTokenizerGetTypeIDPtr.asFunction(); + + CFStringTokenizerRef CFStringTokenizerCreate( + CFAllocatorRef alloc, + CFStringRef string, + CFRange range, + int options, + CFLocaleRef locale, ) { - return _dispatch_queue_get_specific( - queue, - key, + return _CFStringTokenizerCreate( + alloc, + string, + range, + options, + locale, ); } - late final _dispatch_queue_get_specificPtr = _lookup< + late final _CFStringTokenizerCreatePtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(dispatch_queue_t, - ffi.Pointer)>>('dispatch_queue_get_specific'); - late final _dispatch_queue_get_specific = - _dispatch_queue_get_specificPtr.asFunction< - ffi.Pointer Function( - dispatch_queue_t, ffi.Pointer)>(); + CFStringTokenizerRef Function(CFAllocatorRef, CFStringRef, CFRange, + CFOptionFlags, CFLocaleRef)>>('CFStringTokenizerCreate'); + late final _CFStringTokenizerCreate = _CFStringTokenizerCreatePtr.asFunction< + CFStringTokenizerRef Function( + CFAllocatorRef, CFStringRef, CFRange, int, CFLocaleRef)>(); - ffi.Pointer dispatch_get_specific( - ffi.Pointer key, + void CFStringTokenizerSetString( + CFStringTokenizerRef tokenizer, + CFStringRef string, + CFRange range, ) { - return _dispatch_get_specific( - key, + return _CFStringTokenizerSetString( + tokenizer, + string, + range, ); } - late final _dispatch_get_specificPtr = _lookup< + late final _CFStringTokenizerSetStringPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('dispatch_get_specific'); - late final _dispatch_get_specific = _dispatch_get_specificPtr - .asFunction Function(ffi.Pointer)>(); + ffi.Void Function(CFStringTokenizerRef, CFStringRef, + CFRange)>>('CFStringTokenizerSetString'); + late final _CFStringTokenizerSetString = _CFStringTokenizerSetStringPtr + .asFunction(); - void dispatch_assert_queue( - dispatch_queue_t queue, + CFStringTokenizerTokenType CFStringTokenizerGoToTokenAtIndex( + CFStringTokenizerRef tokenizer, + DartCFIndex index, ) { - return _dispatch_assert_queue( - queue, - ); + return CFStringTokenizerTokenType.fromValue( + _CFStringTokenizerGoToTokenAtIndex( + tokenizer, + index, + )); } - late final _dispatch_assert_queuePtr = - _lookup>( - 'dispatch_assert_queue'); - late final _dispatch_assert_queue = - _dispatch_assert_queuePtr.asFunction(); + late final _CFStringTokenizerGoToTokenAtIndexPtr = _lookup< + ffi.NativeFunction< + CFOptionFlags Function(CFStringTokenizerRef, + CFIndex)>>('CFStringTokenizerGoToTokenAtIndex'); + late final _CFStringTokenizerGoToTokenAtIndex = + _CFStringTokenizerGoToTokenAtIndexPtr.asFunction< + int Function(CFStringTokenizerRef, int)>(); - void dispatch_assert_queue_barrier( - dispatch_queue_t queue, + CFStringTokenizerTokenType CFStringTokenizerAdvanceToNextToken( + CFStringTokenizerRef tokenizer, ) { - return _dispatch_assert_queue_barrier( - queue, - ); + return CFStringTokenizerTokenType.fromValue( + _CFStringTokenizerAdvanceToNextToken( + tokenizer, + )); } - late final _dispatch_assert_queue_barrierPtr = - _lookup>( - 'dispatch_assert_queue_barrier'); - late final _dispatch_assert_queue_barrier = _dispatch_assert_queue_barrierPtr - .asFunction(); + late final _CFStringTokenizerAdvanceToNextTokenPtr = + _lookup>( + 'CFStringTokenizerAdvanceToNextToken'); + late final _CFStringTokenizerAdvanceToNextToken = + _CFStringTokenizerAdvanceToNextTokenPtr.asFunction< + int Function(CFStringTokenizerRef)>(); - void dispatch_assert_queue_not( - dispatch_queue_t queue, + CFRange CFStringTokenizerGetCurrentTokenRange( + CFStringTokenizerRef tokenizer, ) { - return _dispatch_assert_queue_not( - queue, + return _CFStringTokenizerGetCurrentTokenRange( + tokenizer, ); } - late final _dispatch_assert_queue_notPtr = - _lookup>( - 'dispatch_assert_queue_not'); - late final _dispatch_assert_queue_not = _dispatch_assert_queue_notPtr - .asFunction(); + late final _CFStringTokenizerGetCurrentTokenRangePtr = + _lookup>( + 'CFStringTokenizerGetCurrentTokenRange'); + late final _CFStringTokenizerGetCurrentTokenRange = + _CFStringTokenizerGetCurrentTokenRangePtr.asFunction< + CFRange Function(CFStringTokenizerRef)>(); - Dartdispatch_block_t dispatch_block_create( - int flags, - Dartdispatch_block_t block, + CFTypeRef CFStringTokenizerCopyCurrentTokenAttribute( + CFStringTokenizerRef tokenizer, + int attribute, ) { - return ObjCBlock_ffiVoid._( - _dispatch_block_create( - flags, - block._id, - ), - this, - retain: false, - release: true); + return _CFStringTokenizerCopyCurrentTokenAttribute( + tokenizer, + attribute, + ); } - late final _dispatch_block_createPtr = _lookup< + late final _CFStringTokenizerCopyCurrentTokenAttributePtr = _lookup< ffi.NativeFunction< - dispatch_block_t Function( - ffi.Int32, dispatch_block_t)>>('dispatch_block_create'); - late final _dispatch_block_create = _dispatch_block_createPtr - .asFunction(); - - Dartdispatch_block_t dispatch_block_create_with_qos_class( - int flags, - int qos_class, - int relative_priority, - Dartdispatch_block_t block, + CFTypeRef Function(CFStringTokenizerRef, + CFOptionFlags)>>('CFStringTokenizerCopyCurrentTokenAttribute'); + late final _CFStringTokenizerCopyCurrentTokenAttribute = + _CFStringTokenizerCopyCurrentTokenAttributePtr.asFunction< + CFTypeRef Function(CFStringTokenizerRef, int)>(); + + int CFStringTokenizerGetCurrentSubTokens( + CFStringTokenizerRef tokenizer, + ffi.Pointer ranges, + int maxRangeLength, + CFMutableArrayRef derivedSubTokens, ) { - return ObjCBlock_ffiVoid._( - _dispatch_block_create_with_qos_class( - flags, - qos_class, - relative_priority, - block._id, - ), - this, - retain: false, - release: true); + return _CFStringTokenizerGetCurrentSubTokens( + tokenizer, + ranges, + maxRangeLength, + derivedSubTokens, + ); } - late final _dispatch_block_create_with_qos_classPtr = _lookup< + late final _CFStringTokenizerGetCurrentSubTokensPtr = _lookup< ffi.NativeFunction< - dispatch_block_t Function(ffi.Int32, ffi.Int32, ffi.Int, - dispatch_block_t)>>('dispatch_block_create_with_qos_class'); - late final _dispatch_block_create_with_qos_class = - _dispatch_block_create_with_qos_classPtr.asFunction< - dispatch_block_t Function(int, int, int, dispatch_block_t)>(); + CFIndex Function(CFStringTokenizerRef, ffi.Pointer, CFIndex, + CFMutableArrayRef)>>('CFStringTokenizerGetCurrentSubTokens'); + late final _CFStringTokenizerGetCurrentSubTokens = + _CFStringTokenizerGetCurrentSubTokensPtr.asFunction< + int Function(CFStringTokenizerRef, ffi.Pointer, int, + CFMutableArrayRef)>(); - void dispatch_block_perform( - int flags, - Dartdispatch_block_t block, - ) { - return _dispatch_block_perform( - flags, - block._id, - ); + int CFFileDescriptorGetTypeID() { + return _CFFileDescriptorGetTypeID(); } - late final _dispatch_block_performPtr = _lookup< - ffi.NativeFunction>( - 'dispatch_block_perform'); - late final _dispatch_block_perform = _dispatch_block_performPtr - .asFunction(); + late final _CFFileDescriptorGetTypeIDPtr = + _lookup>( + 'CFFileDescriptorGetTypeID'); + late final _CFFileDescriptorGetTypeID = + _CFFileDescriptorGetTypeIDPtr.asFunction(); - int dispatch_block_wait( - Dartdispatch_block_t block, - Dartdispatch_time_t timeout, + CFFileDescriptorRef CFFileDescriptorCreate( + CFAllocatorRef allocator, + int fd, + int closeOnInvalidate, + CFFileDescriptorCallBack callout, + ffi.Pointer context, ) { - return _dispatch_block_wait( - block._id, - timeout, + return _CFFileDescriptorCreate( + allocator, + fd, + closeOnInvalidate, + callout, + context, ); } - late final _dispatch_block_waitPtr = _lookup< + late final _CFFileDescriptorCreatePtr = _lookup< ffi.NativeFunction< - ffi.IntPtr Function( - dispatch_block_t, dispatch_time_t)>>('dispatch_block_wait'); - late final _dispatch_block_wait = - _dispatch_block_waitPtr.asFunction(); + CFFileDescriptorRef Function( + CFAllocatorRef, + CFFileDescriptorNativeDescriptor, + Boolean, + CFFileDescriptorCallBack, + ffi.Pointer)>>('CFFileDescriptorCreate'); + late final _CFFileDescriptorCreate = _CFFileDescriptorCreatePtr.asFunction< + CFFileDescriptorRef Function(CFAllocatorRef, int, int, + CFFileDescriptorCallBack, ffi.Pointer)>(); - void dispatch_block_notify( - Dartdispatch_block_t block, - dispatch_queue_t queue, - Dartdispatch_block_t notification_block, + int CFFileDescriptorGetNativeDescriptor( + CFFileDescriptorRef f, ) { - return _dispatch_block_notify( - block._id, - queue, - notification_block._id, + return _CFFileDescriptorGetNativeDescriptor( + f, ); } - late final _dispatch_block_notifyPtr = _lookup< + late final _CFFileDescriptorGetNativeDescriptorPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_block_t, dispatch_queue_t, - dispatch_block_t)>>('dispatch_block_notify'); - late final _dispatch_block_notify = _dispatch_block_notifyPtr.asFunction< - void Function(dispatch_block_t, dispatch_queue_t, dispatch_block_t)>(); + CFFileDescriptorNativeDescriptor Function( + CFFileDescriptorRef)>>('CFFileDescriptorGetNativeDescriptor'); + late final _CFFileDescriptorGetNativeDescriptor = + _CFFileDescriptorGetNativeDescriptorPtr.asFunction< + int Function(CFFileDescriptorRef)>(); - void dispatch_block_cancel( - Dartdispatch_block_t block, + void CFFileDescriptorGetContext( + CFFileDescriptorRef f, + ffi.Pointer context, ) { - return _dispatch_block_cancel( - block._id, + return _CFFileDescriptorGetContext( + f, + context, ); } - late final _dispatch_block_cancelPtr = - _lookup>( - 'dispatch_block_cancel'); - late final _dispatch_block_cancel = - _dispatch_block_cancelPtr.asFunction(); + late final _CFFileDescriptorGetContextPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + CFFileDescriptorRef, ffi.Pointer)>>( + 'CFFileDescriptorGetContext'); + late final _CFFileDescriptorGetContext = + _CFFileDescriptorGetContextPtr.asFunction< + void Function( + CFFileDescriptorRef, ffi.Pointer)>(); - int dispatch_block_testcancel( - Dartdispatch_block_t block, + void CFFileDescriptorEnableCallBacks( + CFFileDescriptorRef f, + int callBackTypes, ) { - return _dispatch_block_testcancel( - block._id, + return _CFFileDescriptorEnableCallBacks( + f, + callBackTypes, ); } - late final _dispatch_block_testcancelPtr = - _lookup>( - 'dispatch_block_testcancel'); - late final _dispatch_block_testcancel = _dispatch_block_testcancelPtr - .asFunction(); - - late final ffi.Pointer _KERNEL_SECURITY_TOKEN = - _lookup('KERNEL_SECURITY_TOKEN'); - - security_token_t get KERNEL_SECURITY_TOKEN => _KERNEL_SECURITY_TOKEN.ref; - - late final ffi.Pointer _KERNEL_AUDIT_TOKEN = - _lookup('KERNEL_AUDIT_TOKEN'); - - audit_token_t get KERNEL_AUDIT_TOKEN => _KERNEL_AUDIT_TOKEN.ref; + late final _CFFileDescriptorEnableCallBacksPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(CFFileDescriptorRef, + CFOptionFlags)>>('CFFileDescriptorEnableCallBacks'); + late final _CFFileDescriptorEnableCallBacks = + _CFFileDescriptorEnableCallBacksPtr.asFunction< + void Function(CFFileDescriptorRef, int)>(); - int mach_msg_overwrite( - ffi.Pointer msg, - int option, - int send_size, - int rcv_size, - int rcv_name, - int timeout, - int notify, - ffi.Pointer rcv_msg, - int rcv_limit, + void CFFileDescriptorDisableCallBacks( + CFFileDescriptorRef f, + int callBackTypes, ) { - return _mach_msg_overwrite( - msg, - option, - send_size, - rcv_size, - rcv_name, - timeout, - notify, - rcv_msg, - rcv_limit, + return _CFFileDescriptorDisableCallBacks( + f, + callBackTypes, ); } - late final _mach_msg_overwritePtr = _lookup< + late final _CFFileDescriptorDisableCallBacksPtr = _lookup< ffi.NativeFunction< - mach_msg_return_t Function( - ffi.Pointer, - mach_msg_option_t, - mach_msg_size_t, - mach_msg_size_t, - mach_port_name_t, - mach_msg_timeout_t, - mach_port_name_t, - ffi.Pointer, - mach_msg_size_t)>>('mach_msg_overwrite'); - late final _mach_msg_overwrite = _mach_msg_overwritePtr.asFunction< - int Function(ffi.Pointer, int, int, int, int, int, int, - ffi.Pointer, int)>(); + ffi.Void Function(CFFileDescriptorRef, + CFOptionFlags)>>('CFFileDescriptorDisableCallBacks'); + late final _CFFileDescriptorDisableCallBacks = + _CFFileDescriptorDisableCallBacksPtr.asFunction< + void Function(CFFileDescriptorRef, int)>(); - int mach_msg( - ffi.Pointer msg, - int option, - int send_size, - int rcv_size, - int rcv_name, - int timeout, - int notify, + void CFFileDescriptorInvalidate( + CFFileDescriptorRef f, ) { - return _mach_msg( - msg, - option, - send_size, - rcv_size, - rcv_name, - timeout, - notify, + return _CFFileDescriptorInvalidate( + f, ); } - late final _mach_msgPtr = _lookup< - ffi.NativeFunction< - mach_msg_return_t Function( - ffi.Pointer, - mach_msg_option_t, - mach_msg_size_t, - mach_msg_size_t, - mach_port_name_t, - mach_msg_timeout_t, - mach_port_name_t)>>('mach_msg'); - late final _mach_msg = _mach_msgPtr.asFunction< - int Function( - ffi.Pointer, int, int, int, int, int, int)>(); + late final _CFFileDescriptorInvalidatePtr = + _lookup>( + 'CFFileDescriptorInvalidate'); + late final _CFFileDescriptorInvalidate = _CFFileDescriptorInvalidatePtr + .asFunction(); - int mach_voucher_deallocate( - int voucher, + int CFFileDescriptorIsValid( + CFFileDescriptorRef f, ) { - return _mach_voucher_deallocate( - voucher, + return _CFFileDescriptorIsValid( + f, ); } - late final _mach_voucher_deallocatePtr = - _lookup>( - 'mach_voucher_deallocate'); - late final _mach_voucher_deallocate = - _mach_voucher_deallocatePtr.asFunction(); - - late final ffi.Pointer - __dispatch_source_type_data_add = - _lookup('_dispatch_source_type_data_add'); - - ffi.Pointer get _dispatch_source_type_data_add => - __dispatch_source_type_data_add; - - late final ffi.Pointer - __dispatch_source_type_data_or = - _lookup('_dispatch_source_type_data_or'); - - ffi.Pointer get _dispatch_source_type_data_or => - __dispatch_source_type_data_or; - - late final ffi.Pointer - __dispatch_source_type_data_replace = - _lookup('_dispatch_source_type_data_replace'); - - ffi.Pointer get _dispatch_source_type_data_replace => - __dispatch_source_type_data_replace; - - late final ffi.Pointer - __dispatch_source_type_mach_send = - _lookup('_dispatch_source_type_mach_send'); - - ffi.Pointer get _dispatch_source_type_mach_send => - __dispatch_source_type_mach_send; - - late final ffi.Pointer - __dispatch_source_type_mach_recv = - _lookup('_dispatch_source_type_mach_recv'); - - ffi.Pointer get _dispatch_source_type_mach_recv => - __dispatch_source_type_mach_recv; - - late final ffi.Pointer - __dispatch_source_type_memorypressure = - _lookup('_dispatch_source_type_memorypressure'); - - ffi.Pointer - get _dispatch_source_type_memorypressure => - __dispatch_source_type_memorypressure; - - late final ffi.Pointer __dispatch_source_type_proc = - _lookup('_dispatch_source_type_proc'); - - ffi.Pointer get _dispatch_source_type_proc => - __dispatch_source_type_proc; - - late final ffi.Pointer __dispatch_source_type_read = - _lookup('_dispatch_source_type_read'); - - ffi.Pointer get _dispatch_source_type_read => - __dispatch_source_type_read; - - late final ffi.Pointer __dispatch_source_type_signal = - _lookup('_dispatch_source_type_signal'); - - ffi.Pointer get _dispatch_source_type_signal => - __dispatch_source_type_signal; - - late final ffi.Pointer __dispatch_source_type_timer = - _lookup('_dispatch_source_type_timer'); - - ffi.Pointer get _dispatch_source_type_timer => - __dispatch_source_type_timer; + late final _CFFileDescriptorIsValidPtr = + _lookup>( + 'CFFileDescriptorIsValid'); + late final _CFFileDescriptorIsValid = _CFFileDescriptorIsValidPtr.asFunction< + int Function(CFFileDescriptorRef)>(); - late final ffi.Pointer __dispatch_source_type_vnode = - _lookup('_dispatch_source_type_vnode'); + CFRunLoopSourceRef CFFileDescriptorCreateRunLoopSource( + CFAllocatorRef allocator, + CFFileDescriptorRef f, + int order, + ) { + return _CFFileDescriptorCreateRunLoopSource( + allocator, + f, + order, + ); + } - ffi.Pointer get _dispatch_source_type_vnode => - __dispatch_source_type_vnode; + late final _CFFileDescriptorCreateRunLoopSourcePtr = _lookup< + ffi.NativeFunction< + CFRunLoopSourceRef Function(CFAllocatorRef, CFFileDescriptorRef, + CFIndex)>>('CFFileDescriptorCreateRunLoopSource'); + late final _CFFileDescriptorCreateRunLoopSource = + _CFFileDescriptorCreateRunLoopSourcePtr.asFunction< + CFRunLoopSourceRef Function( + CFAllocatorRef, CFFileDescriptorRef, int)>(); - late final ffi.Pointer __dispatch_source_type_write = - _lookup('_dispatch_source_type_write'); + int CFUserNotificationGetTypeID() { + return _CFUserNotificationGetTypeID(); + } - ffi.Pointer get _dispatch_source_type_write => - __dispatch_source_type_write; + late final _CFUserNotificationGetTypeIDPtr = + _lookup>( + 'CFUserNotificationGetTypeID'); + late final _CFUserNotificationGetTypeID = + _CFUserNotificationGetTypeIDPtr.asFunction(); - dispatch_source_t dispatch_source_create( - dispatch_source_type_t type, - int handle, - int mask, - dispatch_queue_t queue, + CFUserNotificationRef CFUserNotificationCreate( + CFAllocatorRef allocator, + double timeout, + int flags, + ffi.Pointer error, + CFDictionaryRef dictionary, ) { - return _dispatch_source_create( - type, - handle, - mask, - queue, + return _CFUserNotificationCreate( + allocator, + timeout, + flags, + error, + dictionary, ); } - late final _dispatch_source_createPtr = _lookup< + late final _CFUserNotificationCreatePtr = _lookup< ffi.NativeFunction< - dispatch_source_t Function(dispatch_source_type_t, ffi.UintPtr, - ffi.UintPtr, dispatch_queue_t)>>('dispatch_source_create'); - late final _dispatch_source_create = _dispatch_source_createPtr.asFunction< - dispatch_source_t Function( - dispatch_source_type_t, int, int, dispatch_queue_t)>(); + CFUserNotificationRef Function( + CFAllocatorRef, + CFTimeInterval, + CFOptionFlags, + ffi.Pointer, + CFDictionaryRef)>>('CFUserNotificationCreate'); + late final _CFUserNotificationCreate = + _CFUserNotificationCreatePtr.asFunction< + CFUserNotificationRef Function(CFAllocatorRef, double, int, + ffi.Pointer, CFDictionaryRef)>(); - void dispatch_source_set_event_handler( - dispatch_source_t source, - Dartdispatch_block_t handler, + int CFUserNotificationReceiveResponse( + CFUserNotificationRef userNotification, + double timeout, + ffi.Pointer responseFlags, ) { - return _dispatch_source_set_event_handler( - source, - handler._id, + return _CFUserNotificationReceiveResponse( + userNotification, + timeout, + responseFlags, ); } - late final _dispatch_source_set_event_handlerPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_source_t, - dispatch_block_t)>>('dispatch_source_set_event_handler'); - late final _dispatch_source_set_event_handler = - _dispatch_source_set_event_handlerPtr - .asFunction(); + late final _CFUserNotificationReceiveResponsePtr = _lookup< + ffi.NativeFunction< + SInt32 Function(CFUserNotificationRef, CFTimeInterval, + ffi.Pointer)>>( + 'CFUserNotificationReceiveResponse'); + late final _CFUserNotificationReceiveResponse = + _CFUserNotificationReceiveResponsePtr.asFunction< + int Function( + CFUserNotificationRef, double, ffi.Pointer)>(); - void dispatch_source_set_event_handler_f( - dispatch_source_t source, - dispatch_function_t handler, + CFStringRef CFUserNotificationGetResponseValue( + CFUserNotificationRef userNotification, + CFStringRef key, + int idx, ) { - return _dispatch_source_set_event_handler_f( - source, - handler, + return _CFUserNotificationGetResponseValue( + userNotification, + key, + idx, ); } - late final _dispatch_source_set_event_handler_fPtr = _lookup< + late final _CFUserNotificationGetResponseValuePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_source_t, - dispatch_function_t)>>('dispatch_source_set_event_handler_f'); - late final _dispatch_source_set_event_handler_f = - _dispatch_source_set_event_handler_fPtr - .asFunction(); + CFStringRef Function(CFUserNotificationRef, CFStringRef, + CFIndex)>>('CFUserNotificationGetResponseValue'); + late final _CFUserNotificationGetResponseValue = + _CFUserNotificationGetResponseValuePtr.asFunction< + CFStringRef Function(CFUserNotificationRef, CFStringRef, int)>(); - void dispatch_source_set_cancel_handler( - dispatch_source_t source, - Dartdispatch_block_t handler, + CFDictionaryRef CFUserNotificationGetResponseDictionary( + CFUserNotificationRef userNotification, ) { - return _dispatch_source_set_cancel_handler( - source, - handler._id, + return _CFUserNotificationGetResponseDictionary( + userNotification, ); } - late final _dispatch_source_set_cancel_handlerPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_source_t, - dispatch_block_t)>>('dispatch_source_set_cancel_handler'); - late final _dispatch_source_set_cancel_handler = - _dispatch_source_set_cancel_handlerPtr - .asFunction(); + late final _CFUserNotificationGetResponseDictionaryPtr = _lookup< + ffi.NativeFunction>( + 'CFUserNotificationGetResponseDictionary'); + late final _CFUserNotificationGetResponseDictionary = + _CFUserNotificationGetResponseDictionaryPtr.asFunction< + CFDictionaryRef Function(CFUserNotificationRef)>(); - void dispatch_source_set_cancel_handler_f( - dispatch_source_t source, - dispatch_function_t handler, + int CFUserNotificationUpdate( + CFUserNotificationRef userNotification, + double timeout, + int flags, + CFDictionaryRef dictionary, ) { - return _dispatch_source_set_cancel_handler_f( - source, - handler, + return _CFUserNotificationUpdate( + userNotification, + timeout, + flags, + dictionary, ); } - late final _dispatch_source_set_cancel_handler_fPtr = _lookup< + late final _CFUserNotificationUpdatePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_source_t, - dispatch_function_t)>>('dispatch_source_set_cancel_handler_f'); - late final _dispatch_source_set_cancel_handler_f = - _dispatch_source_set_cancel_handler_fPtr - .asFunction(); + SInt32 Function(CFUserNotificationRef, CFTimeInterval, CFOptionFlags, + CFDictionaryRef)>>('CFUserNotificationUpdate'); + late final _CFUserNotificationUpdate = + _CFUserNotificationUpdatePtr.asFunction< + int Function(CFUserNotificationRef, double, int, CFDictionaryRef)>(); - void dispatch_source_cancel( - dispatch_source_t source, + int CFUserNotificationCancel( + CFUserNotificationRef userNotification, ) { - return _dispatch_source_cancel( - source, + return _CFUserNotificationCancel( + userNotification, ); } - late final _dispatch_source_cancelPtr = - _lookup>( - 'dispatch_source_cancel'); - late final _dispatch_source_cancel = - _dispatch_source_cancelPtr.asFunction(); + late final _CFUserNotificationCancelPtr = + _lookup>( + 'CFUserNotificationCancel'); + late final _CFUserNotificationCancel = _CFUserNotificationCancelPtr + .asFunction(); - int dispatch_source_testcancel( - dispatch_source_t source, + CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource( + CFAllocatorRef allocator, + CFUserNotificationRef userNotification, + CFUserNotificationCallBack callout, + int order, ) { - return _dispatch_source_testcancel( - source, + return _CFUserNotificationCreateRunLoopSource( + allocator, + userNotification, + callout, + order, ); } - late final _dispatch_source_testcancelPtr = - _lookup>( - 'dispatch_source_testcancel'); - late final _dispatch_source_testcancel = _dispatch_source_testcancelPtr - .asFunction(); + late final _CFUserNotificationCreateRunLoopSourcePtr = _lookup< + ffi.NativeFunction< + CFRunLoopSourceRef Function( + CFAllocatorRef, + CFUserNotificationRef, + CFUserNotificationCallBack, + CFIndex)>>('CFUserNotificationCreateRunLoopSource'); + late final _CFUserNotificationCreateRunLoopSource = + _CFUserNotificationCreateRunLoopSourcePtr.asFunction< + CFRunLoopSourceRef Function(CFAllocatorRef, CFUserNotificationRef, + CFUserNotificationCallBack, int)>(); - int dispatch_source_get_handle( - dispatch_source_t source, + int CFUserNotificationDisplayNotice( + double timeout, + int flags, + CFURLRef iconURL, + CFURLRef soundURL, + CFURLRef localizationURL, + CFStringRef alertHeader, + CFStringRef alertMessage, + CFStringRef defaultButtonTitle, ) { - return _dispatch_source_get_handle( - source, + return _CFUserNotificationDisplayNotice( + timeout, + flags, + iconURL, + soundURL, + localizationURL, + alertHeader, + alertMessage, + defaultButtonTitle, ); } - late final _dispatch_source_get_handlePtr = - _lookup>( - 'dispatch_source_get_handle'); - late final _dispatch_source_get_handle = _dispatch_source_get_handlePtr - .asFunction(); + late final _CFUserNotificationDisplayNoticePtr = _lookup< + ffi.NativeFunction< + SInt32 Function( + CFTimeInterval, + CFOptionFlags, + CFURLRef, + CFURLRef, + CFURLRef, + CFStringRef, + CFStringRef, + CFStringRef)>>('CFUserNotificationDisplayNotice'); + late final _CFUserNotificationDisplayNotice = + _CFUserNotificationDisplayNoticePtr.asFunction< + int Function(double, int, CFURLRef, CFURLRef, CFURLRef, CFStringRef, + CFStringRef, CFStringRef)>(); - int dispatch_source_get_mask( - dispatch_source_t source, + int CFUserNotificationDisplayAlert( + double timeout, + int flags, + CFURLRef iconURL, + CFURLRef soundURL, + CFURLRef localizationURL, + CFStringRef alertHeader, + CFStringRef alertMessage, + CFStringRef defaultButtonTitle, + CFStringRef alternateButtonTitle, + CFStringRef otherButtonTitle, + ffi.Pointer responseFlags, ) { - return _dispatch_source_get_mask( - source, + return _CFUserNotificationDisplayAlert( + timeout, + flags, + iconURL, + soundURL, + localizationURL, + alertHeader, + alertMessage, + defaultButtonTitle, + alternateButtonTitle, + otherButtonTitle, + responseFlags, ); } - late final _dispatch_source_get_maskPtr = - _lookup>( - 'dispatch_source_get_mask'); - late final _dispatch_source_get_mask = _dispatch_source_get_maskPtr - .asFunction(); + late final _CFUserNotificationDisplayAlertPtr = _lookup< + ffi.NativeFunction< + SInt32 Function( + CFTimeInterval, + CFOptionFlags, + CFURLRef, + CFURLRef, + CFURLRef, + CFStringRef, + CFStringRef, + CFStringRef, + CFStringRef, + CFStringRef, + ffi.Pointer)>>('CFUserNotificationDisplayAlert'); + late final _CFUserNotificationDisplayAlert = + _CFUserNotificationDisplayAlertPtr.asFunction< + int Function( + double, + int, + CFURLRef, + CFURLRef, + CFURLRef, + CFStringRef, + CFStringRef, + CFStringRef, + CFStringRef, + CFStringRef, + ffi.Pointer)>(); - int dispatch_source_get_data( - dispatch_source_t source, - ) { - return _dispatch_source_get_data( - source, - ); - } + late final ffi.Pointer _kCFUserNotificationIconURLKey = + _lookup('kCFUserNotificationIconURLKey'); - late final _dispatch_source_get_dataPtr = - _lookup>( - 'dispatch_source_get_data'); - late final _dispatch_source_get_data = _dispatch_source_get_dataPtr - .asFunction(); + CFStringRef get kCFUserNotificationIconURLKey => + _kCFUserNotificationIconURLKey.value; - void dispatch_source_merge_data( - dispatch_source_t source, - int value, - ) { - return _dispatch_source_merge_data( - source, - value, - ); - } + late final ffi.Pointer _kCFUserNotificationSoundURLKey = + _lookup('kCFUserNotificationSoundURLKey'); - late final _dispatch_source_merge_dataPtr = _lookup< - ffi - .NativeFunction>( - 'dispatch_source_merge_data'); - late final _dispatch_source_merge_data = _dispatch_source_merge_dataPtr - .asFunction(); + CFStringRef get kCFUserNotificationSoundURLKey => + _kCFUserNotificationSoundURLKey.value; - void dispatch_source_set_timer( - dispatch_source_t source, - int start, - int interval, - int leeway, - ) { - return _dispatch_source_set_timer( - source, - start, - interval, - leeway, - ); - } + late final ffi.Pointer _kCFUserNotificationLocalizationURLKey = + _lookup('kCFUserNotificationLocalizationURLKey'); - late final _dispatch_source_set_timerPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_source_t, dispatch_time_t, ffi.Uint64, - ffi.Uint64)>>('dispatch_source_set_timer'); - late final _dispatch_source_set_timer = _dispatch_source_set_timerPtr - .asFunction(); + CFStringRef get kCFUserNotificationLocalizationURLKey => + _kCFUserNotificationLocalizationURLKey.value; - void dispatch_source_set_registration_handler( - dispatch_source_t source, - Dartdispatch_block_t handler, - ) { - return _dispatch_source_set_registration_handler( - source, - handler._id, - ); - } + late final ffi.Pointer _kCFUserNotificationAlertHeaderKey = + _lookup('kCFUserNotificationAlertHeaderKey'); - late final _dispatch_source_set_registration_handlerPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_source_t, - dispatch_block_t)>>('dispatch_source_set_registration_handler'); - late final _dispatch_source_set_registration_handler = - _dispatch_source_set_registration_handlerPtr - .asFunction(); + CFStringRef get kCFUserNotificationAlertHeaderKey => + _kCFUserNotificationAlertHeaderKey.value; - void dispatch_source_set_registration_handler_f( - dispatch_source_t source, - dispatch_function_t handler, - ) { - return _dispatch_source_set_registration_handler_f( - source, - handler, - ); - } + late final ffi.Pointer _kCFUserNotificationAlertMessageKey = + _lookup('kCFUserNotificationAlertMessageKey'); - late final _dispatch_source_set_registration_handler_fPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_source_t, dispatch_function_t)>>( - 'dispatch_source_set_registration_handler_f'); - late final _dispatch_source_set_registration_handler_f = - _dispatch_source_set_registration_handler_fPtr - .asFunction(); + CFStringRef get kCFUserNotificationAlertMessageKey => + _kCFUserNotificationAlertMessageKey.value; - dispatch_group_t dispatch_group_create() { - return _dispatch_group_create(); - } + late final ffi.Pointer + _kCFUserNotificationDefaultButtonTitleKey = + _lookup('kCFUserNotificationDefaultButtonTitleKey'); - late final _dispatch_group_createPtr = - _lookup>( - 'dispatch_group_create'); - late final _dispatch_group_create = - _dispatch_group_createPtr.asFunction(); + CFStringRef get kCFUserNotificationDefaultButtonTitleKey => + _kCFUserNotificationDefaultButtonTitleKey.value; - void dispatch_group_async( - dispatch_group_t group, - dispatch_queue_t queue, - Dartdispatch_block_t block, - ) { - return _dispatch_group_async( - group, - queue, - block._id, - ); - } + late final ffi.Pointer + _kCFUserNotificationAlternateButtonTitleKey = + _lookup('kCFUserNotificationAlternateButtonTitleKey'); - late final _dispatch_group_asyncPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_group_t, dispatch_queue_t, - dispatch_block_t)>>('dispatch_group_async'); - late final _dispatch_group_async = _dispatch_group_asyncPtr.asFunction< - void Function(dispatch_group_t, dispatch_queue_t, dispatch_block_t)>(); + CFStringRef get kCFUserNotificationAlternateButtonTitleKey => + _kCFUserNotificationAlternateButtonTitleKey.value; - void dispatch_group_async_f( - dispatch_group_t group, - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, - ) { - return _dispatch_group_async_f( - group, - queue, - context, - work, - ); - } + late final ffi.Pointer _kCFUserNotificationOtherButtonTitleKey = + _lookup('kCFUserNotificationOtherButtonTitleKey'); - late final _dispatch_group_async_fPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - dispatch_group_t, - dispatch_queue_t, - ffi.Pointer, - dispatch_function_t)>>('dispatch_group_async_f'); - late final _dispatch_group_async_f = _dispatch_group_async_fPtr.asFunction< - void Function(dispatch_group_t, dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>(); + CFStringRef get kCFUserNotificationOtherButtonTitleKey => + _kCFUserNotificationOtherButtonTitleKey.value; - int dispatch_group_wait( - dispatch_group_t group, - int timeout, - ) { - return _dispatch_group_wait( - group, - timeout, - ); - } + late final ffi.Pointer + _kCFUserNotificationProgressIndicatorValueKey = + _lookup('kCFUserNotificationProgressIndicatorValueKey'); - late final _dispatch_group_waitPtr = _lookup< - ffi.NativeFunction< - ffi.IntPtr Function( - dispatch_group_t, dispatch_time_t)>>('dispatch_group_wait'); - late final _dispatch_group_wait = - _dispatch_group_waitPtr.asFunction(); + CFStringRef get kCFUserNotificationProgressIndicatorValueKey => + _kCFUserNotificationProgressIndicatorValueKey.value; - void dispatch_group_notify( - dispatch_group_t group, - dispatch_queue_t queue, - Dartdispatch_block_t block, - ) { - return _dispatch_group_notify( - group, - queue, - block._id, - ); + late final ffi.Pointer _kCFUserNotificationPopUpTitlesKey = + _lookup('kCFUserNotificationPopUpTitlesKey'); + + CFStringRef get kCFUserNotificationPopUpTitlesKey => + _kCFUserNotificationPopUpTitlesKey.value; + + late final ffi.Pointer _kCFUserNotificationTextFieldTitlesKey = + _lookup('kCFUserNotificationTextFieldTitlesKey'); + + CFStringRef get kCFUserNotificationTextFieldTitlesKey => + _kCFUserNotificationTextFieldTitlesKey.value; + + late final ffi.Pointer _kCFUserNotificationCheckBoxTitlesKey = + _lookup('kCFUserNotificationCheckBoxTitlesKey'); + + CFStringRef get kCFUserNotificationCheckBoxTitlesKey => + _kCFUserNotificationCheckBoxTitlesKey.value; + + late final ffi.Pointer _kCFUserNotificationTextFieldValuesKey = + _lookup('kCFUserNotificationTextFieldValuesKey'); + + CFStringRef get kCFUserNotificationTextFieldValuesKey => + _kCFUserNotificationTextFieldValuesKey.value; + + late final ffi.Pointer _kCFUserNotificationPopUpSelectionKey = + _lookup('kCFUserNotificationPopUpSelectionKey'); + + CFStringRef get kCFUserNotificationPopUpSelectionKey => + _kCFUserNotificationPopUpSelectionKey.value; + + late final ffi.Pointer _kCFUserNotificationAlertTopMostKey = + _lookup('kCFUserNotificationAlertTopMostKey'); + + CFStringRef get kCFUserNotificationAlertTopMostKey => + _kCFUserNotificationAlertTopMostKey.value; + + late final ffi.Pointer _kCFUserNotificationKeyboardTypesKey = + _lookup('kCFUserNotificationKeyboardTypesKey'); + + CFStringRef get kCFUserNotificationKeyboardTypesKey => + _kCFUserNotificationKeyboardTypesKey.value; + + int CFXMLNodeGetTypeID() { + return _CFXMLNodeGetTypeID(); } - late final _dispatch_group_notifyPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_group_t, dispatch_queue_t, - dispatch_block_t)>>('dispatch_group_notify'); - late final _dispatch_group_notify = _dispatch_group_notifyPtr.asFunction< - void Function(dispatch_group_t, dispatch_queue_t, dispatch_block_t)>(); + late final _CFXMLNodeGetTypeIDPtr = + _lookup>('CFXMLNodeGetTypeID'); + late final _CFXMLNodeGetTypeID = + _CFXMLNodeGetTypeIDPtr.asFunction(); - void dispatch_group_notify_f( - dispatch_group_t group, - dispatch_queue_t queue, - ffi.Pointer context, - dispatch_function_t work, + CFXMLNodeRef CFXMLNodeCreate( + CFAllocatorRef alloc, + CFXMLNodeTypeCode xmlType, + CFStringRef dataString, + ffi.Pointer additionalInfoPtr, + DartCFIndex version, ) { - return _dispatch_group_notify_f( - group, - queue, - context, - work, + return _CFXMLNodeCreate( + alloc, + xmlType.value, + dataString, + additionalInfoPtr, + version, ); } - late final _dispatch_group_notify_fPtr = _lookup< + late final _CFXMLNodeCreatePtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - dispatch_group_t, - dispatch_queue_t, - ffi.Pointer, - dispatch_function_t)>>('dispatch_group_notify_f'); - late final _dispatch_group_notify_f = _dispatch_group_notify_fPtr.asFunction< - void Function(dispatch_group_t, dispatch_queue_t, ffi.Pointer, - dispatch_function_t)>(); + CFXMLNodeRef Function(CFAllocatorRef, CFIndex, CFStringRef, + ffi.Pointer, CFIndex)>>('CFXMLNodeCreate'); + late final _CFXMLNodeCreate = _CFXMLNodeCreatePtr.asFunction< + CFXMLNodeRef Function( + CFAllocatorRef, int, CFStringRef, ffi.Pointer, int)>(); - void dispatch_group_enter( - dispatch_group_t group, + CFXMLNodeRef CFXMLNodeCreateCopy( + CFAllocatorRef alloc, + CFXMLNodeRef origNode, ) { - return _dispatch_group_enter( - group, + return _CFXMLNodeCreateCopy( + alloc, + origNode, ); } - late final _dispatch_group_enterPtr = - _lookup>( - 'dispatch_group_enter'); - late final _dispatch_group_enter = - _dispatch_group_enterPtr.asFunction(); + late final _CFXMLNodeCreateCopyPtr = _lookup< + ffi + .NativeFunction>( + 'CFXMLNodeCreateCopy'); + late final _CFXMLNodeCreateCopy = _CFXMLNodeCreateCopyPtr.asFunction< + CFXMLNodeRef Function(CFAllocatorRef, CFXMLNodeRef)>(); - void dispatch_group_leave( - dispatch_group_t group, + CFXMLNodeTypeCode CFXMLNodeGetTypeCode( + CFXMLNodeRef node, ) { - return _dispatch_group_leave( - group, - ); + return CFXMLNodeTypeCode.fromValue(_CFXMLNodeGetTypeCode( + node, + )); } - late final _dispatch_group_leavePtr = - _lookup>( - 'dispatch_group_leave'); - late final _dispatch_group_leave = - _dispatch_group_leavePtr.asFunction(); + late final _CFXMLNodeGetTypeCodePtr = + _lookup>( + 'CFXMLNodeGetTypeCode'); + late final _CFXMLNodeGetTypeCode = + _CFXMLNodeGetTypeCodePtr.asFunction(); - dispatch_semaphore_t dispatch_semaphore_create( - int value, + CFStringRef CFXMLNodeGetString( + CFXMLNodeRef node, ) { - return _dispatch_semaphore_create( - value, + return _CFXMLNodeGetString( + node, ); } - late final _dispatch_semaphore_createPtr = - _lookup>( - 'dispatch_semaphore_create'); - late final _dispatch_semaphore_create = _dispatch_semaphore_createPtr - .asFunction(); + late final _CFXMLNodeGetStringPtr = + _lookup>( + 'CFXMLNodeGetString'); + late final _CFXMLNodeGetString = + _CFXMLNodeGetStringPtr.asFunction(); - int dispatch_semaphore_wait( - dispatch_semaphore_t dsema, - int timeout, + ffi.Pointer CFXMLNodeGetInfoPtr( + CFXMLNodeRef node, ) { - return _dispatch_semaphore_wait( - dsema, - timeout, + return _CFXMLNodeGetInfoPtr( + node, ); } - late final _dispatch_semaphore_waitPtr = _lookup< - ffi.NativeFunction< - ffi.IntPtr Function(dispatch_semaphore_t, - dispatch_time_t)>>('dispatch_semaphore_wait'); - late final _dispatch_semaphore_wait = _dispatch_semaphore_waitPtr - .asFunction(); + late final _CFXMLNodeGetInfoPtrPtr = + _lookup Function(CFXMLNodeRef)>>( + 'CFXMLNodeGetInfoPtr'); + late final _CFXMLNodeGetInfoPtr = _CFXMLNodeGetInfoPtrPtr.asFunction< + ffi.Pointer Function(CFXMLNodeRef)>(); - int dispatch_semaphore_signal( - dispatch_semaphore_t dsema, + int CFXMLNodeGetVersion( + CFXMLNodeRef node, ) { - return _dispatch_semaphore_signal( - dsema, + return _CFXMLNodeGetVersion( + node, ); } - late final _dispatch_semaphore_signalPtr = - _lookup>( - 'dispatch_semaphore_signal'); - late final _dispatch_semaphore_signal = _dispatch_semaphore_signalPtr - .asFunction(); + late final _CFXMLNodeGetVersionPtr = + _lookup>( + 'CFXMLNodeGetVersion'); + late final _CFXMLNodeGetVersion = + _CFXMLNodeGetVersionPtr.asFunction(); - void dispatch_once( - ffi.Pointer predicate, - Dartdispatch_block_t block, + CFXMLTreeRef CFXMLTreeCreateWithNode( + CFAllocatorRef allocator, + CFXMLNodeRef node, ) { - return _dispatch_once( - predicate, - block._id, + return _CFXMLTreeCreateWithNode( + allocator, + node, ); } - late final _dispatch_oncePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - dispatch_block_t)>>('dispatch_once'); - late final _dispatch_once = _dispatch_oncePtr.asFunction< - void Function(ffi.Pointer, dispatch_block_t)>(); + late final _CFXMLTreeCreateWithNodePtr = _lookup< + ffi + .NativeFunction>( + 'CFXMLTreeCreateWithNode'); + late final _CFXMLTreeCreateWithNode = _CFXMLTreeCreateWithNodePtr.asFunction< + CFXMLTreeRef Function(CFAllocatorRef, CFXMLNodeRef)>(); - void dispatch_once_f( - ffi.Pointer predicate, - ffi.Pointer context, - dispatch_function_t function, + CFXMLNodeRef CFXMLTreeGetNode( + CFXMLTreeRef xmlTree, ) { - return _dispatch_once_f( - predicate, - context, - function, + return _CFXMLTreeGetNode( + xmlTree, ); } - late final _dispatch_once_fPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - dispatch_function_t)>>('dispatch_once_f'); - late final _dispatch_once_f = _dispatch_once_fPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - dispatch_function_t)>(); - - late final ffi.Pointer __dispatch_data_empty = - _lookup('_dispatch_data_empty'); - - ffi.Pointer get _dispatch_data_empty => - __dispatch_data_empty; - - late final ffi.Pointer __dispatch_data_destructor_free = - _lookup('_dispatch_data_destructor_free'); - - dispatch_block_t get _dispatch_data_destructor_free => - __dispatch_data_destructor_free.value; - - set _dispatch_data_destructor_free(dispatch_block_t value) => - __dispatch_data_destructor_free.value = value; - - late final ffi.Pointer __dispatch_data_destructor_munmap = - _lookup('_dispatch_data_destructor_munmap'); + late final _CFXMLTreeGetNodePtr = + _lookup>( + 'CFXMLTreeGetNode'); + late final _CFXMLTreeGetNode = + _CFXMLTreeGetNodePtr.asFunction(); - dispatch_block_t get _dispatch_data_destructor_munmap => - __dispatch_data_destructor_munmap.value; + int CFXMLParserGetTypeID() { + return _CFXMLParserGetTypeID(); + } - set _dispatch_data_destructor_munmap(dispatch_block_t value) => - __dispatch_data_destructor_munmap.value = value; + late final _CFXMLParserGetTypeIDPtr = + _lookup>('CFXMLParserGetTypeID'); + late final _CFXMLParserGetTypeID = + _CFXMLParserGetTypeIDPtr.asFunction(); - dispatch_data_t dispatch_data_create( - ffi.Pointer buffer, - int size, - dispatch_queue_t queue, - Dartdispatch_block_t destructor, + CFXMLParserRef CFXMLParserCreate( + CFAllocatorRef allocator, + CFDataRef xmlData, + CFURLRef dataSource, + int parseOptions, + int versionOfNodes, + ffi.Pointer callBacks, + ffi.Pointer context, ) { - return _dispatch_data_create( - buffer, - size, - queue, - destructor._id, + return _CFXMLParserCreate( + allocator, + xmlData, + dataSource, + parseOptions, + versionOfNodes, + callBacks, + context, ); } - late final _dispatch_data_createPtr = _lookup< + late final _CFXMLParserCreatePtr = _lookup< ffi.NativeFunction< - dispatch_data_t Function(ffi.Pointer, ffi.Size, - dispatch_queue_t, dispatch_block_t)>>('dispatch_data_create'); - late final _dispatch_data_create = _dispatch_data_createPtr.asFunction< - dispatch_data_t Function( - ffi.Pointer, int, dispatch_queue_t, dispatch_block_t)>(); + CFXMLParserRef Function( + CFAllocatorRef, + CFDataRef, + CFURLRef, + CFOptionFlags, + CFIndex, + ffi.Pointer, + ffi.Pointer)>>('CFXMLParserCreate'); + late final _CFXMLParserCreate = _CFXMLParserCreatePtr.asFunction< + CFXMLParserRef Function( + CFAllocatorRef, + CFDataRef, + CFURLRef, + int, + int, + ffi.Pointer, + ffi.Pointer)>(); - int dispatch_data_get_size( - dispatch_data_t data, + CFXMLParserRef CFXMLParserCreateWithDataFromURL( + CFAllocatorRef allocator, + CFURLRef dataSource, + int parseOptions, + int versionOfNodes, + ffi.Pointer callBacks, + ffi.Pointer context, ) { - return _dispatch_data_get_size( - data, + return _CFXMLParserCreateWithDataFromURL( + allocator, + dataSource, + parseOptions, + versionOfNodes, + callBacks, + context, ); } - late final _dispatch_data_get_sizePtr = - _lookup>( - 'dispatch_data_get_size'); - late final _dispatch_data_get_size = - _dispatch_data_get_sizePtr.asFunction(); + late final _CFXMLParserCreateWithDataFromURLPtr = _lookup< + ffi.NativeFunction< + CFXMLParserRef Function( + CFAllocatorRef, + CFURLRef, + CFOptionFlags, + CFIndex, + ffi.Pointer, + ffi.Pointer)>>( + 'CFXMLParserCreateWithDataFromURL'); + late final _CFXMLParserCreateWithDataFromURL = + _CFXMLParserCreateWithDataFromURLPtr.asFunction< + CFXMLParserRef Function( + CFAllocatorRef, + CFURLRef, + int, + int, + ffi.Pointer, + ffi.Pointer)>(); - dispatch_data_t dispatch_data_create_map( - dispatch_data_t data, - ffi.Pointer> buffer_ptr, - ffi.Pointer size_ptr, + void CFXMLParserGetContext( + CFXMLParserRef parser, + ffi.Pointer context, ) { - return _dispatch_data_create_map( - data, - buffer_ptr, - size_ptr, + return _CFXMLParserGetContext( + parser, + context, ); } - late final _dispatch_data_create_mapPtr = _lookup< + late final _CFXMLParserGetContextPtr = _lookup< ffi.NativeFunction< - dispatch_data_t Function( - dispatch_data_t, - ffi.Pointer>, - ffi.Pointer)>>('dispatch_data_create_map'); - late final _dispatch_data_create_map = - _dispatch_data_create_mapPtr.asFunction< - dispatch_data_t Function(dispatch_data_t, - ffi.Pointer>, ffi.Pointer)>(); + ffi.Void Function(CFXMLParserRef, + ffi.Pointer)>>('CFXMLParserGetContext'); + late final _CFXMLParserGetContext = _CFXMLParserGetContextPtr.asFunction< + void Function(CFXMLParserRef, ffi.Pointer)>(); - dispatch_data_t dispatch_data_create_concat( - dispatch_data_t data1, - dispatch_data_t data2, + void CFXMLParserGetCallBacks( + CFXMLParserRef parser, + ffi.Pointer callBacks, ) { - return _dispatch_data_create_concat( - data1, - data2, + return _CFXMLParserGetCallBacks( + parser, + callBacks, ); } - late final _dispatch_data_create_concatPtr = _lookup< + late final _CFXMLParserGetCallBacksPtr = _lookup< ffi.NativeFunction< - dispatch_data_t Function(dispatch_data_t, - dispatch_data_t)>>('dispatch_data_create_concat'); - late final _dispatch_data_create_concat = _dispatch_data_create_concatPtr - .asFunction(); + ffi.Void Function(CFXMLParserRef, + ffi.Pointer)>>('CFXMLParserGetCallBacks'); + late final _CFXMLParserGetCallBacks = _CFXMLParserGetCallBacksPtr.asFunction< + void Function(CFXMLParserRef, ffi.Pointer)>(); - dispatch_data_t dispatch_data_create_subrange( - dispatch_data_t data, - int offset, - int length, + CFURLRef CFXMLParserGetSourceURL( + CFXMLParserRef parser, ) { - return _dispatch_data_create_subrange( - data, - offset, - length, + return _CFXMLParserGetSourceURL( + parser, ); } - late final _dispatch_data_create_subrangePtr = _lookup< - ffi.NativeFunction< - dispatch_data_t Function(dispatch_data_t, ffi.Size, - ffi.Size)>>('dispatch_data_create_subrange'); - late final _dispatch_data_create_subrange = _dispatch_data_create_subrangePtr - .asFunction(); + late final _CFXMLParserGetSourceURLPtr = + _lookup>( + 'CFXMLParserGetSourceURL'); + late final _CFXMLParserGetSourceURL = _CFXMLParserGetSourceURLPtr.asFunction< + CFURLRef Function(CFXMLParserRef)>(); - bool dispatch_data_apply( - dispatch_data_t data, - Dartdispatch_data_applier_t applier, + int CFXMLParserGetLocation( + CFXMLParserRef parser, ) { - return _dispatch_data_apply( - data, - applier._id, + return _CFXMLParserGetLocation( + parser, ); } - late final _dispatch_data_applyPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(dispatch_data_t, - dispatch_data_applier_t)>>('dispatch_data_apply'); - late final _dispatch_data_apply = _dispatch_data_applyPtr - .asFunction(); + late final _CFXMLParserGetLocationPtr = + _lookup>( + 'CFXMLParserGetLocation'); + late final _CFXMLParserGetLocation = + _CFXMLParserGetLocationPtr.asFunction(); - dispatch_data_t dispatch_data_copy_region( - dispatch_data_t data, - int location, - ffi.Pointer offset_ptr, + int CFXMLParserGetLineNumber( + CFXMLParserRef parser, ) { - return _dispatch_data_copy_region( - data, - location, - offset_ptr, + return _CFXMLParserGetLineNumber( + parser, ); } - late final _dispatch_data_copy_regionPtr = _lookup< - ffi.NativeFunction< - dispatch_data_t Function(dispatch_data_t, ffi.Size, - ffi.Pointer)>>('dispatch_data_copy_region'); - late final _dispatch_data_copy_region = - _dispatch_data_copy_regionPtr.asFunction< - dispatch_data_t Function( - dispatch_data_t, int, ffi.Pointer)>(); + late final _CFXMLParserGetLineNumberPtr = + _lookup>( + 'CFXMLParserGetLineNumber'); + late final _CFXMLParserGetLineNumber = + _CFXMLParserGetLineNumberPtr.asFunction(); - void dispatch_read( - Dartdispatch_fd_t fd, - int length, - dispatch_queue_t queue, - ObjCBlock_ffiVoid_dispatchdatat_ffiInt handler, + ffi.Pointer CFXMLParserGetDocument( + CFXMLParserRef parser, ) { - return _dispatch_read( - fd, - length, - queue, - handler._id, + return _CFXMLParserGetDocument( + parser, ); } - late final _dispatch_readPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_fd_t, ffi.Size, dispatch_queue_t, - ffi.Pointer<_ObjCBlock>)>>('dispatch_read'); - late final _dispatch_read = _dispatch_readPtr.asFunction< - void Function(int, int, dispatch_queue_t, ffi.Pointer<_ObjCBlock>)>(); + late final _CFXMLParserGetDocumentPtr = _lookup< + ffi.NativeFunction Function(CFXMLParserRef)>>( + 'CFXMLParserGetDocument'); + late final _CFXMLParserGetDocument = _CFXMLParserGetDocumentPtr.asFunction< + ffi.Pointer Function(CFXMLParserRef)>(); - void dispatch_write( - Dartdispatch_fd_t fd, - dispatch_data_t data, - dispatch_queue_t queue, - ObjCBlock_ffiVoid_dispatchdatat_ffiInt handler, + CFXMLParserStatusCode CFXMLParserGetStatusCode( + CFXMLParserRef parser, ) { - return _dispatch_write( - fd, - data, - queue, - handler._id, - ); + return CFXMLParserStatusCode.fromValue(_CFXMLParserGetStatusCode( + parser, + )); } - late final _dispatch_writePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_fd_t, dispatch_data_t, dispatch_queue_t, - ffi.Pointer<_ObjCBlock>)>>('dispatch_write'); - late final _dispatch_write = _dispatch_writePtr.asFunction< - void Function( - int, dispatch_data_t, dispatch_queue_t, ffi.Pointer<_ObjCBlock>)>(); + late final _CFXMLParserGetStatusCodePtr = + _lookup>( + 'CFXMLParserGetStatusCode'); + late final _CFXMLParserGetStatusCode = + _CFXMLParserGetStatusCodePtr.asFunction(); - dispatch_io_t dispatch_io_create( - Dartdispatch_io_type_t type, - Dartdispatch_fd_t fd, - dispatch_queue_t queue, - ObjCBlock_ffiVoid_ffiInt cleanup_handler, + CFStringRef CFXMLParserCopyErrorDescription( + CFXMLParserRef parser, ) { - return _dispatch_io_create( - type, - fd, - queue, - cleanup_handler._id, + return _CFXMLParserCopyErrorDescription( + parser, ); } - late final _dispatch_io_createPtr = _lookup< - ffi.NativeFunction< - dispatch_io_t Function( - dispatch_io_type_t, - dispatch_fd_t, - dispatch_queue_t, - ffi.Pointer<_ObjCBlock>)>>('dispatch_io_create'); - late final _dispatch_io_create = _dispatch_io_createPtr.asFunction< - dispatch_io_t Function( - int, int, dispatch_queue_t, ffi.Pointer<_ObjCBlock>)>(); + late final _CFXMLParserCopyErrorDescriptionPtr = + _lookup>( + 'CFXMLParserCopyErrorDescription'); + late final _CFXMLParserCopyErrorDescription = + _CFXMLParserCopyErrorDescriptionPtr.asFunction< + CFStringRef Function(CFXMLParserRef)>(); - dispatch_io_t dispatch_io_create_with_path( - Dartdispatch_io_type_t type, - ffi.Pointer path, - int oflag, - Dart__uint16_t mode, - dispatch_queue_t queue, - ObjCBlock_ffiVoid_ffiInt cleanup_handler, + void CFXMLParserAbort( + CFXMLParserRef parser, + CFXMLParserStatusCode errorCode, + CFStringRef errorDescription, ) { - return _dispatch_io_create_with_path( - type, - path, - oflag, - mode, - queue, - cleanup_handler._id, + return _CFXMLParserAbort( + parser, + errorCode.value, + errorDescription, ); } - late final _dispatch_io_create_with_pathPtr = _lookup< + late final _CFXMLParserAbortPtr = _lookup< ffi.NativeFunction< - dispatch_io_t Function( - dispatch_io_type_t, - ffi.Pointer, - ffi.Int, - mode_t, - dispatch_queue_t, - ffi.Pointer<_ObjCBlock>)>>('dispatch_io_create_with_path'); - late final _dispatch_io_create_with_path = - _dispatch_io_create_with_pathPtr.asFunction< - dispatch_io_t Function(int, ffi.Pointer, int, int, - dispatch_queue_t, ffi.Pointer<_ObjCBlock>)>(); + ffi.Void Function( + CFXMLParserRef, CFIndex, CFStringRef)>>('CFXMLParserAbort'); + late final _CFXMLParserAbort = _CFXMLParserAbortPtr.asFunction< + void Function(CFXMLParserRef, int, CFStringRef)>(); - dispatch_io_t dispatch_io_create_with_io( - Dartdispatch_io_type_t type, - dispatch_io_t io, - dispatch_queue_t queue, - ObjCBlock_ffiVoid_ffiInt cleanup_handler, + int CFXMLParserParse( + CFXMLParserRef parser, ) { - return _dispatch_io_create_with_io( - type, - io, - queue, - cleanup_handler._id, + return _CFXMLParserParse( + parser, ); } - late final _dispatch_io_create_with_ioPtr = _lookup< - ffi.NativeFunction< - dispatch_io_t Function( - dispatch_io_type_t, - dispatch_io_t, - dispatch_queue_t, - ffi.Pointer<_ObjCBlock>)>>('dispatch_io_create_with_io'); - late final _dispatch_io_create_with_io = - _dispatch_io_create_with_ioPtr.asFunction< - dispatch_io_t Function( - int, dispatch_io_t, dispatch_queue_t, ffi.Pointer<_ObjCBlock>)>(); + late final _CFXMLParserParsePtr = + _lookup>( + 'CFXMLParserParse'); + late final _CFXMLParserParse = + _CFXMLParserParsePtr.asFunction(); - void dispatch_io_read( - dispatch_io_t channel, - Dart__int64_t offset, - int length, - dispatch_queue_t queue, - Dartdispatch_io_handler_t io_handler, + CFXMLTreeRef CFXMLTreeCreateFromData( + CFAllocatorRef allocator, + CFDataRef xmlData, + CFURLRef dataSource, + int parseOptions, + int versionOfNodes, ) { - return _dispatch_io_read( - channel, - offset, - length, - queue, - io_handler._id, + return _CFXMLTreeCreateFromData( + allocator, + xmlData, + dataSource, + parseOptions, + versionOfNodes, ); } - late final _dispatch_io_readPtr = _lookup< + late final _CFXMLTreeCreateFromDataPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(dispatch_io_t, off_t, ffi.Size, dispatch_queue_t, - dispatch_io_handler_t)>>('dispatch_io_read'); - late final _dispatch_io_read = _dispatch_io_readPtr.asFunction< - void Function( - dispatch_io_t, int, int, dispatch_queue_t, dispatch_io_handler_t)>(); + CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, + CFOptionFlags, CFIndex)>>('CFXMLTreeCreateFromData'); + late final _CFXMLTreeCreateFromData = _CFXMLTreeCreateFromDataPtr.asFunction< + CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, int, int)>(); - void dispatch_io_write( - dispatch_io_t channel, - Dart__int64_t offset, - dispatch_data_t data, - dispatch_queue_t queue, - Dartdispatch_io_handler_t io_handler, + CFXMLTreeRef CFXMLTreeCreateFromDataWithError( + CFAllocatorRef allocator, + CFDataRef xmlData, + CFURLRef dataSource, + int parseOptions, + int versionOfNodes, + ffi.Pointer errorDict, ) { - return _dispatch_io_write( - channel, - offset, - data, - queue, - io_handler._id, + return _CFXMLTreeCreateFromDataWithError( + allocator, + xmlData, + dataSource, + parseOptions, + versionOfNodes, + errorDict, ); } - late final _dispatch_io_writePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_io_t, off_t, dispatch_data_t, - dispatch_queue_t, dispatch_io_handler_t)>>('dispatch_io_write'); - late final _dispatch_io_write = _dispatch_io_writePtr.asFunction< - void Function(dispatch_io_t, int, dispatch_data_t, dispatch_queue_t, - dispatch_io_handler_t)>(); + late final _CFXMLTreeCreateFromDataWithErrorPtr = _lookup< + ffi.NativeFunction< + CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, + CFOptionFlags, CFIndex, ffi.Pointer)>>( + 'CFXMLTreeCreateFromDataWithError'); + late final _CFXMLTreeCreateFromDataWithError = + _CFXMLTreeCreateFromDataWithErrorPtr.asFunction< + CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, int, int, + ffi.Pointer)>(); - void dispatch_io_close( - dispatch_io_t channel, - int flags, + CFXMLTreeRef CFXMLTreeCreateWithDataFromURL( + CFAllocatorRef allocator, + CFURLRef dataSource, + int parseOptions, + int versionOfNodes, ) { - return _dispatch_io_close( - channel, - flags, + return _CFXMLTreeCreateWithDataFromURL( + allocator, + dataSource, + parseOptions, + versionOfNodes, ); } - late final _dispatch_io_closePtr = _lookup< + late final _CFXMLTreeCreateWithDataFromURLPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - dispatch_io_t, dispatch_io_close_flags_t)>>('dispatch_io_close'); - late final _dispatch_io_close = - _dispatch_io_closePtr.asFunction(); + CFXMLTreeRef Function(CFAllocatorRef, CFURLRef, CFOptionFlags, + CFIndex)>>('CFXMLTreeCreateWithDataFromURL'); + late final _CFXMLTreeCreateWithDataFromURL = + _CFXMLTreeCreateWithDataFromURLPtr.asFunction< + CFXMLTreeRef Function(CFAllocatorRef, CFURLRef, int, int)>(); - void dispatch_io_barrier( - dispatch_io_t channel, - Dartdispatch_block_t barrier, + CFDataRef CFXMLTreeCreateXMLData( + CFAllocatorRef allocator, + CFXMLTreeRef xmlTree, ) { - return _dispatch_io_barrier( - channel, - barrier._id, + return _CFXMLTreeCreateXMLData( + allocator, + xmlTree, ); } - late final _dispatch_io_barrierPtr = _lookup< - ffi - .NativeFunction>( - 'dispatch_io_barrier'); - late final _dispatch_io_barrier = _dispatch_io_barrierPtr - .asFunction(); + late final _CFXMLTreeCreateXMLDataPtr = _lookup< + ffi.NativeFunction>( + 'CFXMLTreeCreateXMLData'); + late final _CFXMLTreeCreateXMLData = _CFXMLTreeCreateXMLDataPtr.asFunction< + CFDataRef Function(CFAllocatorRef, CFXMLTreeRef)>(); - int dispatch_io_get_descriptor( - dispatch_io_t channel, + CFStringRef CFXMLCreateStringByEscapingEntities( + CFAllocatorRef allocator, + CFStringRef string, + CFDictionaryRef entitiesDictionary, ) { - return _dispatch_io_get_descriptor( - channel, + return _CFXMLCreateStringByEscapingEntities( + allocator, + string, + entitiesDictionary, ); } - late final _dispatch_io_get_descriptorPtr = - _lookup>( - 'dispatch_io_get_descriptor'); - late final _dispatch_io_get_descriptor = - _dispatch_io_get_descriptorPtr.asFunction(); + late final _CFXMLCreateStringByEscapingEntitiesPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, + CFDictionaryRef)>>('CFXMLCreateStringByEscapingEntities'); + late final _CFXMLCreateStringByEscapingEntities = + _CFXMLCreateStringByEscapingEntitiesPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, CFDictionaryRef)>(); - void dispatch_io_set_high_water( - dispatch_io_t channel, - int high_water, + CFStringRef CFXMLCreateStringByUnescapingEntities( + CFAllocatorRef allocator, + CFStringRef string, + CFDictionaryRef entitiesDictionary, ) { - return _dispatch_io_set_high_water( - channel, - high_water, + return _CFXMLCreateStringByUnescapingEntities( + allocator, + string, + entitiesDictionary, ); } - late final _dispatch_io_set_high_waterPtr = - _lookup>( - 'dispatch_io_set_high_water'); - late final _dispatch_io_set_high_water = _dispatch_io_set_high_waterPtr - .asFunction(); + late final _CFXMLCreateStringByUnescapingEntitiesPtr = _lookup< + ffi.NativeFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, + CFDictionaryRef)>>('CFXMLCreateStringByUnescapingEntities'); + late final _CFXMLCreateStringByUnescapingEntities = + _CFXMLCreateStringByUnescapingEntitiesPtr.asFunction< + CFStringRef Function(CFAllocatorRef, CFStringRef, CFDictionaryRef)>(); - void dispatch_io_set_low_water( - dispatch_io_t channel, - int low_water, - ) { - return _dispatch_io_set_low_water( - channel, - low_water, - ); - } + late final ffi.Pointer _kCFXMLTreeErrorDescription = + _lookup('kCFXMLTreeErrorDescription'); - late final _dispatch_io_set_low_waterPtr = - _lookup>( - 'dispatch_io_set_low_water'); - late final _dispatch_io_set_low_water = _dispatch_io_set_low_waterPtr - .asFunction(); + CFStringRef get kCFXMLTreeErrorDescription => + _kCFXMLTreeErrorDescription.value; - void dispatch_io_set_interval( - dispatch_io_t channel, - int interval, - int flags, - ) { - return _dispatch_io_set_interval( - channel, - interval, - flags, - ); - } + late final ffi.Pointer _kCFXMLTreeErrorLineNumber = + _lookup('kCFXMLTreeErrorLineNumber'); - late final _dispatch_io_set_intervalPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_io_t, ffi.Uint64, - dispatch_io_interval_flags_t)>>('dispatch_io_set_interval'); - late final _dispatch_io_set_interval = _dispatch_io_set_intervalPtr - .asFunction(); + CFStringRef get kCFXMLTreeErrorLineNumber => _kCFXMLTreeErrorLineNumber.value; - dispatch_workloop_t dispatch_workloop_create( - ffi.Pointer label, - ) { - return _dispatch_workloop_create( - label, - ); - } + late final ffi.Pointer _kCFXMLTreeErrorLocation = + _lookup('kCFXMLTreeErrorLocation'); - late final _dispatch_workloop_createPtr = _lookup< - ffi - .NativeFunction)>>( - 'dispatch_workloop_create'); - late final _dispatch_workloop_create = _dispatch_workloop_createPtr - .asFunction)>(); + CFStringRef get kCFXMLTreeErrorLocation => _kCFXMLTreeErrorLocation.value; - dispatch_workloop_t dispatch_workloop_create_inactive( - ffi.Pointer label, - ) { - return _dispatch_workloop_create_inactive( - label, - ); - } + late final ffi.Pointer _kCFXMLTreeErrorStatusCode = + _lookup('kCFXMLTreeErrorStatusCode'); - late final _dispatch_workloop_create_inactivePtr = _lookup< - ffi - .NativeFunction)>>( - 'dispatch_workloop_create_inactive'); - late final _dispatch_workloop_create_inactive = - _dispatch_workloop_create_inactivePtr - .asFunction)>(); + CFStringRef get kCFXMLTreeErrorStatusCode => _kCFXMLTreeErrorStatusCode.value; - void dispatch_workloop_set_autorelease_frequency( - dispatch_workloop_t workloop, - int frequency, - ) { - return _dispatch_workloop_set_autorelease_frequency( - workloop, - frequency, - ); - } + late final ffi.Pointer _gGuidCssm = + _lookup('gGuidCssm'); - late final _dispatch_workloop_set_autorelease_frequencyPtr = _lookup< - ffi - .NativeFunction>( - 'dispatch_workloop_set_autorelease_frequency'); - late final _dispatch_workloop_set_autorelease_frequency = - _dispatch_workloop_set_autorelease_frequencyPtr - .asFunction(); + CSSM_GUID get gGuidCssm => _gGuidCssm.ref; - void dispatch_workloop_set_os_workgroup( - dispatch_workloop_t workloop, - os_workgroup_t workgroup, - ) { - return _dispatch_workloop_set_os_workgroup( - workloop, - workgroup, - ); - } + late final ffi.Pointer _gGuidAppleFileDL = + _lookup('gGuidAppleFileDL'); - late final _dispatch_workloop_set_os_workgroupPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(dispatch_workloop_t, - os_workgroup_t)>>('dispatch_workloop_set_os_workgroup'); - late final _dispatch_workloop_set_os_workgroup = - _dispatch_workloop_set_os_workgroupPtr - .asFunction(); + CSSM_GUID get gGuidAppleFileDL => _gGuidAppleFileDL.ref; - int CFReadStreamGetTypeID() { - return _CFReadStreamGetTypeID(); - } + late final ffi.Pointer _gGuidAppleCSP = + _lookup('gGuidAppleCSP'); - late final _CFReadStreamGetTypeIDPtr = - _lookup>('CFReadStreamGetTypeID'); - late final _CFReadStreamGetTypeID = - _CFReadStreamGetTypeIDPtr.asFunction(); + CSSM_GUID get gGuidAppleCSP => _gGuidAppleCSP.ref; - int CFWriteStreamGetTypeID() { - return _CFWriteStreamGetTypeID(); - } + late final ffi.Pointer _gGuidAppleCSPDL = + _lookup('gGuidAppleCSPDL'); - late final _CFWriteStreamGetTypeIDPtr = - _lookup>( - 'CFWriteStreamGetTypeID'); - late final _CFWriteStreamGetTypeID = - _CFWriteStreamGetTypeIDPtr.asFunction(); + CSSM_GUID get gGuidAppleCSPDL => _gGuidAppleCSPDL.ref; - late final ffi.Pointer _kCFStreamPropertyDataWritten = - _lookup('kCFStreamPropertyDataWritten'); + late final ffi.Pointer _gGuidAppleX509CL = + _lookup('gGuidAppleX509CL'); - CFStreamPropertyKey get kCFStreamPropertyDataWritten => - _kCFStreamPropertyDataWritten.value; + CSSM_GUID get gGuidAppleX509CL => _gGuidAppleX509CL.ref; - CFReadStreamRef CFReadStreamCreateWithBytesNoCopy( - CFAllocatorRef alloc, - ffi.Pointer bytes, - int length, - CFAllocatorRef bytesDeallocator, - ) { - return _CFReadStreamCreateWithBytesNoCopy( - alloc, - bytes, - length, - bytesDeallocator, - ); - } + late final ffi.Pointer _gGuidAppleX509TP = + _lookup('gGuidAppleX509TP'); - late final _CFReadStreamCreateWithBytesNoCopyPtr = _lookup< - ffi.NativeFunction< - CFReadStreamRef Function(CFAllocatorRef, ffi.Pointer, CFIndex, - CFAllocatorRef)>>('CFReadStreamCreateWithBytesNoCopy'); - late final _CFReadStreamCreateWithBytesNoCopy = - _CFReadStreamCreateWithBytesNoCopyPtr.asFunction< - CFReadStreamRef Function( - CFAllocatorRef, ffi.Pointer, int, CFAllocatorRef)>(); + CSSM_GUID get gGuidAppleX509TP => _gGuidAppleX509TP.ref; - CFWriteStreamRef CFWriteStreamCreateWithBuffer( - CFAllocatorRef alloc, - ffi.Pointer buffer, - int bufferCapacity, - ) { - return _CFWriteStreamCreateWithBuffer( - alloc, - buffer, - bufferCapacity, - ); - } + late final ffi.Pointer _gGuidAppleLDAPDL = + _lookup('gGuidAppleLDAPDL'); - late final _CFWriteStreamCreateWithBufferPtr = _lookup< - ffi.NativeFunction< - CFWriteStreamRef Function(CFAllocatorRef, ffi.Pointer, - CFIndex)>>('CFWriteStreamCreateWithBuffer'); - late final _CFWriteStreamCreateWithBuffer = - _CFWriteStreamCreateWithBufferPtr.asFunction< - CFWriteStreamRef Function(CFAllocatorRef, ffi.Pointer, int)>(); + CSSM_GUID get gGuidAppleLDAPDL => _gGuidAppleLDAPDL.ref; - CFWriteStreamRef CFWriteStreamCreateWithAllocatedBuffers( - CFAllocatorRef alloc, - CFAllocatorRef bufferAllocator, - ) { - return _CFWriteStreamCreateWithAllocatedBuffers( - alloc, - bufferAllocator, - ); - } + late final ffi.Pointer _gGuidAppleDotMacTP = + _lookup('gGuidAppleDotMacTP'); - late final _CFWriteStreamCreateWithAllocatedBuffersPtr = _lookup< - ffi.NativeFunction< - CFWriteStreamRef Function(CFAllocatorRef, - CFAllocatorRef)>>('CFWriteStreamCreateWithAllocatedBuffers'); - late final _CFWriteStreamCreateWithAllocatedBuffers = - _CFWriteStreamCreateWithAllocatedBuffersPtr.asFunction< - CFWriteStreamRef Function(CFAllocatorRef, CFAllocatorRef)>(); + CSSM_GUID get gGuidAppleDotMacTP => _gGuidAppleDotMacTP.ref; - CFReadStreamRef CFReadStreamCreateWithFile( - CFAllocatorRef alloc, - CFURLRef fileURL, + late final ffi.Pointer _gGuidAppleSdCSPDL = + _lookup('gGuidAppleSdCSPDL'); + + CSSM_GUID get gGuidAppleSdCSPDL => _gGuidAppleSdCSPDL.ref; + + late final ffi.Pointer _gGuidAppleDotMacDL = + _lookup('gGuidAppleDotMacDL'); + + CSSM_GUID get gGuidAppleDotMacDL => _gGuidAppleDotMacDL.ref; + + void cssmPerror( + ffi.Pointer how, + int error, ) { - return _CFReadStreamCreateWithFile( - alloc, - fileURL, + return _cssmPerror( + how, + error, ); } - late final _CFReadStreamCreateWithFilePtr = _lookup< - ffi - .NativeFunction>( - 'CFReadStreamCreateWithFile'); - late final _CFReadStreamCreateWithFile = _CFReadStreamCreateWithFilePtr - .asFunction(); + late final _cssmPerrorPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, CSSM_RETURN)>>('cssmPerror'); + late final _cssmPerror = + _cssmPerrorPtr.asFunction, int)>(); - CFWriteStreamRef CFWriteStreamCreateWithFile( - CFAllocatorRef alloc, - CFURLRef fileURL, + bool cssmOidToAlg( + ffi.Pointer oid, + ffi.Pointer alg, ) { - return _CFWriteStreamCreateWithFile( - alloc, - fileURL, + return _cssmOidToAlg( + oid, + alg, ); } - late final _CFWriteStreamCreateWithFilePtr = _lookup< - ffi - .NativeFunction>( - 'CFWriteStreamCreateWithFile'); - late final _CFWriteStreamCreateWithFile = _CFWriteStreamCreateWithFilePtr - .asFunction(); + late final _cssmOidToAlgPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>>('cssmOidToAlg'); + late final _cssmOidToAlg = _cssmOidToAlgPtr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer)>(); - void CFStreamCreateBoundPair( - CFAllocatorRef alloc, - ffi.Pointer readStream, - ffi.Pointer writeStream, - int transferBufferSize, + ffi.Pointer cssmAlgToOid( + int algId, ) { - return _CFStreamCreateBoundPair( - alloc, - readStream, - writeStream, - transferBufferSize, + return _cssmAlgToOid( + algId, ); } - late final _CFStreamCreateBoundPairPtr = _lookup< + late final _cssmAlgToOidPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef, - ffi.Pointer, - ffi.Pointer, - CFIndex)>>('CFStreamCreateBoundPair'); - late final _CFStreamCreateBoundPair = _CFStreamCreateBoundPairPtr.asFunction< - void Function(CFAllocatorRef, ffi.Pointer, - ffi.Pointer, int)>(); - - late final ffi.Pointer _kCFStreamPropertyAppendToFile = - _lookup('kCFStreamPropertyAppendToFile'); + ffi.Pointer Function(CSSM_ALGORITHMS)>>('cssmAlgToOid'); + late final _cssmAlgToOid = + _cssmAlgToOidPtr.asFunction Function(int)>(); - CFStreamPropertyKey get kCFStreamPropertyAppendToFile => - _kCFStreamPropertyAppendToFile.value; + late final ffi.Pointer _kSecPropertyTypeTitle = + _lookup('kSecPropertyTypeTitle'); - late final ffi.Pointer - _kCFStreamPropertyFileCurrentOffset = - _lookup('kCFStreamPropertyFileCurrentOffset'); + CFStringRef get kSecPropertyTypeTitle => _kSecPropertyTypeTitle.value; - CFStreamPropertyKey get kCFStreamPropertyFileCurrentOffset => - _kCFStreamPropertyFileCurrentOffset.value; + set kSecPropertyTypeTitle(CFStringRef value) => + _kSecPropertyTypeTitle.value = value; - late final ffi.Pointer - _kCFStreamPropertySocketNativeHandle = - _lookup('kCFStreamPropertySocketNativeHandle'); + late final ffi.Pointer _kSecPropertyTypeError = + _lookup('kSecPropertyTypeError'); - CFStreamPropertyKey get kCFStreamPropertySocketNativeHandle => - _kCFStreamPropertySocketNativeHandle.value; + CFStringRef get kSecPropertyTypeError => _kSecPropertyTypeError.value; - late final ffi.Pointer - _kCFStreamPropertySocketRemoteHostName = - _lookup('kCFStreamPropertySocketRemoteHostName'); + set kSecPropertyTypeError(CFStringRef value) => + _kSecPropertyTypeError.value = value; - CFStreamPropertyKey get kCFStreamPropertySocketRemoteHostName => - _kCFStreamPropertySocketRemoteHostName.value; + late final ffi.Pointer _kSecTrustEvaluationDate = + _lookup('kSecTrustEvaluationDate'); - late final ffi.Pointer - _kCFStreamPropertySocketRemotePortNumber = - _lookup('kCFStreamPropertySocketRemotePortNumber'); + CFStringRef get kSecTrustEvaluationDate => _kSecTrustEvaluationDate.value; - CFStreamPropertyKey get kCFStreamPropertySocketRemotePortNumber => - _kCFStreamPropertySocketRemotePortNumber.value; + set kSecTrustEvaluationDate(CFStringRef value) => + _kSecTrustEvaluationDate.value = value; - late final ffi.Pointer _kCFStreamErrorDomainSOCKS = - _lookup('kCFStreamErrorDomainSOCKS'); + late final ffi.Pointer _kSecTrustExtendedValidation = + _lookup('kSecTrustExtendedValidation'); - int get kCFStreamErrorDomainSOCKS => _kCFStreamErrorDomainSOCKS.value; + CFStringRef get kSecTrustExtendedValidation => + _kSecTrustExtendedValidation.value; - late final ffi.Pointer _kCFStreamPropertySOCKSProxy = - _lookup('kCFStreamPropertySOCKSProxy'); + set kSecTrustExtendedValidation(CFStringRef value) => + _kSecTrustExtendedValidation.value = value; - CFStringRef get kCFStreamPropertySOCKSProxy => - _kCFStreamPropertySOCKSProxy.value; + late final ffi.Pointer _kSecTrustOrganizationName = + _lookup('kSecTrustOrganizationName'); - set kCFStreamPropertySOCKSProxy(CFStringRef value) => - _kCFStreamPropertySOCKSProxy.value = value; + CFStringRef get kSecTrustOrganizationName => _kSecTrustOrganizationName.value; - late final ffi.Pointer _kCFStreamPropertySOCKSProxyHost = - _lookup('kCFStreamPropertySOCKSProxyHost'); + set kSecTrustOrganizationName(CFStringRef value) => + _kSecTrustOrganizationName.value = value; - CFStringRef get kCFStreamPropertySOCKSProxyHost => - _kCFStreamPropertySOCKSProxyHost.value; + late final ffi.Pointer _kSecTrustResultValue = + _lookup('kSecTrustResultValue'); - set kCFStreamPropertySOCKSProxyHost(CFStringRef value) => - _kCFStreamPropertySOCKSProxyHost.value = value; + CFStringRef get kSecTrustResultValue => _kSecTrustResultValue.value; - late final ffi.Pointer _kCFStreamPropertySOCKSProxyPort = - _lookup('kCFStreamPropertySOCKSProxyPort'); + set kSecTrustResultValue(CFStringRef value) => + _kSecTrustResultValue.value = value; - CFStringRef get kCFStreamPropertySOCKSProxyPort => - _kCFStreamPropertySOCKSProxyPort.value; + late final ffi.Pointer _kSecTrustRevocationChecked = + _lookup('kSecTrustRevocationChecked'); - set kCFStreamPropertySOCKSProxyPort(CFStringRef value) => - _kCFStreamPropertySOCKSProxyPort.value = value; + CFStringRef get kSecTrustRevocationChecked => + _kSecTrustRevocationChecked.value; - late final ffi.Pointer _kCFStreamPropertySOCKSVersion = - _lookup('kCFStreamPropertySOCKSVersion'); + set kSecTrustRevocationChecked(CFStringRef value) => + _kSecTrustRevocationChecked.value = value; - CFStringRef get kCFStreamPropertySOCKSVersion => - _kCFStreamPropertySOCKSVersion.value; + late final ffi.Pointer _kSecTrustRevocationValidUntilDate = + _lookup('kSecTrustRevocationValidUntilDate'); - set kCFStreamPropertySOCKSVersion(CFStringRef value) => - _kCFStreamPropertySOCKSVersion.value = value; + CFStringRef get kSecTrustRevocationValidUntilDate => + _kSecTrustRevocationValidUntilDate.value; - late final ffi.Pointer _kCFStreamSocketSOCKSVersion4 = - _lookup('kCFStreamSocketSOCKSVersion4'); + set kSecTrustRevocationValidUntilDate(CFStringRef value) => + _kSecTrustRevocationValidUntilDate.value = value; - CFStringRef get kCFStreamSocketSOCKSVersion4 => - _kCFStreamSocketSOCKSVersion4.value; + late final ffi.Pointer _kSecTrustCertificateTransparency = + _lookup('kSecTrustCertificateTransparency'); - set kCFStreamSocketSOCKSVersion4(CFStringRef value) => - _kCFStreamSocketSOCKSVersion4.value = value; + CFStringRef get kSecTrustCertificateTransparency => + _kSecTrustCertificateTransparency.value; - late final ffi.Pointer _kCFStreamSocketSOCKSVersion5 = - _lookup('kCFStreamSocketSOCKSVersion5'); + set kSecTrustCertificateTransparency(CFStringRef value) => + _kSecTrustCertificateTransparency.value = value; - CFStringRef get kCFStreamSocketSOCKSVersion5 => - _kCFStreamSocketSOCKSVersion5.value; + late final ffi.Pointer + _kSecTrustCertificateTransparencyWhiteList = + _lookup('kSecTrustCertificateTransparencyWhiteList'); - set kCFStreamSocketSOCKSVersion5(CFStringRef value) => - _kCFStreamSocketSOCKSVersion5.value = value; + CFStringRef get kSecTrustCertificateTransparencyWhiteList => + _kSecTrustCertificateTransparencyWhiteList.value; - late final ffi.Pointer _kCFStreamPropertySOCKSUser = - _lookup('kCFStreamPropertySOCKSUser'); + set kSecTrustCertificateTransparencyWhiteList(CFStringRef value) => + _kSecTrustCertificateTransparencyWhiteList.value = value; - CFStringRef get kCFStreamPropertySOCKSUser => - _kCFStreamPropertySOCKSUser.value; + int SecTrustGetTypeID() { + return _SecTrustGetTypeID(); + } - set kCFStreamPropertySOCKSUser(CFStringRef value) => - _kCFStreamPropertySOCKSUser.value = value; + late final _SecTrustGetTypeIDPtr = + _lookup>('SecTrustGetTypeID'); + late final _SecTrustGetTypeID = + _SecTrustGetTypeIDPtr.asFunction(); - late final ffi.Pointer _kCFStreamPropertySOCKSPassword = - _lookup('kCFStreamPropertySOCKSPassword'); + int SecTrustCreateWithCertificates( + CFTypeRef certificates, + CFTypeRef policies, + ffi.Pointer trust, + ) { + return _SecTrustCreateWithCertificates( + certificates, + policies, + trust, + ); + } - CFStringRef get kCFStreamPropertySOCKSPassword => - _kCFStreamPropertySOCKSPassword.value; + late final _SecTrustCreateWithCertificatesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(CFTypeRef, CFTypeRef, + ffi.Pointer)>>('SecTrustCreateWithCertificates'); + late final _SecTrustCreateWithCertificates = + _SecTrustCreateWithCertificatesPtr.asFunction< + int Function(CFTypeRef, CFTypeRef, ffi.Pointer)>(); - set kCFStreamPropertySOCKSPassword(CFStringRef value) => - _kCFStreamPropertySOCKSPassword.value = value; + int SecTrustSetPolicies( + SecTrustRef trust, + CFTypeRef policies, + ) { + return _SecTrustSetPolicies( + trust, + policies, + ); + } - late final ffi.Pointer _kCFStreamErrorDomainSSL = - _lookup('kCFStreamErrorDomainSSL'); + late final _SecTrustSetPoliciesPtr = + _lookup>( + 'SecTrustSetPolicies'); + late final _SecTrustSetPolicies = _SecTrustSetPoliciesPtr.asFunction< + int Function(SecTrustRef, CFTypeRef)>(); - int get kCFStreamErrorDomainSSL => _kCFStreamErrorDomainSSL.value; + int SecTrustCopyPolicies( + SecTrustRef trust, + ffi.Pointer policies, + ) { + return _SecTrustCopyPolicies( + trust, + policies, + ); + } - late final ffi.Pointer _kCFStreamPropertySocketSecurityLevel = - _lookup('kCFStreamPropertySocketSecurityLevel'); + late final _SecTrustCopyPoliciesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SecTrustRef, ffi.Pointer)>>('SecTrustCopyPolicies'); + late final _SecTrustCopyPolicies = _SecTrustCopyPoliciesPtr.asFunction< + int Function(SecTrustRef, ffi.Pointer)>(); - CFStringRef get kCFStreamPropertySocketSecurityLevel => - _kCFStreamPropertySocketSecurityLevel.value; + int SecTrustSetNetworkFetchAllowed( + SecTrustRef trust, + int allowFetch, + ) { + return _SecTrustSetNetworkFetchAllowed( + trust, + allowFetch, + ); + } - set kCFStreamPropertySocketSecurityLevel(CFStringRef value) => - _kCFStreamPropertySocketSecurityLevel.value = value; + late final _SecTrustSetNetworkFetchAllowedPtr = + _lookup>( + 'SecTrustSetNetworkFetchAllowed'); + late final _SecTrustSetNetworkFetchAllowed = + _SecTrustSetNetworkFetchAllowedPtr.asFunction< + int Function(SecTrustRef, int)>(); - late final ffi.Pointer _kCFStreamSocketSecurityLevelNone = - _lookup('kCFStreamSocketSecurityLevelNone'); + int SecTrustGetNetworkFetchAllowed( + SecTrustRef trust, + ffi.Pointer allowFetch, + ) { + return _SecTrustGetNetworkFetchAllowed( + trust, + allowFetch, + ); + } - CFStringRef get kCFStreamSocketSecurityLevelNone => - _kCFStreamSocketSecurityLevelNone.value; + late final _SecTrustGetNetworkFetchAllowedPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecTrustRef, + ffi.Pointer)>>('SecTrustGetNetworkFetchAllowed'); + late final _SecTrustGetNetworkFetchAllowed = + _SecTrustGetNetworkFetchAllowedPtr.asFunction< + int Function(SecTrustRef, ffi.Pointer)>(); - set kCFStreamSocketSecurityLevelNone(CFStringRef value) => - _kCFStreamSocketSecurityLevelNone.value = value; + int SecTrustSetAnchorCertificates( + SecTrustRef trust, + CFArrayRef anchorCertificates, + ) { + return _SecTrustSetAnchorCertificates( + trust, + anchorCertificates, + ); + } - late final ffi.Pointer _kCFStreamSocketSecurityLevelSSLv2 = - _lookup('kCFStreamSocketSecurityLevelSSLv2'); + late final _SecTrustSetAnchorCertificatesPtr = + _lookup>( + 'SecTrustSetAnchorCertificates'); + late final _SecTrustSetAnchorCertificates = _SecTrustSetAnchorCertificatesPtr + .asFunction(); - CFStringRef get kCFStreamSocketSecurityLevelSSLv2 => - _kCFStreamSocketSecurityLevelSSLv2.value; + int SecTrustSetAnchorCertificatesOnly( + SecTrustRef trust, + int anchorCertificatesOnly, + ) { + return _SecTrustSetAnchorCertificatesOnly( + trust, + anchorCertificatesOnly, + ); + } - set kCFStreamSocketSecurityLevelSSLv2(CFStringRef value) => - _kCFStreamSocketSecurityLevelSSLv2.value = value; + late final _SecTrustSetAnchorCertificatesOnlyPtr = + _lookup>( + 'SecTrustSetAnchorCertificatesOnly'); + late final _SecTrustSetAnchorCertificatesOnly = + _SecTrustSetAnchorCertificatesOnlyPtr.asFunction< + int Function(SecTrustRef, int)>(); - late final ffi.Pointer _kCFStreamSocketSecurityLevelSSLv3 = - _lookup('kCFStreamSocketSecurityLevelSSLv3'); + int SecTrustCopyCustomAnchorCertificates( + SecTrustRef trust, + ffi.Pointer anchors, + ) { + return _SecTrustCopyCustomAnchorCertificates( + trust, + anchors, + ); + } - CFStringRef get kCFStreamSocketSecurityLevelSSLv3 => - _kCFStreamSocketSecurityLevelSSLv3.value; - - set kCFStreamSocketSecurityLevelSSLv3(CFStringRef value) => - _kCFStreamSocketSecurityLevelSSLv3.value = value; - - late final ffi.Pointer _kCFStreamSocketSecurityLevelTLSv1 = - _lookup('kCFStreamSocketSecurityLevelTLSv1'); - - CFStringRef get kCFStreamSocketSecurityLevelTLSv1 => - _kCFStreamSocketSecurityLevelTLSv1.value; - - set kCFStreamSocketSecurityLevelTLSv1(CFStringRef value) => - _kCFStreamSocketSecurityLevelTLSv1.value = value; - - late final ffi.Pointer - _kCFStreamSocketSecurityLevelNegotiatedSSL = - _lookup('kCFStreamSocketSecurityLevelNegotiatedSSL'); - - CFStringRef get kCFStreamSocketSecurityLevelNegotiatedSSL => - _kCFStreamSocketSecurityLevelNegotiatedSSL.value; - - set kCFStreamSocketSecurityLevelNegotiatedSSL(CFStringRef value) => - _kCFStreamSocketSecurityLevelNegotiatedSSL.value = value; - - late final ffi.Pointer - _kCFStreamPropertyShouldCloseNativeSocket = - _lookup('kCFStreamPropertyShouldCloseNativeSocket'); - - CFStringRef get kCFStreamPropertyShouldCloseNativeSocket => - _kCFStreamPropertyShouldCloseNativeSocket.value; - - set kCFStreamPropertyShouldCloseNativeSocket(CFStringRef value) => - _kCFStreamPropertyShouldCloseNativeSocket.value = value; + late final _SecTrustCopyCustomAnchorCertificatesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecTrustRef, ffi.Pointer)>>( + 'SecTrustCopyCustomAnchorCertificates'); + late final _SecTrustCopyCustomAnchorCertificates = + _SecTrustCopyCustomAnchorCertificatesPtr.asFunction< + int Function(SecTrustRef, ffi.Pointer)>(); - void CFStreamCreatePairWithSocket( - CFAllocatorRef alloc, - int sock, - ffi.Pointer readStream, - ffi.Pointer writeStream, + int SecTrustSetVerifyDate( + SecTrustRef trust, + CFDateRef verifyDate, ) { - return _CFStreamCreatePairWithSocket( - alloc, - sock, - readStream, - writeStream, + return _SecTrustSetVerifyDate( + trust, + verifyDate, ); } - late final _CFStreamCreatePairWithSocketPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef, - CFSocketNativeHandle, - ffi.Pointer, - ffi.Pointer)>>('CFStreamCreatePairWithSocket'); - late final _CFStreamCreatePairWithSocket = - _CFStreamCreatePairWithSocketPtr.asFunction< - void Function(CFAllocatorRef, int, ffi.Pointer, - ffi.Pointer)>(); + late final _SecTrustSetVerifyDatePtr = + _lookup>( + 'SecTrustSetVerifyDate'); + late final _SecTrustSetVerifyDate = _SecTrustSetVerifyDatePtr.asFunction< + int Function(SecTrustRef, CFDateRef)>(); - void CFStreamCreatePairWithSocketToHost( - CFAllocatorRef alloc, - CFStringRef host, - int port, - ffi.Pointer readStream, - ffi.Pointer writeStream, + double SecTrustGetVerifyTime( + SecTrustRef trust, ) { - return _CFStreamCreatePairWithSocketToHost( - alloc, - host, - port, - readStream, - writeStream, + return _SecTrustGetVerifyTime( + trust, ); } - late final _CFStreamCreatePairWithSocketToHostPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef, - CFStringRef, - UInt32, - ffi.Pointer, - ffi.Pointer)>>( - 'CFStreamCreatePairWithSocketToHost'); - late final _CFStreamCreatePairWithSocketToHost = - _CFStreamCreatePairWithSocketToHostPtr.asFunction< - void Function(CFAllocatorRef, CFStringRef, int, - ffi.Pointer, ffi.Pointer)>(); + late final _SecTrustGetVerifyTimePtr = + _lookup>( + 'SecTrustGetVerifyTime'); + late final _SecTrustGetVerifyTime = + _SecTrustGetVerifyTimePtr.asFunction(); - void CFStreamCreatePairWithPeerSocketSignature( - CFAllocatorRef alloc, - ffi.Pointer signature, - ffi.Pointer readStream, - ffi.Pointer writeStream, + int SecTrustEvaluate( + SecTrustRef trust, + ffi.Pointer result, ) { - return _CFStreamCreatePairWithPeerSocketSignature( - alloc, - signature, - readStream, - writeStream, + return _SecTrustEvaluate( + trust, + result, ); } - late final _CFStreamCreatePairWithPeerSocketSignaturePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>( - 'CFStreamCreatePairWithPeerSocketSignature'); - late final _CFStreamCreatePairWithPeerSocketSignature = - _CFStreamCreatePairWithPeerSocketSignaturePtr.asFunction< - void Function(CFAllocatorRef, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); + late final _SecTrustEvaluatePtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SecTrustRef, ffi.Pointer)>>('SecTrustEvaluate'); + late final _SecTrustEvaluate = _SecTrustEvaluatePtr.asFunction< + int Function(SecTrustRef, ffi.Pointer)>(); - int CFReadStreamGetStatus( - CFReadStreamRef stream, + DartSInt32 SecTrustEvaluateAsync( + SecTrustRef trust, + Dartdispatch_queue_t queue, + DartSecTrustCallback result, ) { - return _CFReadStreamGetStatus( - stream, + return _SecTrustEvaluateAsync( + trust, + queue.ref.pointer, + result.ref.pointer, ); } - late final _CFReadStreamGetStatusPtr = - _lookup>( - 'CFReadStreamGetStatus'); - late final _CFReadStreamGetStatus = - _CFReadStreamGetStatusPtr.asFunction(); + late final _SecTrustEvaluateAsyncPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecTrustRef, dispatch_queue_t, + SecTrustCallback)>>('SecTrustEvaluateAsync'); + late final _SecTrustEvaluateAsync = _SecTrustEvaluateAsyncPtr.asFunction< + int Function(SecTrustRef, dispatch_queue_t, SecTrustCallback)>(); - int CFWriteStreamGetStatus( - CFWriteStreamRef stream, + bool SecTrustEvaluateWithError( + SecTrustRef trust, + ffi.Pointer error, ) { - return _CFWriteStreamGetStatus( - stream, + return _SecTrustEvaluateWithError( + trust, + error, ); } - late final _CFWriteStreamGetStatusPtr = - _lookup>( - 'CFWriteStreamGetStatus'); - late final _CFWriteStreamGetStatus = - _CFWriteStreamGetStatusPtr.asFunction(); + late final _SecTrustEvaluateWithErrorPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(SecTrustRef, + ffi.Pointer)>>('SecTrustEvaluateWithError'); + late final _SecTrustEvaluateWithError = _SecTrustEvaluateWithErrorPtr + .asFunction)>(); - CFErrorRef CFReadStreamCopyError( - CFReadStreamRef stream, + DartSInt32 SecTrustEvaluateAsyncWithError( + SecTrustRef trust, + Dartdispatch_queue_t queue, + DartSecTrustWithErrorCallback result, ) { - return _CFReadStreamCopyError( - stream, + return _SecTrustEvaluateAsyncWithError( + trust, + queue.ref.pointer, + result.ref.pointer, ); } - late final _CFReadStreamCopyErrorPtr = - _lookup>( - 'CFReadStreamCopyError'); - late final _CFReadStreamCopyError = _CFReadStreamCopyErrorPtr.asFunction< - CFErrorRef Function(CFReadStreamRef)>(); + late final _SecTrustEvaluateAsyncWithErrorPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecTrustRef, dispatch_queue_t, + SecTrustWithErrorCallback)>>('SecTrustEvaluateAsyncWithError'); + late final _SecTrustEvaluateAsyncWithError = + _SecTrustEvaluateAsyncWithErrorPtr.asFunction< + int Function( + SecTrustRef, dispatch_queue_t, SecTrustWithErrorCallback)>(); - CFErrorRef CFWriteStreamCopyError( - CFWriteStreamRef stream, + int SecTrustGetTrustResult( + SecTrustRef trust, + ffi.Pointer result, ) { - return _CFWriteStreamCopyError( - stream, + return _SecTrustGetTrustResult( + trust, + result, ); } - late final _CFWriteStreamCopyErrorPtr = - _lookup>( - 'CFWriteStreamCopyError'); - late final _CFWriteStreamCopyError = _CFWriteStreamCopyErrorPtr.asFunction< - CFErrorRef Function(CFWriteStreamRef)>(); + late final _SecTrustGetTrustResultPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SecTrustRef, ffi.Pointer)>>('SecTrustGetTrustResult'); + late final _SecTrustGetTrustResult = _SecTrustGetTrustResultPtr.asFunction< + int Function(SecTrustRef, ffi.Pointer)>(); - int CFReadStreamOpen( - CFReadStreamRef stream, + SecKeyRef SecTrustCopyPublicKey( + SecTrustRef trust, ) { - return _CFReadStreamOpen( - stream, + return _SecTrustCopyPublicKey( + trust, ); } - late final _CFReadStreamOpenPtr = - _lookup>( - 'CFReadStreamOpen'); - late final _CFReadStreamOpen = - _CFReadStreamOpenPtr.asFunction(); + late final _SecTrustCopyPublicKeyPtr = + _lookup>( + 'SecTrustCopyPublicKey'); + late final _SecTrustCopyPublicKey = + _SecTrustCopyPublicKeyPtr.asFunction(); - int CFWriteStreamOpen( - CFWriteStreamRef stream, + SecKeyRef SecTrustCopyKey( + SecTrustRef trust, ) { - return _CFWriteStreamOpen( - stream, + return _SecTrustCopyKey( + trust, ); } - late final _CFWriteStreamOpenPtr = - _lookup>( - 'CFWriteStreamOpen'); - late final _CFWriteStreamOpen = - _CFWriteStreamOpenPtr.asFunction(); + late final _SecTrustCopyKeyPtr = + _lookup>( + 'SecTrustCopyKey'); + late final _SecTrustCopyKey = + _SecTrustCopyKeyPtr.asFunction(); - void CFReadStreamClose( - CFReadStreamRef stream, + int SecTrustGetCertificateCount( + SecTrustRef trust, ) { - return _CFReadStreamClose( - stream, + return _SecTrustGetCertificateCount( + trust, ); } - late final _CFReadStreamClosePtr = - _lookup>( - 'CFReadStreamClose'); - late final _CFReadStreamClose = - _CFReadStreamClosePtr.asFunction(); + late final _SecTrustGetCertificateCountPtr = + _lookup>( + 'SecTrustGetCertificateCount'); + late final _SecTrustGetCertificateCount = + _SecTrustGetCertificateCountPtr.asFunction(); - void CFWriteStreamClose( - CFWriteStreamRef stream, + SecCertificateRef SecTrustGetCertificateAtIndex( + SecTrustRef trust, + int ix, ) { - return _CFWriteStreamClose( - stream, + return _SecTrustGetCertificateAtIndex( + trust, + ix, ); } - late final _CFWriteStreamClosePtr = - _lookup>( - 'CFWriteStreamClose'); - late final _CFWriteStreamClose = - _CFWriteStreamClosePtr.asFunction(); + late final _SecTrustGetCertificateAtIndexPtr = _lookup< + ffi.NativeFunction>( + 'SecTrustGetCertificateAtIndex'); + late final _SecTrustGetCertificateAtIndex = _SecTrustGetCertificateAtIndexPtr + .asFunction(); - int CFReadStreamHasBytesAvailable( - CFReadStreamRef stream, + CFDataRef SecTrustCopyExceptions( + SecTrustRef trust, ) { - return _CFReadStreamHasBytesAvailable( - stream, + return _SecTrustCopyExceptions( + trust, ); } - late final _CFReadStreamHasBytesAvailablePtr = - _lookup>( - 'CFReadStreamHasBytesAvailable'); - late final _CFReadStreamHasBytesAvailable = _CFReadStreamHasBytesAvailablePtr - .asFunction(); + late final _SecTrustCopyExceptionsPtr = + _lookup>( + 'SecTrustCopyExceptions'); + late final _SecTrustCopyExceptions = + _SecTrustCopyExceptionsPtr.asFunction(); - int CFReadStreamRead( - CFReadStreamRef stream, - ffi.Pointer buffer, - int bufferLength, + bool SecTrustSetExceptions( + SecTrustRef trust, + CFDataRef exceptions, ) { - return _CFReadStreamRead( - stream, - buffer, - bufferLength, + return _SecTrustSetExceptions( + trust, + exceptions, ); } - late final _CFReadStreamReadPtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFReadStreamRef, ffi.Pointer, - CFIndex)>>('CFReadStreamRead'); - late final _CFReadStreamRead = _CFReadStreamReadPtr.asFunction< - int Function(CFReadStreamRef, ffi.Pointer, int)>(); + late final _SecTrustSetExceptionsPtr = + _lookup>( + 'SecTrustSetExceptions'); + late final _SecTrustSetExceptions = _SecTrustSetExceptionsPtr.asFunction< + bool Function(SecTrustRef, CFDataRef)>(); - ffi.Pointer CFReadStreamGetBuffer( - CFReadStreamRef stream, - int maxBytesToRead, - ffi.Pointer numBytesRead, + CFArrayRef SecTrustCopyProperties( + SecTrustRef trust, ) { - return _CFReadStreamGetBuffer( - stream, - maxBytesToRead, - numBytesRead, + return _SecTrustCopyProperties( + trust, ); } - late final _CFReadStreamGetBufferPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(CFReadStreamRef, CFIndex, - ffi.Pointer)>>('CFReadStreamGetBuffer'); - late final _CFReadStreamGetBuffer = _CFReadStreamGetBufferPtr.asFunction< - ffi.Pointer Function( - CFReadStreamRef, int, ffi.Pointer)>(); + late final _SecTrustCopyPropertiesPtr = + _lookup>( + 'SecTrustCopyProperties'); + late final _SecTrustCopyProperties = + _SecTrustCopyPropertiesPtr.asFunction(); - int CFWriteStreamCanAcceptBytes( - CFWriteStreamRef stream, + CFDictionaryRef SecTrustCopyResult( + SecTrustRef trust, ) { - return _CFWriteStreamCanAcceptBytes( - stream, + return _SecTrustCopyResult( + trust, ); } - late final _CFWriteStreamCanAcceptBytesPtr = - _lookup>( - 'CFWriteStreamCanAcceptBytes'); - late final _CFWriteStreamCanAcceptBytes = _CFWriteStreamCanAcceptBytesPtr - .asFunction(); + late final _SecTrustCopyResultPtr = + _lookup>( + 'SecTrustCopyResult'); + late final _SecTrustCopyResult = _SecTrustCopyResultPtr.asFunction< + CFDictionaryRef Function(SecTrustRef)>(); - int CFWriteStreamWrite( - CFWriteStreamRef stream, - ffi.Pointer buffer, - int bufferLength, + int SecTrustSetOCSPResponse( + SecTrustRef trust, + CFTypeRef responseData, ) { - return _CFWriteStreamWrite( - stream, - buffer, - bufferLength, + return _SecTrustSetOCSPResponse( + trust, + responseData, ); } - late final _CFWriteStreamWritePtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFWriteStreamRef, ffi.Pointer, - CFIndex)>>('CFWriteStreamWrite'); - late final _CFWriteStreamWrite = _CFWriteStreamWritePtr.asFunction< - int Function(CFWriteStreamRef, ffi.Pointer, int)>(); + late final _SecTrustSetOCSPResponsePtr = + _lookup>( + 'SecTrustSetOCSPResponse'); + late final _SecTrustSetOCSPResponse = _SecTrustSetOCSPResponsePtr.asFunction< + int Function(SecTrustRef, CFTypeRef)>(); - CFTypeRef CFReadStreamCopyProperty( - CFReadStreamRef stream, - CFStreamPropertyKey propertyName, + int SecTrustSetSignedCertificateTimestamps( + SecTrustRef trust, + CFArrayRef sctArray, ) { - return _CFReadStreamCopyProperty( - stream, - propertyName, + return _SecTrustSetSignedCertificateTimestamps( + trust, + sctArray, ); } - late final _CFReadStreamCopyPropertyPtr = _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFReadStreamRef, - CFStreamPropertyKey)>>('CFReadStreamCopyProperty'); - late final _CFReadStreamCopyProperty = _CFReadStreamCopyPropertyPtr - .asFunction(); + late final _SecTrustSetSignedCertificateTimestampsPtr = + _lookup>( + 'SecTrustSetSignedCertificateTimestamps'); + late final _SecTrustSetSignedCertificateTimestamps = + _SecTrustSetSignedCertificateTimestampsPtr.asFunction< + int Function(SecTrustRef, CFArrayRef)>(); - CFTypeRef CFWriteStreamCopyProperty( - CFWriteStreamRef stream, - CFStreamPropertyKey propertyName, + CFArrayRef SecTrustCopyCertificateChain( + SecTrustRef trust, ) { - return _CFWriteStreamCopyProperty( - stream, - propertyName, + return _SecTrustCopyCertificateChain( + trust, ); } - late final _CFWriteStreamCopyPropertyPtr = _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFWriteStreamRef, - CFStreamPropertyKey)>>('CFWriteStreamCopyProperty'); - late final _CFWriteStreamCopyProperty = _CFWriteStreamCopyPropertyPtr - .asFunction(); + late final _SecTrustCopyCertificateChainPtr = + _lookup>( + 'SecTrustCopyCertificateChain'); + late final _SecTrustCopyCertificateChain = _SecTrustCopyCertificateChainPtr + .asFunction(); - int CFReadStreamSetProperty( - CFReadStreamRef stream, - CFStreamPropertyKey propertyName, - CFTypeRef propertyValue, + DartSInt32 SecTrustSetOptions( + SecTrustRef trustRef, + SecTrustOptionFlags options, ) { - return _CFReadStreamSetProperty( - stream, - propertyName, - propertyValue, + return _SecTrustSetOptions( + trustRef, + options.value, ); } - late final _CFReadStreamSetPropertyPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFReadStreamRef, CFStreamPropertyKey, - CFTypeRef)>>('CFReadStreamSetProperty'); - late final _CFReadStreamSetProperty = _CFReadStreamSetPropertyPtr.asFunction< - int Function(CFReadStreamRef, CFStreamPropertyKey, CFTypeRef)>(); + late final _SecTrustSetOptionsPtr = + _lookup>( + 'SecTrustSetOptions'); + late final _SecTrustSetOptions = + _SecTrustSetOptionsPtr.asFunction(); - int CFWriteStreamSetProperty( - CFWriteStreamRef stream, - CFStreamPropertyKey propertyName, - CFTypeRef propertyValue, + int SecTrustSetParameters( + SecTrustRef trustRef, + int action, + CFDataRef actionData, ) { - return _CFWriteStreamSetProperty( - stream, - propertyName, - propertyValue, + return _SecTrustSetParameters( + trustRef, + action, + actionData, ); } - late final _CFWriteStreamSetPropertyPtr = _lookup< + late final _SecTrustSetParametersPtr = _lookup< ffi.NativeFunction< - Boolean Function(CFWriteStreamRef, CFStreamPropertyKey, - CFTypeRef)>>('CFWriteStreamSetProperty'); - late final _CFWriteStreamSetProperty = - _CFWriteStreamSetPropertyPtr.asFunction< - int Function(CFWriteStreamRef, CFStreamPropertyKey, CFTypeRef)>(); + OSStatus Function(SecTrustRef, CSSM_TP_ACTION, + CFDataRef)>>('SecTrustSetParameters'); + late final _SecTrustSetParameters = _SecTrustSetParametersPtr.asFunction< + int Function(SecTrustRef, int, CFDataRef)>(); - int CFReadStreamSetClient( - CFReadStreamRef stream, - int streamEvents, - CFReadStreamClientCallBack clientCB, - ffi.Pointer clientContext, + int SecTrustSetKeychains( + SecTrustRef trust, + CFTypeRef keychainOrArray, ) { - return _CFReadStreamSetClient( - stream, - streamEvents, - clientCB, - clientContext, + return _SecTrustSetKeychains( + trust, + keychainOrArray, ); } - late final _CFReadStreamSetClientPtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFReadStreamRef, - CFOptionFlags, - CFReadStreamClientCallBack, - ffi.Pointer)>>('CFReadStreamSetClient'); - late final _CFReadStreamSetClient = _CFReadStreamSetClientPtr.asFunction< - int Function(CFReadStreamRef, int, CFReadStreamClientCallBack, - ffi.Pointer)>(); + late final _SecTrustSetKeychainsPtr = + _lookup>( + 'SecTrustSetKeychains'); + late final _SecTrustSetKeychains = _SecTrustSetKeychainsPtr.asFunction< + int Function(SecTrustRef, CFTypeRef)>(); - int CFWriteStreamSetClient( - CFWriteStreamRef stream, - int streamEvents, - CFWriteStreamClientCallBack clientCB, - ffi.Pointer clientContext, + int SecTrustGetResult( + SecTrustRef trustRef, + ffi.Pointer result, + ffi.Pointer certChain, + ffi.Pointer> statusChain, ) { - return _CFWriteStreamSetClient( - stream, - streamEvents, - clientCB, - clientContext, + return _SecTrustGetResult( + trustRef, + result, + certChain, + statusChain, ); } - late final _CFWriteStreamSetClientPtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFWriteStreamRef, - CFOptionFlags, - CFWriteStreamClientCallBack, - ffi.Pointer)>>('CFWriteStreamSetClient'); - late final _CFWriteStreamSetClient = _CFWriteStreamSetClientPtr.asFunction< - int Function(CFWriteStreamRef, int, CFWriteStreamClientCallBack, - ffi.Pointer)>(); + late final _SecTrustGetResultPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SecTrustRef, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>>( + 'SecTrustGetResult'); + late final _SecTrustGetResult = _SecTrustGetResultPtr.asFunction< + int Function( + SecTrustRef, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>(); - void CFReadStreamScheduleWithRunLoop( - CFReadStreamRef stream, - CFRunLoopRef runLoop, - CFRunLoopMode runLoopMode, + int SecTrustGetCssmResult( + SecTrustRef trust, + ffi.Pointer result, ) { - return _CFReadStreamScheduleWithRunLoop( - stream, - runLoop, - runLoopMode, + return _SecTrustGetCssmResult( + trust, + result, ); } - late final _CFReadStreamScheduleWithRunLoopPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFReadStreamRef, CFRunLoopRef, - CFRunLoopMode)>>('CFReadStreamScheduleWithRunLoop'); - late final _CFReadStreamScheduleWithRunLoop = - _CFReadStreamScheduleWithRunLoopPtr.asFunction< - void Function(CFReadStreamRef, CFRunLoopRef, CFRunLoopMode)>(); + late final _SecTrustGetCssmResultPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecTrustRef, + ffi.Pointer)>>( + 'SecTrustGetCssmResult'); + late final _SecTrustGetCssmResult = _SecTrustGetCssmResultPtr.asFunction< + int Function( + SecTrustRef, ffi.Pointer)>(); - void CFWriteStreamScheduleWithRunLoop( - CFWriteStreamRef stream, - CFRunLoopRef runLoop, - CFRunLoopMode runLoopMode, + int SecTrustGetCssmResultCode( + SecTrustRef trust, + ffi.Pointer resultCode, ) { - return _CFWriteStreamScheduleWithRunLoop( - stream, - runLoop, - runLoopMode, + return _SecTrustGetCssmResultCode( + trust, + resultCode, ); } - late final _CFWriteStreamScheduleWithRunLoopPtr = _lookup< + late final _SecTrustGetCssmResultCodePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFWriteStreamRef, CFRunLoopRef, - CFRunLoopMode)>>('CFWriteStreamScheduleWithRunLoop'); - late final _CFWriteStreamScheduleWithRunLoop = - _CFWriteStreamScheduleWithRunLoopPtr.asFunction< - void Function(CFWriteStreamRef, CFRunLoopRef, CFRunLoopMode)>(); + OSStatus Function(SecTrustRef, + ffi.Pointer)>>('SecTrustGetCssmResultCode'); + late final _SecTrustGetCssmResultCode = _SecTrustGetCssmResultCodePtr + .asFunction)>(); - void CFReadStreamUnscheduleFromRunLoop( - CFReadStreamRef stream, - CFRunLoopRef runLoop, - CFRunLoopMode runLoopMode, + int SecTrustGetTPHandle( + SecTrustRef trust, + ffi.Pointer handle, ) { - return _CFReadStreamUnscheduleFromRunLoop( - stream, - runLoop, - runLoopMode, + return _SecTrustGetTPHandle( + trust, + handle, ); } - late final _CFReadStreamUnscheduleFromRunLoopPtr = _lookup< + late final _SecTrustGetTPHandlePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFReadStreamRef, CFRunLoopRef, - CFRunLoopMode)>>('CFReadStreamUnscheduleFromRunLoop'); - late final _CFReadStreamUnscheduleFromRunLoop = - _CFReadStreamUnscheduleFromRunLoopPtr.asFunction< - void Function(CFReadStreamRef, CFRunLoopRef, CFRunLoopMode)>(); + OSStatus Function(SecTrustRef, + ffi.Pointer)>>('SecTrustGetTPHandle'); + late final _SecTrustGetTPHandle = _SecTrustGetTPHandlePtr.asFunction< + int Function(SecTrustRef, ffi.Pointer)>(); - void CFWriteStreamUnscheduleFromRunLoop( - CFWriteStreamRef stream, - CFRunLoopRef runLoop, - CFRunLoopMode runLoopMode, + int SecTrustCopyAnchorCertificates( + ffi.Pointer anchors, ) { - return _CFWriteStreamUnscheduleFromRunLoop( - stream, - runLoop, - runLoopMode, + return _SecTrustCopyAnchorCertificates( + anchors, ); } - late final _CFWriteStreamUnscheduleFromRunLoopPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFWriteStreamRef, CFRunLoopRef, - CFRunLoopMode)>>('CFWriteStreamUnscheduleFromRunLoop'); - late final _CFWriteStreamUnscheduleFromRunLoop = - _CFWriteStreamUnscheduleFromRunLoopPtr.asFunction< - void Function(CFWriteStreamRef, CFRunLoopRef, CFRunLoopMode)>(); + late final _SecTrustCopyAnchorCertificatesPtr = + _lookup)>>( + 'SecTrustCopyAnchorCertificates'); + late final _SecTrustCopyAnchorCertificates = + _SecTrustCopyAnchorCertificatesPtr.asFunction< + int Function(ffi.Pointer)>(); - void CFReadStreamSetDispatchQueue( - CFReadStreamRef stream, - dispatch_queue_t q, - ) { - return _CFReadStreamSetDispatchQueue( - stream, - q, - ); + int SecCertificateGetTypeID() { + return _SecCertificateGetTypeID(); } - late final _CFReadStreamSetDispatchQueuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFReadStreamRef, - dispatch_queue_t)>>('CFReadStreamSetDispatchQueue'); - late final _CFReadStreamSetDispatchQueue = _CFReadStreamSetDispatchQueuePtr - .asFunction(); + late final _SecCertificateGetTypeIDPtr = + _lookup>( + 'SecCertificateGetTypeID'); + late final _SecCertificateGetTypeID = + _SecCertificateGetTypeIDPtr.asFunction(); - void CFWriteStreamSetDispatchQueue( - CFWriteStreamRef stream, - dispatch_queue_t q, + SecCertificateRef SecCertificateCreateWithData( + CFAllocatorRef allocator, + CFDataRef data, ) { - return _CFWriteStreamSetDispatchQueue( - stream, - q, + return _SecCertificateCreateWithData( + allocator, + data, ); } - late final _CFWriteStreamSetDispatchQueuePtr = _lookup< + late final _SecCertificateCreateWithDataPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFWriteStreamRef, - dispatch_queue_t)>>('CFWriteStreamSetDispatchQueue'); - late final _CFWriteStreamSetDispatchQueue = _CFWriteStreamSetDispatchQueuePtr - .asFunction(); + SecCertificateRef Function( + CFAllocatorRef, CFDataRef)>>('SecCertificateCreateWithData'); + late final _SecCertificateCreateWithData = _SecCertificateCreateWithDataPtr + .asFunction(); - dispatch_queue_t CFReadStreamCopyDispatchQueue( - CFReadStreamRef stream, + CFDataRef SecCertificateCopyData( + SecCertificateRef certificate, ) { - return _CFReadStreamCopyDispatchQueue( - stream, + return _SecCertificateCopyData( + certificate, ); } - late final _CFReadStreamCopyDispatchQueuePtr = - _lookup>( - 'CFReadStreamCopyDispatchQueue'); - late final _CFReadStreamCopyDispatchQueue = _CFReadStreamCopyDispatchQueuePtr - .asFunction(); + late final _SecCertificateCopyDataPtr = + _lookup>( + 'SecCertificateCopyData'); + late final _SecCertificateCopyData = _SecCertificateCopyDataPtr.asFunction< + CFDataRef Function(SecCertificateRef)>(); - dispatch_queue_t CFWriteStreamCopyDispatchQueue( - CFWriteStreamRef stream, + CFStringRef SecCertificateCopySubjectSummary( + SecCertificateRef certificate, ) { - return _CFWriteStreamCopyDispatchQueue( - stream, + return _SecCertificateCopySubjectSummary( + certificate, ); } - late final _CFWriteStreamCopyDispatchQueuePtr = - _lookup>( - 'CFWriteStreamCopyDispatchQueue'); - late final _CFWriteStreamCopyDispatchQueue = - _CFWriteStreamCopyDispatchQueuePtr.asFunction< - dispatch_queue_t Function(CFWriteStreamRef)>(); + late final _SecCertificateCopySubjectSummaryPtr = + _lookup>( + 'SecCertificateCopySubjectSummary'); + late final _SecCertificateCopySubjectSummary = + _SecCertificateCopySubjectSummaryPtr.asFunction< + CFStringRef Function(SecCertificateRef)>(); - CFStreamError CFReadStreamGetError( - CFReadStreamRef stream, + int SecCertificateCopyCommonName( + SecCertificateRef certificate, + ffi.Pointer commonName, ) { - return _CFReadStreamGetError( - stream, + return _SecCertificateCopyCommonName( + certificate, + commonName, ); } - late final _CFReadStreamGetErrorPtr = - _lookup>( - 'CFReadStreamGetError'); - late final _CFReadStreamGetError = _CFReadStreamGetErrorPtr.asFunction< - CFStreamError Function(CFReadStreamRef)>(); + late final _SecCertificateCopyCommonNamePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecCertificateRef, + ffi.Pointer)>>('SecCertificateCopyCommonName'); + late final _SecCertificateCopyCommonName = _SecCertificateCopyCommonNamePtr + .asFunction)>(); - CFStreamError CFWriteStreamGetError( - CFWriteStreamRef stream, + int SecCertificateCopyEmailAddresses( + SecCertificateRef certificate, + ffi.Pointer emailAddresses, ) { - return _CFWriteStreamGetError( - stream, + return _SecCertificateCopyEmailAddresses( + certificate, + emailAddresses, ); } - late final _CFWriteStreamGetErrorPtr = - _lookup>( - 'CFWriteStreamGetError'); - late final _CFWriteStreamGetError = _CFWriteStreamGetErrorPtr.asFunction< - CFStreamError Function(CFWriteStreamRef)>(); + late final _SecCertificateCopyEmailAddressesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecCertificateRef, + ffi.Pointer)>>('SecCertificateCopyEmailAddresses'); + late final _SecCertificateCopyEmailAddresses = + _SecCertificateCopyEmailAddressesPtr.asFunction< + int Function(SecCertificateRef, ffi.Pointer)>(); - CFPropertyListRef CFPropertyListCreateFromXMLData( - CFAllocatorRef allocator, - CFDataRef xmlData, - int mutabilityOption, - ffi.Pointer errorString, + CFDataRef SecCertificateCopyNormalizedIssuerSequence( + SecCertificateRef certificate, ) { - return _CFPropertyListCreateFromXMLData( - allocator, - xmlData, - mutabilityOption, - errorString, + return _SecCertificateCopyNormalizedIssuerSequence( + certificate, ); } - late final _CFPropertyListCreateFromXMLDataPtr = _lookup< - ffi.NativeFunction< - CFPropertyListRef Function(CFAllocatorRef, CFDataRef, CFOptionFlags, - ffi.Pointer)>>('CFPropertyListCreateFromXMLData'); - late final _CFPropertyListCreateFromXMLData = - _CFPropertyListCreateFromXMLDataPtr.asFunction< - CFPropertyListRef Function( - CFAllocatorRef, CFDataRef, int, ffi.Pointer)>(); + late final _SecCertificateCopyNormalizedIssuerSequencePtr = + _lookup>( + 'SecCertificateCopyNormalizedIssuerSequence'); + late final _SecCertificateCopyNormalizedIssuerSequence = + _SecCertificateCopyNormalizedIssuerSequencePtr.asFunction< + CFDataRef Function(SecCertificateRef)>(); - CFDataRef CFPropertyListCreateXMLData( - CFAllocatorRef allocator, - CFPropertyListRef propertyList, + CFDataRef SecCertificateCopyNormalizedSubjectSequence( + SecCertificateRef certificate, ) { - return _CFPropertyListCreateXMLData( - allocator, - propertyList, + return _SecCertificateCopyNormalizedSubjectSequence( + certificate, ); } - late final _CFPropertyListCreateXMLDataPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(CFAllocatorRef, - CFPropertyListRef)>>('CFPropertyListCreateXMLData'); - late final _CFPropertyListCreateXMLData = _CFPropertyListCreateXMLDataPtr - .asFunction(); + late final _SecCertificateCopyNormalizedSubjectSequencePtr = + _lookup>( + 'SecCertificateCopyNormalizedSubjectSequence'); + late final _SecCertificateCopyNormalizedSubjectSequence = + _SecCertificateCopyNormalizedSubjectSequencePtr.asFunction< + CFDataRef Function(SecCertificateRef)>(); - CFPropertyListRef CFPropertyListCreateDeepCopy( - CFAllocatorRef allocator, - CFPropertyListRef propertyList, - int mutabilityOption, + SecKeyRef SecCertificateCopyKey( + SecCertificateRef certificate, ) { - return _CFPropertyListCreateDeepCopy( - allocator, - propertyList, - mutabilityOption, + return _SecCertificateCopyKey( + certificate, ); } - late final _CFPropertyListCreateDeepCopyPtr = _lookup< - ffi.NativeFunction< - CFPropertyListRef Function(CFAllocatorRef, CFPropertyListRef, - CFOptionFlags)>>('CFPropertyListCreateDeepCopy'); - late final _CFPropertyListCreateDeepCopy = - _CFPropertyListCreateDeepCopyPtr.asFunction< - CFPropertyListRef Function(CFAllocatorRef, CFPropertyListRef, int)>(); + late final _SecCertificateCopyKeyPtr = + _lookup>( + 'SecCertificateCopyKey'); + late final _SecCertificateCopyKey = _SecCertificateCopyKeyPtr.asFunction< + SecKeyRef Function(SecCertificateRef)>(); - int CFPropertyListIsValid( - CFPropertyListRef plist, - int format, + int SecCertificateCopyPublicKey( + SecCertificateRef certificate, + ffi.Pointer key, ) { - return _CFPropertyListIsValid( - plist, - format, + return _SecCertificateCopyPublicKey( + certificate, + key, ); } - late final _CFPropertyListIsValidPtr = _lookup< - ffi.NativeFunction>( - 'CFPropertyListIsValid'); - late final _CFPropertyListIsValid = _CFPropertyListIsValidPtr.asFunction< - int Function(CFPropertyListRef, int)>(); + late final _SecCertificateCopyPublicKeyPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecCertificateRef, + ffi.Pointer)>>('SecCertificateCopyPublicKey'); + late final _SecCertificateCopyPublicKey = _SecCertificateCopyPublicKeyPtr + .asFunction)>(); - int CFPropertyListWriteToStream( - CFPropertyListRef propertyList, - CFWriteStreamRef stream, - int format, - ffi.Pointer errorString, + CFDataRef SecCertificateCopySerialNumberData( + SecCertificateRef certificate, + ffi.Pointer error, ) { - return _CFPropertyListWriteToStream( - propertyList, - stream, - format, - errorString, + return _SecCertificateCopySerialNumberData( + certificate, + error, ); } - late final _CFPropertyListWriteToStreamPtr = _lookup< + late final _SecCertificateCopySerialNumberDataPtr = _lookup< ffi.NativeFunction< - CFIndex Function(CFPropertyListRef, CFWriteStreamRef, ffi.Int32, - ffi.Pointer)>>('CFPropertyListWriteToStream'); - late final _CFPropertyListWriteToStream = - _CFPropertyListWriteToStreamPtr.asFunction< - int Function(CFPropertyListRef, CFWriteStreamRef, int, - ffi.Pointer)>(); + CFDataRef Function(SecCertificateRef, + ffi.Pointer)>>('SecCertificateCopySerialNumberData'); + late final _SecCertificateCopySerialNumberData = + _SecCertificateCopySerialNumberDataPtr.asFunction< + CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); - CFPropertyListRef CFPropertyListCreateFromStream( - CFAllocatorRef allocator, - CFReadStreamRef stream, - int streamLength, - int mutabilityOption, - ffi.Pointer format, - ffi.Pointer errorString, + CFDataRef SecCertificateCopySerialNumber( + SecCertificateRef certificate, + ffi.Pointer error, ) { - return _CFPropertyListCreateFromStream( - allocator, - stream, - streamLength, - mutabilityOption, - format, - errorString, + return _SecCertificateCopySerialNumber( + certificate, + error, ); } - late final _CFPropertyListCreateFromStreamPtr = _lookup< + late final _SecCertificateCopySerialNumberPtr = _lookup< ffi.NativeFunction< - CFPropertyListRef Function( - CFAllocatorRef, - CFReadStreamRef, - CFIndex, - CFOptionFlags, - ffi.Pointer, - ffi.Pointer)>>('CFPropertyListCreateFromStream'); - late final _CFPropertyListCreateFromStream = - _CFPropertyListCreateFromStreamPtr.asFunction< - CFPropertyListRef Function(CFAllocatorRef, CFReadStreamRef, int, int, - ffi.Pointer, ffi.Pointer)>(); + CFDataRef Function(SecCertificateRef, + ffi.Pointer)>>('SecCertificateCopySerialNumber'); + late final _SecCertificateCopySerialNumber = + _SecCertificateCopySerialNumberPtr.asFunction< + CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); - CFPropertyListRef CFPropertyListCreateWithData( - CFAllocatorRef allocator, - CFDataRef data, - int options, - ffi.Pointer format, - ffi.Pointer error, + int SecCertificateCreateFromData( + ffi.Pointer data, + int type, + int encoding, + ffi.Pointer certificate, ) { - return _CFPropertyListCreateWithData( - allocator, + return _SecCertificateCreateFromData( data, - options, - format, - error, + type, + encoding, + certificate, ); } - late final _CFPropertyListCreateWithDataPtr = _lookup< + late final _SecCertificateCreateFromDataPtr = _lookup< ffi.NativeFunction< - CFPropertyListRef Function( - CFAllocatorRef, - CFDataRef, - CFOptionFlags, - ffi.Pointer, - ffi.Pointer)>>('CFPropertyListCreateWithData'); - late final _CFPropertyListCreateWithData = - _CFPropertyListCreateWithDataPtr.asFunction< - CFPropertyListRef Function(CFAllocatorRef, CFDataRef, int, - ffi.Pointer, ffi.Pointer)>(); + OSStatus Function( + ffi.Pointer, + CSSM_CERT_TYPE, + CSSM_CERT_ENCODING, + ffi.Pointer)>>('SecCertificateCreateFromData'); + late final _SecCertificateCreateFromData = + _SecCertificateCreateFromDataPtr.asFunction< + int Function(ffi.Pointer, int, int, + ffi.Pointer)>(); - CFPropertyListRef CFPropertyListCreateWithStream( - CFAllocatorRef allocator, - CFReadStreamRef stream, - int streamLength, - int options, - ffi.Pointer format, - ffi.Pointer error, + int SecCertificateAddToKeychain( + SecCertificateRef certificate, + SecKeychainRef keychain, ) { - return _CFPropertyListCreateWithStream( - allocator, - stream, - streamLength, - options, - format, - error, + return _SecCertificateAddToKeychain( + certificate, + keychain, ); } - late final _CFPropertyListCreateWithStreamPtr = _lookup< + late final _SecCertificateAddToKeychainPtr = _lookup< ffi.NativeFunction< - CFPropertyListRef Function( - CFAllocatorRef, - CFReadStreamRef, - CFIndex, - CFOptionFlags, - ffi.Pointer, - ffi.Pointer)>>('CFPropertyListCreateWithStream'); - late final _CFPropertyListCreateWithStream = - _CFPropertyListCreateWithStreamPtr.asFunction< - CFPropertyListRef Function(CFAllocatorRef, CFReadStreamRef, int, int, - ffi.Pointer, ffi.Pointer)>(); + OSStatus Function(SecCertificateRef, + SecKeychainRef)>>('SecCertificateAddToKeychain'); + late final _SecCertificateAddToKeychain = _SecCertificateAddToKeychainPtr + .asFunction(); - int CFPropertyListWrite( - CFPropertyListRef propertyList, - CFWriteStreamRef stream, - int format, - int options, - ffi.Pointer error, + int SecCertificateGetData( + SecCertificateRef certificate, + CSSM_DATA_PTR data, ) { - return _CFPropertyListWrite( - propertyList, - stream, - format, - options, - error, + return _SecCertificateGetData( + certificate, + data, ); } - late final _CFPropertyListWritePtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFPropertyListRef, CFWriteStreamRef, ffi.Int32, - CFOptionFlags, ffi.Pointer)>>('CFPropertyListWrite'); - late final _CFPropertyListWrite = _CFPropertyListWritePtr.asFunction< - int Function(CFPropertyListRef, CFWriteStreamRef, int, int, - ffi.Pointer)>(); + late final _SecCertificateGetDataPtr = _lookup< + ffi + .NativeFunction>( + 'SecCertificateGetData'); + late final _SecCertificateGetData = _SecCertificateGetDataPtr.asFunction< + int Function(SecCertificateRef, CSSM_DATA_PTR)>(); - CFDataRef CFPropertyListCreateData( - CFAllocatorRef allocator, - CFPropertyListRef propertyList, - int format, - int options, - ffi.Pointer error, + int SecCertificateGetType( + SecCertificateRef certificate, + ffi.Pointer certificateType, ) { - return _CFPropertyListCreateData( - allocator, - propertyList, - format, - options, - error, + return _SecCertificateGetType( + certificate, + certificateType, ); } - late final _CFPropertyListCreateDataPtr = _lookup< + late final _SecCertificateGetTypePtr = _lookup< ffi.NativeFunction< - CFDataRef Function( - CFAllocatorRef, - CFPropertyListRef, - ffi.Int32, - CFOptionFlags, - ffi.Pointer)>>('CFPropertyListCreateData'); - late final _CFPropertyListCreateData = - _CFPropertyListCreateDataPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFPropertyListRef, int, int, - ffi.Pointer)>(); - - late final ffi.Pointer _kCFTypeSetCallBacks = - _lookup('kCFTypeSetCallBacks'); - - CFSetCallBacks get kCFTypeSetCallBacks => _kCFTypeSetCallBacks.ref; - - late final ffi.Pointer _kCFCopyStringSetCallBacks = - _lookup('kCFCopyStringSetCallBacks'); - - CFSetCallBacks get kCFCopyStringSetCallBacks => - _kCFCopyStringSetCallBacks.ref; - - int CFSetGetTypeID() { - return _CFSetGetTypeID(); - } - - late final _CFSetGetTypeIDPtr = - _lookup>('CFSetGetTypeID'); - late final _CFSetGetTypeID = _CFSetGetTypeIDPtr.asFunction(); + OSStatus Function(SecCertificateRef, + ffi.Pointer)>>('SecCertificateGetType'); + late final _SecCertificateGetType = _SecCertificateGetTypePtr.asFunction< + int Function(SecCertificateRef, ffi.Pointer)>(); - CFSetRef CFSetCreate( - CFAllocatorRef allocator, - ffi.Pointer> values, - int numValues, - ffi.Pointer callBacks, + int SecCertificateGetSubject( + SecCertificateRef certificate, + ffi.Pointer> subject, ) { - return _CFSetCreate( - allocator, - values, - numValues, - callBacks, + return _SecCertificateGetSubject( + certificate, + subject, ); } - late final _CFSetCreatePtr = _lookup< - ffi.NativeFunction< - CFSetRef Function(CFAllocatorRef, ffi.Pointer>, - CFIndex, ffi.Pointer)>>('CFSetCreate'); - late final _CFSetCreate = _CFSetCreatePtr.asFunction< - CFSetRef Function(CFAllocatorRef, ffi.Pointer>, int, - ffi.Pointer)>(); + late final _SecCertificateGetSubjectPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecCertificateRef, + ffi.Pointer>)>>( + 'SecCertificateGetSubject'); + late final _SecCertificateGetSubject = + _SecCertificateGetSubjectPtr.asFunction< + int Function( + SecCertificateRef, ffi.Pointer>)>(); - CFSetRef CFSetCreateCopy( - CFAllocatorRef allocator, - CFSetRef theSet, + int SecCertificateGetIssuer( + SecCertificateRef certificate, + ffi.Pointer> issuer, ) { - return _CFSetCreateCopy( - allocator, - theSet, + return _SecCertificateGetIssuer( + certificate, + issuer, ); } - late final _CFSetCreateCopyPtr = - _lookup>( - 'CFSetCreateCopy'); - late final _CFSetCreateCopy = _CFSetCreateCopyPtr.asFunction< - CFSetRef Function(CFAllocatorRef, CFSetRef)>(); + late final _SecCertificateGetIssuerPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecCertificateRef, + ffi.Pointer>)>>( + 'SecCertificateGetIssuer'); + late final _SecCertificateGetIssuer = _SecCertificateGetIssuerPtr.asFunction< + int Function( + SecCertificateRef, ffi.Pointer>)>(); - CFMutableSetRef CFSetCreateMutable( - CFAllocatorRef allocator, - int capacity, - ffi.Pointer callBacks, + int SecCertificateGetCLHandle( + SecCertificateRef certificate, + ffi.Pointer clHandle, ) { - return _CFSetCreateMutable( - allocator, - capacity, - callBacks, + return _SecCertificateGetCLHandle( + certificate, + clHandle, ); } - late final _CFSetCreateMutablePtr = _lookup< + late final _SecCertificateGetCLHandlePtr = _lookup< ffi.NativeFunction< - CFMutableSetRef Function(CFAllocatorRef, CFIndex, - ffi.Pointer)>>('CFSetCreateMutable'); - late final _CFSetCreateMutable = _CFSetCreateMutablePtr.asFunction< - CFMutableSetRef Function( - CFAllocatorRef, int, ffi.Pointer)>(); + OSStatus Function(SecCertificateRef, + ffi.Pointer)>>('SecCertificateGetCLHandle'); + late final _SecCertificateGetCLHandle = + _SecCertificateGetCLHandlePtr.asFunction< + int Function(SecCertificateRef, ffi.Pointer)>(); - CFMutableSetRef CFSetCreateMutableCopy( - CFAllocatorRef allocator, - int capacity, - CFSetRef theSet, + int SecCertificateGetAlgorithmID( + SecCertificateRef certificate, + ffi.Pointer> algid, ) { - return _CFSetCreateMutableCopy( - allocator, - capacity, - theSet, + return _SecCertificateGetAlgorithmID( + certificate, + algid, ); } - late final _CFSetCreateMutableCopyPtr = _lookup< - ffi.NativeFunction< - CFMutableSetRef Function( - CFAllocatorRef, CFIndex, CFSetRef)>>('CFSetCreateMutableCopy'); - late final _CFSetCreateMutableCopy = _CFSetCreateMutableCopyPtr.asFunction< - CFMutableSetRef Function(CFAllocatorRef, int, CFSetRef)>(); + late final _SecCertificateGetAlgorithmIDPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SecCertificateRef, ffi.Pointer>)>>( + 'SecCertificateGetAlgorithmID'); + late final _SecCertificateGetAlgorithmID = + _SecCertificateGetAlgorithmIDPtr.asFunction< + int Function( + SecCertificateRef, ffi.Pointer>)>(); - int CFSetGetCount( - CFSetRef theSet, + int SecCertificateCopyPreference( + CFStringRef name, + int keyUsage, + ffi.Pointer certificate, ) { - return _CFSetGetCount( - theSet, + return _SecCertificateCopyPreference( + name, + keyUsage, + certificate, ); } - late final _CFSetGetCountPtr = - _lookup>('CFSetGetCount'); - late final _CFSetGetCount = - _CFSetGetCountPtr.asFunction(); + late final _SecCertificateCopyPreferencePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(CFStringRef, uint32, + ffi.Pointer)>>('SecCertificateCopyPreference'); + late final _SecCertificateCopyPreference = + _SecCertificateCopyPreferencePtr.asFunction< + int Function(CFStringRef, int, ffi.Pointer)>(); - int CFSetGetCountOfValue( - CFSetRef theSet, - ffi.Pointer value, + SecCertificateRef SecCertificateCopyPreferred( + CFStringRef name, + CFArrayRef keyUsage, ) { - return _CFSetGetCountOfValue( - theSet, - value, + return _SecCertificateCopyPreferred( + name, + keyUsage, ); } - late final _CFSetGetCountOfValuePtr = _lookup< + late final _SecCertificateCopyPreferredPtr = _lookup< ffi - .NativeFunction)>>( - 'CFSetGetCountOfValue'); - late final _CFSetGetCountOfValue = _CFSetGetCountOfValuePtr.asFunction< - int Function(CFSetRef, ffi.Pointer)>(); + .NativeFunction>( + 'SecCertificateCopyPreferred'); + late final _SecCertificateCopyPreferred = _SecCertificateCopyPreferredPtr + .asFunction(); - int CFSetContainsValue( - CFSetRef theSet, - ffi.Pointer value, + int SecCertificateSetPreference( + SecCertificateRef certificate, + CFStringRef name, + int keyUsage, + CFDateRef date, ) { - return _CFSetContainsValue( - theSet, - value, + return _SecCertificateSetPreference( + certificate, + name, + keyUsage, + date, ); } - late final _CFSetContainsValuePtr = _lookup< - ffi - .NativeFunction)>>( - 'CFSetContainsValue'); - late final _CFSetContainsValue = _CFSetContainsValuePtr.asFunction< - int Function(CFSetRef, ffi.Pointer)>(); + late final _SecCertificateSetPreferencePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecCertificateRef, CFStringRef, uint32, + CFDateRef)>>('SecCertificateSetPreference'); + late final _SecCertificateSetPreference = + _SecCertificateSetPreferencePtr.asFunction< + int Function(SecCertificateRef, CFStringRef, int, CFDateRef)>(); - ffi.Pointer CFSetGetValue( - CFSetRef theSet, - ffi.Pointer value, + int SecCertificateSetPreferred( + SecCertificateRef certificate, + CFStringRef name, + CFArrayRef keyUsage, ) { - return _CFSetGetValue( - theSet, - value, + return _SecCertificateSetPreferred( + certificate, + name, + keyUsage, ); } - late final _CFSetGetValuePtr = _lookup< + late final _SecCertificateSetPreferredPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - CFSetRef, ffi.Pointer)>>('CFSetGetValue'); - late final _CFSetGetValue = _CFSetGetValuePtr.asFunction< - ffi.Pointer Function(CFSetRef, ffi.Pointer)>(); + OSStatus Function(SecCertificateRef, CFStringRef, + CFArrayRef)>>('SecCertificateSetPreferred'); + late final _SecCertificateSetPreferred = _SecCertificateSetPreferredPtr + .asFunction(); - int CFSetGetValueIfPresent( - CFSetRef theSet, - ffi.Pointer candidate, - ffi.Pointer> value, - ) { - return _CFSetGetValueIfPresent( - theSet, - candidate, - value, - ); - } + late final ffi.Pointer _kSecPropertyKeyType = + _lookup('kSecPropertyKeyType'); - late final _CFSetGetValueIfPresentPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFSetRef, ffi.Pointer, - ffi.Pointer>)>>('CFSetGetValueIfPresent'); - late final _CFSetGetValueIfPresent = _CFSetGetValueIfPresentPtr.asFunction< - int Function(CFSetRef, ffi.Pointer, - ffi.Pointer>)>(); + CFStringRef get kSecPropertyKeyType => _kSecPropertyKeyType.value; - void CFSetGetValues( - CFSetRef theSet, - ffi.Pointer> values, + set kSecPropertyKeyType(CFStringRef value) => + _kSecPropertyKeyType.value = value; + + late final ffi.Pointer _kSecPropertyKeyLabel = + _lookup('kSecPropertyKeyLabel'); + + CFStringRef get kSecPropertyKeyLabel => _kSecPropertyKeyLabel.value; + + set kSecPropertyKeyLabel(CFStringRef value) => + _kSecPropertyKeyLabel.value = value; + + late final ffi.Pointer _kSecPropertyKeyLocalizedLabel = + _lookup('kSecPropertyKeyLocalizedLabel'); + + CFStringRef get kSecPropertyKeyLocalizedLabel => + _kSecPropertyKeyLocalizedLabel.value; + + set kSecPropertyKeyLocalizedLabel(CFStringRef value) => + _kSecPropertyKeyLocalizedLabel.value = value; + + late final ffi.Pointer _kSecPropertyKeyValue = + _lookup('kSecPropertyKeyValue'); + + CFStringRef get kSecPropertyKeyValue => _kSecPropertyKeyValue.value; + + set kSecPropertyKeyValue(CFStringRef value) => + _kSecPropertyKeyValue.value = value; + + late final ffi.Pointer _kSecPropertyTypeWarning = + _lookup('kSecPropertyTypeWarning'); + + CFStringRef get kSecPropertyTypeWarning => _kSecPropertyTypeWarning.value; + + set kSecPropertyTypeWarning(CFStringRef value) => + _kSecPropertyTypeWarning.value = value; + + late final ffi.Pointer _kSecPropertyTypeSuccess = + _lookup('kSecPropertyTypeSuccess'); + + CFStringRef get kSecPropertyTypeSuccess => _kSecPropertyTypeSuccess.value; + + set kSecPropertyTypeSuccess(CFStringRef value) => + _kSecPropertyTypeSuccess.value = value; + + late final ffi.Pointer _kSecPropertyTypeSection = + _lookup('kSecPropertyTypeSection'); + + CFStringRef get kSecPropertyTypeSection => _kSecPropertyTypeSection.value; + + set kSecPropertyTypeSection(CFStringRef value) => + _kSecPropertyTypeSection.value = value; + + late final ffi.Pointer _kSecPropertyTypeData = + _lookup('kSecPropertyTypeData'); + + CFStringRef get kSecPropertyTypeData => _kSecPropertyTypeData.value; + + set kSecPropertyTypeData(CFStringRef value) => + _kSecPropertyTypeData.value = value; + + late final ffi.Pointer _kSecPropertyTypeString = + _lookup('kSecPropertyTypeString'); + + CFStringRef get kSecPropertyTypeString => _kSecPropertyTypeString.value; + + set kSecPropertyTypeString(CFStringRef value) => + _kSecPropertyTypeString.value = value; + + late final ffi.Pointer _kSecPropertyTypeURL = + _lookup('kSecPropertyTypeURL'); + + CFStringRef get kSecPropertyTypeURL => _kSecPropertyTypeURL.value; + + set kSecPropertyTypeURL(CFStringRef value) => + _kSecPropertyTypeURL.value = value; + + late final ffi.Pointer _kSecPropertyTypeDate = + _lookup('kSecPropertyTypeDate'); + + CFStringRef get kSecPropertyTypeDate => _kSecPropertyTypeDate.value; + + set kSecPropertyTypeDate(CFStringRef value) => + _kSecPropertyTypeDate.value = value; + + late final ffi.Pointer _kSecPropertyTypeArray = + _lookup('kSecPropertyTypeArray'); + + CFStringRef get kSecPropertyTypeArray => _kSecPropertyTypeArray.value; + + set kSecPropertyTypeArray(CFStringRef value) => + _kSecPropertyTypeArray.value = value; + + late final ffi.Pointer _kSecPropertyTypeNumber = + _lookup('kSecPropertyTypeNumber'); + + CFStringRef get kSecPropertyTypeNumber => _kSecPropertyTypeNumber.value; + + set kSecPropertyTypeNumber(CFStringRef value) => + _kSecPropertyTypeNumber.value = value; + + CFDictionaryRef SecCertificateCopyValues( + SecCertificateRef certificate, + CFArrayRef keys, + ffi.Pointer error, ) { - return _CFSetGetValues( - theSet, - values, + return _SecCertificateCopyValues( + certificate, + keys, + error, ); } - late final _CFSetGetValuesPtr = _lookup< + late final _SecCertificateCopyValuesPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFSetRef, ffi.Pointer>)>>('CFSetGetValues'); - late final _CFSetGetValues = _CFSetGetValuesPtr.asFunction< - void Function(CFSetRef, ffi.Pointer>)>(); + CFDictionaryRef Function(SecCertificateRef, CFArrayRef, + ffi.Pointer)>>('SecCertificateCopyValues'); + late final _SecCertificateCopyValues = + _SecCertificateCopyValuesPtr.asFunction< + CFDictionaryRef Function( + SecCertificateRef, CFArrayRef, ffi.Pointer)>(); - void CFSetApplyFunction( - CFSetRef theSet, - CFSetApplierFunction applier, - ffi.Pointer context, + CFStringRef SecCertificateCopyLongDescription( + CFAllocatorRef alloc, + SecCertificateRef certificate, + ffi.Pointer error, ) { - return _CFSetApplyFunction( - theSet, - applier, - context, + return _SecCertificateCopyLongDescription( + alloc, + certificate, + error, ); } - late final _CFSetApplyFunctionPtr = _lookup< + late final _SecCertificateCopyLongDescriptionPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFSetRef, CFSetApplierFunction, - ffi.Pointer)>>('CFSetApplyFunction'); - late final _CFSetApplyFunction = _CFSetApplyFunctionPtr.asFunction< - void Function(CFSetRef, CFSetApplierFunction, ffi.Pointer)>(); + CFStringRef Function(CFAllocatorRef, SecCertificateRef, + ffi.Pointer)>>('SecCertificateCopyLongDescription'); + late final _SecCertificateCopyLongDescription = + _SecCertificateCopyLongDescriptionPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, SecCertificateRef, ffi.Pointer)>(); - void CFSetAddValue( - CFMutableSetRef theSet, - ffi.Pointer value, + CFStringRef SecCertificateCopyShortDescription( + CFAllocatorRef alloc, + SecCertificateRef certificate, + ffi.Pointer error, ) { - return _CFSetAddValue( - theSet, - value, + return _SecCertificateCopyShortDescription( + alloc, + certificate, + error, ); } - late final _CFSetAddValuePtr = _lookup< + late final _SecCertificateCopyShortDescriptionPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFMutableSetRef, ffi.Pointer)>>('CFSetAddValue'); - late final _CFSetAddValue = _CFSetAddValuePtr.asFunction< - void Function(CFMutableSetRef, ffi.Pointer)>(); + CFStringRef Function(CFAllocatorRef, SecCertificateRef, + ffi.Pointer)>>('SecCertificateCopyShortDescription'); + late final _SecCertificateCopyShortDescription = + _SecCertificateCopyShortDescriptionPtr.asFunction< + CFStringRef Function( + CFAllocatorRef, SecCertificateRef, ffi.Pointer)>(); - void CFSetReplaceValue( - CFMutableSetRef theSet, - ffi.Pointer value, + CFDataRef SecCertificateCopyNormalizedIssuerContent( + SecCertificateRef certificate, + ffi.Pointer error, ) { - return _CFSetReplaceValue( - theSet, - value, + return _SecCertificateCopyNormalizedIssuerContent( + certificate, + error, ); } - late final _CFSetReplaceValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableSetRef, ffi.Pointer)>>('CFSetReplaceValue'); - late final _CFSetReplaceValue = _CFSetReplaceValuePtr.asFunction< - void Function(CFMutableSetRef, ffi.Pointer)>(); + late final _SecCertificateCopyNormalizedIssuerContentPtr = _lookup< + ffi.NativeFunction< + CFDataRef Function(SecCertificateRef, ffi.Pointer)>>( + 'SecCertificateCopyNormalizedIssuerContent'); + late final _SecCertificateCopyNormalizedIssuerContent = + _SecCertificateCopyNormalizedIssuerContentPtr.asFunction< + CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); - void CFSetSetValue( - CFMutableSetRef theSet, - ffi.Pointer value, + CFDataRef SecCertificateCopyNormalizedSubjectContent( + SecCertificateRef certificate, + ffi.Pointer error, ) { - return _CFSetSetValue( - theSet, - value, + return _SecCertificateCopyNormalizedSubjectContent( + certificate, + error, ); } - late final _CFSetSetValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableSetRef, ffi.Pointer)>>('CFSetSetValue'); - late final _CFSetSetValue = _CFSetSetValuePtr.asFunction< - void Function(CFMutableSetRef, ffi.Pointer)>(); + late final _SecCertificateCopyNormalizedSubjectContentPtr = _lookup< + ffi.NativeFunction< + CFDataRef Function(SecCertificateRef, ffi.Pointer)>>( + 'SecCertificateCopyNormalizedSubjectContent'); + late final _SecCertificateCopyNormalizedSubjectContent = + _SecCertificateCopyNormalizedSubjectContentPtr.asFunction< + CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); - void CFSetRemoveValue( - CFMutableSetRef theSet, - ffi.Pointer value, - ) { - return _CFSetRemoveValue( - theSet, - value, - ); + int SecIdentityGetTypeID() { + return _SecIdentityGetTypeID(); } - late final _CFSetRemoveValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMutableSetRef, ffi.Pointer)>>('CFSetRemoveValue'); - late final _CFSetRemoveValue = _CFSetRemoveValuePtr.asFunction< - void Function(CFMutableSetRef, ffi.Pointer)>(); + late final _SecIdentityGetTypeIDPtr = + _lookup>('SecIdentityGetTypeID'); + late final _SecIdentityGetTypeID = + _SecIdentityGetTypeIDPtr.asFunction(); - void CFSetRemoveAllValues( - CFMutableSetRef theSet, + int SecIdentityCreateWithCertificate( + CFTypeRef keychainOrArray, + SecCertificateRef certificateRef, + ffi.Pointer identityRef, ) { - return _CFSetRemoveAllValues( - theSet, + return _SecIdentityCreateWithCertificate( + keychainOrArray, + certificateRef, + identityRef, ); } - late final _CFSetRemoveAllValuesPtr = - _lookup>( - 'CFSetRemoveAllValues'); - late final _CFSetRemoveAllValues = - _CFSetRemoveAllValuesPtr.asFunction(); + late final _SecIdentityCreateWithCertificatePtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + CFTypeRef, SecCertificateRef, ffi.Pointer)>>( + 'SecIdentityCreateWithCertificate'); + late final _SecIdentityCreateWithCertificate = + _SecIdentityCreateWithCertificatePtr.asFunction< + int Function( + CFTypeRef, SecCertificateRef, ffi.Pointer)>(); - int CFTreeGetTypeID() { - return _CFTreeGetTypeID(); + int SecIdentityCopyCertificate( + SecIdentityRef identityRef, + ffi.Pointer certificateRef, + ) { + return _SecIdentityCopyCertificate( + identityRef, + certificateRef, + ); } - late final _CFTreeGetTypeIDPtr = - _lookup>('CFTreeGetTypeID'); - late final _CFTreeGetTypeID = - _CFTreeGetTypeIDPtr.asFunction(); + late final _SecIdentityCopyCertificatePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecIdentityRef, + ffi.Pointer)>>('SecIdentityCopyCertificate'); + late final _SecIdentityCopyCertificate = + _SecIdentityCopyCertificatePtr.asFunction< + int Function(SecIdentityRef, ffi.Pointer)>(); - CFTreeRef CFTreeCreate( - CFAllocatorRef allocator, - ffi.Pointer context, + int SecIdentityCopyPrivateKey( + SecIdentityRef identityRef, + ffi.Pointer privateKeyRef, ) { - return _CFTreeCreate( - allocator, - context, + return _SecIdentityCopyPrivateKey( + identityRef, + privateKeyRef, ); } - late final _CFTreeCreatePtr = _lookup< + late final _SecIdentityCopyPrivateKeyPtr = _lookup< ffi.NativeFunction< - CFTreeRef Function( - CFAllocatorRef, ffi.Pointer)>>('CFTreeCreate'); - late final _CFTreeCreate = _CFTreeCreatePtr.asFunction< - CFTreeRef Function(CFAllocatorRef, ffi.Pointer)>(); + OSStatus Function(SecIdentityRef, + ffi.Pointer)>>('SecIdentityCopyPrivateKey'); + late final _SecIdentityCopyPrivateKey = _SecIdentityCopyPrivateKeyPtr + .asFunction)>(); - CFTreeRef CFTreeGetParent( - CFTreeRef tree, + int SecIdentityCopyPreference( + CFStringRef name, + int keyUsage, + CFArrayRef validIssuers, + ffi.Pointer identity, ) { - return _CFTreeGetParent( - tree, + return _SecIdentityCopyPreference( + name, + keyUsage, + validIssuers, + identity, ); } - late final _CFTreeGetParentPtr = - _lookup>( - 'CFTreeGetParent'); - late final _CFTreeGetParent = - _CFTreeGetParentPtr.asFunction(); + late final _SecIdentityCopyPreferencePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(CFStringRef, CSSM_KEYUSE, CFArrayRef, + ffi.Pointer)>>('SecIdentityCopyPreference'); + late final _SecIdentityCopyPreference = + _SecIdentityCopyPreferencePtr.asFunction< + int Function( + CFStringRef, int, CFArrayRef, ffi.Pointer)>(); - CFTreeRef CFTreeGetNextSibling( - CFTreeRef tree, + SecIdentityRef SecIdentityCopyPreferred( + CFStringRef name, + CFArrayRef keyUsage, + CFArrayRef validIssuers, ) { - return _CFTreeGetNextSibling( - tree, + return _SecIdentityCopyPreferred( + name, + keyUsage, + validIssuers, ); } - late final _CFTreeGetNextSiblingPtr = - _lookup>( - 'CFTreeGetNextSibling'); - late final _CFTreeGetNextSibling = - _CFTreeGetNextSiblingPtr.asFunction(); + late final _SecIdentityCopyPreferredPtr = _lookup< + ffi.NativeFunction< + SecIdentityRef Function(CFStringRef, CFArrayRef, + CFArrayRef)>>('SecIdentityCopyPreferred'); + late final _SecIdentityCopyPreferred = + _SecIdentityCopyPreferredPtr.asFunction< + SecIdentityRef Function(CFStringRef, CFArrayRef, CFArrayRef)>(); - CFTreeRef CFTreeGetFirstChild( - CFTreeRef tree, + int SecIdentitySetPreference( + SecIdentityRef identity, + CFStringRef name, + int keyUsage, ) { - return _CFTreeGetFirstChild( - tree, + return _SecIdentitySetPreference( + identity, + name, + keyUsage, ); } - late final _CFTreeGetFirstChildPtr = - _lookup>( - 'CFTreeGetFirstChild'); - late final _CFTreeGetFirstChild = - _CFTreeGetFirstChildPtr.asFunction(); + late final _SecIdentitySetPreferencePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SecIdentityRef, CFStringRef, + CSSM_KEYUSE)>>('SecIdentitySetPreference'); + late final _SecIdentitySetPreference = _SecIdentitySetPreferencePtr + .asFunction(); - void CFTreeGetContext( - CFTreeRef tree, - ffi.Pointer context, + int SecIdentitySetPreferred( + SecIdentityRef identity, + CFStringRef name, + CFArrayRef keyUsage, ) { - return _CFTreeGetContext( - tree, - context, + return _SecIdentitySetPreferred( + identity, + name, + keyUsage, ); } - late final _CFTreeGetContextPtr = _lookup< + late final _SecIdentitySetPreferredPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - CFTreeRef, ffi.Pointer)>>('CFTreeGetContext'); - late final _CFTreeGetContext = _CFTreeGetContextPtr.asFunction< - void Function(CFTreeRef, ffi.Pointer)>(); + OSStatus Function(SecIdentityRef, CFStringRef, + CFArrayRef)>>('SecIdentitySetPreferred'); + late final _SecIdentitySetPreferred = _SecIdentitySetPreferredPtr.asFunction< + int Function(SecIdentityRef, CFStringRef, CFArrayRef)>(); - int CFTreeGetChildCount( - CFTreeRef tree, + int SecIdentityCopySystemIdentity( + CFStringRef domain, + ffi.Pointer idRef, + ffi.Pointer actualDomain, ) { - return _CFTreeGetChildCount( - tree, + return _SecIdentityCopySystemIdentity( + domain, + idRef, + actualDomain, ); } - late final _CFTreeGetChildCountPtr = - _lookup>( - 'CFTreeGetChildCount'); - late final _CFTreeGetChildCount = - _CFTreeGetChildCountPtr.asFunction(); + late final _SecIdentityCopySystemIdentityPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(CFStringRef, ffi.Pointer, + ffi.Pointer)>>('SecIdentityCopySystemIdentity'); + late final _SecIdentityCopySystemIdentity = + _SecIdentityCopySystemIdentityPtr.asFunction< + int Function(CFStringRef, ffi.Pointer, + ffi.Pointer)>(); - CFTreeRef CFTreeGetChildAtIndex( - CFTreeRef tree, - int idx, + int SecIdentitySetSystemIdentity( + CFStringRef domain, + SecIdentityRef idRef, ) { - return _CFTreeGetChildAtIndex( - tree, - idx, + return _SecIdentitySetSystemIdentity( + domain, + idRef, ); } - late final _CFTreeGetChildAtIndexPtr = - _lookup>( - 'CFTreeGetChildAtIndex'); - late final _CFTreeGetChildAtIndex = _CFTreeGetChildAtIndexPtr.asFunction< - CFTreeRef Function(CFTreeRef, int)>(); + late final _SecIdentitySetSystemIdentityPtr = _lookup< + ffi.NativeFunction>( + 'SecIdentitySetSystemIdentity'); + late final _SecIdentitySetSystemIdentity = _SecIdentitySetSystemIdentityPtr + .asFunction(); - void CFTreeGetChildren( - CFTreeRef tree, - ffi.Pointer children, + late final ffi.Pointer _kSecIdentityDomainDefault = + _lookup('kSecIdentityDomainDefault'); + + CFStringRef get kSecIdentityDomainDefault => _kSecIdentityDomainDefault.value; + + set kSecIdentityDomainDefault(CFStringRef value) => + _kSecIdentityDomainDefault.value = value; + + late final ffi.Pointer _kSecIdentityDomainKerberosKDC = + _lookup('kSecIdentityDomainKerberosKDC'); + + CFStringRef get kSecIdentityDomainKerberosKDC => + _kSecIdentityDomainKerberosKDC.value; + + set kSecIdentityDomainKerberosKDC(CFStringRef value) => + _kSecIdentityDomainKerberosKDC.value = value; + + Dartsec_trust_t sec_trust_create( + SecTrustRef trust, ) { - return _CFTreeGetChildren( - tree, - children, - ); + return objc.NSObject.castFromPointer( + _sec_trust_create( + trust, + ), + retain: false, + release: true); } - late final _CFTreeGetChildrenPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFTreeRef, ffi.Pointer)>>('CFTreeGetChildren'); - late final _CFTreeGetChildren = _CFTreeGetChildrenPtr.asFunction< - void Function(CFTreeRef, ffi.Pointer)>(); + late final _sec_trust_createPtr = + _lookup>( + 'sec_trust_create'); + late final _sec_trust_create = + _sec_trust_createPtr.asFunction(); - void CFTreeApplyFunctionToChildren( - CFTreeRef tree, - CFTreeApplierFunction applier, - ffi.Pointer context, + SecTrustRef sec_trust_copy_ref( + Dartsec_trust_t trust, ) { - return _CFTreeApplyFunctionToChildren( - tree, - applier, - context, + return _sec_trust_copy_ref( + trust.ref.pointer, ); } - late final _CFTreeApplyFunctionToChildrenPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFTreeRef, CFTreeApplierFunction, - ffi.Pointer)>>('CFTreeApplyFunctionToChildren'); - late final _CFTreeApplyFunctionToChildren = - _CFTreeApplyFunctionToChildrenPtr.asFunction< - void Function( - CFTreeRef, CFTreeApplierFunction, ffi.Pointer)>(); + late final _sec_trust_copy_refPtr = + _lookup>( + 'sec_trust_copy_ref'); + late final _sec_trust_copy_ref = + _sec_trust_copy_refPtr.asFunction(); - CFTreeRef CFTreeFindRoot( - CFTreeRef tree, + Dartsec_identity_t sec_identity_create( + SecIdentityRef identity, ) { - return _CFTreeFindRoot( - tree, - ); + return objc.NSObject.castFromPointer( + _sec_identity_create( + identity, + ), + retain: false, + release: true); } - late final _CFTreeFindRootPtr = - _lookup>( - 'CFTreeFindRoot'); - late final _CFTreeFindRoot = - _CFTreeFindRootPtr.asFunction(); + late final _sec_identity_createPtr = + _lookup>( + 'sec_identity_create'); + late final _sec_identity_create = _sec_identity_createPtr + .asFunction(); - void CFTreeSetContext( - CFTreeRef tree, - ffi.Pointer context, + Dartsec_identity_t sec_identity_create_with_certificates( + SecIdentityRef identity, + CFArrayRef certificates, ) { - return _CFTreeSetContext( - tree, - context, - ); + return objc.NSObject.castFromPointer( + _sec_identity_create_with_certificates( + identity, + certificates, + ), + retain: false, + release: true); } - late final _CFTreeSetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFTreeRef, ffi.Pointer)>>('CFTreeSetContext'); - late final _CFTreeSetContext = _CFTreeSetContextPtr.asFunction< - void Function(CFTreeRef, ffi.Pointer)>(); + late final _sec_identity_create_with_certificatesPtr = _lookup< + ffi + .NativeFunction>( + 'sec_identity_create_with_certificates'); + late final _sec_identity_create_with_certificates = + _sec_identity_create_with_certificatesPtr + .asFunction(); - void CFTreePrependChild( - CFTreeRef tree, - CFTreeRef newChild, + bool sec_identity_access_certificates( + Dartsec_identity_t identity, + objc.ObjCBlock handler, ) { - return _CFTreePrependChild( - tree, - newChild, + return _sec_identity_access_certificates( + identity.ref.pointer, + handler.ref.pointer, ); } - late final _CFTreePrependChildPtr = - _lookup>( - 'CFTreePrependChild'); - late final _CFTreePrependChild = - _CFTreePrependChildPtr.asFunction(); + late final _sec_identity_access_certificatesPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + sec_identity_t, ffi.Pointer)>>( + 'sec_identity_access_certificates'); + late final _sec_identity_access_certificates = + _sec_identity_access_certificatesPtr.asFunction< + bool Function(sec_identity_t, ffi.Pointer)>(); - void CFTreeAppendChild( - CFTreeRef tree, - CFTreeRef newChild, + SecIdentityRef sec_identity_copy_ref( + Dartsec_identity_t identity, ) { - return _CFTreeAppendChild( - tree, - newChild, + return _sec_identity_copy_ref( + identity.ref.pointer, ); } - late final _CFTreeAppendChildPtr = - _lookup>( - 'CFTreeAppendChild'); - late final _CFTreeAppendChild = - _CFTreeAppendChildPtr.asFunction(); + late final _sec_identity_copy_refPtr = + _lookup>( + 'sec_identity_copy_ref'); + late final _sec_identity_copy_ref = _sec_identity_copy_refPtr + .asFunction(); - void CFTreeInsertSibling( - CFTreeRef tree, - CFTreeRef newSibling, + CFArrayRef sec_identity_copy_certificates_ref( + Dartsec_identity_t identity, ) { - return _CFTreeInsertSibling( - tree, - newSibling, + return _sec_identity_copy_certificates_ref( + identity.ref.pointer, ); } - late final _CFTreeInsertSiblingPtr = - _lookup>( - 'CFTreeInsertSibling'); - late final _CFTreeInsertSibling = - _CFTreeInsertSiblingPtr.asFunction(); + late final _sec_identity_copy_certificates_refPtr = + _lookup>( + 'sec_identity_copy_certificates_ref'); + late final _sec_identity_copy_certificates_ref = + _sec_identity_copy_certificates_refPtr + .asFunction(); - void CFTreeRemove( - CFTreeRef tree, + Dartsec_certificate_t sec_certificate_create( + SecCertificateRef certificate, ) { - return _CFTreeRemove( - tree, - ); + return objc.NSObject.castFromPointer( + _sec_certificate_create( + certificate, + ), + retain: false, + release: true); } - late final _CFTreeRemovePtr = - _lookup>('CFTreeRemove'); - late final _CFTreeRemove = - _CFTreeRemovePtr.asFunction(); + late final _sec_certificate_createPtr = _lookup< + ffi.NativeFunction>( + 'sec_certificate_create'); + late final _sec_certificate_create = _sec_certificate_createPtr + .asFunction(); - void CFTreeRemoveAllChildren( - CFTreeRef tree, + SecCertificateRef sec_certificate_copy_ref( + Dartsec_certificate_t certificate, ) { - return _CFTreeRemoveAllChildren( - tree, + return _sec_certificate_copy_ref( + certificate.ref.pointer, ); } - late final _CFTreeRemoveAllChildrenPtr = - _lookup>( - 'CFTreeRemoveAllChildren'); - late final _CFTreeRemoveAllChildren = - _CFTreeRemoveAllChildrenPtr.asFunction(); + late final _sec_certificate_copy_refPtr = _lookup< + ffi.NativeFunction>( + 'sec_certificate_copy_ref'); + late final _sec_certificate_copy_ref = _sec_certificate_copy_refPtr + .asFunction(); - void CFTreeSortChildren( - CFTreeRef tree, - CFComparatorFunction comparator, - ffi.Pointer context, + ffi.Pointer sec_protocol_metadata_get_negotiated_protocol( + Dartsec_protocol_metadata_t metadata, ) { - return _CFTreeSortChildren( - tree, - comparator, - context, + return _sec_protocol_metadata_get_negotiated_protocol( + metadata.ref.pointer, ); } - late final _CFTreeSortChildrenPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFTreeRef, CFComparatorFunction, - ffi.Pointer)>>('CFTreeSortChildren'); - late final _CFTreeSortChildren = _CFTreeSortChildrenPtr.asFunction< - void Function(CFTreeRef, CFComparatorFunction, ffi.Pointer)>(); + late final _sec_protocol_metadata_get_negotiated_protocolPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(sec_protocol_metadata_t)>>( + 'sec_protocol_metadata_get_negotiated_protocol'); + late final _sec_protocol_metadata_get_negotiated_protocol = + _sec_protocol_metadata_get_negotiated_protocolPtr.asFunction< + ffi.Pointer Function(sec_protocol_metadata_t)>(); - int CFURLCreateDataAndPropertiesFromResource( - CFAllocatorRef alloc, - CFURLRef url, - ffi.Pointer resourceData, - ffi.Pointer properties, - CFArrayRef desiredProperties, - ffi.Pointer errorCode, + Dartdispatch_data_t sec_protocol_metadata_copy_peer_public_key( + Dartsec_protocol_metadata_t metadata, ) { - return _CFURLCreateDataAndPropertiesFromResource( - alloc, - url, - resourceData, - properties, - desiredProperties, - errorCode, - ); + return objc.NSObject.castFromPointer( + _sec_protocol_metadata_copy_peer_public_key( + metadata.ref.pointer, + ), + retain: false, + release: true); } - late final _CFURLCreateDataAndPropertiesFromResourcePtr = _lookup< - ffi.NativeFunction< - Boolean Function( - CFAllocatorRef, - CFURLRef, - ffi.Pointer, - ffi.Pointer, - CFArrayRef, - ffi.Pointer)>>( - 'CFURLCreateDataAndPropertiesFromResource'); - late final _CFURLCreateDataAndPropertiesFromResource = - _CFURLCreateDataAndPropertiesFromResourcePtr.asFunction< - int Function(CFAllocatorRef, CFURLRef, ffi.Pointer, - ffi.Pointer, CFArrayRef, ffi.Pointer)>(); + late final _sec_protocol_metadata_copy_peer_public_keyPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_metadata_copy_peer_public_key'); + late final _sec_protocol_metadata_copy_peer_public_key = + _sec_protocol_metadata_copy_peer_public_keyPtr + .asFunction(); - int CFURLWriteDataAndPropertiesToResource( - CFURLRef url, - CFDataRef dataToWrite, - CFDictionaryRef propertiesToWrite, - ffi.Pointer errorCode, + tls_protocol_version_t + sec_protocol_metadata_get_negotiated_tls_protocol_version( + Dartsec_protocol_metadata_t metadata, ) { - return _CFURLWriteDataAndPropertiesToResource( - url, - dataToWrite, - propertiesToWrite, - errorCode, - ); + return tls_protocol_version_t + .fromValue(_sec_protocol_metadata_get_negotiated_tls_protocol_version( + metadata.ref.pointer, + )); } - late final _CFURLWriteDataAndPropertiesToResourcePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFURLRef, CFDataRef, CFDictionaryRef, - ffi.Pointer)>>('CFURLWriteDataAndPropertiesToResource'); - late final _CFURLWriteDataAndPropertiesToResource = - _CFURLWriteDataAndPropertiesToResourcePtr.asFunction< - int Function( - CFURLRef, CFDataRef, CFDictionaryRef, ffi.Pointer)>(); + late final _sec_protocol_metadata_get_negotiated_tls_protocol_versionPtr = + _lookup>( + 'sec_protocol_metadata_get_negotiated_tls_protocol_version'); + late final _sec_protocol_metadata_get_negotiated_tls_protocol_version = + _sec_protocol_metadata_get_negotiated_tls_protocol_versionPtr + .asFunction(); - int CFURLDestroyResource( - CFURLRef url, - ffi.Pointer errorCode, + SSLProtocol sec_protocol_metadata_get_negotiated_protocol_version( + Dartsec_protocol_metadata_t metadata, ) { - return _CFURLDestroyResource( - url, - errorCode, - ); + return SSLProtocol.fromValue( + _sec_protocol_metadata_get_negotiated_protocol_version( + metadata.ref.pointer, + )); } - late final _CFURLDestroyResourcePtr = _lookup< - ffi.NativeFunction)>>( - 'CFURLDestroyResource'); - late final _CFURLDestroyResource = _CFURLDestroyResourcePtr.asFunction< - int Function(CFURLRef, ffi.Pointer)>(); + late final _sec_protocol_metadata_get_negotiated_protocol_versionPtr = + _lookup< + ffi.NativeFunction< + ffi.UnsignedInt Function(sec_protocol_metadata_t)>>( + 'sec_protocol_metadata_get_negotiated_protocol_version'); + late final _sec_protocol_metadata_get_negotiated_protocol_version = + _sec_protocol_metadata_get_negotiated_protocol_versionPtr + .asFunction(); - CFTypeRef CFURLCreatePropertyFromResource( - CFAllocatorRef alloc, - CFURLRef url, - CFStringRef property, - ffi.Pointer errorCode, + tls_ciphersuite_t sec_protocol_metadata_get_negotiated_tls_ciphersuite( + Dartsec_protocol_metadata_t metadata, ) { - return _CFURLCreatePropertyFromResource( - alloc, - url, - property, - errorCode, - ); + return tls_ciphersuite_t + .fromValue(_sec_protocol_metadata_get_negotiated_tls_ciphersuite( + metadata.ref.pointer, + )); } - late final _CFURLCreatePropertyFromResourcePtr = _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFAllocatorRef, CFURLRef, CFStringRef, - ffi.Pointer)>>('CFURLCreatePropertyFromResource'); - late final _CFURLCreatePropertyFromResource = - _CFURLCreatePropertyFromResourcePtr.asFunction< - CFTypeRef Function( - CFAllocatorRef, CFURLRef, CFStringRef, ffi.Pointer)>(); + late final _sec_protocol_metadata_get_negotiated_tls_ciphersuitePtr = + _lookup>( + 'sec_protocol_metadata_get_negotiated_tls_ciphersuite'); + late final _sec_protocol_metadata_get_negotiated_tls_ciphersuite = + _sec_protocol_metadata_get_negotiated_tls_ciphersuitePtr + .asFunction(); - late final ffi.Pointer _kCFURLFileExists = - _lookup('kCFURLFileExists'); + DartSSLCipherSuite sec_protocol_metadata_get_negotiated_ciphersuite( + Dartsec_protocol_metadata_t metadata, + ) { + return _sec_protocol_metadata_get_negotiated_ciphersuite( + metadata.ref.pointer, + ); + } - CFStringRef get kCFURLFileExists => _kCFURLFileExists.value; + late final _sec_protocol_metadata_get_negotiated_ciphersuitePtr = _lookup< + ffi.NativeFunction>( + 'sec_protocol_metadata_get_negotiated_ciphersuite'); + late final _sec_protocol_metadata_get_negotiated_ciphersuite = + _sec_protocol_metadata_get_negotiated_ciphersuitePtr + .asFunction(); - late final ffi.Pointer _kCFURLFileDirectoryContents = - _lookup('kCFURLFileDirectoryContents'); + bool sec_protocol_metadata_get_early_data_accepted( + Dartsec_protocol_metadata_t metadata, + ) { + return _sec_protocol_metadata_get_early_data_accepted( + metadata.ref.pointer, + ); + } - CFStringRef get kCFURLFileDirectoryContents => - _kCFURLFileDirectoryContents.value; + late final _sec_protocol_metadata_get_early_data_acceptedPtr = + _lookup>( + 'sec_protocol_metadata_get_early_data_accepted'); + late final _sec_protocol_metadata_get_early_data_accepted = + _sec_protocol_metadata_get_early_data_acceptedPtr + .asFunction(); - late final ffi.Pointer _kCFURLFileLength = - _lookup('kCFURLFileLength'); + bool sec_protocol_metadata_access_peer_certificate_chain( + Dartsec_protocol_metadata_t metadata, + objc.ObjCBlock handler, + ) { + return _sec_protocol_metadata_access_peer_certificate_chain( + metadata.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLFileLength => _kCFURLFileLength.value; + late final _sec_protocol_metadata_access_peer_certificate_chainPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + sec_protocol_metadata_t, ffi.Pointer)>>( + 'sec_protocol_metadata_access_peer_certificate_chain'); + late final _sec_protocol_metadata_access_peer_certificate_chain = + _sec_protocol_metadata_access_peer_certificate_chainPtr.asFunction< + bool Function( + sec_protocol_metadata_t, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLFileLastModificationTime = - _lookup('kCFURLFileLastModificationTime'); + bool sec_protocol_metadata_access_ocsp_response( + Dartsec_protocol_metadata_t metadata, + objc.ObjCBlock handler, + ) { + return _sec_protocol_metadata_access_ocsp_response( + metadata.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLFileLastModificationTime => - _kCFURLFileLastModificationTime.value; + late final _sec_protocol_metadata_access_ocsp_responsePtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + sec_protocol_metadata_t, ffi.Pointer)>>( + 'sec_protocol_metadata_access_ocsp_response'); + late final _sec_protocol_metadata_access_ocsp_response = + _sec_protocol_metadata_access_ocsp_responsePtr.asFunction< + bool Function( + sec_protocol_metadata_t, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLFilePOSIXMode = - _lookup('kCFURLFilePOSIXMode'); + bool sec_protocol_metadata_access_supported_signature_algorithms( + Dartsec_protocol_metadata_t metadata, + objc.ObjCBlock handler, + ) { + return _sec_protocol_metadata_access_supported_signature_algorithms( + metadata.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLFilePOSIXMode => _kCFURLFilePOSIXMode.value; + late final _sec_protocol_metadata_access_supported_signature_algorithmsPtr = + _lookup< + ffi.NativeFunction< + ffi.Bool Function(sec_protocol_metadata_t, + ffi.Pointer)>>( + 'sec_protocol_metadata_access_supported_signature_algorithms'); + late final _sec_protocol_metadata_access_supported_signature_algorithms = + _sec_protocol_metadata_access_supported_signature_algorithmsPtr + .asFunction< + bool Function( + sec_protocol_metadata_t, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLFileOwnerID = - _lookup('kCFURLFileOwnerID'); + bool sec_protocol_metadata_access_distinguished_names( + Dartsec_protocol_metadata_t metadata, + objc.ObjCBlock handler, + ) { + return _sec_protocol_metadata_access_distinguished_names( + metadata.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLFileOwnerID => _kCFURLFileOwnerID.value; + late final _sec_protocol_metadata_access_distinguished_namesPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + sec_protocol_metadata_t, ffi.Pointer)>>( + 'sec_protocol_metadata_access_distinguished_names'); + late final _sec_protocol_metadata_access_distinguished_names = + _sec_protocol_metadata_access_distinguished_namesPtr.asFunction< + bool Function( + sec_protocol_metadata_t, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLHTTPStatusCode = - _lookup('kCFURLHTTPStatusCode'); + bool sec_protocol_metadata_access_pre_shared_keys( + Dartsec_protocol_metadata_t metadata, + objc.ObjCBlock handler, + ) { + return _sec_protocol_metadata_access_pre_shared_keys( + metadata.ref.pointer, + handler.ref.pointer, + ); + } - CFStringRef get kCFURLHTTPStatusCode => _kCFURLHTTPStatusCode.value; + late final _sec_protocol_metadata_access_pre_shared_keysPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + sec_protocol_metadata_t, ffi.Pointer)>>( + 'sec_protocol_metadata_access_pre_shared_keys'); + late final _sec_protocol_metadata_access_pre_shared_keys = + _sec_protocol_metadata_access_pre_shared_keysPtr.asFunction< + bool Function( + sec_protocol_metadata_t, ffi.Pointer)>(); - late final ffi.Pointer _kCFURLHTTPStatusLine = - _lookup('kCFURLHTTPStatusLine'); + ffi.Pointer sec_protocol_metadata_get_server_name( + Dartsec_protocol_metadata_t metadata, + ) { + return _sec_protocol_metadata_get_server_name( + metadata.ref.pointer, + ); + } - CFStringRef get kCFURLHTTPStatusLine => _kCFURLHTTPStatusLine.value; + late final _sec_protocol_metadata_get_server_namePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(sec_protocol_metadata_t)>>( + 'sec_protocol_metadata_get_server_name'); + late final _sec_protocol_metadata_get_server_name = + _sec_protocol_metadata_get_server_namePtr.asFunction< + ffi.Pointer Function(sec_protocol_metadata_t)>(); - int CFUUIDGetTypeID() { - return _CFUUIDGetTypeID(); + bool sec_protocol_metadata_peers_are_equal( + Dartsec_protocol_metadata_t metadataA, + Dartsec_protocol_metadata_t metadataB, + ) { + return _sec_protocol_metadata_peers_are_equal( + metadataA.ref.pointer, + metadataB.ref.pointer, + ); } - late final _CFUUIDGetTypeIDPtr = - _lookup>('CFUUIDGetTypeID'); - late final _CFUUIDGetTypeID = - _CFUUIDGetTypeIDPtr.asFunction(); + late final _sec_protocol_metadata_peers_are_equalPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + sec_protocol_metadata_t, sec_protocol_metadata_t)>>( + 'sec_protocol_metadata_peers_are_equal'); + late final _sec_protocol_metadata_peers_are_equal = + _sec_protocol_metadata_peers_are_equalPtr.asFunction< + bool Function(sec_protocol_metadata_t, sec_protocol_metadata_t)>(); - CFUUIDRef CFUUIDCreate( - CFAllocatorRef alloc, + bool sec_protocol_metadata_challenge_parameters_are_equal( + Dartsec_protocol_metadata_t metadataA, + Dartsec_protocol_metadata_t metadataB, ) { - return _CFUUIDCreate( - alloc, + return _sec_protocol_metadata_challenge_parameters_are_equal( + metadataA.ref.pointer, + metadataB.ref.pointer, ); } - late final _CFUUIDCreatePtr = - _lookup>( - 'CFUUIDCreate'); - late final _CFUUIDCreate = - _CFUUIDCreatePtr.asFunction(); + late final _sec_protocol_metadata_challenge_parameters_are_equalPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + sec_protocol_metadata_t, sec_protocol_metadata_t)>>( + 'sec_protocol_metadata_challenge_parameters_are_equal'); + late final _sec_protocol_metadata_challenge_parameters_are_equal = + _sec_protocol_metadata_challenge_parameters_are_equalPtr.asFunction< + bool Function(sec_protocol_metadata_t, sec_protocol_metadata_t)>(); - CFUUIDRef CFUUIDCreateWithBytes( - CFAllocatorRef alloc, - int byte0, - int byte1, - int byte2, - int byte3, - int byte4, - int byte5, - int byte6, - int byte7, - int byte8, - int byte9, - int byte10, - int byte11, - int byte12, - int byte13, - int byte14, - int byte15, + Dartdispatch_data_t sec_protocol_metadata_create_secret( + Dartsec_protocol_metadata_t metadata, + int label_len, + ffi.Pointer label, + int exporter_length, ) { - return _CFUUIDCreateWithBytes( - alloc, - byte0, - byte1, - byte2, - byte3, - byte4, - byte5, - byte6, - byte7, - byte8, - byte9, - byte10, - byte11, - byte12, - byte13, - byte14, - byte15, - ); + return objc.NSObject.castFromPointer( + _sec_protocol_metadata_create_secret( + metadata.ref.pointer, + label_len, + label, + exporter_length, + ), + retain: false, + release: true); } - late final _CFUUIDCreateWithBytesPtr = _lookup< + late final _sec_protocol_metadata_create_secretPtr = _lookup< ffi.NativeFunction< - CFUUIDRef Function( - CFAllocatorRef, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8)>>('CFUUIDCreateWithBytes'); - late final _CFUUIDCreateWithBytes = _CFUUIDCreateWithBytesPtr.asFunction< - CFUUIDRef Function(CFAllocatorRef, int, int, int, int, int, int, int, int, - int, int, int, int, int, int, int, int)>(); + dispatch_data_t Function( + sec_protocol_metadata_t, + ffi.Size, + ffi.Pointer, + ffi.Size)>>('sec_protocol_metadata_create_secret'); + late final _sec_protocol_metadata_create_secret = + _sec_protocol_metadata_create_secretPtr.asFunction< + dispatch_data_t Function( + sec_protocol_metadata_t, int, ffi.Pointer, int)>(); - CFUUIDRef CFUUIDCreateFromString( - CFAllocatorRef alloc, - CFStringRef uuidStr, + Dartdispatch_data_t sec_protocol_metadata_create_secret_with_context( + Dartsec_protocol_metadata_t metadata, + int label_len, + ffi.Pointer label, + int context_len, + ffi.Pointer context, + int exporter_length, ) { - return _CFUUIDCreateFromString( - alloc, - uuidStr, - ); + return objc.NSObject.castFromPointer( + _sec_protocol_metadata_create_secret_with_context( + metadata.ref.pointer, + label_len, + label, + context_len, + context, + exporter_length, + ), + retain: false, + release: true); } - late final _CFUUIDCreateFromStringPtr = _lookup< - ffi.NativeFunction>( - 'CFUUIDCreateFromString'); - late final _CFUUIDCreateFromString = _CFUUIDCreateFromStringPtr.asFunction< - CFUUIDRef Function(CFAllocatorRef, CFStringRef)>(); + late final _sec_protocol_metadata_create_secret_with_contextPtr = _lookup< + ffi.NativeFunction< + dispatch_data_t Function( + sec_protocol_metadata_t, + ffi.Size, + ffi.Pointer, + ffi.Size, + ffi.Pointer, + ffi.Size)>>('sec_protocol_metadata_create_secret_with_context'); + late final _sec_protocol_metadata_create_secret_with_context = + _sec_protocol_metadata_create_secret_with_contextPtr.asFunction< + dispatch_data_t Function(sec_protocol_metadata_t, int, + ffi.Pointer, int, ffi.Pointer, int)>(); - CFStringRef CFUUIDCreateString( - CFAllocatorRef alloc, - CFUUIDRef uuid, + bool sec_protocol_options_are_equal( + Dartsec_protocol_options_t optionsA, + Dartsec_protocol_options_t optionsB, ) { - return _CFUUIDCreateString( - alloc, - uuid, + return _sec_protocol_options_are_equal( + optionsA.ref.pointer, + optionsB.ref.pointer, ); } - late final _CFUUIDCreateStringPtr = _lookup< - ffi.NativeFunction>( - 'CFUUIDCreateString'); - late final _CFUUIDCreateString = _CFUUIDCreateStringPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFUUIDRef)>(); + late final _sec_protocol_options_are_equalPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(sec_protocol_options_t, + sec_protocol_options_t)>>('sec_protocol_options_are_equal'); + late final _sec_protocol_options_are_equal = + _sec_protocol_options_are_equalPtr.asFunction< + bool Function(sec_protocol_options_t, sec_protocol_options_t)>(); - CFUUIDRef CFUUIDGetConstantUUIDWithBytes( - CFAllocatorRef alloc, - int byte0, - int byte1, - int byte2, - int byte3, - int byte4, - int byte5, - int byte6, - int byte7, - int byte8, - int byte9, - int byte10, - int byte11, - int byte12, - int byte13, - int byte14, - int byte15, + void sec_protocol_options_set_local_identity( + Dartsec_protocol_options_t options, + Dartsec_identity_t identity, ) { - return _CFUUIDGetConstantUUIDWithBytes( - alloc, - byte0, - byte1, - byte2, - byte3, - byte4, - byte5, - byte6, - byte7, - byte8, - byte9, - byte10, - byte11, - byte12, - byte13, - byte14, - byte15, + return _sec_protocol_options_set_local_identity( + options.ref.pointer, + identity.ref.pointer, ); } - late final _CFUUIDGetConstantUUIDWithBytesPtr = _lookup< + late final _sec_protocol_options_set_local_identityPtr = _lookup< ffi.NativeFunction< - CFUUIDRef Function( - CFAllocatorRef, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8, - UInt8)>>('CFUUIDGetConstantUUIDWithBytes'); - late final _CFUUIDGetConstantUUIDWithBytes = - _CFUUIDGetConstantUUIDWithBytesPtr.asFunction< - CFUUIDRef Function(CFAllocatorRef, int, int, int, int, int, int, int, - int, int, int, int, int, int, int, int, int)>(); + ffi.Void Function(sec_protocol_options_t, + sec_identity_t)>>('sec_protocol_options_set_local_identity'); + late final _sec_protocol_options_set_local_identity = + _sec_protocol_options_set_local_identityPtr + .asFunction(); - CFUUIDBytes CFUUIDGetUUIDBytes( - CFUUIDRef uuid, + void sec_protocol_options_append_tls_ciphersuite( + Dartsec_protocol_options_t options, + tls_ciphersuite_t ciphersuite, ) { - return _CFUUIDGetUUIDBytes( - uuid, + return _sec_protocol_options_append_tls_ciphersuite( + options.ref.pointer, + ciphersuite.value, ); } - late final _CFUUIDGetUUIDBytesPtr = - _lookup>( - 'CFUUIDGetUUIDBytes'); - late final _CFUUIDGetUUIDBytes = - _CFUUIDGetUUIDBytesPtr.asFunction(); + late final _sec_protocol_options_append_tls_ciphersuitePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, + ffi.Uint16)>>('sec_protocol_options_append_tls_ciphersuite'); + late final _sec_protocol_options_append_tls_ciphersuite = + _sec_protocol_options_append_tls_ciphersuitePtr + .asFunction(); - CFUUIDRef CFUUIDCreateFromUUIDBytes( - CFAllocatorRef alloc, - CFUUIDBytes bytes, + void sec_protocol_options_add_tls_ciphersuite( + Dartsec_protocol_options_t options, + DartSSLCipherSuite ciphersuite, ) { - return _CFUUIDCreateFromUUIDBytes( - alloc, - bytes, + return _sec_protocol_options_add_tls_ciphersuite( + options.ref.pointer, + ciphersuite, ); } - late final _CFUUIDCreateFromUUIDBytesPtr = _lookup< - ffi.NativeFunction>( - 'CFUUIDCreateFromUUIDBytes'); - late final _CFUUIDCreateFromUUIDBytes = _CFUUIDCreateFromUUIDBytesPtr - .asFunction(); + late final _sec_protocol_options_add_tls_ciphersuitePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, + SSLCipherSuite)>>('sec_protocol_options_add_tls_ciphersuite'); + late final _sec_protocol_options_add_tls_ciphersuite = + _sec_protocol_options_add_tls_ciphersuitePtr + .asFunction(); - CFURLRef CFCopyHomeDirectoryURL() { - return _CFCopyHomeDirectoryURL(); + void sec_protocol_options_append_tls_ciphersuite_group( + Dartsec_protocol_options_t options, + tls_ciphersuite_group_t group, + ) { + return _sec_protocol_options_append_tls_ciphersuite_group( + options.ref.pointer, + group.value, + ); } - late final _CFCopyHomeDirectoryURLPtr = - _lookup>( - 'CFCopyHomeDirectoryURL'); - late final _CFCopyHomeDirectoryURL = - _CFCopyHomeDirectoryURLPtr.asFunction(); - - late final ffi.Pointer _kCFBundleInfoDictionaryVersionKey = - _lookup('kCFBundleInfoDictionaryVersionKey'); + late final _sec_protocol_options_append_tls_ciphersuite_groupPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, ffi.Uint16)>>( + 'sec_protocol_options_append_tls_ciphersuite_group'); + late final _sec_protocol_options_append_tls_ciphersuite_group = + _sec_protocol_options_append_tls_ciphersuite_groupPtr + .asFunction(); - CFStringRef get kCFBundleInfoDictionaryVersionKey => - _kCFBundleInfoDictionaryVersionKey.value; + void sec_protocol_options_add_tls_ciphersuite_group( + Dartsec_protocol_options_t options, + SSLCiphersuiteGroup group, + ) { + return _sec_protocol_options_add_tls_ciphersuite_group( + options.ref.pointer, + group.value, + ); + } - late final ffi.Pointer _kCFBundleExecutableKey = - _lookup('kCFBundleExecutableKey'); + late final _sec_protocol_options_add_tls_ciphersuite_groupPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, ffi.UnsignedInt)>>( + 'sec_protocol_options_add_tls_ciphersuite_group'); + late final _sec_protocol_options_add_tls_ciphersuite_group = + _sec_protocol_options_add_tls_ciphersuite_groupPtr + .asFunction(); - CFStringRef get kCFBundleExecutableKey => _kCFBundleExecutableKey.value; + void sec_protocol_options_set_tls_min_version( + Dartsec_protocol_options_t options, + SSLProtocol version, + ) { + return _sec_protocol_options_set_tls_min_version( + options.ref.pointer, + version.value, + ); + } - late final ffi.Pointer _kCFBundleIdentifierKey = - _lookup('kCFBundleIdentifierKey'); + late final _sec_protocol_options_set_tls_min_versionPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, + ffi.UnsignedInt)>>('sec_protocol_options_set_tls_min_version'); + late final _sec_protocol_options_set_tls_min_version = + _sec_protocol_options_set_tls_min_versionPtr + .asFunction(); - CFStringRef get kCFBundleIdentifierKey => _kCFBundleIdentifierKey.value; + void sec_protocol_options_set_min_tls_protocol_version( + Dartsec_protocol_options_t options, + tls_protocol_version_t version, + ) { + return _sec_protocol_options_set_min_tls_protocol_version( + options.ref.pointer, + version.value, + ); + } - late final ffi.Pointer _kCFBundleVersionKey = - _lookup('kCFBundleVersionKey'); + late final _sec_protocol_options_set_min_tls_protocol_versionPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, ffi.Uint16)>>( + 'sec_protocol_options_set_min_tls_protocol_version'); + late final _sec_protocol_options_set_min_tls_protocol_version = + _sec_protocol_options_set_min_tls_protocol_versionPtr + .asFunction(); - CFStringRef get kCFBundleVersionKey => _kCFBundleVersionKey.value; + tls_protocol_version_t + sec_protocol_options_get_default_min_tls_protocol_version() { + return tls_protocol_version_t.fromValue( + _sec_protocol_options_get_default_min_tls_protocol_version()); + } - late final ffi.Pointer _kCFBundleDevelopmentRegionKey = - _lookup('kCFBundleDevelopmentRegionKey'); + late final _sec_protocol_options_get_default_min_tls_protocol_versionPtr = + _lookup>( + 'sec_protocol_options_get_default_min_tls_protocol_version'); + late final _sec_protocol_options_get_default_min_tls_protocol_version = + _sec_protocol_options_get_default_min_tls_protocol_versionPtr + .asFunction(); - CFStringRef get kCFBundleDevelopmentRegionKey => - _kCFBundleDevelopmentRegionKey.value; + tls_protocol_version_t + sec_protocol_options_get_default_min_dtls_protocol_version() { + return tls_protocol_version_t.fromValue( + _sec_protocol_options_get_default_min_dtls_protocol_version()); + } - late final ffi.Pointer _kCFBundleNameKey = - _lookup('kCFBundleNameKey'); - - CFStringRef get kCFBundleNameKey => _kCFBundleNameKey.value; - - late final ffi.Pointer _kCFBundleLocalizationsKey = - _lookup('kCFBundleLocalizationsKey'); - - CFStringRef get kCFBundleLocalizationsKey => _kCFBundleLocalizationsKey.value; + late final _sec_protocol_options_get_default_min_dtls_protocol_versionPtr = + _lookup>( + 'sec_protocol_options_get_default_min_dtls_protocol_version'); + late final _sec_protocol_options_get_default_min_dtls_protocol_version = + _sec_protocol_options_get_default_min_dtls_protocol_versionPtr + .asFunction(); - CFBundleRef CFBundleGetMainBundle() { - return _CFBundleGetMainBundle(); + void sec_protocol_options_set_tls_max_version( + Dartsec_protocol_options_t options, + SSLProtocol version, + ) { + return _sec_protocol_options_set_tls_max_version( + options.ref.pointer, + version.value, + ); } - late final _CFBundleGetMainBundlePtr = - _lookup>( - 'CFBundleGetMainBundle'); - late final _CFBundleGetMainBundle = - _CFBundleGetMainBundlePtr.asFunction(); + late final _sec_protocol_options_set_tls_max_versionPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, + ffi.UnsignedInt)>>('sec_protocol_options_set_tls_max_version'); + late final _sec_protocol_options_set_tls_max_version = + _sec_protocol_options_set_tls_max_versionPtr + .asFunction(); - CFBundleRef CFBundleGetBundleWithIdentifier( - CFStringRef bundleID, + void sec_protocol_options_set_max_tls_protocol_version( + Dartsec_protocol_options_t options, + tls_protocol_version_t version, ) { - return _CFBundleGetBundleWithIdentifier( - bundleID, + return _sec_protocol_options_set_max_tls_protocol_version( + options.ref.pointer, + version.value, ); } - late final _CFBundleGetBundleWithIdentifierPtr = - _lookup>( - 'CFBundleGetBundleWithIdentifier'); - late final _CFBundleGetBundleWithIdentifier = - _CFBundleGetBundleWithIdentifierPtr.asFunction< - CFBundleRef Function(CFStringRef)>(); + late final _sec_protocol_options_set_max_tls_protocol_versionPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, ffi.Uint16)>>( + 'sec_protocol_options_set_max_tls_protocol_version'); + late final _sec_protocol_options_set_max_tls_protocol_version = + _sec_protocol_options_set_max_tls_protocol_versionPtr + .asFunction(); - CFArrayRef CFBundleGetAllBundles() { - return _CFBundleGetAllBundles(); + tls_protocol_version_t + sec_protocol_options_get_default_max_tls_protocol_version() { + return tls_protocol_version_t.fromValue( + _sec_protocol_options_get_default_max_tls_protocol_version()); } - late final _CFBundleGetAllBundlesPtr = - _lookup>( - 'CFBundleGetAllBundles'); - late final _CFBundleGetAllBundles = - _CFBundleGetAllBundlesPtr.asFunction(); + late final _sec_protocol_options_get_default_max_tls_protocol_versionPtr = + _lookup>( + 'sec_protocol_options_get_default_max_tls_protocol_version'); + late final _sec_protocol_options_get_default_max_tls_protocol_version = + _sec_protocol_options_get_default_max_tls_protocol_versionPtr + .asFunction(); - int CFBundleGetTypeID() { - return _CFBundleGetTypeID(); + tls_protocol_version_t + sec_protocol_options_get_default_max_dtls_protocol_version() { + return tls_protocol_version_t.fromValue( + _sec_protocol_options_get_default_max_dtls_protocol_version()); } - late final _CFBundleGetTypeIDPtr = - _lookup>('CFBundleGetTypeID'); - late final _CFBundleGetTypeID = - _CFBundleGetTypeIDPtr.asFunction(); + late final _sec_protocol_options_get_default_max_dtls_protocol_versionPtr = + _lookup>( + 'sec_protocol_options_get_default_max_dtls_protocol_version'); + late final _sec_protocol_options_get_default_max_dtls_protocol_version = + _sec_protocol_options_get_default_max_dtls_protocol_versionPtr + .asFunction(); - CFBundleRef CFBundleCreate( - CFAllocatorRef allocator, - CFURLRef bundleURL, + bool sec_protocol_options_get_enable_encrypted_client_hello( + Dartsec_protocol_options_t options, ) { - return _CFBundleCreate( - allocator, - bundleURL, + return _sec_protocol_options_get_enable_encrypted_client_hello( + options.ref.pointer, ); } - late final _CFBundleCreatePtr = _lookup< - ffi.NativeFunction>( - 'CFBundleCreate'); - late final _CFBundleCreate = _CFBundleCreatePtr.asFunction< - CFBundleRef Function(CFAllocatorRef, CFURLRef)>(); + late final _sec_protocol_options_get_enable_encrypted_client_helloPtr = + _lookup>( + 'sec_protocol_options_get_enable_encrypted_client_hello'); + late final _sec_protocol_options_get_enable_encrypted_client_hello = + _sec_protocol_options_get_enable_encrypted_client_helloPtr + .asFunction(); - CFArrayRef CFBundleCreateBundlesFromDirectory( - CFAllocatorRef allocator, - CFURLRef directoryURL, - CFStringRef bundleType, + bool sec_protocol_options_get_quic_use_legacy_codepoint( + Dartsec_protocol_options_t options, ) { - return _CFBundleCreateBundlesFromDirectory( - allocator, - directoryURL, - bundleType, + return _sec_protocol_options_get_quic_use_legacy_codepoint( + options.ref.pointer, ); } - late final _CFBundleCreateBundlesFromDirectoryPtr = _lookup< - ffi.NativeFunction< - CFArrayRef Function(CFAllocatorRef, CFURLRef, - CFStringRef)>>('CFBundleCreateBundlesFromDirectory'); - late final _CFBundleCreateBundlesFromDirectory = - _CFBundleCreateBundlesFromDirectoryPtr.asFunction< - CFArrayRef Function(CFAllocatorRef, CFURLRef, CFStringRef)>(); + late final _sec_protocol_options_get_quic_use_legacy_codepointPtr = + _lookup>( + 'sec_protocol_options_get_quic_use_legacy_codepoint'); + late final _sec_protocol_options_get_quic_use_legacy_codepoint = + _sec_protocol_options_get_quic_use_legacy_codepointPtr + .asFunction(); - CFURLRef CFBundleCopyBundleURL( - CFBundleRef bundle, + void sec_protocol_options_add_tls_application_protocol( + Dartsec_protocol_options_t options, + ffi.Pointer application_protocol, ) { - return _CFBundleCopyBundleURL( - bundle, + return _sec_protocol_options_add_tls_application_protocol( + options.ref.pointer, + application_protocol, ); } - late final _CFBundleCopyBundleURLPtr = - _lookup>( - 'CFBundleCopyBundleURL'); - late final _CFBundleCopyBundleURL = - _CFBundleCopyBundleURLPtr.asFunction(); + late final _sec_protocol_options_add_tls_application_protocolPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_options_t, ffi.Pointer)>>( + 'sec_protocol_options_add_tls_application_protocol'); + late final _sec_protocol_options_add_tls_application_protocol = + _sec_protocol_options_add_tls_application_protocolPtr.asFunction< + void Function(sec_protocol_options_t, ffi.Pointer)>(); - CFTypeRef CFBundleGetValueForInfoDictionaryKey( - CFBundleRef bundle, - CFStringRef key, + void sec_protocol_options_set_tls_server_name( + Dartsec_protocol_options_t options, + ffi.Pointer server_name, ) { - return _CFBundleGetValueForInfoDictionaryKey( - bundle, - key, + return _sec_protocol_options_set_tls_server_name( + options.ref.pointer, + server_name, ); } - late final _CFBundleGetValueForInfoDictionaryKeyPtr = - _lookup>( - 'CFBundleGetValueForInfoDictionaryKey'); - late final _CFBundleGetValueForInfoDictionaryKey = - _CFBundleGetValueForInfoDictionaryKeyPtr.asFunction< - CFTypeRef Function(CFBundleRef, CFStringRef)>(); + late final _sec_protocol_options_set_tls_server_namePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_options_t, ffi.Pointer)>>( + 'sec_protocol_options_set_tls_server_name'); + late final _sec_protocol_options_set_tls_server_name = + _sec_protocol_options_set_tls_server_namePtr.asFunction< + void Function(sec_protocol_options_t, ffi.Pointer)>(); - CFDictionaryRef CFBundleGetInfoDictionary( - CFBundleRef bundle, + void sec_protocol_options_set_tls_diffie_hellman_parameters( + Dartsec_protocol_options_t options, + Dartdispatch_data_t params, ) { - return _CFBundleGetInfoDictionary( - bundle, + return _sec_protocol_options_set_tls_diffie_hellman_parameters( + options.ref.pointer, + params.ref.pointer, ); } - late final _CFBundleGetInfoDictionaryPtr = - _lookup>( - 'CFBundleGetInfoDictionary'); - late final _CFBundleGetInfoDictionary = _CFBundleGetInfoDictionaryPtr - .asFunction(); + late final _sec_protocol_options_set_tls_diffie_hellman_parametersPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, dispatch_data_t)>>( + 'sec_protocol_options_set_tls_diffie_hellman_parameters'); + late final _sec_protocol_options_set_tls_diffie_hellman_parameters = + _sec_protocol_options_set_tls_diffie_hellman_parametersPtr + .asFunction(); - CFDictionaryRef CFBundleGetLocalInfoDictionary( - CFBundleRef bundle, + void sec_protocol_options_add_pre_shared_key( + Dartsec_protocol_options_t options, + Dartdispatch_data_t psk, + Dartdispatch_data_t psk_identity, ) { - return _CFBundleGetLocalInfoDictionary( - bundle, + return _sec_protocol_options_add_pre_shared_key( + options.ref.pointer, + psk.ref.pointer, + psk_identity.ref.pointer, ); } - late final _CFBundleGetLocalInfoDictionaryPtr = - _lookup>( - 'CFBundleGetLocalInfoDictionary'); - late final _CFBundleGetLocalInfoDictionary = - _CFBundleGetLocalInfoDictionaryPtr.asFunction< - CFDictionaryRef Function(CFBundleRef)>(); + late final _sec_protocol_options_add_pre_shared_keyPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, dispatch_data_t, + dispatch_data_t)>>('sec_protocol_options_add_pre_shared_key'); + late final _sec_protocol_options_add_pre_shared_key = + _sec_protocol_options_add_pre_shared_keyPtr.asFunction< + void Function( + sec_protocol_options_t, dispatch_data_t, dispatch_data_t)>(); - void CFBundleGetPackageInfo( - CFBundleRef bundle, - ffi.Pointer packageType, - ffi.Pointer packageCreator, + void sec_protocol_options_set_tls_pre_shared_key_identity_hint( + Dartsec_protocol_options_t options, + Dartdispatch_data_t psk_identity_hint, ) { - return _CFBundleGetPackageInfo( - bundle, - packageType, - packageCreator, + return _sec_protocol_options_set_tls_pre_shared_key_identity_hint( + options.ref.pointer, + psk_identity_hint.ref.pointer, ); } - late final _CFBundleGetPackageInfoPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFBundleRef, ffi.Pointer, - ffi.Pointer)>>('CFBundleGetPackageInfo'); - late final _CFBundleGetPackageInfo = _CFBundleGetPackageInfoPtr.asFunction< - void Function(CFBundleRef, ffi.Pointer, ffi.Pointer)>(); + late final _sec_protocol_options_set_tls_pre_shared_key_identity_hintPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, dispatch_data_t)>>( + 'sec_protocol_options_set_tls_pre_shared_key_identity_hint'); + late final _sec_protocol_options_set_tls_pre_shared_key_identity_hint = + _sec_protocol_options_set_tls_pre_shared_key_identity_hintPtr + .asFunction(); - CFStringRef CFBundleGetIdentifier( - CFBundleRef bundle, + void sec_protocol_options_set_pre_shared_key_selection_block( + Dartsec_protocol_options_t options, + Dartsec_protocol_pre_shared_key_selection_t psk_selection_block, + Dartdispatch_queue_t psk_selection_queue, ) { - return _CFBundleGetIdentifier( - bundle, + return _sec_protocol_options_set_pre_shared_key_selection_block( + options.ref.pointer, + psk_selection_block.ref.pointer, + psk_selection_queue.ref.pointer, ); } - late final _CFBundleGetIdentifierPtr = - _lookup>( - 'CFBundleGetIdentifier'); - late final _CFBundleGetIdentifier = - _CFBundleGetIdentifierPtr.asFunction(); + late final _sec_protocol_options_set_pre_shared_key_selection_blockPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_options_t, + sec_protocol_pre_shared_key_selection_t, + dispatch_queue_t)>>( + 'sec_protocol_options_set_pre_shared_key_selection_block'); + late final _sec_protocol_options_set_pre_shared_key_selection_block = + _sec_protocol_options_set_pre_shared_key_selection_blockPtr.asFunction< + void Function(sec_protocol_options_t, + sec_protocol_pre_shared_key_selection_t, dispatch_queue_t)>(); - int CFBundleGetVersionNumber( - CFBundleRef bundle, + void sec_protocol_options_set_tls_tickets_enabled( + Dartsec_protocol_options_t options, + bool tickets_enabled, ) { - return _CFBundleGetVersionNumber( - bundle, + return _sec_protocol_options_set_tls_tickets_enabled( + options.ref.pointer, + tickets_enabled, ); } - late final _CFBundleGetVersionNumberPtr = - _lookup>( - 'CFBundleGetVersionNumber'); - late final _CFBundleGetVersionNumber = - _CFBundleGetVersionNumberPtr.asFunction(); + late final _sec_protocol_options_set_tls_tickets_enabledPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_tls_tickets_enabled'); + late final _sec_protocol_options_set_tls_tickets_enabled = + _sec_protocol_options_set_tls_tickets_enabledPtr + .asFunction(); - CFStringRef CFBundleGetDevelopmentRegion( - CFBundleRef bundle, + void sec_protocol_options_set_tls_is_fallback_attempt( + Dartsec_protocol_options_t options, + bool is_fallback_attempt, ) { - return _CFBundleGetDevelopmentRegion( - bundle, + return _sec_protocol_options_set_tls_is_fallback_attempt( + options.ref.pointer, + is_fallback_attempt, ); } - late final _CFBundleGetDevelopmentRegionPtr = - _lookup>( - 'CFBundleGetDevelopmentRegion'); - late final _CFBundleGetDevelopmentRegion = _CFBundleGetDevelopmentRegionPtr - .asFunction(); + late final _sec_protocol_options_set_tls_is_fallback_attemptPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_tls_is_fallback_attempt'); + late final _sec_protocol_options_set_tls_is_fallback_attempt = + _sec_protocol_options_set_tls_is_fallback_attemptPtr + .asFunction(); - CFURLRef CFBundleCopySupportFilesDirectoryURL( - CFBundleRef bundle, + void sec_protocol_options_set_tls_resumption_enabled( + Dartsec_protocol_options_t options, + bool resumption_enabled, ) { - return _CFBundleCopySupportFilesDirectoryURL( - bundle, + return _sec_protocol_options_set_tls_resumption_enabled( + options.ref.pointer, + resumption_enabled, ); } - late final _CFBundleCopySupportFilesDirectoryURLPtr = - _lookup>( - 'CFBundleCopySupportFilesDirectoryURL'); - late final _CFBundleCopySupportFilesDirectoryURL = - _CFBundleCopySupportFilesDirectoryURLPtr.asFunction< - CFURLRef Function(CFBundleRef)>(); + late final _sec_protocol_options_set_tls_resumption_enabledPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_tls_resumption_enabled'); + late final _sec_protocol_options_set_tls_resumption_enabled = + _sec_protocol_options_set_tls_resumption_enabledPtr + .asFunction(); - CFURLRef CFBundleCopyResourcesDirectoryURL( - CFBundleRef bundle, + void sec_protocol_options_set_tls_false_start_enabled( + Dartsec_protocol_options_t options, + bool false_start_enabled, ) { - return _CFBundleCopyResourcesDirectoryURL( - bundle, + return _sec_protocol_options_set_tls_false_start_enabled( + options.ref.pointer, + false_start_enabled, ); } - late final _CFBundleCopyResourcesDirectoryURLPtr = - _lookup>( - 'CFBundleCopyResourcesDirectoryURL'); - late final _CFBundleCopyResourcesDirectoryURL = - _CFBundleCopyResourcesDirectoryURLPtr.asFunction< - CFURLRef Function(CFBundleRef)>(); + late final _sec_protocol_options_set_tls_false_start_enabledPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_tls_false_start_enabled'); + late final _sec_protocol_options_set_tls_false_start_enabled = + _sec_protocol_options_set_tls_false_start_enabledPtr + .asFunction(); - CFURLRef CFBundleCopyPrivateFrameworksURL( - CFBundleRef bundle, + void sec_protocol_options_set_tls_ocsp_enabled( + Dartsec_protocol_options_t options, + bool ocsp_enabled, ) { - return _CFBundleCopyPrivateFrameworksURL( - bundle, + return _sec_protocol_options_set_tls_ocsp_enabled( + options.ref.pointer, + ocsp_enabled, ); } - late final _CFBundleCopyPrivateFrameworksURLPtr = - _lookup>( - 'CFBundleCopyPrivateFrameworksURL'); - late final _CFBundleCopyPrivateFrameworksURL = - _CFBundleCopyPrivateFrameworksURLPtr.asFunction< - CFURLRef Function(CFBundleRef)>(); + late final _sec_protocol_options_set_tls_ocsp_enabledPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_tls_ocsp_enabled'); + late final _sec_protocol_options_set_tls_ocsp_enabled = + _sec_protocol_options_set_tls_ocsp_enabledPtr + .asFunction(); - CFURLRef CFBundleCopySharedFrameworksURL( - CFBundleRef bundle, + void sec_protocol_options_set_tls_sct_enabled( + Dartsec_protocol_options_t options, + bool sct_enabled, ) { - return _CFBundleCopySharedFrameworksURL( - bundle, + return _sec_protocol_options_set_tls_sct_enabled( + options.ref.pointer, + sct_enabled, ); } - late final _CFBundleCopySharedFrameworksURLPtr = - _lookup>( - 'CFBundleCopySharedFrameworksURL'); - late final _CFBundleCopySharedFrameworksURL = - _CFBundleCopySharedFrameworksURLPtr.asFunction< - CFURLRef Function(CFBundleRef)>(); + late final _sec_protocol_options_set_tls_sct_enabledPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_tls_sct_enabled'); + late final _sec_protocol_options_set_tls_sct_enabled = + _sec_protocol_options_set_tls_sct_enabledPtr + .asFunction(); - CFURLRef CFBundleCopySharedSupportURL( - CFBundleRef bundle, + void sec_protocol_options_set_tls_renegotiation_enabled( + Dartsec_protocol_options_t options, + bool renegotiation_enabled, ) { - return _CFBundleCopySharedSupportURL( - bundle, + return _sec_protocol_options_set_tls_renegotiation_enabled( + options.ref.pointer, + renegotiation_enabled, ); } - late final _CFBundleCopySharedSupportURLPtr = - _lookup>( - 'CFBundleCopySharedSupportURL'); - late final _CFBundleCopySharedSupportURL = _CFBundleCopySharedSupportURLPtr - .asFunction(); + late final _sec_protocol_options_set_tls_renegotiation_enabledPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_tls_renegotiation_enabled'); + late final _sec_protocol_options_set_tls_renegotiation_enabled = + _sec_protocol_options_set_tls_renegotiation_enabledPtr + .asFunction(); - CFURLRef CFBundleCopyBuiltInPlugInsURL( - CFBundleRef bundle, + void sec_protocol_options_set_peer_authentication_required( + Dartsec_protocol_options_t options, + bool peer_authentication_required, ) { - return _CFBundleCopyBuiltInPlugInsURL( - bundle, + return _sec_protocol_options_set_peer_authentication_required( + options.ref.pointer, + peer_authentication_required, ); } - late final _CFBundleCopyBuiltInPlugInsURLPtr = - _lookup>( - 'CFBundleCopyBuiltInPlugInsURL'); - late final _CFBundleCopyBuiltInPlugInsURL = _CFBundleCopyBuiltInPlugInsURLPtr - .asFunction(); + late final _sec_protocol_options_set_peer_authentication_requiredPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, ffi.Bool)>>( + 'sec_protocol_options_set_peer_authentication_required'); + late final _sec_protocol_options_set_peer_authentication_required = + _sec_protocol_options_set_peer_authentication_requiredPtr + .asFunction(); - CFDictionaryRef CFBundleCopyInfoDictionaryInDirectory( - CFURLRef bundleURL, + void sec_protocol_options_set_peer_authentication_optional( + Dartsec_protocol_options_t options, + bool peer_authentication_optional, ) { - return _CFBundleCopyInfoDictionaryInDirectory( - bundleURL, + return _sec_protocol_options_set_peer_authentication_optional( + options.ref.pointer, + peer_authentication_optional, ); } - late final _CFBundleCopyInfoDictionaryInDirectoryPtr = - _lookup>( - 'CFBundleCopyInfoDictionaryInDirectory'); - late final _CFBundleCopyInfoDictionaryInDirectory = - _CFBundleCopyInfoDictionaryInDirectoryPtr.asFunction< - CFDictionaryRef Function(CFURLRef)>(); + late final _sec_protocol_options_set_peer_authentication_optionalPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, ffi.Bool)>>( + 'sec_protocol_options_set_peer_authentication_optional'); + late final _sec_protocol_options_set_peer_authentication_optional = + _sec_protocol_options_set_peer_authentication_optionalPtr + .asFunction(); - int CFBundleGetPackageInfoInDirectory( - CFURLRef url, - ffi.Pointer packageType, - ffi.Pointer packageCreator, + void sec_protocol_options_set_enable_encrypted_client_hello( + Dartsec_protocol_options_t options, + bool enable_encrypted_client_hello, ) { - return _CFBundleGetPackageInfoInDirectory( - url, - packageType, - packageCreator, + return _sec_protocol_options_set_enable_encrypted_client_hello( + options.ref.pointer, + enable_encrypted_client_hello, ); } - late final _CFBundleGetPackageInfoInDirectoryPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFURLRef, ffi.Pointer, - ffi.Pointer)>>('CFBundleGetPackageInfoInDirectory'); - late final _CFBundleGetPackageInfoInDirectory = - _CFBundleGetPackageInfoInDirectoryPtr.asFunction< - int Function(CFURLRef, ffi.Pointer, ffi.Pointer)>(); + late final _sec_protocol_options_set_enable_encrypted_client_helloPtr = + _lookup< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_options_t, ffi.Bool)>>( + 'sec_protocol_options_set_enable_encrypted_client_hello'); + late final _sec_protocol_options_set_enable_encrypted_client_hello = + _sec_protocol_options_set_enable_encrypted_client_helloPtr + .asFunction(); - CFURLRef CFBundleCopyResourceURL( - CFBundleRef bundle, - CFStringRef resourceName, - CFStringRef resourceType, - CFStringRef subDirName, + void sec_protocol_options_set_quic_use_legacy_codepoint( + Dartsec_protocol_options_t options, + bool quic_use_legacy_codepoint, ) { - return _CFBundleCopyResourceURL( - bundle, - resourceName, - resourceType, - subDirName, + return _sec_protocol_options_set_quic_use_legacy_codepoint( + options.ref.pointer, + quic_use_legacy_codepoint, ); } - late final _CFBundleCopyResourceURLPtr = _lookup< - ffi.NativeFunction< - CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, - CFStringRef)>>('CFBundleCopyResourceURL'); - late final _CFBundleCopyResourceURL = _CFBundleCopyResourceURLPtr.asFunction< - CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, CFStringRef)>(); + late final _sec_protocol_options_set_quic_use_legacy_codepointPtr = _lookup< + ffi + .NativeFunction>( + 'sec_protocol_options_set_quic_use_legacy_codepoint'); + late final _sec_protocol_options_set_quic_use_legacy_codepoint = + _sec_protocol_options_set_quic_use_legacy_codepointPtr + .asFunction(); - CFArrayRef CFBundleCopyResourceURLsOfType( - CFBundleRef bundle, - CFStringRef resourceType, - CFStringRef subDirName, + void sec_protocol_options_set_key_update_block( + Dartsec_protocol_options_t options, + Dartsec_protocol_key_update_t key_update_block, + Dartdispatch_queue_t key_update_queue, ) { - return _CFBundleCopyResourceURLsOfType( - bundle, - resourceType, - subDirName, + return _sec_protocol_options_set_key_update_block( + options.ref.pointer, + key_update_block.ref.pointer, + key_update_queue.ref.pointer, ); } - late final _CFBundleCopyResourceURLsOfTypePtr = _lookup< + late final _sec_protocol_options_set_key_update_blockPtr = _lookup< ffi.NativeFunction< - CFArrayRef Function(CFBundleRef, CFStringRef, - CFStringRef)>>('CFBundleCopyResourceURLsOfType'); - late final _CFBundleCopyResourceURLsOfType = - _CFBundleCopyResourceURLsOfTypePtr.asFunction< - CFArrayRef Function(CFBundleRef, CFStringRef, CFStringRef)>(); + ffi.Void Function(sec_protocol_options_t, sec_protocol_key_update_t, + dispatch_queue_t)>>('sec_protocol_options_set_key_update_block'); + late final _sec_protocol_options_set_key_update_block = + _sec_protocol_options_set_key_update_blockPtr.asFunction< + void Function(sec_protocol_options_t, sec_protocol_key_update_t, + dispatch_queue_t)>(); - CFStringRef CFBundleCopyLocalizedString( - CFBundleRef bundle, - CFStringRef key, - CFStringRef value, - CFStringRef tableName, + void sec_protocol_options_set_challenge_block( + Dartsec_protocol_options_t options, + Dartsec_protocol_challenge_t challenge_block, + Dartdispatch_queue_t challenge_queue, ) { - return _CFBundleCopyLocalizedString( - bundle, - key, - value, - tableName, + return _sec_protocol_options_set_challenge_block( + options.ref.pointer, + challenge_block.ref.pointer, + challenge_queue.ref.pointer, ); } - late final _CFBundleCopyLocalizedStringPtr = _lookup< + late final _sec_protocol_options_set_challenge_blockPtr = _lookup< ffi.NativeFunction< - CFStringRef Function(CFBundleRef, CFStringRef, CFStringRef, - CFStringRef)>>('CFBundleCopyLocalizedString'); - late final _CFBundleCopyLocalizedString = - _CFBundleCopyLocalizedStringPtr.asFunction< - CFStringRef Function( - CFBundleRef, CFStringRef, CFStringRef, CFStringRef)>(); + ffi.Void Function(sec_protocol_options_t, sec_protocol_challenge_t, + dispatch_queue_t)>>('sec_protocol_options_set_challenge_block'); + late final _sec_protocol_options_set_challenge_block = + _sec_protocol_options_set_challenge_blockPtr.asFunction< + void Function(sec_protocol_options_t, sec_protocol_challenge_t, + dispatch_queue_t)>(); - CFURLRef CFBundleCopyResourceURLInDirectory( - CFURLRef bundleURL, - CFStringRef resourceName, - CFStringRef resourceType, - CFStringRef subDirName, + void sec_protocol_options_set_verify_block( + Dartsec_protocol_options_t options, + Dartsec_protocol_verify_t verify_block, + Dartdispatch_queue_t verify_block_queue, ) { - return _CFBundleCopyResourceURLInDirectory( - bundleURL, - resourceName, - resourceType, - subDirName, + return _sec_protocol_options_set_verify_block( + options.ref.pointer, + verify_block.ref.pointer, + verify_block_queue.ref.pointer, ); } - late final _CFBundleCopyResourceURLInDirectoryPtr = _lookup< + late final _sec_protocol_options_set_verify_blockPtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFURLRef, CFStringRef, CFStringRef, - CFStringRef)>>('CFBundleCopyResourceURLInDirectory'); - late final _CFBundleCopyResourceURLInDirectory = - _CFBundleCopyResourceURLInDirectoryPtr.asFunction< - CFURLRef Function(CFURLRef, CFStringRef, CFStringRef, CFStringRef)>(); + ffi.Void Function(sec_protocol_options_t, sec_protocol_verify_t, + dispatch_queue_t)>>('sec_protocol_options_set_verify_block'); + late final _sec_protocol_options_set_verify_block = + _sec_protocol_options_set_verify_blockPtr.asFunction< + void Function(sec_protocol_options_t, sec_protocol_verify_t, + dispatch_queue_t)>(); - CFArrayRef CFBundleCopyResourceURLsOfTypeInDirectory( - CFURLRef bundleURL, - CFStringRef resourceType, - CFStringRef subDirName, + late final ffi.Pointer _kSSLSessionConfig_default = + _lookup('kSSLSessionConfig_default'); + + CFStringRef get kSSLSessionConfig_default => _kSSLSessionConfig_default.value; + + set kSSLSessionConfig_default(CFStringRef value) => + _kSSLSessionConfig_default.value = value; + + late final ffi.Pointer _kSSLSessionConfig_ATSv1 = + _lookup('kSSLSessionConfig_ATSv1'); + + CFStringRef get kSSLSessionConfig_ATSv1 => _kSSLSessionConfig_ATSv1.value; + + set kSSLSessionConfig_ATSv1(CFStringRef value) => + _kSSLSessionConfig_ATSv1.value = value; + + late final ffi.Pointer _kSSLSessionConfig_ATSv1_noPFS = + _lookup('kSSLSessionConfig_ATSv1_noPFS'); + + CFStringRef get kSSLSessionConfig_ATSv1_noPFS => + _kSSLSessionConfig_ATSv1_noPFS.value; + + set kSSLSessionConfig_ATSv1_noPFS(CFStringRef value) => + _kSSLSessionConfig_ATSv1_noPFS.value = value; + + late final ffi.Pointer _kSSLSessionConfig_standard = + _lookup('kSSLSessionConfig_standard'); + + CFStringRef get kSSLSessionConfig_standard => + _kSSLSessionConfig_standard.value; + + set kSSLSessionConfig_standard(CFStringRef value) => + _kSSLSessionConfig_standard.value = value; + + late final ffi.Pointer _kSSLSessionConfig_RC4_fallback = + _lookup('kSSLSessionConfig_RC4_fallback'); + + CFStringRef get kSSLSessionConfig_RC4_fallback => + _kSSLSessionConfig_RC4_fallback.value; + + set kSSLSessionConfig_RC4_fallback(CFStringRef value) => + _kSSLSessionConfig_RC4_fallback.value = value; + + late final ffi.Pointer _kSSLSessionConfig_TLSv1_fallback = + _lookup('kSSLSessionConfig_TLSv1_fallback'); + + CFStringRef get kSSLSessionConfig_TLSv1_fallback => + _kSSLSessionConfig_TLSv1_fallback.value; + + set kSSLSessionConfig_TLSv1_fallback(CFStringRef value) => + _kSSLSessionConfig_TLSv1_fallback.value = value; + + late final ffi.Pointer _kSSLSessionConfig_TLSv1_RC4_fallback = + _lookup('kSSLSessionConfig_TLSv1_RC4_fallback'); + + CFStringRef get kSSLSessionConfig_TLSv1_RC4_fallback => + _kSSLSessionConfig_TLSv1_RC4_fallback.value; + + set kSSLSessionConfig_TLSv1_RC4_fallback(CFStringRef value) => + _kSSLSessionConfig_TLSv1_RC4_fallback.value = value; + + late final ffi.Pointer _kSSLSessionConfig_legacy = + _lookup('kSSLSessionConfig_legacy'); + + CFStringRef get kSSLSessionConfig_legacy => _kSSLSessionConfig_legacy.value; + + set kSSLSessionConfig_legacy(CFStringRef value) => + _kSSLSessionConfig_legacy.value = value; + + late final ffi.Pointer _kSSLSessionConfig_legacy_DHE = + _lookup('kSSLSessionConfig_legacy_DHE'); + + CFStringRef get kSSLSessionConfig_legacy_DHE => + _kSSLSessionConfig_legacy_DHE.value; + + set kSSLSessionConfig_legacy_DHE(CFStringRef value) => + _kSSLSessionConfig_legacy_DHE.value = value; + + late final ffi.Pointer _kSSLSessionConfig_anonymous = + _lookup('kSSLSessionConfig_anonymous'); + + CFStringRef get kSSLSessionConfig_anonymous => + _kSSLSessionConfig_anonymous.value; + + set kSSLSessionConfig_anonymous(CFStringRef value) => + _kSSLSessionConfig_anonymous.value = value; + + late final ffi.Pointer _kSSLSessionConfig_3DES_fallback = + _lookup('kSSLSessionConfig_3DES_fallback'); + + CFStringRef get kSSLSessionConfig_3DES_fallback => + _kSSLSessionConfig_3DES_fallback.value; + + set kSSLSessionConfig_3DES_fallback(CFStringRef value) => + _kSSLSessionConfig_3DES_fallback.value = value; + + late final ffi.Pointer _kSSLSessionConfig_TLSv1_3DES_fallback = + _lookup('kSSLSessionConfig_TLSv1_3DES_fallback'); + + CFStringRef get kSSLSessionConfig_TLSv1_3DES_fallback => + _kSSLSessionConfig_TLSv1_3DES_fallback.value; + + set kSSLSessionConfig_TLSv1_3DES_fallback(CFStringRef value) => + _kSSLSessionConfig_TLSv1_3DES_fallback.value = value; + + int SSLContextGetTypeID() { + return _SSLContextGetTypeID(); + } + + late final _SSLContextGetTypeIDPtr = + _lookup>('SSLContextGetTypeID'); + late final _SSLContextGetTypeID = + _SSLContextGetTypeIDPtr.asFunction(); + + SSLContextRef SSLCreateContext( + CFAllocatorRef alloc, + SSLProtocolSide protocolSide, + SSLConnectionType connectionType, ) { - return _CFBundleCopyResourceURLsOfTypeInDirectory( - bundleURL, - resourceType, - subDirName, + return _SSLCreateContext( + alloc, + protocolSide.value, + connectionType.value, ); } - late final _CFBundleCopyResourceURLsOfTypeInDirectoryPtr = _lookup< + late final _SSLCreateContextPtr = _lookup< ffi.NativeFunction< - CFArrayRef Function(CFURLRef, CFStringRef, - CFStringRef)>>('CFBundleCopyResourceURLsOfTypeInDirectory'); - late final _CFBundleCopyResourceURLsOfTypeInDirectory = - _CFBundleCopyResourceURLsOfTypeInDirectoryPtr.asFunction< - CFArrayRef Function(CFURLRef, CFStringRef, CFStringRef)>(); + SSLContextRef Function(CFAllocatorRef, ffi.UnsignedInt, + ffi.UnsignedInt)>>('SSLCreateContext'); + late final _SSLCreateContext = _SSLCreateContextPtr.asFunction< + SSLContextRef Function(CFAllocatorRef, int, int)>(); - CFArrayRef CFBundleCopyBundleLocalizations( - CFBundleRef bundle, + int SSLNewContext( + int isServer, + ffi.Pointer contextPtr, ) { - return _CFBundleCopyBundleLocalizations( - bundle, + return _SSLNewContext( + isServer, + contextPtr, ); } - late final _CFBundleCopyBundleLocalizationsPtr = - _lookup>( - 'CFBundleCopyBundleLocalizations'); - late final _CFBundleCopyBundleLocalizations = - _CFBundleCopyBundleLocalizationsPtr.asFunction< - CFArrayRef Function(CFBundleRef)>(); + late final _SSLNewContextPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + Boolean, ffi.Pointer)>>('SSLNewContext'); + late final _SSLNewContext = _SSLNewContextPtr.asFunction< + int Function(int, ffi.Pointer)>(); - CFArrayRef CFBundleCopyPreferredLocalizationsFromArray( - CFArrayRef locArray, + int SSLDisposeContext( + SSLContextRef context, ) { - return _CFBundleCopyPreferredLocalizationsFromArray( - locArray, + return _SSLDisposeContext( + context, ); } - late final _CFBundleCopyPreferredLocalizationsFromArrayPtr = - _lookup>( - 'CFBundleCopyPreferredLocalizationsFromArray'); - late final _CFBundleCopyPreferredLocalizationsFromArray = - _CFBundleCopyPreferredLocalizationsFromArrayPtr.asFunction< - CFArrayRef Function(CFArrayRef)>(); + late final _SSLDisposeContextPtr = + _lookup>( + 'SSLDisposeContext'); + late final _SSLDisposeContext = + _SSLDisposeContextPtr.asFunction(); - CFArrayRef CFBundleCopyLocalizationsForPreferences( - CFArrayRef locArray, - CFArrayRef prefArray, + int SSLGetSessionState( + SSLContextRef context, + ffi.Pointer state, ) { - return _CFBundleCopyLocalizationsForPreferences( - locArray, - prefArray, + return _SSLGetSessionState( + context, + state, ); } - late final _CFBundleCopyLocalizationsForPreferencesPtr = - _lookup>( - 'CFBundleCopyLocalizationsForPreferences'); - late final _CFBundleCopyLocalizationsForPreferences = - _CFBundleCopyLocalizationsForPreferencesPtr.asFunction< - CFArrayRef Function(CFArrayRef, CFArrayRef)>(); + late final _SSLGetSessionStatePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetSessionState'); + late final _SSLGetSessionState = _SSLGetSessionStatePtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - CFURLRef CFBundleCopyResourceURLForLocalization( - CFBundleRef bundle, - CFStringRef resourceName, - CFStringRef resourceType, - CFStringRef subDirName, - CFStringRef localizationName, + DartSInt32 SSLSetSessionOption( + SSLContextRef context, + SSLSessionOption option, + DartBoolean value, ) { - return _CFBundleCopyResourceURLForLocalization( - bundle, - resourceName, - resourceType, - subDirName, - localizationName, + return _SSLSetSessionOption( + context, + option.value, + value, ); } - late final _CFBundleCopyResourceURLForLocalizationPtr = _lookup< + late final _SSLSetSessionOptionPtr = _lookup< ffi.NativeFunction< - CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, CFStringRef, - CFStringRef)>>('CFBundleCopyResourceURLForLocalization'); - late final _CFBundleCopyResourceURLForLocalization = - _CFBundleCopyResourceURLForLocalizationPtr.asFunction< - CFURLRef Function(CFBundleRef, CFStringRef, CFStringRef, CFStringRef, - CFStringRef)>(); + OSStatus Function( + SSLContextRef, ffi.UnsignedInt, Boolean)>>('SSLSetSessionOption'); + late final _SSLSetSessionOption = _SSLSetSessionOptionPtr.asFunction< + int Function(SSLContextRef, int, int)>(); - CFArrayRef CFBundleCopyResourceURLsOfTypeForLocalization( - CFBundleRef bundle, - CFStringRef resourceType, - CFStringRef subDirName, - CFStringRef localizationName, + DartSInt32 SSLGetSessionOption( + SSLContextRef context, + SSLSessionOption option, + ffi.Pointer value, ) { - return _CFBundleCopyResourceURLsOfTypeForLocalization( - bundle, - resourceType, - subDirName, - localizationName, + return _SSLGetSessionOption( + context, + option.value, + value, ); } - late final _CFBundleCopyResourceURLsOfTypeForLocalizationPtr = _lookup< + late final _SSLGetSessionOptionPtr = _lookup< ffi.NativeFunction< - CFArrayRef Function(CFBundleRef, CFStringRef, CFStringRef, - CFStringRef)>>('CFBundleCopyResourceURLsOfTypeForLocalization'); - late final _CFBundleCopyResourceURLsOfTypeForLocalization = - _CFBundleCopyResourceURLsOfTypeForLocalizationPtr.asFunction< - CFArrayRef Function( - CFBundleRef, CFStringRef, CFStringRef, CFStringRef)>(); + OSStatus Function(SSLContextRef, ffi.UnsignedInt, + ffi.Pointer)>>('SSLGetSessionOption'); + late final _SSLGetSessionOption = _SSLGetSessionOptionPtr.asFunction< + int Function(SSLContextRef, int, ffi.Pointer)>(); - CFDictionaryRef CFBundleCopyInfoDictionaryForURL( - CFURLRef url, + int SSLSetIOFuncs( + SSLContextRef context, + SSLReadFunc readFunc, + SSLWriteFunc writeFunc, ) { - return _CFBundleCopyInfoDictionaryForURL( - url, + return _SSLSetIOFuncs( + context, + readFunc, + writeFunc, ); } - late final _CFBundleCopyInfoDictionaryForURLPtr = - _lookup>( - 'CFBundleCopyInfoDictionaryForURL'); - late final _CFBundleCopyInfoDictionaryForURL = - _CFBundleCopyInfoDictionaryForURLPtr.asFunction< - CFDictionaryRef Function(CFURLRef)>(); + late final _SSLSetIOFuncsPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SSLContextRef, SSLReadFunc, SSLWriteFunc)>>('SSLSetIOFuncs'); + late final _SSLSetIOFuncs = _SSLSetIOFuncsPtr.asFunction< + int Function(SSLContextRef, SSLReadFunc, SSLWriteFunc)>(); - CFArrayRef CFBundleCopyLocalizationsForURL( - CFURLRef url, + int SSLSetSessionConfig( + SSLContextRef context, + CFStringRef config, ) { - return _CFBundleCopyLocalizationsForURL( - url, + return _SSLSetSessionConfig( + context, + config, ); } - late final _CFBundleCopyLocalizationsForURLPtr = - _lookup>( - 'CFBundleCopyLocalizationsForURL'); - late final _CFBundleCopyLocalizationsForURL = - _CFBundleCopyLocalizationsForURLPtr.asFunction< - CFArrayRef Function(CFURLRef)>(); + late final _SSLSetSessionConfigPtr = _lookup< + ffi.NativeFunction>( + 'SSLSetSessionConfig'); + late final _SSLSetSessionConfig = _SSLSetSessionConfigPtr.asFunction< + int Function(SSLContextRef, CFStringRef)>(); - CFArrayRef CFBundleCopyExecutableArchitecturesForURL( - CFURLRef url, + DartSInt32 SSLSetProtocolVersionMin( + SSLContextRef context, + SSLProtocol minVersion, ) { - return _CFBundleCopyExecutableArchitecturesForURL( - url, + return _SSLSetProtocolVersionMin( + context, + minVersion.value, ); } - late final _CFBundleCopyExecutableArchitecturesForURLPtr = - _lookup>( - 'CFBundleCopyExecutableArchitecturesForURL'); - late final _CFBundleCopyExecutableArchitecturesForURL = - _CFBundleCopyExecutableArchitecturesForURLPtr.asFunction< - CFArrayRef Function(CFURLRef)>(); + late final _SSLSetProtocolVersionMinPtr = _lookup< + ffi + .NativeFunction>( + 'SSLSetProtocolVersionMin'); + late final _SSLSetProtocolVersionMin = _SSLSetProtocolVersionMinPtr + .asFunction(); - CFURLRef CFBundleCopyExecutableURL( - CFBundleRef bundle, + int SSLGetProtocolVersionMin( + SSLContextRef context, + ffi.Pointer minVersion, ) { - return _CFBundleCopyExecutableURL( - bundle, + return _SSLGetProtocolVersionMin( + context, + minVersion, ); } - late final _CFBundleCopyExecutableURLPtr = - _lookup>( - 'CFBundleCopyExecutableURL'); - late final _CFBundleCopyExecutableURL = _CFBundleCopyExecutableURLPtr - .asFunction(); + late final _SSLGetProtocolVersionMinPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetProtocolVersionMin'); + late final _SSLGetProtocolVersionMin = _SSLGetProtocolVersionMinPtr + .asFunction)>(); - CFArrayRef CFBundleCopyExecutableArchitectures( - CFBundleRef bundle, + DartSInt32 SSLSetProtocolVersionMax( + SSLContextRef context, + SSLProtocol maxVersion, ) { - return _CFBundleCopyExecutableArchitectures( - bundle, + return _SSLSetProtocolVersionMax( + context, + maxVersion.value, ); } - late final _CFBundleCopyExecutableArchitecturesPtr = - _lookup>( - 'CFBundleCopyExecutableArchitectures'); - late final _CFBundleCopyExecutableArchitectures = - _CFBundleCopyExecutableArchitecturesPtr.asFunction< - CFArrayRef Function(CFBundleRef)>(); + late final _SSLSetProtocolVersionMaxPtr = _lookup< + ffi + .NativeFunction>( + 'SSLSetProtocolVersionMax'); + late final _SSLSetProtocolVersionMax = _SSLSetProtocolVersionMaxPtr + .asFunction(); - int CFBundlePreflightExecutable( - CFBundleRef bundle, - ffi.Pointer error, + int SSLGetProtocolVersionMax( + SSLContextRef context, + ffi.Pointer maxVersion, ) { - return _CFBundlePreflightExecutable( - bundle, - error, + return _SSLGetProtocolVersionMax( + context, + maxVersion, ); } - late final _CFBundlePreflightExecutablePtr = _lookup< + late final _SSLGetProtocolVersionMaxPtr = _lookup< ffi.NativeFunction< - Boolean Function(CFBundleRef, - ffi.Pointer)>>('CFBundlePreflightExecutable'); - late final _CFBundlePreflightExecutable = _CFBundlePreflightExecutablePtr - .asFunction)>(); + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetProtocolVersionMax'); + late final _SSLGetProtocolVersionMax = _SSLGetProtocolVersionMaxPtr + .asFunction)>(); - int CFBundleLoadExecutableAndReturnError( - CFBundleRef bundle, - ffi.Pointer error, + DartSInt32 SSLSetProtocolVersionEnabled( + SSLContextRef context, + SSLProtocol protocol, + DartBoolean enable, ) { - return _CFBundleLoadExecutableAndReturnError( - bundle, - error, + return _SSLSetProtocolVersionEnabled( + context, + protocol.value, + enable, ); } - late final _CFBundleLoadExecutableAndReturnErrorPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFBundleRef, ffi.Pointer)>>( - 'CFBundleLoadExecutableAndReturnError'); - late final _CFBundleLoadExecutableAndReturnError = - _CFBundleLoadExecutableAndReturnErrorPtr.asFunction< - int Function(CFBundleRef, ffi.Pointer)>(); + late final _SSLSetProtocolVersionEnabledPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.UnsignedInt, + Boolean)>>('SSLSetProtocolVersionEnabled'); + late final _SSLSetProtocolVersionEnabled = _SSLSetProtocolVersionEnabledPtr + .asFunction(); - int CFBundleLoadExecutable( - CFBundleRef bundle, + DartSInt32 SSLGetProtocolVersionEnabled( + SSLContextRef context, + SSLProtocol protocol, + ffi.Pointer enable, ) { - return _CFBundleLoadExecutable( - bundle, + return _SSLGetProtocolVersionEnabled( + context, + protocol.value, + enable, ); } - late final _CFBundleLoadExecutablePtr = - _lookup>( - 'CFBundleLoadExecutable'); - late final _CFBundleLoadExecutable = - _CFBundleLoadExecutablePtr.asFunction(); + late final _SSLGetProtocolVersionEnabledPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.UnsignedInt, + ffi.Pointer)>>('SSLGetProtocolVersionEnabled'); + late final _SSLGetProtocolVersionEnabled = _SSLGetProtocolVersionEnabledPtr + .asFunction)>(); - int CFBundleIsExecutableLoaded( - CFBundleRef bundle, + DartSInt32 SSLSetProtocolVersion( + SSLContextRef context, + SSLProtocol version, ) { - return _CFBundleIsExecutableLoaded( - bundle, + return _SSLSetProtocolVersion( + context, + version.value, ); } - late final _CFBundleIsExecutableLoadedPtr = - _lookup>( - 'CFBundleIsExecutableLoaded'); - late final _CFBundleIsExecutableLoaded = - _CFBundleIsExecutableLoadedPtr.asFunction(); + late final _SSLSetProtocolVersionPtr = _lookup< + ffi + .NativeFunction>( + 'SSLSetProtocolVersion'); + late final _SSLSetProtocolVersion = + _SSLSetProtocolVersionPtr.asFunction(); - void CFBundleUnloadExecutable( - CFBundleRef bundle, + int SSLGetProtocolVersion( + SSLContextRef context, + ffi.Pointer protocol, ) { - return _CFBundleUnloadExecutable( - bundle, + return _SSLGetProtocolVersion( + context, + protocol, ); } - late final _CFBundleUnloadExecutablePtr = - _lookup>( - 'CFBundleUnloadExecutable'); - late final _CFBundleUnloadExecutable = - _CFBundleUnloadExecutablePtr.asFunction(); + late final _SSLGetProtocolVersionPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetProtocolVersion'); + late final _SSLGetProtocolVersion = _SSLGetProtocolVersionPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - ffi.Pointer CFBundleGetFunctionPointerForName( - CFBundleRef bundle, - CFStringRef functionName, + int SSLSetCertificate( + SSLContextRef context, + CFArrayRef certRefs, ) { - return _CFBundleGetFunctionPointerForName( - bundle, - functionName, + return _SSLSetCertificate( + context, + certRefs, ); } - late final _CFBundleGetFunctionPointerForNamePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - CFBundleRef, CFStringRef)>>('CFBundleGetFunctionPointerForName'); - late final _CFBundleGetFunctionPointerForName = - _CFBundleGetFunctionPointerForNamePtr.asFunction< - ffi.Pointer Function(CFBundleRef, CFStringRef)>(); + late final _SSLSetCertificatePtr = + _lookup>( + 'SSLSetCertificate'); + late final _SSLSetCertificate = _SSLSetCertificatePtr.asFunction< + int Function(SSLContextRef, CFArrayRef)>(); - void CFBundleGetFunctionPointersForNames( - CFBundleRef bundle, - CFArrayRef functionNames, - ffi.Pointer> ftbl, + int SSLSetConnection( + SSLContextRef context, + SSLConnectionRef connection, ) { - return _CFBundleGetFunctionPointersForNames( - bundle, - functionNames, - ftbl, + return _SSLSetConnection( + context, + connection, ); } - late final _CFBundleGetFunctionPointersForNamesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFBundleRef, CFArrayRef, - ffi.Pointer>)>>( - 'CFBundleGetFunctionPointersForNames'); - late final _CFBundleGetFunctionPointersForNames = - _CFBundleGetFunctionPointersForNamesPtr.asFunction< - void Function( - CFBundleRef, CFArrayRef, ffi.Pointer>)>(); + late final _SSLSetConnectionPtr = _lookup< + ffi + .NativeFunction>( + 'SSLSetConnection'); + late final _SSLSetConnection = _SSLSetConnectionPtr.asFunction< + int Function(SSLContextRef, SSLConnectionRef)>(); - ffi.Pointer CFBundleGetDataPointerForName( - CFBundleRef bundle, - CFStringRef symbolName, + int SSLGetConnection( + SSLContextRef context, + ffi.Pointer connection, ) { - return _CFBundleGetDataPointerForName( - bundle, - symbolName, + return _SSLGetConnection( + context, + connection, ); } - late final _CFBundleGetDataPointerForNamePtr = _lookup< + late final _SSLGetConnectionPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - CFBundleRef, CFStringRef)>>('CFBundleGetDataPointerForName'); - late final _CFBundleGetDataPointerForName = _CFBundleGetDataPointerForNamePtr - .asFunction Function(CFBundleRef, CFStringRef)>(); + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetConnection'); + late final _SSLGetConnection = _SSLGetConnectionPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - void CFBundleGetDataPointersForNames( - CFBundleRef bundle, - CFArrayRef symbolNames, - ffi.Pointer> stbl, + int SSLSetPeerDomainName( + SSLContextRef context, + ffi.Pointer peerName, + int peerNameLen, ) { - return _CFBundleGetDataPointersForNames( - bundle, - symbolNames, - stbl, + return _SSLSetPeerDomainName( + context, + peerName, + peerNameLen, ); } - late final _CFBundleGetDataPointersForNamesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFBundleRef, CFArrayRef, - ffi.Pointer>)>>( - 'CFBundleGetDataPointersForNames'); - late final _CFBundleGetDataPointersForNames = - _CFBundleGetDataPointersForNamesPtr.asFunction< - void Function( - CFBundleRef, CFArrayRef, ffi.Pointer>)>(); + late final _SSLSetPeerDomainNamePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Size)>>('SSLSetPeerDomainName'); + late final _SSLSetPeerDomainName = _SSLSetPeerDomainNamePtr.asFunction< + int Function(SSLContextRef, ffi.Pointer, int)>(); - CFURLRef CFBundleCopyAuxiliaryExecutableURL( - CFBundleRef bundle, - CFStringRef executableName, + int SSLGetPeerDomainNameLength( + SSLContextRef context, + ffi.Pointer peerNameLen, ) { - return _CFBundleCopyAuxiliaryExecutableURL( - bundle, - executableName, + return _SSLGetPeerDomainNameLength( + context, + peerNameLen, ); } - late final _CFBundleCopyAuxiliaryExecutableURLPtr = - _lookup>( - 'CFBundleCopyAuxiliaryExecutableURL'); - late final _CFBundleCopyAuxiliaryExecutableURL = - _CFBundleCopyAuxiliaryExecutableURLPtr.asFunction< - CFURLRef Function(CFBundleRef, CFStringRef)>(); + late final _SSLGetPeerDomainNameLengthPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetPeerDomainNameLength'); + late final _SSLGetPeerDomainNameLength = _SSLGetPeerDomainNameLengthPtr + .asFunction)>(); - int CFBundleIsExecutableLoadable( - CFBundleRef bundle, + int SSLGetPeerDomainName( + SSLContextRef context, + ffi.Pointer peerName, + ffi.Pointer peerNameLen, ) { - return _CFBundleIsExecutableLoadable( - bundle, + return _SSLGetPeerDomainName( + context, + peerName, + peerNameLen, ); } - late final _CFBundleIsExecutableLoadablePtr = - _lookup>( - 'CFBundleIsExecutableLoadable'); - late final _CFBundleIsExecutableLoadable = - _CFBundleIsExecutableLoadablePtr.asFunction(); + late final _SSLGetPeerDomainNamePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Pointer)>>('SSLGetPeerDomainName'); + late final _SSLGetPeerDomainName = _SSLGetPeerDomainNamePtr.asFunction< + int Function( + SSLContextRef, ffi.Pointer, ffi.Pointer)>(); - int CFBundleIsExecutableLoadableForURL( - CFURLRef url, + int SSLCopyRequestedPeerNameLength( + SSLContextRef ctx, + ffi.Pointer peerNameLen, ) { - return _CFBundleIsExecutableLoadableForURL( - url, + return _SSLCopyRequestedPeerNameLength( + ctx, + peerNameLen, ); } - late final _CFBundleIsExecutableLoadableForURLPtr = - _lookup>( - 'CFBundleIsExecutableLoadableForURL'); - late final _CFBundleIsExecutableLoadableForURL = - _CFBundleIsExecutableLoadableForURLPtr.asFunction< - int Function(CFURLRef)>(); + late final _SSLCopyRequestedPeerNameLengthPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLCopyRequestedPeerNameLength'); + late final _SSLCopyRequestedPeerNameLength = + _SSLCopyRequestedPeerNameLengthPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - int CFBundleIsArchitectureLoadable( - int arch, + int SSLCopyRequestedPeerName( + SSLContextRef context, + ffi.Pointer peerName, + ffi.Pointer peerNameLen, ) { - return _CFBundleIsArchitectureLoadable( - arch, + return _SSLCopyRequestedPeerName( + context, + peerName, + peerNameLen, ); } - late final _CFBundleIsArchitectureLoadablePtr = - _lookup>( - 'CFBundleIsArchitectureLoadable'); - late final _CFBundleIsArchitectureLoadable = - _CFBundleIsArchitectureLoadablePtr.asFunction(); + late final _SSLCopyRequestedPeerNamePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Pointer)>>('SSLCopyRequestedPeerName'); + late final _SSLCopyRequestedPeerName = + _SSLCopyRequestedPeerNamePtr.asFunction< + int Function( + SSLContextRef, ffi.Pointer, ffi.Pointer)>(); - CFPlugInRef CFBundleGetPlugIn( - CFBundleRef bundle, + int SSLSetDatagramHelloCookie( + SSLContextRef dtlsContext, + ffi.Pointer cookie, + int cookieLen, ) { - return _CFBundleGetPlugIn( - bundle, + return _SSLSetDatagramHelloCookie( + dtlsContext, + cookie, + cookieLen, ); } - late final _CFBundleGetPlugInPtr = - _lookup>( - 'CFBundleGetPlugIn'); - late final _CFBundleGetPlugIn = - _CFBundleGetPlugInPtr.asFunction(); + late final _SSLSetDatagramHelloCookiePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Size)>>('SSLSetDatagramHelloCookie'); + late final _SSLSetDatagramHelloCookie = _SSLSetDatagramHelloCookiePtr + .asFunction, int)>(); - int CFBundleOpenBundleResourceMap( - CFBundleRef bundle, + int SSLSetMaxDatagramRecordSize( + SSLContextRef dtlsContext, + int maxSize, ) { - return _CFBundleOpenBundleResourceMap( - bundle, + return _SSLSetMaxDatagramRecordSize( + dtlsContext, + maxSize, ); } - late final _CFBundleOpenBundleResourceMapPtr = - _lookup>( - 'CFBundleOpenBundleResourceMap'); - late final _CFBundleOpenBundleResourceMap = - _CFBundleOpenBundleResourceMapPtr.asFunction(); + late final _SSLSetMaxDatagramRecordSizePtr = + _lookup>( + 'SSLSetMaxDatagramRecordSize'); + late final _SSLSetMaxDatagramRecordSize = _SSLSetMaxDatagramRecordSizePtr + .asFunction(); - int CFBundleOpenBundleResourceFiles( - CFBundleRef bundle, - ffi.Pointer refNum, - ffi.Pointer localizedRefNum, + int SSLGetMaxDatagramRecordSize( + SSLContextRef dtlsContext, + ffi.Pointer maxSize, ) { - return _CFBundleOpenBundleResourceFiles( - bundle, - refNum, - localizedRefNum, + return _SSLGetMaxDatagramRecordSize( + dtlsContext, + maxSize, ); } - late final _CFBundleOpenBundleResourceFilesPtr = _lookup< + late final _SSLGetMaxDatagramRecordSizePtr = _lookup< ffi.NativeFunction< - SInt32 Function(CFBundleRef, ffi.Pointer, - ffi.Pointer)>>('CFBundleOpenBundleResourceFiles'); - late final _CFBundleOpenBundleResourceFiles = - _CFBundleOpenBundleResourceFilesPtr.asFunction< - int Function(CFBundleRef, ffi.Pointer, - ffi.Pointer)>(); + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetMaxDatagramRecordSize'); + late final _SSLGetMaxDatagramRecordSize = _SSLGetMaxDatagramRecordSizePtr + .asFunction)>(); - void CFBundleCloseBundleResourceMap( - CFBundleRef bundle, - int refNum, + int SSLGetNegotiatedProtocolVersion( + SSLContextRef context, + ffi.Pointer protocol, ) { - return _CFBundleCloseBundleResourceMap( - bundle, - refNum, + return _SSLGetNegotiatedProtocolVersion( + context, + protocol, ); } - late final _CFBundleCloseBundleResourceMapPtr = _lookup< - ffi.NativeFunction>( - 'CFBundleCloseBundleResourceMap'); - late final _CFBundleCloseBundleResourceMap = - _CFBundleCloseBundleResourceMapPtr.asFunction< - void Function(CFBundleRef, int)>(); + late final _SSLGetNegotiatedProtocolVersionPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer)>>( + 'SSLGetNegotiatedProtocolVersion'); + late final _SSLGetNegotiatedProtocolVersion = + _SSLGetNegotiatedProtocolVersionPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - int CFMessagePortGetTypeID() { - return _CFMessagePortGetTypeID(); + int SSLGetNumberSupportedCiphers( + SSLContextRef context, + ffi.Pointer numCiphers, + ) { + return _SSLGetNumberSupportedCiphers( + context, + numCiphers, + ); } - late final _CFMessagePortGetTypeIDPtr = - _lookup>( - 'CFMessagePortGetTypeID'); - late final _CFMessagePortGetTypeID = - _CFMessagePortGetTypeIDPtr.asFunction(); + late final _SSLGetNumberSupportedCiphersPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetNumberSupportedCiphers'); + late final _SSLGetNumberSupportedCiphers = _SSLGetNumberSupportedCiphersPtr + .asFunction)>(); - CFMessagePortRef CFMessagePortCreateLocal( - CFAllocatorRef allocator, - CFStringRef name, - CFMessagePortCallBack callout, - ffi.Pointer context, - ffi.Pointer shouldFreeInfo, + int SSLGetSupportedCiphers( + SSLContextRef context, + ffi.Pointer ciphers, + ffi.Pointer numCiphers, ) { - return _CFMessagePortCreateLocal( - allocator, - name, - callout, + return _SSLGetSupportedCiphers( context, - shouldFreeInfo, + ciphers, + numCiphers, ); } - late final _CFMessagePortCreateLocalPtr = _lookup< + late final _SSLGetSupportedCiphersPtr = _lookup< ffi.NativeFunction< - CFMessagePortRef Function( - CFAllocatorRef, - CFStringRef, - CFMessagePortCallBack, - ffi.Pointer, - ffi.Pointer)>>('CFMessagePortCreateLocal'); - late final _CFMessagePortCreateLocal = - _CFMessagePortCreateLocalPtr.asFunction< - CFMessagePortRef Function( - CFAllocatorRef, - CFStringRef, - CFMessagePortCallBack, - ffi.Pointer, - ffi.Pointer)>(); + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Pointer)>>('SSLGetSupportedCiphers'); + late final _SSLGetSupportedCiphers = _SSLGetSupportedCiphersPtr.asFunction< + int Function( + SSLContextRef, ffi.Pointer, ffi.Pointer)>(); - CFMessagePortRef CFMessagePortCreateRemote( - CFAllocatorRef allocator, - CFStringRef name, + int SSLGetNumberEnabledCiphers( + SSLContextRef context, + ffi.Pointer numCiphers, ) { - return _CFMessagePortCreateRemote( - allocator, - name, + return _SSLGetNumberEnabledCiphers( + context, + numCiphers, ); } - late final _CFMessagePortCreateRemotePtr = _lookup< + late final _SSLGetNumberEnabledCiphersPtr = _lookup< ffi.NativeFunction< - CFMessagePortRef Function( - CFAllocatorRef, CFStringRef)>>('CFMessagePortCreateRemote'); - late final _CFMessagePortCreateRemote = _CFMessagePortCreateRemotePtr - .asFunction(); + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetNumberEnabledCiphers'); + late final _SSLGetNumberEnabledCiphers = _SSLGetNumberEnabledCiphersPtr + .asFunction)>(); - int CFMessagePortIsRemote( - CFMessagePortRef ms, + int SSLSetEnabledCiphers( + SSLContextRef context, + ffi.Pointer ciphers, + int numCiphers, ) { - return _CFMessagePortIsRemote( - ms, + return _SSLSetEnabledCiphers( + context, + ciphers, + numCiphers, ); } - late final _CFMessagePortIsRemotePtr = - _lookup>( - 'CFMessagePortIsRemote'); - late final _CFMessagePortIsRemote = - _CFMessagePortIsRemotePtr.asFunction(); + late final _SSLSetEnabledCiphersPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Size)>>('SSLSetEnabledCiphers'); + late final _SSLSetEnabledCiphers = _SSLSetEnabledCiphersPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer, int)>(); - CFStringRef CFMessagePortGetName( - CFMessagePortRef ms, + int SSLGetEnabledCiphers( + SSLContextRef context, + ffi.Pointer ciphers, + ffi.Pointer numCiphers, ) { - return _CFMessagePortGetName( - ms, + return _SSLGetEnabledCiphers( + context, + ciphers, + numCiphers, ); } - late final _CFMessagePortGetNamePtr = - _lookup>( - 'CFMessagePortGetName'); - late final _CFMessagePortGetName = _CFMessagePortGetNamePtr.asFunction< - CFStringRef Function(CFMessagePortRef)>(); + late final _SSLGetEnabledCiphersPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Pointer)>>('SSLGetEnabledCiphers'); + late final _SSLGetEnabledCiphers = _SSLGetEnabledCiphersPtr.asFunction< + int Function( + SSLContextRef, ffi.Pointer, ffi.Pointer)>(); - int CFMessagePortSetName( - CFMessagePortRef ms, - CFStringRef newName, + int SSLSetSessionTicketsEnabled( + SSLContextRef context, + int enabled, ) { - return _CFMessagePortSetName( - ms, - newName, + return _SSLSetSessionTicketsEnabled( + context, + enabled, ); } - late final _CFMessagePortSetNamePtr = _lookup< - ffi.NativeFunction>( - 'CFMessagePortSetName'); - late final _CFMessagePortSetName = _CFMessagePortSetNamePtr.asFunction< - int Function(CFMessagePortRef, CFStringRef)>(); + late final _SSLSetSessionTicketsEnabledPtr = + _lookup>( + 'SSLSetSessionTicketsEnabled'); + late final _SSLSetSessionTicketsEnabled = _SSLSetSessionTicketsEnabledPtr + .asFunction(); - void CFMessagePortGetContext( - CFMessagePortRef ms, - ffi.Pointer context, + int SSLSetEnableCertVerify( + SSLContextRef context, + int enableVerify, ) { - return _CFMessagePortGetContext( - ms, + return _SSLSetEnableCertVerify( context, + enableVerify, ); } - late final _CFMessagePortGetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMessagePortRef, - ffi.Pointer)>>('CFMessagePortGetContext'); - late final _CFMessagePortGetContext = _CFMessagePortGetContextPtr.asFunction< - void Function(CFMessagePortRef, ffi.Pointer)>(); + late final _SSLSetEnableCertVerifyPtr = + _lookup>( + 'SSLSetEnableCertVerify'); + late final _SSLSetEnableCertVerify = + _SSLSetEnableCertVerifyPtr.asFunction(); - void CFMessagePortInvalidate( - CFMessagePortRef ms, + int SSLGetEnableCertVerify( + SSLContextRef context, + ffi.Pointer enableVerify, ) { - return _CFMessagePortInvalidate( - ms, + return _SSLGetEnableCertVerify( + context, + enableVerify, ); } - late final _CFMessagePortInvalidatePtr = - _lookup>( - 'CFMessagePortInvalidate'); - late final _CFMessagePortInvalidate = - _CFMessagePortInvalidatePtr.asFunction(); + late final _SSLGetEnableCertVerifyPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SSLContextRef, ffi.Pointer)>>('SSLGetEnableCertVerify'); + late final _SSLGetEnableCertVerify = _SSLGetEnableCertVerifyPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - int CFMessagePortIsValid( - CFMessagePortRef ms, + int SSLSetAllowsExpiredCerts( + SSLContextRef context, + int allowsExpired, ) { - return _CFMessagePortIsValid( - ms, + return _SSLSetAllowsExpiredCerts( + context, + allowsExpired, ); } - late final _CFMessagePortIsValidPtr = - _lookup>( - 'CFMessagePortIsValid'); - late final _CFMessagePortIsValid = - _CFMessagePortIsValidPtr.asFunction(); + late final _SSLSetAllowsExpiredCertsPtr = + _lookup>( + 'SSLSetAllowsExpiredCerts'); + late final _SSLSetAllowsExpiredCerts = _SSLSetAllowsExpiredCertsPtr + .asFunction(); - CFMessagePortInvalidationCallBack CFMessagePortGetInvalidationCallBack( - CFMessagePortRef ms, + int SSLGetAllowsExpiredCerts( + SSLContextRef context, + ffi.Pointer allowsExpired, ) { - return _CFMessagePortGetInvalidationCallBack( - ms, + return _SSLGetAllowsExpiredCerts( + context, + allowsExpired, ); } - late final _CFMessagePortGetInvalidationCallBackPtr = _lookup< + late final _SSLGetAllowsExpiredCertsPtr = _lookup< ffi.NativeFunction< - CFMessagePortInvalidationCallBack Function( - CFMessagePortRef)>>('CFMessagePortGetInvalidationCallBack'); - late final _CFMessagePortGetInvalidationCallBack = - _CFMessagePortGetInvalidationCallBackPtr.asFunction< - CFMessagePortInvalidationCallBack Function(CFMessagePortRef)>(); + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetAllowsExpiredCerts'); + late final _SSLGetAllowsExpiredCerts = _SSLGetAllowsExpiredCertsPtr + .asFunction)>(); - void CFMessagePortSetInvalidationCallBack( - CFMessagePortRef ms, - CFMessagePortInvalidationCallBack callout, + int SSLSetAllowsExpiredRoots( + SSLContextRef context, + int allowsExpired, ) { - return _CFMessagePortSetInvalidationCallBack( - ms, - callout, - ); + return _SSLSetAllowsExpiredRoots( + context, + allowsExpired, + ); } - late final _CFMessagePortSetInvalidationCallBackPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMessagePortRef, CFMessagePortInvalidationCallBack)>>( - 'CFMessagePortSetInvalidationCallBack'); - late final _CFMessagePortSetInvalidationCallBack = - _CFMessagePortSetInvalidationCallBackPtr.asFunction< - void Function(CFMessagePortRef, CFMessagePortInvalidationCallBack)>(); + late final _SSLSetAllowsExpiredRootsPtr = + _lookup>( + 'SSLSetAllowsExpiredRoots'); + late final _SSLSetAllowsExpiredRoots = _SSLSetAllowsExpiredRootsPtr + .asFunction(); - int CFMessagePortSendRequest( - CFMessagePortRef remote, - int msgid, - CFDataRef data, - double sendTimeout, - double rcvTimeout, - CFStringRef replyMode, - ffi.Pointer returnData, + int SSLGetAllowsExpiredRoots( + SSLContextRef context, + ffi.Pointer allowsExpired, ) { - return _CFMessagePortSendRequest( - remote, - msgid, - data, - sendTimeout, - rcvTimeout, - replyMode, - returnData, + return _SSLGetAllowsExpiredRoots( + context, + allowsExpired, ); } - late final _CFMessagePortSendRequestPtr = _lookup< + late final _SSLGetAllowsExpiredRootsPtr = _lookup< ffi.NativeFunction< - SInt32 Function( - CFMessagePortRef, - SInt32, - CFDataRef, - CFTimeInterval, - CFTimeInterval, - CFStringRef, - ffi.Pointer)>>('CFMessagePortSendRequest'); - late final _CFMessagePortSendRequest = - _CFMessagePortSendRequestPtr.asFunction< - int Function(CFMessagePortRef, int, CFDataRef, double, double, - CFStringRef, ffi.Pointer)>(); + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetAllowsExpiredRoots'); + late final _SSLGetAllowsExpiredRoots = _SSLGetAllowsExpiredRootsPtr + .asFunction)>(); - CFRunLoopSourceRef CFMessagePortCreateRunLoopSource( - CFAllocatorRef allocator, - CFMessagePortRef local, - int order, + int SSLSetAllowsAnyRoot( + SSLContextRef context, + int anyRoot, ) { - return _CFMessagePortCreateRunLoopSource( - allocator, - local, - order, + return _SSLSetAllowsAnyRoot( + context, + anyRoot, ); } - late final _CFMessagePortCreateRunLoopSourcePtr = _lookup< - ffi.NativeFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFMessagePortRef, - CFIndex)>>('CFMessagePortCreateRunLoopSource'); - late final _CFMessagePortCreateRunLoopSource = - _CFMessagePortCreateRunLoopSourcePtr.asFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFMessagePortRef, int)>(); + late final _SSLSetAllowsAnyRootPtr = + _lookup>( + 'SSLSetAllowsAnyRoot'); + late final _SSLSetAllowsAnyRoot = + _SSLSetAllowsAnyRootPtr.asFunction(); - void CFMessagePortSetDispatchQueue( - CFMessagePortRef ms, - dispatch_queue_t queue, + int SSLGetAllowsAnyRoot( + SSLContextRef context, + ffi.Pointer anyRoot, ) { - return _CFMessagePortSetDispatchQueue( - ms, - queue, + return _SSLGetAllowsAnyRoot( + context, + anyRoot, ); } - late final _CFMessagePortSetDispatchQueuePtr = _lookup< + late final _SSLGetAllowsAnyRootPtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFMessagePortRef, - dispatch_queue_t)>>('CFMessagePortSetDispatchQueue'); - late final _CFMessagePortSetDispatchQueue = _CFMessagePortSetDispatchQueuePtr - .asFunction(); - - late final ffi.Pointer _kCFPlugInDynamicRegistrationKey = - _lookup('kCFPlugInDynamicRegistrationKey'); - - CFStringRef get kCFPlugInDynamicRegistrationKey => - _kCFPlugInDynamicRegistrationKey.value; - - late final ffi.Pointer _kCFPlugInDynamicRegisterFunctionKey = - _lookup('kCFPlugInDynamicRegisterFunctionKey'); - - CFStringRef get kCFPlugInDynamicRegisterFunctionKey => - _kCFPlugInDynamicRegisterFunctionKey.value; - - late final ffi.Pointer _kCFPlugInUnloadFunctionKey = - _lookup('kCFPlugInUnloadFunctionKey'); - - CFStringRef get kCFPlugInUnloadFunctionKey => - _kCFPlugInUnloadFunctionKey.value; - - late final ffi.Pointer _kCFPlugInFactoriesKey = - _lookup('kCFPlugInFactoriesKey'); - - CFStringRef get kCFPlugInFactoriesKey => _kCFPlugInFactoriesKey.value; - - late final ffi.Pointer _kCFPlugInTypesKey = - _lookup('kCFPlugInTypesKey'); - - CFStringRef get kCFPlugInTypesKey => _kCFPlugInTypesKey.value; + OSStatus Function( + SSLContextRef, ffi.Pointer)>>('SSLGetAllowsAnyRoot'); + late final _SSLGetAllowsAnyRoot = _SSLGetAllowsAnyRootPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - int CFPlugInGetTypeID() { - return _CFPlugInGetTypeID(); + int SSLSetTrustedRoots( + SSLContextRef context, + CFArrayRef trustedRoots, + int replaceExisting, + ) { + return _SSLSetTrustedRoots( + context, + trustedRoots, + replaceExisting, + ); } - late final _CFPlugInGetTypeIDPtr = - _lookup>('CFPlugInGetTypeID'); - late final _CFPlugInGetTypeID = - _CFPlugInGetTypeIDPtr.asFunction(); + late final _SSLSetTrustedRootsPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SSLContextRef, CFArrayRef, Boolean)>>('SSLSetTrustedRoots'); + late final _SSLSetTrustedRoots = _SSLSetTrustedRootsPtr.asFunction< + int Function(SSLContextRef, CFArrayRef, int)>(); - CFPlugInRef CFPlugInCreate( - CFAllocatorRef allocator, - CFURLRef plugInURL, + int SSLCopyTrustedRoots( + SSLContextRef context, + ffi.Pointer trustedRoots, ) { - return _CFPlugInCreate( - allocator, - plugInURL, + return _SSLCopyTrustedRoots( + context, + trustedRoots, ); } - late final _CFPlugInCreatePtr = _lookup< - ffi.NativeFunction>( - 'CFPlugInCreate'); - late final _CFPlugInCreate = _CFPlugInCreatePtr.asFunction< - CFPlugInRef Function(CFAllocatorRef, CFURLRef)>(); + late final _SSLCopyTrustedRootsPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SSLContextRef, ffi.Pointer)>>('SSLCopyTrustedRoots'); + late final _SSLCopyTrustedRoots = _SSLCopyTrustedRootsPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - CFBundleRef CFPlugInGetBundle( - CFPlugInRef plugIn, + int SSLCopyPeerCertificates( + SSLContextRef context, + ffi.Pointer certs, ) { - return _CFPlugInGetBundle( - plugIn, + return _SSLCopyPeerCertificates( + context, + certs, ); } - late final _CFPlugInGetBundlePtr = - _lookup>( - 'CFPlugInGetBundle'); - late final _CFPlugInGetBundle = - _CFPlugInGetBundlePtr.asFunction(); + late final _SSLCopyPeerCertificatesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLCopyPeerCertificates'); + late final _SSLCopyPeerCertificates = _SSLCopyPeerCertificatesPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - void CFPlugInSetLoadOnDemand( - CFPlugInRef plugIn, - int flag, + int SSLCopyPeerTrust( + SSLContextRef context, + ffi.Pointer trust, ) { - return _CFPlugInSetLoadOnDemand( - plugIn, - flag, + return _SSLCopyPeerTrust( + context, + trust, ); } - late final _CFPlugInSetLoadOnDemandPtr = - _lookup>( - 'CFPlugInSetLoadOnDemand'); - late final _CFPlugInSetLoadOnDemand = - _CFPlugInSetLoadOnDemandPtr.asFunction(); + late final _SSLCopyPeerTrustPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SSLContextRef, ffi.Pointer)>>('SSLCopyPeerTrust'); + late final _SSLCopyPeerTrust = _SSLCopyPeerTrustPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - int CFPlugInIsLoadOnDemand( - CFPlugInRef plugIn, + int SSLSetPeerID( + SSLContextRef context, + ffi.Pointer peerID, + int peerIDLen, ) { - return _CFPlugInIsLoadOnDemand( - plugIn, + return _SSLSetPeerID( + context, + peerID, + peerIDLen, ); } - late final _CFPlugInIsLoadOnDemandPtr = - _lookup>( - 'CFPlugInIsLoadOnDemand'); - late final _CFPlugInIsLoadOnDemand = - _CFPlugInIsLoadOnDemandPtr.asFunction(); + late final _SSLSetPeerIDPtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SSLContextRef, ffi.Pointer, ffi.Size)>>('SSLSetPeerID'); + late final _SSLSetPeerID = _SSLSetPeerIDPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer, int)>(); - CFArrayRef CFPlugInFindFactoriesForPlugInType( - CFUUIDRef typeUUID, + int SSLGetPeerID( + SSLContextRef context, + ffi.Pointer> peerID, + ffi.Pointer peerIDLen, ) { - return _CFPlugInFindFactoriesForPlugInType( - typeUUID, + return _SSLGetPeerID( + context, + peerID, + peerIDLen, ); } - late final _CFPlugInFindFactoriesForPlugInTypePtr = - _lookup>( - 'CFPlugInFindFactoriesForPlugInType'); - late final _CFPlugInFindFactoriesForPlugInType = - _CFPlugInFindFactoriesForPlugInTypePtr.asFunction< - CFArrayRef Function(CFUUIDRef)>(); + late final _SSLGetPeerIDPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer>, + ffi.Pointer)>>('SSLGetPeerID'); + late final _SSLGetPeerID = _SSLGetPeerIDPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer>, + ffi.Pointer)>(); - CFArrayRef CFPlugInFindFactoriesForPlugInTypeInPlugIn( - CFUUIDRef typeUUID, - CFPlugInRef plugIn, + int SSLGetNegotiatedCipher( + SSLContextRef context, + ffi.Pointer cipherSuite, ) { - return _CFPlugInFindFactoriesForPlugInTypeInPlugIn( - typeUUID, - plugIn, + return _SSLGetNegotiatedCipher( + context, + cipherSuite, ); } - late final _CFPlugInFindFactoriesForPlugInTypeInPlugInPtr = - _lookup>( - 'CFPlugInFindFactoriesForPlugInTypeInPlugIn'); - late final _CFPlugInFindFactoriesForPlugInTypeInPlugIn = - _CFPlugInFindFactoriesForPlugInTypeInPlugInPtr.asFunction< - CFArrayRef Function(CFUUIDRef, CFPlugInRef)>(); + late final _SSLGetNegotiatedCipherPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetNegotiatedCipher'); + late final _SSLGetNegotiatedCipher = _SSLGetNegotiatedCipherPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - ffi.Pointer CFPlugInInstanceCreate( - CFAllocatorRef allocator, - CFUUIDRef factoryUUID, - CFUUIDRef typeUUID, + int SSLSetALPNProtocols( + SSLContextRef context, + CFArrayRef protocols, ) { - return _CFPlugInInstanceCreate( - allocator, - factoryUUID, - typeUUID, + return _SSLSetALPNProtocols( + context, + protocols, ); } - late final _CFPlugInInstanceCreatePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - CFAllocatorRef, CFUUIDRef, CFUUIDRef)>>('CFPlugInInstanceCreate'); - late final _CFPlugInInstanceCreate = _CFPlugInInstanceCreatePtr.asFunction< - ffi.Pointer Function(CFAllocatorRef, CFUUIDRef, CFUUIDRef)>(); + late final _SSLSetALPNProtocolsPtr = + _lookup>( + 'SSLSetALPNProtocols'); + late final _SSLSetALPNProtocols = _SSLSetALPNProtocolsPtr.asFunction< + int Function(SSLContextRef, CFArrayRef)>(); - int CFPlugInRegisterFactoryFunction( - CFUUIDRef factoryUUID, - CFPlugInFactoryFunction func, + int SSLCopyALPNProtocols( + SSLContextRef context, + ffi.Pointer protocols, ) { - return _CFPlugInRegisterFactoryFunction( - factoryUUID, - func, + return _SSLCopyALPNProtocols( + context, + protocols, ); } - late final _CFPlugInRegisterFactoryFunctionPtr = _lookup< + late final _SSLCopyALPNProtocolsPtr = _lookup< ffi.NativeFunction< - Boolean Function(CFUUIDRef, - CFPlugInFactoryFunction)>>('CFPlugInRegisterFactoryFunction'); - late final _CFPlugInRegisterFactoryFunction = - _CFPlugInRegisterFactoryFunctionPtr.asFunction< - int Function(CFUUIDRef, CFPlugInFactoryFunction)>(); + OSStatus Function( + SSLContextRef, ffi.Pointer)>>('SSLCopyALPNProtocols'); + late final _SSLCopyALPNProtocols = _SSLCopyALPNProtocolsPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - int CFPlugInRegisterFactoryFunctionByName( - CFUUIDRef factoryUUID, - CFPlugInRef plugIn, - CFStringRef functionName, + int SSLSetOCSPResponse( + SSLContextRef context, + CFDataRef response, ) { - return _CFPlugInRegisterFactoryFunctionByName( - factoryUUID, - plugIn, - functionName, + return _SSLSetOCSPResponse( + context, + response, ); } - late final _CFPlugInRegisterFactoryFunctionByNamePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFUUIDRef, CFPlugInRef, - CFStringRef)>>('CFPlugInRegisterFactoryFunctionByName'); - late final _CFPlugInRegisterFactoryFunctionByName = - _CFPlugInRegisterFactoryFunctionByNamePtr.asFunction< - int Function(CFUUIDRef, CFPlugInRef, CFStringRef)>(); + late final _SSLSetOCSPResponsePtr = + _lookup>( + 'SSLSetOCSPResponse'); + late final _SSLSetOCSPResponse = _SSLSetOCSPResponsePtr.asFunction< + int Function(SSLContextRef, CFDataRef)>(); - int CFPlugInUnregisterFactory( - CFUUIDRef factoryUUID, + int SSLSetEncryptionCertificate( + SSLContextRef context, + CFArrayRef certRefs, ) { - return _CFPlugInUnregisterFactory( - factoryUUID, + return _SSLSetEncryptionCertificate( + context, + certRefs, ); } - late final _CFPlugInUnregisterFactoryPtr = - _lookup>( - 'CFPlugInUnregisterFactory'); - late final _CFPlugInUnregisterFactory = - _CFPlugInUnregisterFactoryPtr.asFunction(); + late final _SSLSetEncryptionCertificatePtr = + _lookup>( + 'SSLSetEncryptionCertificate'); + late final _SSLSetEncryptionCertificate = _SSLSetEncryptionCertificatePtr + .asFunction(); - int CFPlugInRegisterPlugInType( - CFUUIDRef factoryUUID, - CFUUIDRef typeUUID, + DartSInt32 SSLSetClientSideAuthenticate( + SSLContextRef context, + SSLAuthenticate auth, ) { - return _CFPlugInRegisterPlugInType( - factoryUUID, - typeUUID, + return _SSLSetClientSideAuthenticate( + context, + auth.value, ); } - late final _CFPlugInRegisterPlugInTypePtr = - _lookup>( - 'CFPlugInRegisterPlugInType'); - late final _CFPlugInRegisterPlugInType = _CFPlugInRegisterPlugInTypePtr - .asFunction(); + late final _SSLSetClientSideAuthenticatePtr = _lookup< + ffi + .NativeFunction>( + 'SSLSetClientSideAuthenticate'); + late final _SSLSetClientSideAuthenticate = _SSLSetClientSideAuthenticatePtr + .asFunction(); - int CFPlugInUnregisterPlugInType( - CFUUIDRef factoryUUID, - CFUUIDRef typeUUID, + int SSLAddDistinguishedName( + SSLContextRef context, + ffi.Pointer derDN, + int derDNLen, ) { - return _CFPlugInUnregisterPlugInType( - factoryUUID, - typeUUID, + return _SSLAddDistinguishedName( + context, + derDN, + derDNLen, ); } - late final _CFPlugInUnregisterPlugInTypePtr = - _lookup>( - 'CFPlugInUnregisterPlugInType'); - late final _CFPlugInUnregisterPlugInType = _CFPlugInUnregisterPlugInTypePtr - .asFunction(); + late final _SSLAddDistinguishedNamePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Size)>>('SSLAddDistinguishedName'); + late final _SSLAddDistinguishedName = _SSLAddDistinguishedNamePtr.asFunction< + int Function(SSLContextRef, ffi.Pointer, int)>(); - void CFPlugInAddInstanceForFactory( - CFUUIDRef factoryID, + int SSLSetCertificateAuthorities( + SSLContextRef context, + CFTypeRef certificateOrArray, + int replaceExisting, ) { - return _CFPlugInAddInstanceForFactory( - factoryID, + return _SSLSetCertificateAuthorities( + context, + certificateOrArray, + replaceExisting, ); } - late final _CFPlugInAddInstanceForFactoryPtr = - _lookup>( - 'CFPlugInAddInstanceForFactory'); - late final _CFPlugInAddInstanceForFactory = - _CFPlugInAddInstanceForFactoryPtr.asFunction(); + late final _SSLSetCertificateAuthoritiesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, CFTypeRef, + Boolean)>>('SSLSetCertificateAuthorities'); + late final _SSLSetCertificateAuthorities = _SSLSetCertificateAuthoritiesPtr + .asFunction(); - void CFPlugInRemoveInstanceForFactory( - CFUUIDRef factoryID, + int SSLCopyCertificateAuthorities( + SSLContextRef context, + ffi.Pointer certificates, ) { - return _CFPlugInRemoveInstanceForFactory( - factoryID, + return _SSLCopyCertificateAuthorities( + context, + certificates, ); } - late final _CFPlugInRemoveInstanceForFactoryPtr = - _lookup>( - 'CFPlugInRemoveInstanceForFactory'); - late final _CFPlugInRemoveInstanceForFactory = - _CFPlugInRemoveInstanceForFactoryPtr.asFunction< - void Function(CFUUIDRef)>(); + late final _SSLCopyCertificateAuthoritiesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLCopyCertificateAuthorities'); + late final _SSLCopyCertificateAuthorities = _SSLCopyCertificateAuthoritiesPtr + .asFunction)>(); - int CFPlugInInstanceGetInterfaceFunctionTable( - CFPlugInInstanceRef instance, - CFStringRef interfaceName, - ffi.Pointer> ftbl, + int SSLCopyDistinguishedNames( + SSLContextRef context, + ffi.Pointer names, ) { - return _CFPlugInInstanceGetInterfaceFunctionTable( - instance, - interfaceName, - ftbl, + return _SSLCopyDistinguishedNames( + context, + names, ); } - late final _CFPlugInInstanceGetInterfaceFunctionTablePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFPlugInInstanceRef, CFStringRef, - ffi.Pointer>)>>( - 'CFPlugInInstanceGetInterfaceFunctionTable'); - late final _CFPlugInInstanceGetInterfaceFunctionTable = - _CFPlugInInstanceGetInterfaceFunctionTablePtr.asFunction< - int Function(CFPlugInInstanceRef, CFStringRef, - ffi.Pointer>)>(); + late final _SSLCopyDistinguishedNamesPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLCopyDistinguishedNames'); + late final _SSLCopyDistinguishedNames = _SSLCopyDistinguishedNamesPtr + .asFunction)>(); - CFStringRef CFPlugInInstanceGetFactoryName( - CFPlugInInstanceRef instance, + int SSLGetClientCertificateState( + SSLContextRef context, + ffi.Pointer clientState, ) { - return _CFPlugInInstanceGetFactoryName( - instance, + return _SSLGetClientCertificateState( + context, + clientState, ); } - late final _CFPlugInInstanceGetFactoryNamePtr = - _lookup>( - 'CFPlugInInstanceGetFactoryName'); - late final _CFPlugInInstanceGetFactoryName = - _CFPlugInInstanceGetFactoryNamePtr.asFunction< - CFStringRef Function(CFPlugInInstanceRef)>(); + late final _SSLGetClientCertificateStatePtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetClientCertificateState'); + late final _SSLGetClientCertificateState = _SSLGetClientCertificateStatePtr + .asFunction)>(); - ffi.Pointer CFPlugInInstanceGetInstanceData( - CFPlugInInstanceRef instance, + int SSLSetDiffieHellmanParams( + SSLContextRef context, + ffi.Pointer dhParams, + int dhParamsLen, ) { - return _CFPlugInInstanceGetInstanceData( - instance, + return _SSLSetDiffieHellmanParams( + context, + dhParams, + dhParamsLen, ); } - late final _CFPlugInInstanceGetInstanceDataPtr = _lookup< - ffi - .NativeFunction Function(CFPlugInInstanceRef)>>( - 'CFPlugInInstanceGetInstanceData'); - late final _CFPlugInInstanceGetInstanceData = - _CFPlugInInstanceGetInstanceDataPtr.asFunction< - ffi.Pointer Function(CFPlugInInstanceRef)>(); - - int CFPlugInInstanceGetTypeID() { - return _CFPlugInInstanceGetTypeID(); - } - - late final _CFPlugInInstanceGetTypeIDPtr = - _lookup>( - 'CFPlugInInstanceGetTypeID'); - late final _CFPlugInInstanceGetTypeID = - _CFPlugInInstanceGetTypeIDPtr.asFunction(); + late final _SSLSetDiffieHellmanParamsPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, + ffi.Size)>>('SSLSetDiffieHellmanParams'); + late final _SSLSetDiffieHellmanParams = _SSLSetDiffieHellmanParamsPtr + .asFunction, int)>(); - CFPlugInInstanceRef CFPlugInInstanceCreateWithInstanceDataSize( - CFAllocatorRef allocator, - int instanceDataSize, - CFPlugInInstanceDeallocateInstanceDataFunction deallocateInstanceFunction, - CFStringRef factoryName, - CFPlugInInstanceGetInterfaceFunction getInterfaceFunction, + int SSLGetDiffieHellmanParams( + SSLContextRef context, + ffi.Pointer> dhParams, + ffi.Pointer dhParamsLen, ) { - return _CFPlugInInstanceCreateWithInstanceDataSize( - allocator, - instanceDataSize, - deallocateInstanceFunction, - factoryName, - getInterfaceFunction, + return _SSLGetDiffieHellmanParams( + context, + dhParams, + dhParamsLen, ); } - late final _CFPlugInInstanceCreateWithInstanceDataSizePtr = _lookup< - ffi.NativeFunction< - CFPlugInInstanceRef Function( - CFAllocatorRef, - CFIndex, - CFPlugInInstanceDeallocateInstanceDataFunction, - CFStringRef, - CFPlugInInstanceGetInterfaceFunction)>>( - 'CFPlugInInstanceCreateWithInstanceDataSize'); - late final _CFPlugInInstanceCreateWithInstanceDataSize = - _CFPlugInInstanceCreateWithInstanceDataSizePtr.asFunction< - CFPlugInInstanceRef Function( - CFAllocatorRef, - int, - CFPlugInInstanceDeallocateInstanceDataFunction, - CFStringRef, - CFPlugInInstanceGetInterfaceFunction)>(); + late final _SSLGetDiffieHellmanParamsPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer>, + ffi.Pointer)>>('SSLGetDiffieHellmanParams'); + late final _SSLGetDiffieHellmanParams = + _SSLGetDiffieHellmanParamsPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer>, + ffi.Pointer)>(); - int CFMachPortGetTypeID() { - return _CFMachPortGetTypeID(); + int SSLSetRsaBlinding( + SSLContextRef context, + int blinding, + ) { + return _SSLSetRsaBlinding( + context, + blinding, + ); } - late final _CFMachPortGetTypeIDPtr = - _lookup>('CFMachPortGetTypeID'); - late final _CFMachPortGetTypeID = - _CFMachPortGetTypeIDPtr.asFunction(); + late final _SSLSetRsaBlindingPtr = + _lookup>( + 'SSLSetRsaBlinding'); + late final _SSLSetRsaBlinding = + _SSLSetRsaBlindingPtr.asFunction(); - CFMachPortRef CFMachPortCreate( - CFAllocatorRef allocator, - CFMachPortCallBack callout, - ffi.Pointer context, - ffi.Pointer shouldFreeInfo, + int SSLGetRsaBlinding( + SSLContextRef context, + ffi.Pointer blinding, ) { - return _CFMachPortCreate( - allocator, - callout, + return _SSLGetRsaBlinding( context, - shouldFreeInfo, + blinding, ); } - late final _CFMachPortCreatePtr = _lookup< + late final _SSLGetRsaBlindingPtr = _lookup< ffi.NativeFunction< - CFMachPortRef Function( - CFAllocatorRef, - CFMachPortCallBack, - ffi.Pointer, - ffi.Pointer)>>('CFMachPortCreate'); - late final _CFMachPortCreate = _CFMachPortCreatePtr.asFunction< - CFMachPortRef Function(CFAllocatorRef, CFMachPortCallBack, - ffi.Pointer, ffi.Pointer)>(); + OSStatus Function( + SSLContextRef, ffi.Pointer)>>('SSLGetRsaBlinding'); + late final _SSLGetRsaBlinding = _SSLGetRsaBlindingPtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - CFMachPortRef CFMachPortCreateWithPort( - CFAllocatorRef allocator, - int portNum, - CFMachPortCallBack callout, - ffi.Pointer context, - ffi.Pointer shouldFreeInfo, + int SSLHandshake( + SSLContextRef context, ) { - return _CFMachPortCreateWithPort( - allocator, - portNum, - callout, + return _SSLHandshake( context, - shouldFreeInfo, ); } - late final _CFMachPortCreateWithPortPtr = _lookup< - ffi.NativeFunction< - CFMachPortRef Function( - CFAllocatorRef, - mach_port_t, - CFMachPortCallBack, - ffi.Pointer, - ffi.Pointer)>>('CFMachPortCreateWithPort'); - late final _CFMachPortCreateWithPort = - _CFMachPortCreateWithPortPtr.asFunction< - CFMachPortRef Function(CFAllocatorRef, int, CFMachPortCallBack, - ffi.Pointer, ffi.Pointer)>(); + late final _SSLHandshakePtr = + _lookup>( + 'SSLHandshake'); + late final _SSLHandshake = + _SSLHandshakePtr.asFunction(); - int CFMachPortGetPort( - CFMachPortRef port, + int SSLReHandshake( + SSLContextRef context, ) { - return _CFMachPortGetPort( - port, + return _SSLReHandshake( + context, ); } - late final _CFMachPortGetPortPtr = - _lookup>( - 'CFMachPortGetPort'); - late final _CFMachPortGetPort = - _CFMachPortGetPortPtr.asFunction(); + late final _SSLReHandshakePtr = + _lookup>( + 'SSLReHandshake'); + late final _SSLReHandshake = + _SSLReHandshakePtr.asFunction(); - void CFMachPortGetContext( - CFMachPortRef port, - ffi.Pointer context, + int SSLWrite( + SSLContextRef context, + ffi.Pointer data, + int dataLength, + ffi.Pointer processed, ) { - return _CFMachPortGetContext( - port, + return _SSLWrite( context, + data, + dataLength, + processed, ); } - late final _CFMachPortGetContextPtr = _lookup< + late final _SSLWritePtr = _lookup< ffi.NativeFunction< - ffi.Void Function(CFMachPortRef, - ffi.Pointer)>>('CFMachPortGetContext'); - late final _CFMachPortGetContext = _CFMachPortGetContextPtr.asFunction< - void Function(CFMachPortRef, ffi.Pointer)>(); + OSStatus Function(SSLContextRef, ffi.Pointer, ffi.Size, + ffi.Pointer)>>('SSLWrite'); + late final _SSLWrite = _SSLWritePtr.asFunction< + int Function( + SSLContextRef, ffi.Pointer, int, ffi.Pointer)>(); - void CFMachPortInvalidate( - CFMachPortRef port, + int SSLRead( + SSLContextRef context, + ffi.Pointer data, + int dataLength, + ffi.Pointer processed, ) { - return _CFMachPortInvalidate( - port, + return _SSLRead( + context, + data, + dataLength, + processed, ); } - late final _CFMachPortInvalidatePtr = - _lookup>( - 'CFMachPortInvalidate'); - late final _CFMachPortInvalidate = - _CFMachPortInvalidatePtr.asFunction(); + late final _SSLReadPtr = _lookup< + ffi.NativeFunction< + OSStatus Function(SSLContextRef, ffi.Pointer, ffi.Size, + ffi.Pointer)>>('SSLRead'); + late final _SSLRead = _SSLReadPtr.asFunction< + int Function( + SSLContextRef, ffi.Pointer, int, ffi.Pointer)>(); - int CFMachPortIsValid( - CFMachPortRef port, + int SSLGetBufferedReadSize( + SSLContextRef context, + ffi.Pointer bufferSize, ) { - return _CFMachPortIsValid( - port, + return _SSLGetBufferedReadSize( + context, + bufferSize, ); } - late final _CFMachPortIsValidPtr = - _lookup>( - 'CFMachPortIsValid'); - late final _CFMachPortIsValid = - _CFMachPortIsValidPtr.asFunction(); + late final _SSLGetBufferedReadSizePtr = _lookup< + ffi.NativeFunction< + OSStatus Function( + SSLContextRef, ffi.Pointer)>>('SSLGetBufferedReadSize'); + late final _SSLGetBufferedReadSize = _SSLGetBufferedReadSizePtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - CFMachPortInvalidationCallBack CFMachPortGetInvalidationCallBack( - CFMachPortRef port, + int SSLGetDatagramWriteSize( + SSLContextRef dtlsContext, + ffi.Pointer bufSize, ) { - return _CFMachPortGetInvalidationCallBack( - port, + return _SSLGetDatagramWriteSize( + dtlsContext, + bufSize, ); } - late final _CFMachPortGetInvalidationCallBackPtr = _lookup< + late final _SSLGetDatagramWriteSizePtr = _lookup< ffi.NativeFunction< - CFMachPortInvalidationCallBack Function( - CFMachPortRef)>>('CFMachPortGetInvalidationCallBack'); - late final _CFMachPortGetInvalidationCallBack = - _CFMachPortGetInvalidationCallBackPtr.asFunction< - CFMachPortInvalidationCallBack Function(CFMachPortRef)>(); + OSStatus Function(SSLContextRef, + ffi.Pointer)>>('SSLGetDatagramWriteSize'); + late final _SSLGetDatagramWriteSize = _SSLGetDatagramWriteSizePtr.asFunction< + int Function(SSLContextRef, ffi.Pointer)>(); - void CFMachPortSetInvalidationCallBack( - CFMachPortRef port, - CFMachPortInvalidationCallBack callout, + int SSLClose( + SSLContextRef context, ) { - return _CFMachPortSetInvalidationCallBack( - port, - callout, + return _SSLClose( + context, ); } - late final _CFMachPortSetInvalidationCallBackPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFMachPortRef, CFMachPortInvalidationCallBack)>>( - 'CFMachPortSetInvalidationCallBack'); - late final _CFMachPortSetInvalidationCallBack = - _CFMachPortSetInvalidationCallBackPtr.asFunction< - void Function(CFMachPortRef, CFMachPortInvalidationCallBack)>(); + late final _SSLClosePtr = + _lookup>('SSLClose'); + late final _SSLClose = _SSLClosePtr.asFunction(); - CFRunLoopSourceRef CFMachPortCreateRunLoopSource( - CFAllocatorRef allocator, - CFMachPortRef port, - int order, + int SSLSetError( + SSLContextRef context, + int status, ) { - return _CFMachPortCreateRunLoopSource( - allocator, - port, - order, + return _SSLSetError( + context, + status, ); } - late final _CFMachPortCreateRunLoopSourcePtr = _lookup< - ffi.NativeFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFMachPortRef, - CFIndex)>>('CFMachPortCreateRunLoopSource'); - late final _CFMachPortCreateRunLoopSource = - _CFMachPortCreateRunLoopSourcePtr.asFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFMachPortRef, int)>(); + late final _SSLSetErrorPtr = + _lookup>( + 'SSLSetError'); + late final _SSLSetError = + _SSLSetErrorPtr.asFunction(); - int CFAttributedStringGetTypeID() { - return _CFAttributedStringGetTypeID(); - } + /// -1LL + late final ffi.Pointer _NSURLSessionTransferSizeUnknown = + _lookup('NSURLSessionTransferSizeUnknown'); - late final _CFAttributedStringGetTypeIDPtr = - _lookup>( - 'CFAttributedStringGetTypeID'); - late final _CFAttributedStringGetTypeID = - _CFAttributedStringGetTypeIDPtr.asFunction(); + int get NSURLSessionTransferSizeUnknown => + _NSURLSessionTransferSizeUnknown.value; - CFAttributedStringRef CFAttributedStringCreate( - CFAllocatorRef alloc, - CFStringRef str, - CFDictionaryRef attributes, - ) { - return _CFAttributedStringCreate( - alloc, - str, - attributes, - ); + late final ffi.Pointer _NSURLSessionTaskPriorityDefault = + _lookup('NSURLSessionTaskPriorityDefault'); + + double get NSURLSessionTaskPriorityDefault => + _NSURLSessionTaskPriorityDefault.value; + + late final ffi.Pointer _NSURLSessionTaskPriorityLow = + _lookup('NSURLSessionTaskPriorityLow'); + + double get NSURLSessionTaskPriorityLow => _NSURLSessionTaskPriorityLow.value; + + late final ffi.Pointer _NSURLSessionTaskPriorityHigh = + _lookup('NSURLSessionTaskPriorityHigh'); + + double get NSURLSessionTaskPriorityHigh => + _NSURLSessionTaskPriorityHigh.value; + + /// Key in the userInfo dictionary of an NSError received during a failed download. + late final ffi.Pointer> + _NSURLSessionDownloadTaskResumeData = + _lookup>( + 'NSURLSessionDownloadTaskResumeData'); + + objc.NSString get NSURLSessionDownloadTaskResumeData => + objc.NSString.castFromPointer(_NSURLSessionDownloadTaskResumeData.value, + retain: true, release: true); + + set NSURLSessionDownloadTaskResumeData(objc.NSString value) { + objc.NSString.castFromPointer(_NSURLSessionDownloadTaskResumeData.value, + retain: false, release: true) + .ref + .release(); + _NSURLSessionDownloadTaskResumeData.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringCreatePtr = _lookup< - ffi.NativeFunction< - CFAttributedStringRef Function(CFAllocatorRef, CFStringRef, - CFDictionaryRef)>>('CFAttributedStringCreate'); - late final _CFAttributedStringCreate = - _CFAttributedStringCreatePtr.asFunction< - CFAttributedStringRef Function( - CFAllocatorRef, CFStringRef, CFDictionaryRef)>(); + /// Key in the userInfo dictionary of an NSError received during a failed upload. + late final ffi.Pointer> + _NSURLSessionUploadTaskResumeData = + _lookup>('NSURLSessionUploadTaskResumeData'); - CFAttributedStringRef CFAttributedStringCreateWithSubstring( - CFAllocatorRef alloc, - CFAttributedStringRef aStr, - CFRange range, + objc.NSString get NSURLSessionUploadTaskResumeData => + objc.NSString.castFromPointer(_NSURLSessionUploadTaskResumeData.value, + retain: true, release: true); + + set NSURLSessionUploadTaskResumeData(objc.NSString value) { + objc.NSString.castFromPointer(_NSURLSessionUploadTaskResumeData.value, + retain: false, release: true) + .ref + .release(); + _NSURLSessionUploadTaskResumeData.value = + value.ref.retainAndReturnPointer(); + } + + NSRange NSUnionRange( + NSRange range1, + NSRange range2, ) { - return _CFAttributedStringCreateWithSubstring( - alloc, - aStr, - range, + return _NSUnionRange( + range1, + range2, ); } - late final _CFAttributedStringCreateWithSubstringPtr = _lookup< - ffi.NativeFunction< - CFAttributedStringRef Function(CFAllocatorRef, CFAttributedStringRef, - CFRange)>>('CFAttributedStringCreateWithSubstring'); - late final _CFAttributedStringCreateWithSubstring = - _CFAttributedStringCreateWithSubstringPtr.asFunction< - CFAttributedStringRef Function( - CFAllocatorRef, CFAttributedStringRef, CFRange)>(); + late final _NSUnionRangePtr = + _lookup>( + 'NSUnionRange'); + late final _NSUnionRange = + _NSUnionRangePtr.asFunction(); - CFAttributedStringRef CFAttributedStringCreateCopy( - CFAllocatorRef alloc, - CFAttributedStringRef aStr, + NSRange NSIntersectionRange( + NSRange range1, + NSRange range2, ) { - return _CFAttributedStringCreateCopy( - alloc, - aStr, + return _NSIntersectionRange( + range1, + range2, ); } - late final _CFAttributedStringCreateCopyPtr = _lookup< - ffi.NativeFunction< - CFAttributedStringRef Function(CFAllocatorRef, - CFAttributedStringRef)>>('CFAttributedStringCreateCopy'); - late final _CFAttributedStringCreateCopy = - _CFAttributedStringCreateCopyPtr.asFunction< - CFAttributedStringRef Function( - CFAllocatorRef, CFAttributedStringRef)>(); + late final _NSIntersectionRangePtr = + _lookup>( + 'NSIntersectionRange'); + late final _NSIntersectionRange = + _NSIntersectionRangePtr.asFunction(); - CFStringRef CFAttributedStringGetString( - CFAttributedStringRef aStr, + objc.NSString NSStringFromRange( + NSRange range, ) { - return _CFAttributedStringGetString( - aStr, - ); + return objc.NSString.castFromPointer( + _NSStringFromRange( + range, + ), + retain: true, + release: true); } - late final _CFAttributedStringGetStringPtr = - _lookup>( - 'CFAttributedStringGetString'); - late final _CFAttributedStringGetString = _CFAttributedStringGetStringPtr - .asFunction(); + late final _NSStringFromRangePtr = _lookup< + ffi.NativeFunction Function(NSRange)>>( + 'NSStringFromRange'); + late final _NSStringFromRange = _NSStringFromRangePtr.asFunction< + ffi.Pointer Function(NSRange)>(); - int CFAttributedStringGetLength( - CFAttributedStringRef aStr, + NSRange NSRangeFromString( + objc.NSString aString, ) { - return _CFAttributedStringGetLength( - aStr, + return _NSRangeFromString( + aString.ref.pointer, ); } - late final _CFAttributedStringGetLengthPtr = - _lookup>( - 'CFAttributedStringGetLength'); - late final _CFAttributedStringGetLength = _CFAttributedStringGetLengthPtr - .asFunction(); + late final _NSRangeFromStringPtr = _lookup< + ffi.NativeFunction)>>( + 'NSRangeFromString'); + late final _NSRangeFromString = _NSRangeFromStringPtr.asFunction< + NSRange Function(ffi.Pointer)>(); - CFDictionaryRef CFAttributedStringGetAttributes( - CFAttributedStringRef aStr, - int loc, - ffi.Pointer effectiveRange, - ) { - return _CFAttributedStringGetAttributes( - aStr, - loc, - effectiveRange, - ); + late final ffi.Pointer> + _NSItemProviderPreferredImageSizeKey = + _lookup>( + 'NSItemProviderPreferredImageSizeKey'); + + objc.NSString get NSItemProviderPreferredImageSizeKey => + objc.NSString.castFromPointer(_NSItemProviderPreferredImageSizeKey.value, + retain: true, release: true); + + set NSItemProviderPreferredImageSizeKey(objc.NSString value) { + objc.NSString.castFromPointer(_NSItemProviderPreferredImageSizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSItemProviderPreferredImageSizeKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringGetAttributesPtr = _lookup< - ffi.NativeFunction< - CFDictionaryRef Function(CFAttributedStringRef, CFIndex, - ffi.Pointer)>>('CFAttributedStringGetAttributes'); - late final _CFAttributedStringGetAttributes = - _CFAttributedStringGetAttributesPtr.asFunction< - CFDictionaryRef Function( - CFAttributedStringRef, int, ffi.Pointer)>(); + late final ffi.Pointer> + _NSExtensionJavaScriptPreprocessingResultsKey = + _lookup>( + 'NSExtensionJavaScriptPreprocessingResultsKey'); - CFTypeRef CFAttributedStringGetAttribute( - CFAttributedStringRef aStr, - int loc, - CFStringRef attrName, - ffi.Pointer effectiveRange, - ) { - return _CFAttributedStringGetAttribute( - aStr, - loc, - attrName, - effectiveRange, - ); + objc.NSString get NSExtensionJavaScriptPreprocessingResultsKey => + objc.NSString.castFromPointer( + _NSExtensionJavaScriptPreprocessingResultsKey.value, + retain: true, + release: true); + + set NSExtensionJavaScriptPreprocessingResultsKey(objc.NSString value) { + objc.NSString.castFromPointer( + _NSExtensionJavaScriptPreprocessingResultsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSExtensionJavaScriptPreprocessingResultsKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringGetAttributePtr = _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFAttributedStringRef, CFIndex, CFStringRef, - ffi.Pointer)>>('CFAttributedStringGetAttribute'); - late final _CFAttributedStringGetAttribute = - _CFAttributedStringGetAttributePtr.asFunction< - CFTypeRef Function( - CFAttributedStringRef, int, CFStringRef, ffi.Pointer)>(); + late final ffi.Pointer> + _NSExtensionJavaScriptFinalizeArgumentKey = + _lookup>( + 'NSExtensionJavaScriptFinalizeArgumentKey'); - CFDictionaryRef CFAttributedStringGetAttributesAndLongestEffectiveRange( - CFAttributedStringRef aStr, - int loc, - CFRange inRange, - ffi.Pointer longestEffectiveRange, - ) { - return _CFAttributedStringGetAttributesAndLongestEffectiveRange( - aStr, - loc, - inRange, - longestEffectiveRange, - ); + objc.NSString get NSExtensionJavaScriptFinalizeArgumentKey => + objc.NSString.castFromPointer( + _NSExtensionJavaScriptFinalizeArgumentKey.value, + retain: true, + release: true); + + set NSExtensionJavaScriptFinalizeArgumentKey(objc.NSString value) { + objc.NSString.castFromPointer( + _NSExtensionJavaScriptFinalizeArgumentKey.value, + retain: false, + release: true) + .ref + .release(); + _NSExtensionJavaScriptFinalizeArgumentKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringGetAttributesAndLongestEffectiveRangePtr = - _lookup< - ffi.NativeFunction< - CFDictionaryRef Function(CFAttributedStringRef, CFIndex, - CFRange, ffi.Pointer)>>( - 'CFAttributedStringGetAttributesAndLongestEffectiveRange'); - late final _CFAttributedStringGetAttributesAndLongestEffectiveRange = - _CFAttributedStringGetAttributesAndLongestEffectiveRangePtr.asFunction< - CFDictionaryRef Function( - CFAttributedStringRef, int, CFRange, ffi.Pointer)>(); + late final ffi.Pointer> + _NSItemProviderErrorDomain = + _lookup>('NSItemProviderErrorDomain'); - CFTypeRef CFAttributedStringGetAttributeAndLongestEffectiveRange( - CFAttributedStringRef aStr, - int loc, - CFStringRef attrName, - CFRange inRange, - ffi.Pointer longestEffectiveRange, - ) { - return _CFAttributedStringGetAttributeAndLongestEffectiveRange( - aStr, - loc, - attrName, - inRange, - longestEffectiveRange, - ); + objc.NSString get NSItemProviderErrorDomain => + objc.NSString.castFromPointer(_NSItemProviderErrorDomain.value, + retain: true, release: true); + + set NSItemProviderErrorDomain(objc.NSString value) { + objc.NSString.castFromPointer(_NSItemProviderErrorDomain.value, + retain: false, release: true) + .ref + .release(); + _NSItemProviderErrorDomain.value = value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringGetAttributeAndLongestEffectiveRangePtr = - _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFAttributedStringRef, CFIndex, - CFStringRef, CFRange, ffi.Pointer)>>( - 'CFAttributedStringGetAttributeAndLongestEffectiveRange'); - late final _CFAttributedStringGetAttributeAndLongestEffectiveRange = - _CFAttributedStringGetAttributeAndLongestEffectiveRangePtr.asFunction< - CFTypeRef Function(CFAttributedStringRef, int, CFStringRef, CFRange, - ffi.Pointer)>(); + late final ffi.Pointer _NSStringTransformLatinToKatakana = + _lookup('NSStringTransformLatinToKatakana'); - CFMutableAttributedStringRef CFAttributedStringCreateMutableCopy( - CFAllocatorRef alloc, - int maxLength, - CFAttributedStringRef aStr, - ) { - return _CFAttributedStringCreateMutableCopy( - alloc, - maxLength, - aStr, - ); + DartNSStringTransform get NSStringTransformLatinToKatakana => + objc.NSString.castFromPointer(_NSStringTransformLatinToKatakana.value, + retain: true, release: true); + + set NSStringTransformLatinToKatakana(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToKatakana.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToKatakana.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringCreateMutableCopyPtr = _lookup< - ffi.NativeFunction< - CFMutableAttributedStringRef Function(CFAllocatorRef, CFIndex, - CFAttributedStringRef)>>('CFAttributedStringCreateMutableCopy'); - late final _CFAttributedStringCreateMutableCopy = - _CFAttributedStringCreateMutableCopyPtr.asFunction< - CFMutableAttributedStringRef Function( - CFAllocatorRef, int, CFAttributedStringRef)>(); + late final ffi.Pointer _NSStringTransformLatinToHiragana = + _lookup('NSStringTransformLatinToHiragana'); - CFMutableAttributedStringRef CFAttributedStringCreateMutable( - CFAllocatorRef alloc, - int maxLength, - ) { - return _CFAttributedStringCreateMutable( - alloc, - maxLength, - ); + DartNSStringTransform get NSStringTransformLatinToHiragana => + objc.NSString.castFromPointer(_NSStringTransformLatinToHiragana.value, + retain: true, release: true); + + set NSStringTransformLatinToHiragana(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToHiragana.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToHiragana.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringCreateMutablePtr = _lookup< - ffi.NativeFunction< - CFMutableAttributedStringRef Function( - CFAllocatorRef, CFIndex)>>('CFAttributedStringCreateMutable'); - late final _CFAttributedStringCreateMutable = - _CFAttributedStringCreateMutablePtr.asFunction< - CFMutableAttributedStringRef Function(CFAllocatorRef, int)>(); + late final ffi.Pointer _NSStringTransformLatinToHangul = + _lookup('NSStringTransformLatinToHangul'); - void CFAttributedStringReplaceString( - CFMutableAttributedStringRef aStr, - CFRange range, - CFStringRef replacement, - ) { - return _CFAttributedStringReplaceString( - aStr, - range, - replacement, - ); + DartNSStringTransform get NSStringTransformLatinToHangul => + objc.NSString.castFromPointer(_NSStringTransformLatinToHangul.value, + retain: true, release: true); + + set NSStringTransformLatinToHangul(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToHangul.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToHangul.value = value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringReplaceStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableAttributedStringRef, CFRange, - CFStringRef)>>('CFAttributedStringReplaceString'); - late final _CFAttributedStringReplaceString = - _CFAttributedStringReplaceStringPtr.asFunction< - void Function(CFMutableAttributedStringRef, CFRange, CFStringRef)>(); + late final ffi.Pointer _NSStringTransformLatinToArabic = + _lookup('NSStringTransformLatinToArabic'); - CFMutableStringRef CFAttributedStringGetMutableString( - CFMutableAttributedStringRef aStr, - ) { - return _CFAttributedStringGetMutableString( - aStr, - ); + DartNSStringTransform get NSStringTransformLatinToArabic => + objc.NSString.castFromPointer(_NSStringTransformLatinToArabic.value, + retain: true, release: true); + + set NSStringTransformLatinToArabic(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToArabic.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToArabic.value = value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringGetMutableStringPtr = _lookup< - ffi.NativeFunction< - CFMutableStringRef Function(CFMutableAttributedStringRef)>>( - 'CFAttributedStringGetMutableString'); - late final _CFAttributedStringGetMutableString = - _CFAttributedStringGetMutableStringPtr.asFunction< - CFMutableStringRef Function(CFMutableAttributedStringRef)>(); + late final ffi.Pointer _NSStringTransformLatinToHebrew = + _lookup('NSStringTransformLatinToHebrew'); - void CFAttributedStringSetAttributes( - CFMutableAttributedStringRef aStr, - CFRange range, - CFDictionaryRef replacement, - int clearOtherAttributes, - ) { - return _CFAttributedStringSetAttributes( - aStr, - range, - replacement, - clearOtherAttributes, - ); + DartNSStringTransform get NSStringTransformLatinToHebrew => + objc.NSString.castFromPointer(_NSStringTransformLatinToHebrew.value, + retain: true, release: true); + + set NSStringTransformLatinToHebrew(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToHebrew.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToHebrew.value = value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringSetAttributesPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableAttributedStringRef, CFRange, - CFDictionaryRef, Boolean)>>('CFAttributedStringSetAttributes'); - late final _CFAttributedStringSetAttributes = - _CFAttributedStringSetAttributesPtr.asFunction< - void Function( - CFMutableAttributedStringRef, CFRange, CFDictionaryRef, int)>(); + late final ffi.Pointer _NSStringTransformLatinToThai = + _lookup('NSStringTransformLatinToThai'); - void CFAttributedStringSetAttribute( - CFMutableAttributedStringRef aStr, - CFRange range, - CFStringRef attrName, - CFTypeRef value, - ) { - return _CFAttributedStringSetAttribute( - aStr, - range, - attrName, - value, - ); + DartNSStringTransform get NSStringTransformLatinToThai => + objc.NSString.castFromPointer(_NSStringTransformLatinToThai.value, + retain: true, release: true); + + set NSStringTransformLatinToThai(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToThai.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToThai.value = value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringSetAttributePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableAttributedStringRef, CFRange, CFStringRef, - CFTypeRef)>>('CFAttributedStringSetAttribute'); - late final _CFAttributedStringSetAttribute = - _CFAttributedStringSetAttributePtr.asFunction< - void Function( - CFMutableAttributedStringRef, CFRange, CFStringRef, CFTypeRef)>(); + late final ffi.Pointer _NSStringTransformLatinToCyrillic = + _lookup('NSStringTransformLatinToCyrillic'); - void CFAttributedStringRemoveAttribute( - CFMutableAttributedStringRef aStr, - CFRange range, - CFStringRef attrName, - ) { - return _CFAttributedStringRemoveAttribute( - aStr, - range, - attrName, - ); + DartNSStringTransform get NSStringTransformLatinToCyrillic => + objc.NSString.castFromPointer(_NSStringTransformLatinToCyrillic.value, + retain: true, release: true); + + set NSStringTransformLatinToCyrillic(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToCyrillic.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToCyrillic.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringRemoveAttributePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableAttributedStringRef, CFRange, - CFStringRef)>>('CFAttributedStringRemoveAttribute'); - late final _CFAttributedStringRemoveAttribute = - _CFAttributedStringRemoveAttributePtr.asFunction< - void Function(CFMutableAttributedStringRef, CFRange, CFStringRef)>(); + late final ffi.Pointer _NSStringTransformLatinToGreek = + _lookup('NSStringTransformLatinToGreek'); - void CFAttributedStringReplaceAttributedString( - CFMutableAttributedStringRef aStr, - CFRange range, - CFAttributedStringRef replacement, - ) { - return _CFAttributedStringReplaceAttributedString( - aStr, - range, - replacement, - ); + DartNSStringTransform get NSStringTransformLatinToGreek => + objc.NSString.castFromPointer(_NSStringTransformLatinToGreek.value, + retain: true, release: true); + + set NSStringTransformLatinToGreek(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformLatinToGreek.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformLatinToGreek.value = value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringReplaceAttributedStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFMutableAttributedStringRef, CFRange, - CFAttributedStringRef)>>( - 'CFAttributedStringReplaceAttributedString'); - late final _CFAttributedStringReplaceAttributedString = - _CFAttributedStringReplaceAttributedStringPtr.asFunction< - void Function( - CFMutableAttributedStringRef, CFRange, CFAttributedStringRef)>(); + late final ffi.Pointer _NSStringTransformToLatin = + _lookup('NSStringTransformToLatin'); - void CFAttributedStringBeginEditing( - CFMutableAttributedStringRef aStr, - ) { - return _CFAttributedStringBeginEditing( - aStr, - ); + DartNSStringTransform get NSStringTransformToLatin => + objc.NSString.castFromPointer(_NSStringTransformToLatin.value, + retain: true, release: true); + + set NSStringTransformToLatin(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformToLatin.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformToLatin.value = value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringBeginEditingPtr = _lookup< - ffi.NativeFunction>( - 'CFAttributedStringBeginEditing'); - late final _CFAttributedStringBeginEditing = - _CFAttributedStringBeginEditingPtr.asFunction< - void Function(CFMutableAttributedStringRef)>(); + late final ffi.Pointer _NSStringTransformMandarinToLatin = + _lookup('NSStringTransformMandarinToLatin'); - void CFAttributedStringEndEditing( - CFMutableAttributedStringRef aStr, - ) { - return _CFAttributedStringEndEditing( - aStr, - ); + DartNSStringTransform get NSStringTransformMandarinToLatin => + objc.NSString.castFromPointer(_NSStringTransformMandarinToLatin.value, + retain: true, release: true); + + set NSStringTransformMandarinToLatin(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformMandarinToLatin.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformMandarinToLatin.value = + value.ref.retainAndReturnPointer(); } - late final _CFAttributedStringEndEditingPtr = _lookup< - ffi.NativeFunction>( - 'CFAttributedStringEndEditing'); - late final _CFAttributedStringEndEditing = _CFAttributedStringEndEditingPtr - .asFunction(); + late final ffi.Pointer + _NSStringTransformHiraganaToKatakana = + _lookup('NSStringTransformHiraganaToKatakana'); - int CFURLEnumeratorGetTypeID() { - return _CFURLEnumeratorGetTypeID(); + DartNSStringTransform get NSStringTransformHiraganaToKatakana => + objc.NSString.castFromPointer(_NSStringTransformHiraganaToKatakana.value, + retain: true, release: true); + + set NSStringTransformHiraganaToKatakana(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformHiraganaToKatakana.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformHiraganaToKatakana.value = + value.ref.retainAndReturnPointer(); } - late final _CFURLEnumeratorGetTypeIDPtr = - _lookup>( - 'CFURLEnumeratorGetTypeID'); - late final _CFURLEnumeratorGetTypeID = - _CFURLEnumeratorGetTypeIDPtr.asFunction(); + late final ffi.Pointer + _NSStringTransformFullwidthToHalfwidth = + _lookup('NSStringTransformFullwidthToHalfwidth'); - CFURLEnumeratorRef CFURLEnumeratorCreateForDirectoryURL( - CFAllocatorRef alloc, - CFURLRef directoryURL, - int option, - CFArrayRef propertyKeys, - ) { - return _CFURLEnumeratorCreateForDirectoryURL( - alloc, - directoryURL, - option, - propertyKeys, - ); + DartNSStringTransform get NSStringTransformFullwidthToHalfwidth => + objc.NSString.castFromPointer( + _NSStringTransformFullwidthToHalfwidth.value, + retain: true, + release: true); + + set NSStringTransformFullwidthToHalfwidth(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformFullwidthToHalfwidth.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformFullwidthToHalfwidth.value = + value.ref.retainAndReturnPointer(); } - late final _CFURLEnumeratorCreateForDirectoryURLPtr = _lookup< - ffi.NativeFunction< - CFURLEnumeratorRef Function(CFAllocatorRef, CFURLRef, ffi.Int32, - CFArrayRef)>>('CFURLEnumeratorCreateForDirectoryURL'); - late final _CFURLEnumeratorCreateForDirectoryURL = - _CFURLEnumeratorCreateForDirectoryURLPtr.asFunction< - CFURLEnumeratorRef Function( - CFAllocatorRef, CFURLRef, int, CFArrayRef)>(); + late final ffi.Pointer _NSStringTransformToXMLHex = + _lookup('NSStringTransformToXMLHex'); - CFURLEnumeratorRef CFURLEnumeratorCreateForMountedVolumes( - CFAllocatorRef alloc, - int option, - CFArrayRef propertyKeys, - ) { - return _CFURLEnumeratorCreateForMountedVolumes( - alloc, - option, - propertyKeys, - ); + DartNSStringTransform get NSStringTransformToXMLHex => + objc.NSString.castFromPointer(_NSStringTransformToXMLHex.value, + retain: true, release: true); + + set NSStringTransformToXMLHex(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformToXMLHex.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformToXMLHex.value = value.ref.retainAndReturnPointer(); } - late final _CFURLEnumeratorCreateForMountedVolumesPtr = _lookup< - ffi.NativeFunction< - CFURLEnumeratorRef Function(CFAllocatorRef, ffi.Int32, - CFArrayRef)>>('CFURLEnumeratorCreateForMountedVolumes'); - late final _CFURLEnumeratorCreateForMountedVolumes = - _CFURLEnumeratorCreateForMountedVolumesPtr.asFunction< - CFURLEnumeratorRef Function(CFAllocatorRef, int, CFArrayRef)>(); + late final ffi.Pointer _NSStringTransformToUnicodeName = + _lookup('NSStringTransformToUnicodeName'); - int CFURLEnumeratorGetNextURL( - CFURLEnumeratorRef enumerator, - ffi.Pointer url, - ffi.Pointer error, - ) { - return _CFURLEnumeratorGetNextURL( - enumerator, - url, - error, - ); + DartNSStringTransform get NSStringTransformToUnicodeName => + objc.NSString.castFromPointer(_NSStringTransformToUnicodeName.value, + retain: true, release: true); + + set NSStringTransformToUnicodeName(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformToUnicodeName.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformToUnicodeName.value = value.ref.retainAndReturnPointer(); } - late final _CFURLEnumeratorGetNextURLPtr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function(CFURLEnumeratorRef, ffi.Pointer, - ffi.Pointer)>>('CFURLEnumeratorGetNextURL'); - late final _CFURLEnumeratorGetNextURL = - _CFURLEnumeratorGetNextURLPtr.asFunction< - int Function(CFURLEnumeratorRef, ffi.Pointer, - ffi.Pointer)>(); + late final ffi.Pointer + _NSStringTransformStripCombiningMarks = + _lookup('NSStringTransformStripCombiningMarks'); - void CFURLEnumeratorSkipDescendents( - CFURLEnumeratorRef enumerator, - ) { - return _CFURLEnumeratorSkipDescendents( - enumerator, - ); + DartNSStringTransform get NSStringTransformStripCombiningMarks => + objc.NSString.castFromPointer(_NSStringTransformStripCombiningMarks.value, + retain: true, release: true); + + set NSStringTransformStripCombiningMarks(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformStripCombiningMarks.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformStripCombiningMarks.value = + value.ref.retainAndReturnPointer(); } - late final _CFURLEnumeratorSkipDescendentsPtr = - _lookup>( - 'CFURLEnumeratorSkipDescendents'); - late final _CFURLEnumeratorSkipDescendents = - _CFURLEnumeratorSkipDescendentsPtr.asFunction< - void Function(CFURLEnumeratorRef)>(); + late final ffi.Pointer _NSStringTransformStripDiacritics = + _lookup('NSStringTransformStripDiacritics'); - int CFURLEnumeratorGetDescendentLevel( - CFURLEnumeratorRef enumerator, - ) { - return _CFURLEnumeratorGetDescendentLevel( - enumerator, - ); + DartNSStringTransform get NSStringTransformStripDiacritics => + objc.NSString.castFromPointer(_NSStringTransformStripDiacritics.value, + retain: true, release: true); + + set NSStringTransformStripDiacritics(DartNSStringTransform value) { + objc.NSString.castFromPointer(_NSStringTransformStripDiacritics.value, + retain: false, release: true) + .ref + .release(); + _NSStringTransformStripDiacritics.value = + value.ref.retainAndReturnPointer(); } - late final _CFURLEnumeratorGetDescendentLevelPtr = - _lookup>( - 'CFURLEnumeratorGetDescendentLevel'); - late final _CFURLEnumeratorGetDescendentLevel = - _CFURLEnumeratorGetDescendentLevelPtr.asFunction< - int Function(CFURLEnumeratorRef)>(); + late final ffi.Pointer + _NSStringEncodingDetectionSuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionSuggestedEncodingsKey'); - int CFURLEnumeratorGetSourceDidChange( - CFURLEnumeratorRef enumerator, - ) { - return _CFURLEnumeratorGetSourceDidChange( - enumerator, - ); + DartNSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionSuggestedEncodingsKey => + objc.NSString.castFromPointer( + _NSStringEncodingDetectionSuggestedEncodingsKey.value, + retain: true, + release: true); + + set NSStringEncodingDetectionSuggestedEncodingsKey( + DartNSStringEncodingDetectionOptionsKey value) { + objc.NSString.castFromPointer( + _NSStringEncodingDetectionSuggestedEncodingsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSStringEncodingDetectionSuggestedEncodingsKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFURLEnumeratorGetSourceDidChangePtr = - _lookup>( - 'CFURLEnumeratorGetSourceDidChange'); - late final _CFURLEnumeratorGetSourceDidChange = - _CFURLEnumeratorGetSourceDidChangePtr.asFunction< - int Function(CFURLEnumeratorRef)>(); + late final ffi.Pointer + _NSStringEncodingDetectionDisallowedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionDisallowedEncodingsKey'); - acl_t acl_dup( - acl_t acl, - ) { - return _acl_dup( - acl, - ); + DartNSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionDisallowedEncodingsKey => + objc.NSString.castFromPointer( + _NSStringEncodingDetectionDisallowedEncodingsKey.value, + retain: true, + release: true); + + set NSStringEncodingDetectionDisallowedEncodingsKey( + DartNSStringEncodingDetectionOptionsKey value) { + objc.NSString.castFromPointer( + _NSStringEncodingDetectionDisallowedEncodingsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSStringEncodingDetectionDisallowedEncodingsKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_dupPtr = - _lookup>('acl_dup'); - late final _acl_dup = _acl_dupPtr.asFunction(); + late final ffi.Pointer + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey = + _lookup( + 'NSStringEncodingDetectionUseOnlySuggestedEncodingsKey'); - int acl_free( - ffi.Pointer obj_p, - ) { - return _acl_free( - obj_p, - ); + DartNSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionUseOnlySuggestedEncodingsKey => + objc.NSString.castFromPointer( + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value, + retain: true, + release: true); + + set NSStringEncodingDetectionUseOnlySuggestedEncodingsKey( + DartNSStringEncodingDetectionOptionsKey value) { + objc.NSString.castFromPointer( + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSStringEncodingDetectionUseOnlySuggestedEncodingsKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_freePtr = - _lookup)>>( - 'acl_free'); - late final _acl_free = - _acl_freePtr.asFunction)>(); + late final ffi.Pointer + _NSStringEncodingDetectionAllowLossyKey = + _lookup( + 'NSStringEncodingDetectionAllowLossyKey'); - acl_t acl_init( - int count, - ) { - return _acl_init( - count, - ); + DartNSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionAllowLossyKey => + objc.NSString.castFromPointer( + _NSStringEncodingDetectionAllowLossyKey.value, + retain: true, + release: true); + + set NSStringEncodingDetectionAllowLossyKey( + DartNSStringEncodingDetectionOptionsKey value) { + objc.NSString.castFromPointer(_NSStringEncodingDetectionAllowLossyKey.value, + retain: false, release: true) + .ref + .release(); + _NSStringEncodingDetectionAllowLossyKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_initPtr = - _lookup>('acl_init'); - late final _acl_init = _acl_initPtr.asFunction(); + late final ffi.Pointer + _NSStringEncodingDetectionFromWindowsKey = + _lookup( + 'NSStringEncodingDetectionFromWindowsKey'); - int acl_copy_entry( - acl_entry_t dest_d, - acl_entry_t src_d, - ) { - return _acl_copy_entry( - dest_d, - src_d, - ); + DartNSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionFromWindowsKey => + objc.NSString.castFromPointer( + _NSStringEncodingDetectionFromWindowsKey.value, + retain: true, + release: true); + + set NSStringEncodingDetectionFromWindowsKey( + DartNSStringEncodingDetectionOptionsKey value) { + objc.NSString.castFromPointer( + _NSStringEncodingDetectionFromWindowsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSStringEncodingDetectionFromWindowsKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_copy_entryPtr = - _lookup>( - 'acl_copy_entry'); - late final _acl_copy_entry = - _acl_copy_entryPtr.asFunction(); + late final ffi.Pointer + _NSStringEncodingDetectionLossySubstitutionKey = + _lookup( + 'NSStringEncodingDetectionLossySubstitutionKey'); - int acl_create_entry( - ffi.Pointer acl_p, - ffi.Pointer entry_p, - ) { - return _acl_create_entry( - acl_p, - entry_p, - ); + DartNSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLossySubstitutionKey => + objc.NSString.castFromPointer( + _NSStringEncodingDetectionLossySubstitutionKey.value, + retain: true, + release: true); + + set NSStringEncodingDetectionLossySubstitutionKey( + DartNSStringEncodingDetectionOptionsKey value) { + objc.NSString.castFromPointer( + _NSStringEncodingDetectionLossySubstitutionKey.value, + retain: false, + release: true) + .ref + .release(); + _NSStringEncodingDetectionLossySubstitutionKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_create_entryPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('acl_create_entry'); - late final _acl_create_entry = _acl_create_entryPtr - .asFunction, ffi.Pointer)>(); + late final ffi.Pointer + _NSStringEncodingDetectionLikelyLanguageKey = + _lookup( + 'NSStringEncodingDetectionLikelyLanguageKey'); - int acl_create_entry_np( - ffi.Pointer acl_p, - ffi.Pointer entry_p, - int entry_index, - ) { - return _acl_create_entry_np( - acl_p, - entry_p, - entry_index, - ); + DartNSStringEncodingDetectionOptionsKey + get NSStringEncodingDetectionLikelyLanguageKey => + objc.NSString.castFromPointer( + _NSStringEncodingDetectionLikelyLanguageKey.value, + retain: true, + release: true); + + set NSStringEncodingDetectionLikelyLanguageKey( + DartNSStringEncodingDetectionOptionsKey value) { + objc.NSString.castFromPointer( + _NSStringEncodingDetectionLikelyLanguageKey.value, + retain: false, + release: true) + .ref + .release(); + _NSStringEncodingDetectionLikelyLanguageKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_create_entry_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Int)>>('acl_create_entry_np'); - late final _acl_create_entry_np = _acl_create_entry_npPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); + late final ffi.Pointer _NSCharacterConversionException = + _lookup('NSCharacterConversionException'); - int acl_delete_entry( - acl_t acl, - acl_entry_t entry_d, - ) { - return _acl_delete_entry( - acl, - entry_d, - ); + DartNSExceptionName get NSCharacterConversionException => + objc.NSString.castFromPointer(_NSCharacterConversionException.value, + retain: true, release: true); + + set NSCharacterConversionException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSCharacterConversionException.value, + retain: false, release: true) + .ref + .release(); + _NSCharacterConversionException.value = value.ref.retainAndReturnPointer(); } - late final _acl_delete_entryPtr = - _lookup>( - 'acl_delete_entry'); - late final _acl_delete_entry = - _acl_delete_entryPtr.asFunction(); + late final ffi.Pointer _NSParseErrorException = + _lookup('NSParseErrorException'); - int acl_get_entry( - acl_t acl, - int entry_id, - ffi.Pointer entry_p, - ) { - return _acl_get_entry( - acl, - entry_id, - entry_p, - ); + DartNSExceptionName get NSParseErrorException => + objc.NSString.castFromPointer(_NSParseErrorException.value, + retain: true, release: true); + + set NSParseErrorException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSParseErrorException.value, + retain: false, release: true) + .ref + .release(); + _NSParseErrorException.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_entryPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - acl_t, ffi.Int, ffi.Pointer)>>('acl_get_entry'); - late final _acl_get_entry = _acl_get_entryPtr - .asFunction)>(); + late final ffi.Pointer> + _NSHTTPPropertyStatusCodeKey = + _lookup>('NSHTTPPropertyStatusCodeKey'); - int acl_valid( - acl_t acl, - ) { - return _acl_valid( - acl, - ); - } + objc.NSString get NSHTTPPropertyStatusCodeKey => + objc.NSString.castFromPointer(_NSHTTPPropertyStatusCodeKey.value, + retain: true, release: true); - late final _acl_validPtr = - _lookup>('acl_valid'); - late final _acl_valid = _acl_validPtr.asFunction(); + late final ffi.Pointer> + _NSHTTPPropertyStatusReasonKey = + _lookup>('NSHTTPPropertyStatusReasonKey'); - int acl_valid_fd_np( - int fd, - int type, - acl_t acl, - ) { - return _acl_valid_fd_np( - fd, - type, - acl, - ); + objc.NSString get NSHTTPPropertyStatusReasonKey => + objc.NSString.castFromPointer(_NSHTTPPropertyStatusReasonKey.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSHTTPPropertyServerHTTPVersionKey = + _lookup>( + 'NSHTTPPropertyServerHTTPVersionKey'); + + objc.NSString get NSHTTPPropertyServerHTTPVersionKey => + objc.NSString.castFromPointer(_NSHTTPPropertyServerHTTPVersionKey.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSHTTPPropertyRedirectionHeadersKey = + _lookup>( + 'NSHTTPPropertyRedirectionHeadersKey'); + + objc.NSString get NSHTTPPropertyRedirectionHeadersKey => + objc.NSString.castFromPointer(_NSHTTPPropertyRedirectionHeadersKey.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSHTTPPropertyErrorPageDataKey = + _lookup>('NSHTTPPropertyErrorPageDataKey'); + + objc.NSString get NSHTTPPropertyErrorPageDataKey => + objc.NSString.castFromPointer(_NSHTTPPropertyErrorPageDataKey.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSHTTPPropertyHTTPProxy = + _lookup>('NSHTTPPropertyHTTPProxy'); + + objc.NSString get NSHTTPPropertyHTTPProxy => + objc.NSString.castFromPointer(_NSHTTPPropertyHTTPProxy.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSFTPPropertyUserLoginKey = + _lookup>('NSFTPPropertyUserLoginKey'); + + objc.NSString get NSFTPPropertyUserLoginKey => + objc.NSString.castFromPointer(_NSFTPPropertyUserLoginKey.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSFTPPropertyUserPasswordKey = + _lookup>('NSFTPPropertyUserPasswordKey'); + + objc.NSString get NSFTPPropertyUserPasswordKey => + objc.NSString.castFromPointer(_NSFTPPropertyUserPasswordKey.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSFTPPropertyActiveTransferModeKey = + _lookup>( + 'NSFTPPropertyActiveTransferModeKey'); + + objc.NSString get NSFTPPropertyActiveTransferModeKey => + objc.NSString.castFromPointer(_NSFTPPropertyActiveTransferModeKey.value, + retain: true, release: true); + + late final ffi.Pointer> + _NSFTPPropertyFileOffsetKey = + _lookup>('NSFTPPropertyFileOffsetKey'); + + objc.NSString get NSFTPPropertyFileOffsetKey => + objc.NSString.castFromPointer(_NSFTPPropertyFileOffsetKey.value, + retain: true, release: true); + + late final ffi.Pointer> _NSFTPPropertyFTPProxy = + _lookup>('NSFTPPropertyFTPProxy'); + + objc.NSString get NSFTPPropertyFTPProxy => + objc.NSString.castFromPointer(_NSFTPPropertyFTPProxy.value, + retain: true, release: true); + + /// A string constant for the "file" URL scheme. If you are using this to compare to a URL's scheme to see if it is a file URL, you should instead use the NSURL fileURL property -- the fileURL property is much faster. + late final ffi.Pointer> _NSURLFileScheme = + _lookup>('NSURLFileScheme'); + + objc.NSString get NSURLFileScheme => + objc.NSString.castFromPointer(_NSURLFileScheme.value, + retain: true, release: true); + + set NSURLFileScheme(objc.NSString value) { + objc.NSString.castFromPointer(_NSURLFileScheme.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileScheme.value = value.ref.retainAndReturnPointer(); } - late final _acl_valid_fd_npPtr = - _lookup>( - 'acl_valid_fd_np'); - late final _acl_valid_fd_np = - _acl_valid_fd_npPtr.asFunction(); + /// Key for the resource properties that have not been set after setResourceValues:error: returns an error, returned as an array of of strings. + late final ffi.Pointer _NSURLKeysOfUnsetValuesKey = + _lookup('NSURLKeysOfUnsetValuesKey'); - int acl_valid_file_np( - ffi.Pointer path, - int type, - acl_t acl, - ) { - return _acl_valid_file_np( - path, - type, - acl, - ); + DartNSURLResourceKey get NSURLKeysOfUnsetValuesKey => + objc.NSString.castFromPointer(_NSURLKeysOfUnsetValuesKey.value, + retain: true, release: true); + + set NSURLKeysOfUnsetValuesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLKeysOfUnsetValuesKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLKeysOfUnsetValuesKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_valid_file_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int32, acl_t)>>('acl_valid_file_np'); - late final _acl_valid_file_np = _acl_valid_file_npPtr - .asFunction, int, acl_t)>(); + /// The resource name provided by the file system (Read-write, value type NSString) + late final ffi.Pointer _NSURLNameKey = + _lookup('NSURLNameKey'); - int acl_valid_link_np( - ffi.Pointer path, - int type, - acl_t acl, - ) { - return _acl_valid_link_np( - path, - type, - acl, - ); + DartNSURLResourceKey get NSURLNameKey => + objc.NSString.castFromPointer(_NSURLNameKey.value, + retain: true, release: true); + + set NSURLNameKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLNameKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLNameKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_valid_link_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int32, acl_t)>>('acl_valid_link_np'); - late final _acl_valid_link_np = _acl_valid_link_npPtr - .asFunction, int, acl_t)>(); + /// Localized or extension-hidden name as displayed to users (Read-only, value type NSString) + late final ffi.Pointer _NSURLLocalizedNameKey = + _lookup('NSURLLocalizedNameKey'); - int acl_add_perm( - acl_permset_t permset_d, - int perm, - ) { - return _acl_add_perm( - permset_d, - perm, - ); + DartNSURLResourceKey get NSURLLocalizedNameKey => + objc.NSString.castFromPointer(_NSURLLocalizedNameKey.value, + retain: true, release: true); + + set NSURLLocalizedNameKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLLocalizedNameKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLLocalizedNameKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_add_permPtr = - _lookup>( - 'acl_add_perm'); - late final _acl_add_perm = - _acl_add_permPtr.asFunction(); + /// True for regular files (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsRegularFileKey = + _lookup('NSURLIsRegularFileKey'); - int acl_calc_mask( - ffi.Pointer acl_p, - ) { - return _acl_calc_mask( - acl_p, - ); + DartNSURLResourceKey get NSURLIsRegularFileKey => + objc.NSString.castFromPointer(_NSURLIsRegularFileKey.value, + retain: true, release: true); + + set NSURLIsRegularFileKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsRegularFileKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsRegularFileKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_calc_maskPtr = - _lookup)>>( - 'acl_calc_mask'); - late final _acl_calc_mask = - _acl_calc_maskPtr.asFunction)>(); + /// True for directories (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsDirectoryKey = + _lookup('NSURLIsDirectoryKey'); - int acl_clear_perms( - acl_permset_t permset_d, - ) { - return _acl_clear_perms( - permset_d, - ); + DartNSURLResourceKey get NSURLIsDirectoryKey => + objc.NSString.castFromPointer(_NSURLIsDirectoryKey.value, + retain: true, release: true); + + set NSURLIsDirectoryKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsDirectoryKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsDirectoryKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_clear_permsPtr = - _lookup>( - 'acl_clear_perms'); - late final _acl_clear_perms = - _acl_clear_permsPtr.asFunction(); + /// True for symlinks (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsSymbolicLinkKey = + _lookup('NSURLIsSymbolicLinkKey'); - int acl_delete_perm( - acl_permset_t permset_d, - int perm, - ) { - return _acl_delete_perm( - permset_d, - perm, - ); + DartNSURLResourceKey get NSURLIsSymbolicLinkKey => + objc.NSString.castFromPointer(_NSURLIsSymbolicLinkKey.value, + retain: true, release: true); + + set NSURLIsSymbolicLinkKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsSymbolicLinkKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsSymbolicLinkKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_delete_permPtr = - _lookup>( - 'acl_delete_perm'); - late final _acl_delete_perm = - _acl_delete_permPtr.asFunction(); + /// True for the root directory of a volume (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsVolumeKey = + _lookup('NSURLIsVolumeKey'); - int acl_get_perm_np( - acl_permset_t permset_d, - int perm, - ) { - return _acl_get_perm_np( - permset_d, - perm, - ); + DartNSURLResourceKey get NSURLIsVolumeKey => + objc.NSString.castFromPointer(_NSURLIsVolumeKey.value, + retain: true, release: true); + + set NSURLIsVolumeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsVolumeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsVolumeKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_perm_npPtr = - _lookup>( - 'acl_get_perm_np'); - late final _acl_get_perm_np = - _acl_get_perm_npPtr.asFunction(); + /// True for packaged directories (Read-only 10_6 and 10_7, read-write 10_8, value type boolean NSNumber). Note: You can only set or clear this property on directories; if you try to set this property on non-directory objects, the property is ignored. If the directory is a package for some other reason (extension type, etc), setting this property to false will have no effect. + late final ffi.Pointer _NSURLIsPackageKey = + _lookup('NSURLIsPackageKey'); - int acl_get_permset( - acl_entry_t entry_d, - ffi.Pointer permset_p, - ) { - return _acl_get_permset( - entry_d, - permset_p, - ); + DartNSURLResourceKey get NSURLIsPackageKey => + objc.NSString.castFromPointer(_NSURLIsPackageKey.value, + retain: true, release: true); + + set NSURLIsPackageKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsPackageKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsPackageKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_permsetPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - acl_entry_t, ffi.Pointer)>>('acl_get_permset'); - late final _acl_get_permset = _acl_get_permsetPtr - .asFunction)>(); + /// True if resource is an application (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsApplicationKey = + _lookup('NSURLIsApplicationKey'); - int acl_set_permset( - acl_entry_t entry_d, - acl_permset_t permset_d, - ) { - return _acl_set_permset( - entry_d, - permset_d, - ); + DartNSURLResourceKey get NSURLIsApplicationKey => + objc.NSString.castFromPointer(_NSURLIsApplicationKey.value, + retain: true, release: true); + + set NSURLIsApplicationKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsApplicationKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsApplicationKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_permsetPtr = - _lookup>( - 'acl_set_permset'); - late final _acl_set_permset = _acl_set_permsetPtr - .asFunction(); + /// True if the resource is scriptable. Only applies to applications (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLApplicationIsScriptableKey = + _lookup('NSURLApplicationIsScriptableKey'); - int acl_maximal_permset_mask_np( - ffi.Pointer mask_p, - ) { - return _acl_maximal_permset_mask_np( - mask_p, - ); + DartNSURLResourceKey get NSURLApplicationIsScriptableKey => + objc.NSString.castFromPointer(_NSURLApplicationIsScriptableKey.value, + retain: true, release: true); + + set NSURLApplicationIsScriptableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLApplicationIsScriptableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLApplicationIsScriptableKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_maximal_permset_mask_npPtr = _lookup< - ffi - .NativeFunction)>>( - 'acl_maximal_permset_mask_np'); - late final _acl_maximal_permset_mask_np = _acl_maximal_permset_mask_npPtr - .asFunction)>(); + /// True for system-immutable resources (Read-write, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsSystemImmutableKey = + _lookup('NSURLIsSystemImmutableKey'); - int acl_get_permset_mask_np( - acl_entry_t entry_d, - ffi.Pointer mask_p, - ) { - return _acl_get_permset_mask_np( - entry_d, - mask_p, - ); + DartNSURLResourceKey get NSURLIsSystemImmutableKey => + objc.NSString.castFromPointer(_NSURLIsSystemImmutableKey.value, + retain: true, release: true); + + set NSURLIsSystemImmutableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsSystemImmutableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsSystemImmutableKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_permset_mask_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(acl_entry_t, - ffi.Pointer)>>('acl_get_permset_mask_np'); - late final _acl_get_permset_mask_np = _acl_get_permset_mask_npPtr - .asFunction)>(); + /// True for user-immutable resources (Read-write, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsUserImmutableKey = + _lookup('NSURLIsUserImmutableKey'); - int acl_set_permset_mask_np( - acl_entry_t entry_d, - int mask, - ) { - return _acl_set_permset_mask_np( - entry_d, - mask, - ); + DartNSURLResourceKey get NSURLIsUserImmutableKey => + objc.NSString.castFromPointer(_NSURLIsUserImmutableKey.value, + retain: true, release: true); + + set NSURLIsUserImmutableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsUserImmutableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsUserImmutableKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_permset_mask_npPtr = _lookup< - ffi - .NativeFunction>( - 'acl_set_permset_mask_np'); - late final _acl_set_permset_mask_np = - _acl_set_permset_mask_npPtr.asFunction(); + /// True for resources normally not displayed to users (Read-write, value type boolean NSNumber). Note: If the resource is a hidden because its name starts with a period, setting this property to false will not change the property. + late final ffi.Pointer _NSURLIsHiddenKey = + _lookup('NSURLIsHiddenKey'); - int acl_add_flag_np( - acl_flagset_t flagset_d, - int flag, - ) { - return _acl_add_flag_np( - flagset_d, - flag, - ); + DartNSURLResourceKey get NSURLIsHiddenKey => + objc.NSString.castFromPointer(_NSURLIsHiddenKey.value, + retain: true, release: true); + + set NSURLIsHiddenKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsHiddenKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsHiddenKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_add_flag_npPtr = - _lookup>( - 'acl_add_flag_np'); - late final _acl_add_flag_np = - _acl_add_flag_npPtr.asFunction(); + /// True for resources whose filename extension is removed from the localized name property (Read-write, value type boolean NSNumber) + late final ffi.Pointer _NSURLHasHiddenExtensionKey = + _lookup('NSURLHasHiddenExtensionKey'); - int acl_clear_flags_np( - acl_flagset_t flagset_d, - ) { - return _acl_clear_flags_np( - flagset_d, - ); + DartNSURLResourceKey get NSURLHasHiddenExtensionKey => + objc.NSString.castFromPointer(_NSURLHasHiddenExtensionKey.value, + retain: true, release: true); + + set NSURLHasHiddenExtensionKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLHasHiddenExtensionKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLHasHiddenExtensionKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_clear_flags_npPtr = - _lookup>( - 'acl_clear_flags_np'); - late final _acl_clear_flags_np = - _acl_clear_flags_npPtr.asFunction(); + /// The date the resource was created (Read-write, value type NSDate) + late final ffi.Pointer _NSURLCreationDateKey = + _lookup('NSURLCreationDateKey'); - int acl_delete_flag_np( - acl_flagset_t flagset_d, - int flag, - ) { - return _acl_delete_flag_np( - flagset_d, - flag, - ); + DartNSURLResourceKey get NSURLCreationDateKey => + objc.NSString.castFromPointer(_NSURLCreationDateKey.value, + retain: true, release: true); + + set NSURLCreationDateKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLCreationDateKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLCreationDateKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_delete_flag_npPtr = - _lookup>( - 'acl_delete_flag_np'); - late final _acl_delete_flag_np = - _acl_delete_flag_npPtr.asFunction(); + /// The date the resource was last accessed (Read-write, value type NSDate) + late final ffi.Pointer _NSURLContentAccessDateKey = + _lookup('NSURLContentAccessDateKey'); - int acl_get_flag_np( - acl_flagset_t flagset_d, - int flag, - ) { - return _acl_get_flag_np( - flagset_d, - flag, - ); + DartNSURLResourceKey get NSURLContentAccessDateKey => + objc.NSString.castFromPointer(_NSURLContentAccessDateKey.value, + retain: true, release: true); + + set NSURLContentAccessDateKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLContentAccessDateKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLContentAccessDateKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_flag_npPtr = - _lookup>( - 'acl_get_flag_np'); - late final _acl_get_flag_np = - _acl_get_flag_npPtr.asFunction(); + /// The time the resource content was last modified (Read-write, value type NSDate) + late final ffi.Pointer _NSURLContentModificationDateKey = + _lookup('NSURLContentModificationDateKey'); - int acl_get_flagset_np( - ffi.Pointer obj_p, - ffi.Pointer flagset_p, - ) { - return _acl_get_flagset_np( - obj_p, - flagset_p, - ); + DartNSURLResourceKey get NSURLContentModificationDateKey => + objc.NSString.castFromPointer(_NSURLContentModificationDateKey.value, + retain: true, release: true); + + set NSURLContentModificationDateKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLContentModificationDateKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLContentModificationDateKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_flagset_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, - ffi.Pointer)>>('acl_get_flagset_np'); - late final _acl_get_flagset_np = _acl_get_flagset_npPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); + /// The time the resource's attributes were last modified (Read-only, value type NSDate) + late final ffi.Pointer _NSURLAttributeModificationDateKey = + _lookup('NSURLAttributeModificationDateKey'); - int acl_set_flagset_np( - ffi.Pointer obj_p, - acl_flagset_t flagset_d, - ) { - return _acl_set_flagset_np( - obj_p, - flagset_d, - ); + DartNSURLResourceKey get NSURLAttributeModificationDateKey => + objc.NSString.castFromPointer(_NSURLAttributeModificationDateKey.value, + retain: true, release: true); + + set NSURLAttributeModificationDateKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLAttributeModificationDateKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLAttributeModificationDateKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_set_flagset_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, acl_flagset_t)>>('acl_set_flagset_np'); - late final _acl_set_flagset_np = _acl_set_flagset_npPtr - .asFunction, acl_flagset_t)>(); + /// Number of hard links to the resource (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLLinkCountKey = + _lookup('NSURLLinkCountKey'); - ffi.Pointer acl_get_qualifier( - acl_entry_t entry_d, - ) { - return _acl_get_qualifier( - entry_d, - ); + DartNSURLResourceKey get NSURLLinkCountKey => + objc.NSString.castFromPointer(_NSURLLinkCountKey.value, + retain: true, release: true); + + set NSURLLinkCountKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLLinkCountKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLLinkCountKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_qualifierPtr = - _lookup Function(acl_entry_t)>>( - 'acl_get_qualifier'); - late final _acl_get_qualifier = _acl_get_qualifierPtr - .asFunction Function(acl_entry_t)>(); + /// The resource's parent directory, if any (Read-only, value type NSURL) + late final ffi.Pointer _NSURLParentDirectoryURLKey = + _lookup('NSURLParentDirectoryURLKey'); - int acl_get_tag_type( - acl_entry_t entry_d, - ffi.Pointer tag_type_p, - ) { - return _acl_get_tag_type( - entry_d, - tag_type_p, - ); + DartNSURLResourceKey get NSURLParentDirectoryURLKey => + objc.NSString.castFromPointer(_NSURLParentDirectoryURLKey.value, + retain: true, release: true); + + set NSURLParentDirectoryURLKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLParentDirectoryURLKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLParentDirectoryURLKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_tag_typePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - acl_entry_t, ffi.Pointer)>>('acl_get_tag_type'); - late final _acl_get_tag_type = _acl_get_tag_typePtr - .asFunction)>(); + /// URL of the volume on which the resource is stored (Read-only, value type NSURL) + late final ffi.Pointer _NSURLVolumeURLKey = + _lookup('NSURLVolumeURLKey'); - int acl_set_qualifier( - acl_entry_t entry_d, - ffi.Pointer tag_qualifier_p, - ) { - return _acl_set_qualifier( - entry_d, - tag_qualifier_p, - ); + DartNSURLResourceKey get NSURLVolumeURLKey => + objc.NSString.castFromPointer(_NSURLVolumeURLKey.value, + retain: true, release: true); + + set NSURLVolumeURLKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeURLKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeURLKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_qualifierPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - acl_entry_t, ffi.Pointer)>>('acl_set_qualifier'); - late final _acl_set_qualifier = _acl_set_qualifierPtr - .asFunction)>(); + /// Uniform type identifier (UTI) for the resource (Read-only, value type NSString) + late final ffi.Pointer _NSURLTypeIdentifierKey = + _lookup('NSURLTypeIdentifierKey'); - int acl_set_tag_type( - acl_entry_t entry_d, - int tag_type, - ) { - return _acl_set_tag_type( - entry_d, - tag_type, - ); + DartNSURLResourceKey get NSURLTypeIdentifierKey => + objc.NSString.castFromPointer(_NSURLTypeIdentifierKey.value, + retain: true, release: true); + + set NSURLTypeIdentifierKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLTypeIdentifierKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLTypeIdentifierKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_tag_typePtr = - _lookup>( - 'acl_set_tag_type'); - late final _acl_set_tag_type = - _acl_set_tag_typePtr.asFunction(); + /// File type (UTType) for the resource (Read-only, value type UTType) + late final ffi.Pointer _NSURLContentTypeKey = + _lookup('NSURLContentTypeKey'); - int acl_delete_def_file( - ffi.Pointer path_p, - ) { - return _acl_delete_def_file( - path_p, - ); + DartNSURLResourceKey get NSURLContentTypeKey => + objc.NSString.castFromPointer(_NSURLContentTypeKey.value, + retain: true, release: true); + + set NSURLContentTypeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLContentTypeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLContentTypeKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_delete_def_filePtr = - _lookup)>>( - 'acl_delete_def_file'); - late final _acl_delete_def_file = - _acl_delete_def_filePtr.asFunction)>(); + /// User-visible type or "kind" description (Read-only, value type NSString) + late final ffi.Pointer _NSURLLocalizedTypeDescriptionKey = + _lookup('NSURLLocalizedTypeDescriptionKey'); - acl_t acl_get_fd( - int fd, - ) { - return _acl_get_fd( - fd, - ); + DartNSURLResourceKey get NSURLLocalizedTypeDescriptionKey => + objc.NSString.castFromPointer(_NSURLLocalizedTypeDescriptionKey.value, + retain: true, release: true); + + set NSURLLocalizedTypeDescriptionKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLLocalizedTypeDescriptionKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLLocalizedTypeDescriptionKey.value = + value.ref.retainAndReturnPointer(); } - late final _acl_get_fdPtr = - _lookup>('acl_get_fd'); - late final _acl_get_fd = _acl_get_fdPtr.asFunction(); + /// The label number assigned to the resource (Read-write, value type NSNumber) + late final ffi.Pointer _NSURLLabelNumberKey = + _lookup('NSURLLabelNumberKey'); - acl_t acl_get_fd_np( - int fd, - int type, - ) { - return _acl_get_fd_np( - fd, - type, - ); + DartNSURLResourceKey get NSURLLabelNumberKey => + objc.NSString.castFromPointer(_NSURLLabelNumberKey.value, + retain: true, release: true); + + set NSURLLabelNumberKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLLabelNumberKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLLabelNumberKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_fd_npPtr = - _lookup>( - 'acl_get_fd_np'); - late final _acl_get_fd_np = - _acl_get_fd_npPtr.asFunction(); + /// The color of the assigned label (Read-only, value type NSColor) + late final ffi.Pointer _NSURLLabelColorKey = + _lookup('NSURLLabelColorKey'); - acl_t acl_get_file( - ffi.Pointer path_p, - int type, - ) { - return _acl_get_file( - path_p, - type, - ); + DartNSURLResourceKey get NSURLLabelColorKey => + objc.NSString.castFromPointer(_NSURLLabelColorKey.value, + retain: true, release: true); + + set NSURLLabelColorKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLLabelColorKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLLabelColorKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_filePtr = _lookup< - ffi.NativeFunction, ffi.Int32)>>( - 'acl_get_file'); - late final _acl_get_file = - _acl_get_filePtr.asFunction, int)>(); + /// The user-visible label text (Read-only, value type NSString) + late final ffi.Pointer _NSURLLocalizedLabelKey = + _lookup('NSURLLocalizedLabelKey'); - acl_t acl_get_link_np( - ffi.Pointer path_p, - int type, - ) { - return _acl_get_link_np( - path_p, - type, - ); + DartNSURLResourceKey get NSURLLocalizedLabelKey => + objc.NSString.castFromPointer(_NSURLLocalizedLabelKey.value, + retain: true, release: true); + + set NSURLLocalizedLabelKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLLocalizedLabelKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLLocalizedLabelKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_get_link_npPtr = _lookup< - ffi.NativeFunction, ffi.Int32)>>( - 'acl_get_link_np'); - late final _acl_get_link_np = _acl_get_link_npPtr - .asFunction, int)>(); + /// The icon normally displayed for the resource (Read-only, value type NSImage) + late final ffi.Pointer _NSURLEffectiveIconKey = + _lookup('NSURLEffectiveIconKey'); - int acl_set_fd( - int fd, - acl_t acl, - ) { - return _acl_set_fd( - fd, - acl, - ); + DartNSURLResourceKey get NSURLEffectiveIconKey => + objc.NSString.castFromPointer(_NSURLEffectiveIconKey.value, + retain: true, release: true); + + set NSURLEffectiveIconKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLEffectiveIconKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLEffectiveIconKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_fdPtr = - _lookup>( - 'acl_set_fd'); - late final _acl_set_fd = - _acl_set_fdPtr.asFunction(); + /// The custom icon assigned to the resource, if any (Currently not implemented, value type NSImage) + late final ffi.Pointer _NSURLCustomIconKey = + _lookup('NSURLCustomIconKey'); - int acl_set_fd_np( - int fd, - acl_t acl, - int acl_type, - ) { - return _acl_set_fd_np( - fd, - acl, - acl_type, - ); + DartNSURLResourceKey get NSURLCustomIconKey => + objc.NSString.castFromPointer(_NSURLCustomIconKey.value, + retain: true, release: true); + + set NSURLCustomIconKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLCustomIconKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLCustomIconKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_fd_npPtr = - _lookup>( - 'acl_set_fd_np'); - late final _acl_set_fd_np = - _acl_set_fd_npPtr.asFunction(); + /// An identifier which can be used to compare two file system objects for equality using -isEqual (i.e, two object identifiers are equal if they have the same file system path or if the paths are linked to same inode on the same file system). This identifier is not persistent across system restarts. (Read-only, value type id ) + late final ffi.Pointer _NSURLFileResourceIdentifierKey = + _lookup('NSURLFileResourceIdentifierKey'); - int acl_set_file( - ffi.Pointer path_p, - int type, - acl_t acl, - ) { - return _acl_set_file( - path_p, - type, - acl, - ); + DartNSURLResourceKey get NSURLFileResourceIdentifierKey => + objc.NSString.castFromPointer(_NSURLFileResourceIdentifierKey.value, + retain: true, release: true); + + set NSURLFileResourceIdentifierKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileResourceIdentifierKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceIdentifierKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_filePtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int32, acl_t)>>('acl_set_file'); - late final _acl_set_file = _acl_set_filePtr - .asFunction, int, acl_t)>(); + /// An identifier that can be used to identify the volume the file system object is on. Other objects on the same volume will have the same volume identifier and can be compared using for equality using -isEqual. This identifier is not persistent across system restarts. (Read-only, value type id ) + late final ffi.Pointer _NSURLVolumeIdentifierKey = + _lookup('NSURLVolumeIdentifierKey'); - int acl_set_link_np( - ffi.Pointer path_p, - int type, - acl_t acl, - ) { - return _acl_set_link_np( - path_p, - type, - acl, - ); + DartNSURLResourceKey get NSURLVolumeIdentifierKey => + objc.NSString.castFromPointer(_NSURLVolumeIdentifierKey.value, + retain: true, release: true); + + set NSURLVolumeIdentifierKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIdentifierKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIdentifierKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_set_link_npPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Int32, acl_t)>>('acl_set_link_np'); - late final _acl_set_link_np = _acl_set_link_npPtr - .asFunction, int, acl_t)>(); + /// The optimal block size when reading or writing this file's data, or nil if not available. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLPreferredIOBlockSizeKey = + _lookup('NSURLPreferredIOBlockSizeKey'); - int acl_copy_ext( - ffi.Pointer buf_p, - acl_t acl, - int size, - ) { - return _acl_copy_ext( - buf_p, - acl, - size, - ); + DartNSURLResourceKey get NSURLPreferredIOBlockSizeKey => + objc.NSString.castFromPointer(_NSURLPreferredIOBlockSizeKey.value, + retain: true, release: true); + + set NSURLPreferredIOBlockSizeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLPreferredIOBlockSizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLPreferredIOBlockSizeKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_copy_extPtr = _lookup< - ffi.NativeFunction< - ssize_t Function( - ffi.Pointer, acl_t, ssize_t)>>('acl_copy_ext'); - late final _acl_copy_ext = _acl_copy_extPtr - .asFunction, acl_t, int)>(); + /// true if this process (as determined by EUID) can read the resource. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsReadableKey = + _lookup('NSURLIsReadableKey'); - int acl_copy_ext_native( - ffi.Pointer buf_p, - acl_t acl, - int size, - ) { - return _acl_copy_ext_native( - buf_p, - acl, - size, - ); + DartNSURLResourceKey get NSURLIsReadableKey => + objc.NSString.castFromPointer(_NSURLIsReadableKey.value, + retain: true, release: true); + + set NSURLIsReadableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsReadableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsReadableKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_copy_ext_nativePtr = _lookup< - ffi.NativeFunction< - ssize_t Function( - ffi.Pointer, acl_t, ssize_t)>>('acl_copy_ext_native'); - late final _acl_copy_ext_native = _acl_copy_ext_nativePtr - .asFunction, acl_t, int)>(); + /// true if this process (as determined by EUID) can write to the resource. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsWritableKey = + _lookup('NSURLIsWritableKey'); - acl_t acl_copy_int( - ffi.Pointer buf_p, - ) { - return _acl_copy_int( - buf_p, - ); + DartNSURLResourceKey get NSURLIsWritableKey => + objc.NSString.castFromPointer(_NSURLIsWritableKey.value, + retain: true, release: true); + + set NSURLIsWritableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsWritableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsWritableKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_copy_intPtr = - _lookup)>>( - 'acl_copy_int'); - late final _acl_copy_int = - _acl_copy_intPtr.asFunction)>(); + /// true if this process (as determined by EUID) can execute a file resource or search a directory resource. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsExecutableKey = + _lookup('NSURLIsExecutableKey'); - acl_t acl_copy_int_native( - ffi.Pointer buf_p, - ) { - return _acl_copy_int_native( - buf_p, - ); + DartNSURLResourceKey get NSURLIsExecutableKey => + objc.NSString.castFromPointer(_NSURLIsExecutableKey.value, + retain: true, release: true); + + set NSURLIsExecutableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsExecutableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsExecutableKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_copy_int_nativePtr = - _lookup)>>( - 'acl_copy_int_native'); - late final _acl_copy_int_native = _acl_copy_int_nativePtr - .asFunction)>(); + /// The file system object's security information encapsulated in a NSFileSecurity object. (Read-write, Value type NSFileSecurity) + late final ffi.Pointer _NSURLFileSecurityKey = + _lookup('NSURLFileSecurityKey'); - acl_t acl_from_text( - ffi.Pointer buf_p, - ) { - return _acl_from_text( - buf_p, - ); + DartNSURLResourceKey get NSURLFileSecurityKey => + objc.NSString.castFromPointer(_NSURLFileSecurityKey.value, + retain: true, release: true); + + set NSURLFileSecurityKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileSecurityKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileSecurityKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_from_textPtr = - _lookup)>>( - 'acl_from_text'); - late final _acl_from_text = - _acl_from_textPtr.asFunction)>(); + /// true if resource should be excluded from backups, false otherwise (Read-write, value type boolean NSNumber). This property is only useful for excluding cache and other application support files which are not needed in a backup. Some operations commonly made to user documents will cause this property to be reset to false and so this property should not be used on user documents. + late final ffi.Pointer _NSURLIsExcludedFromBackupKey = + _lookup('NSURLIsExcludedFromBackupKey'); - int acl_size( - acl_t acl, - ) { - return _acl_size( - acl, - ); + DartNSURLResourceKey get NSURLIsExcludedFromBackupKey => + objc.NSString.castFromPointer(_NSURLIsExcludedFromBackupKey.value, + retain: true, release: true); + + set NSURLIsExcludedFromBackupKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsExcludedFromBackupKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsExcludedFromBackupKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_sizePtr = - _lookup>('acl_size'); - late final _acl_size = _acl_sizePtr.asFunction(); + /// The array of Tag names (Read-write, value type NSArray of NSString) + late final ffi.Pointer _NSURLTagNamesKey = + _lookup('NSURLTagNamesKey'); - ffi.Pointer acl_to_text( - acl_t acl, - ffi.Pointer len_p, - ) { - return _acl_to_text( - acl, - len_p, - ); + DartNSURLResourceKey get NSURLTagNamesKey => + objc.NSString.castFromPointer(_NSURLTagNamesKey.value, + retain: true, release: true); + + set NSURLTagNamesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLTagNamesKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLTagNamesKey.value = value.ref.retainAndReturnPointer(); } - late final _acl_to_textPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - acl_t, ffi.Pointer)>>('acl_to_text'); - late final _acl_to_text = _acl_to_textPtr.asFunction< - ffi.Pointer Function(acl_t, ffi.Pointer)>(); + /// the URL's path as a file system path (Read-only, value type NSString) + late final ffi.Pointer _NSURLPathKey = + _lookup('NSURLPathKey'); - int CFFileSecurityGetTypeID() { - return _CFFileSecurityGetTypeID(); + DartNSURLResourceKey get NSURLPathKey => + objc.NSString.castFromPointer(_NSURLPathKey.value, + retain: true, release: true); + + set NSURLPathKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLPathKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLPathKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityGetTypeIDPtr = - _lookup>( - 'CFFileSecurityGetTypeID'); - late final _CFFileSecurityGetTypeID = - _CFFileSecurityGetTypeIDPtr.asFunction(); + /// the URL's path as a canonical absolute file system path (Read-only, value type NSString) + late final ffi.Pointer _NSURLCanonicalPathKey = + _lookup('NSURLCanonicalPathKey'); - CFFileSecurityRef CFFileSecurityCreate( - CFAllocatorRef allocator, - ) { - return _CFFileSecurityCreate( - allocator, - ); + DartNSURLResourceKey get NSURLCanonicalPathKey => + objc.NSString.castFromPointer(_NSURLCanonicalPathKey.value, + retain: true, release: true); + + set NSURLCanonicalPathKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLCanonicalPathKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLCanonicalPathKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityCreatePtr = - _lookup>( - 'CFFileSecurityCreate'); - late final _CFFileSecurityCreate = _CFFileSecurityCreatePtr.asFunction< - CFFileSecurityRef Function(CFAllocatorRef)>(); + /// true if this URL is a file system trigger directory. Traversing or opening a file system trigger will cause an attempt to mount a file system on the trigger directory. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsMountTriggerKey = + _lookup('NSURLIsMountTriggerKey'); - CFFileSecurityRef CFFileSecurityCreateCopy( - CFAllocatorRef allocator, - CFFileSecurityRef fileSec, - ) { - return _CFFileSecurityCreateCopy( - allocator, - fileSec, - ); + DartNSURLResourceKey get NSURLIsMountTriggerKey => + objc.NSString.castFromPointer(_NSURLIsMountTriggerKey.value, + retain: true, release: true); + + set NSURLIsMountTriggerKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsMountTriggerKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsMountTriggerKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityCreateCopyPtr = _lookup< - ffi.NativeFunction< - CFFileSecurityRef Function( - CFAllocatorRef, CFFileSecurityRef)>>('CFFileSecurityCreateCopy'); - late final _CFFileSecurityCreateCopy = - _CFFileSecurityCreateCopyPtr.asFunction< - CFFileSecurityRef Function(CFAllocatorRef, CFFileSecurityRef)>(); + /// An opaque generation identifier which can be compared using isEqual: to determine if the data in a document has been modified. For URLs which refer to the same file inode, the generation identifier will change when the data in the file's data fork is changed (changes to extended attributes or other file system metadata do not change the generation identifier). For URLs which refer to the same directory inode, the generation identifier will change when direct children of that directory are added, removed or renamed (changes to the data of the direct children of that directory will not change the generation identifier). The generation identifier is persistent across system restarts. The generation identifier is tied to a specific document on a specific volume and is not transferred when the document is copied to another volume. This property is not supported by all volumes. (Read-only, value type id ) + late final ffi.Pointer _NSURLGenerationIdentifierKey = + _lookup('NSURLGenerationIdentifierKey'); - int CFFileSecurityCopyOwnerUUID( - CFFileSecurityRef fileSec, - ffi.Pointer ownerUUID, - ) { - return _CFFileSecurityCopyOwnerUUID( - fileSec, - ownerUUID, - ); + DartNSURLResourceKey get NSURLGenerationIdentifierKey => + objc.NSString.castFromPointer(_NSURLGenerationIdentifierKey.value, + retain: true, release: true); + + set NSURLGenerationIdentifierKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLGenerationIdentifierKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLGenerationIdentifierKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityCopyOwnerUUIDPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFFileSecurityRef, - ffi.Pointer)>>('CFFileSecurityCopyOwnerUUID'); - late final _CFFileSecurityCopyOwnerUUID = _CFFileSecurityCopyOwnerUUIDPtr - .asFunction)>(); + /// The document identifier -- a value assigned by the kernel to a document (which can be either a file or directory) and is used to identify the document regardless of where it gets moved on a volume. The document identifier survives "safe save” operations; i.e it is sticky to the path it was assigned to (-replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: is the preferred safe-save API). The document identifier is persistent across system restarts. The document identifier is not transferred when the file is copied. Document identifiers are only unique within a single volume. This property is not supported by all volumes. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLDocumentIdentifierKey = + _lookup('NSURLDocumentIdentifierKey'); - int CFFileSecuritySetOwnerUUID( - CFFileSecurityRef fileSec, - CFUUIDRef ownerUUID, - ) { - return _CFFileSecuritySetOwnerUUID( - fileSec, - ownerUUID, - ); + DartNSURLResourceKey get NSURLDocumentIdentifierKey => + objc.NSString.castFromPointer(_NSURLDocumentIdentifierKey.value, + retain: true, release: true); + + set NSURLDocumentIdentifierKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLDocumentIdentifierKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLDocumentIdentifierKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecuritySetOwnerUUIDPtr = _lookup< - ffi.NativeFunction>( - 'CFFileSecuritySetOwnerUUID'); - late final _CFFileSecuritySetOwnerUUID = _CFFileSecuritySetOwnerUUIDPtr - .asFunction(); + /// The date the resource was created, or renamed into or within its parent directory. Note that inconsistent behavior may be observed when this attribute is requested on hard-linked items. This property is not supported by all volumes. (Read-only before macOS 10.15, iOS 13.0, watchOS 6.0, and tvOS 13.0; Read-write after, value type NSDate) + late final ffi.Pointer _NSURLAddedToDirectoryDateKey = + _lookup('NSURLAddedToDirectoryDateKey'); - int CFFileSecurityCopyGroupUUID( - CFFileSecurityRef fileSec, - ffi.Pointer groupUUID, - ) { - return _CFFileSecurityCopyGroupUUID( - fileSec, - groupUUID, - ); + DartNSURLResourceKey get NSURLAddedToDirectoryDateKey => + objc.NSString.castFromPointer(_NSURLAddedToDirectoryDateKey.value, + retain: true, release: true); + + set NSURLAddedToDirectoryDateKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLAddedToDirectoryDateKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLAddedToDirectoryDateKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityCopyGroupUUIDPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFFileSecurityRef, - ffi.Pointer)>>('CFFileSecurityCopyGroupUUID'); - late final _CFFileSecurityCopyGroupUUID = _CFFileSecurityCopyGroupUUIDPtr - .asFunction)>(); + /// The quarantine properties as defined in LSQuarantine.h. To remove quarantine information from a file, pass NSNull as the value when setting this property. (Read-write, value type NSDictionary) + late final ffi.Pointer _NSURLQuarantinePropertiesKey = + _lookup('NSURLQuarantinePropertiesKey'); - int CFFileSecuritySetGroupUUID( - CFFileSecurityRef fileSec, - CFUUIDRef groupUUID, - ) { - return _CFFileSecuritySetGroupUUID( - fileSec, - groupUUID, - ); + DartNSURLResourceKey get NSURLQuarantinePropertiesKey => + objc.NSString.castFromPointer(_NSURLQuarantinePropertiesKey.value, + retain: true, release: true); + + set NSURLQuarantinePropertiesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLQuarantinePropertiesKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLQuarantinePropertiesKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecuritySetGroupUUIDPtr = _lookup< - ffi.NativeFunction>( - 'CFFileSecuritySetGroupUUID'); - late final _CFFileSecuritySetGroupUUID = _CFFileSecuritySetGroupUUIDPtr - .asFunction(); + /// Returns the file system object type. (Read-only, value type NSString) + late final ffi.Pointer _NSURLFileResourceTypeKey = + _lookup('NSURLFileResourceTypeKey'); - int CFFileSecurityCopyAccessControlList( - CFFileSecurityRef fileSec, - ffi.Pointer accessControlList, - ) { - return _CFFileSecurityCopyAccessControlList( - fileSec, - accessControlList, - ); + DartNSURLResourceKey get NSURLFileResourceTypeKey => + objc.NSString.castFromPointer(_NSURLFileResourceTypeKey.value, + retain: true, release: true); + + set NSURLFileResourceTypeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityCopyAccessControlListPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFFileSecurityRef, - ffi.Pointer)>>('CFFileSecurityCopyAccessControlList'); - late final _CFFileSecurityCopyAccessControlList = - _CFFileSecurityCopyAccessControlListPtr.asFunction< - int Function(CFFileSecurityRef, ffi.Pointer)>(); + /// The file system's internal inode identifier for the item. This value is not stable for all file systems or across all mounts, so it should be used sparingly and not persisted. It is useful, for example, to match URLs from the URL enumerator with paths from FSEvents. (Read-only, value type NSNumber containing an unsigned long long). + late final ffi.Pointer _NSURLFileIdentifierKey = + _lookup('NSURLFileIdentifierKey'); - int CFFileSecuritySetAccessControlList( - CFFileSecurityRef fileSec, - acl_t accessControlList, - ) { - return _CFFileSecuritySetAccessControlList( - fileSec, - accessControlList, - ); + DartNSURLResourceKey get NSURLFileIdentifierKey => + objc.NSString.castFromPointer(_NSURLFileIdentifierKey.value, + retain: true, release: true); + + set NSURLFileIdentifierKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileIdentifierKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileIdentifierKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecuritySetAccessControlListPtr = - _lookup>( - 'CFFileSecuritySetAccessControlList'); - late final _CFFileSecuritySetAccessControlList = - _CFFileSecuritySetAccessControlListPtr.asFunction< - int Function(CFFileSecurityRef, acl_t)>(); + /// A 64-bit value assigned by APFS that identifies a file's content data stream. Only cloned files and their originals can have the same identifier. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLFileContentIdentifierKey = + _lookup('NSURLFileContentIdentifierKey'); - int CFFileSecurityGetOwner( - CFFileSecurityRef fileSec, - ffi.Pointer owner, - ) { - return _CFFileSecurityGetOwner( - fileSec, - owner, - ); + DartNSURLResourceKey get NSURLFileContentIdentifierKey => + objc.NSString.castFromPointer(_NSURLFileContentIdentifierKey.value, + retain: true, release: true); + + set NSURLFileContentIdentifierKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileContentIdentifierKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileContentIdentifierKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityGetOwnerPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFFileSecurityRef, - ffi.Pointer)>>('CFFileSecurityGetOwner'); - late final _CFFileSecurityGetOwner = _CFFileSecurityGetOwnerPtr.asFunction< - int Function(CFFileSecurityRef, ffi.Pointer)>(); + /// True for cloned files and their originals that may share all, some, or no data blocks. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLMayShareFileContentKey = + _lookup('NSURLMayShareFileContentKey'); - int CFFileSecuritySetOwner( - CFFileSecurityRef fileSec, - int owner, - ) { - return _CFFileSecuritySetOwner( - fileSec, - owner, - ); + DartNSURLResourceKey get NSURLMayShareFileContentKey => + objc.NSString.castFromPointer(_NSURLMayShareFileContentKey.value, + retain: true, release: true); + + set NSURLMayShareFileContentKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLMayShareFileContentKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLMayShareFileContentKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecuritySetOwnerPtr = - _lookup>( - 'CFFileSecuritySetOwner'); - late final _CFFileSecuritySetOwner = _CFFileSecuritySetOwnerPtr.asFunction< - int Function(CFFileSecurityRef, int)>(); + /// True if the file has extended attributes. False guarantees there are none. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLMayHaveExtendedAttributesKey = + _lookup('NSURLMayHaveExtendedAttributesKey'); - int CFFileSecurityGetGroup( - CFFileSecurityRef fileSec, - ffi.Pointer group, - ) { - return _CFFileSecurityGetGroup( - fileSec, - group, - ); + DartNSURLResourceKey get NSURLMayHaveExtendedAttributesKey => + objc.NSString.castFromPointer(_NSURLMayHaveExtendedAttributesKey.value, + retain: true, release: true); + + set NSURLMayHaveExtendedAttributesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLMayHaveExtendedAttributesKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLMayHaveExtendedAttributesKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityGetGroupPtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFFileSecurityRef, - ffi.Pointer)>>('CFFileSecurityGetGroup'); - late final _CFFileSecurityGetGroup = _CFFileSecurityGetGroupPtr.asFunction< - int Function(CFFileSecurityRef, ffi.Pointer)>(); + /// True if the file can be deleted by the file system when asked to free space. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLIsPurgeableKey = + _lookup('NSURLIsPurgeableKey'); - int CFFileSecuritySetGroup( - CFFileSecurityRef fileSec, - int group, - ) { - return _CFFileSecuritySetGroup( - fileSec, - group, - ); + DartNSURLResourceKey get NSURLIsPurgeableKey => + objc.NSString.castFromPointer(_NSURLIsPurgeableKey.value, + retain: true, release: true); + + set NSURLIsPurgeableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsPurgeableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsPurgeableKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecuritySetGroupPtr = - _lookup>( - 'CFFileSecuritySetGroup'); - late final _CFFileSecuritySetGroup = _CFFileSecuritySetGroupPtr.asFunction< - int Function(CFFileSecurityRef, int)>(); + /// True if the file has sparse regions. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLIsSparseKey = + _lookup('NSURLIsSparseKey'); - int CFFileSecurityGetMode( - CFFileSecurityRef fileSec, - ffi.Pointer mode, - ) { - return _CFFileSecurityGetMode( - fileSec, - mode, - ); + DartNSURLResourceKey get NSURLIsSparseKey => + objc.NSString.castFromPointer(_NSURLIsSparseKey.value, + retain: true, release: true); + + set NSURLIsSparseKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsSparseKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsSparseKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityGetModePtr = _lookup< - ffi.NativeFunction< - Boolean Function(CFFileSecurityRef, - ffi.Pointer)>>('CFFileSecurityGetMode'); - late final _CFFileSecurityGetMode = _CFFileSecurityGetModePtr.asFunction< - int Function(CFFileSecurityRef, ffi.Pointer)>(); + /// The file system object type values returned for the NSURLFileResourceTypeKey + late final ffi.Pointer + _NSURLFileResourceTypeNamedPipe = + _lookup('NSURLFileResourceTypeNamedPipe'); - int CFFileSecuritySetMode( - CFFileSecurityRef fileSec, - int mode, - ) { - return _CFFileSecuritySetMode( - fileSec, - mode, - ); + DartNSURLFileResourceType get NSURLFileResourceTypeNamedPipe => + objc.NSString.castFromPointer(_NSURLFileResourceTypeNamedPipe.value, + retain: true, release: true); + + set NSURLFileResourceTypeNamedPipe(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeNamedPipe.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeNamedPipe.value = value.ref.retainAndReturnPointer(); } - late final _CFFileSecuritySetModePtr = - _lookup>( - 'CFFileSecuritySetMode'); - late final _CFFileSecuritySetMode = _CFFileSecuritySetModePtr.asFunction< - int Function(CFFileSecurityRef, int)>(); + late final ffi.Pointer + _NSURLFileResourceTypeCharacterSpecial = + _lookup('NSURLFileResourceTypeCharacterSpecial'); - int CFFileSecurityClearProperties( - CFFileSecurityRef fileSec, - int clearPropertyMask, - ) { - return _CFFileSecurityClearProperties( - fileSec, - clearPropertyMask, - ); + DartNSURLFileResourceType get NSURLFileResourceTypeCharacterSpecial => + objc.NSString.castFromPointer( + _NSURLFileResourceTypeCharacterSpecial.value, + retain: true, + release: true); + + set NSURLFileResourceTypeCharacterSpecial(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeCharacterSpecial.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeCharacterSpecial.value = + value.ref.retainAndReturnPointer(); } - late final _CFFileSecurityClearPropertiesPtr = _lookup< - ffi.NativeFunction>( - 'CFFileSecurityClearProperties'); - late final _CFFileSecurityClearProperties = _CFFileSecurityClearPropertiesPtr - .asFunction(); + late final ffi.Pointer + _NSURLFileResourceTypeDirectory = + _lookup('NSURLFileResourceTypeDirectory'); - CFStringRef CFStringTokenizerCopyBestStringLanguage( - CFStringRef string, - CFRange range, - ) { - return _CFStringTokenizerCopyBestStringLanguage( - string, - range, - ); + DartNSURLFileResourceType get NSURLFileResourceTypeDirectory => + objc.NSString.castFromPointer(_NSURLFileResourceTypeDirectory.value, + retain: true, release: true); + + set NSURLFileResourceTypeDirectory(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeDirectory.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeDirectory.value = value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerCopyBestStringLanguagePtr = - _lookup>( - 'CFStringTokenizerCopyBestStringLanguage'); - late final _CFStringTokenizerCopyBestStringLanguage = - _CFStringTokenizerCopyBestStringLanguagePtr.asFunction< - CFStringRef Function(CFStringRef, CFRange)>(); + late final ffi.Pointer + _NSURLFileResourceTypeBlockSpecial = + _lookup('NSURLFileResourceTypeBlockSpecial'); - int CFStringTokenizerGetTypeID() { - return _CFStringTokenizerGetTypeID(); + DartNSURLFileResourceType get NSURLFileResourceTypeBlockSpecial => + objc.NSString.castFromPointer(_NSURLFileResourceTypeBlockSpecial.value, + retain: true, release: true); + + set NSURLFileResourceTypeBlockSpecial(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeBlockSpecial.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeBlockSpecial.value = + value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerGetTypeIDPtr = - _lookup>( - 'CFStringTokenizerGetTypeID'); - late final _CFStringTokenizerGetTypeID = - _CFStringTokenizerGetTypeIDPtr.asFunction(); + late final ffi.Pointer _NSURLFileResourceTypeRegular = + _lookup('NSURLFileResourceTypeRegular'); - CFStringTokenizerRef CFStringTokenizerCreate( - CFAllocatorRef alloc, - CFStringRef string, - CFRange range, - int options, - CFLocaleRef locale, - ) { - return _CFStringTokenizerCreate( - alloc, - string, - range, - options, - locale, - ); + DartNSURLFileResourceType get NSURLFileResourceTypeRegular => + objc.NSString.castFromPointer(_NSURLFileResourceTypeRegular.value, + retain: true, release: true); + + set NSURLFileResourceTypeRegular(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeRegular.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeRegular.value = value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerCreatePtr = _lookup< - ffi.NativeFunction< - CFStringTokenizerRef Function(CFAllocatorRef, CFStringRef, CFRange, - CFOptionFlags, CFLocaleRef)>>('CFStringTokenizerCreate'); - late final _CFStringTokenizerCreate = _CFStringTokenizerCreatePtr.asFunction< - CFStringTokenizerRef Function( - CFAllocatorRef, CFStringRef, CFRange, int, CFLocaleRef)>(); + late final ffi.Pointer + _NSURLFileResourceTypeSymbolicLink = + _lookup('NSURLFileResourceTypeSymbolicLink'); - void CFStringTokenizerSetString( - CFStringTokenizerRef tokenizer, - CFStringRef string, - CFRange range, - ) { - return _CFStringTokenizerSetString( - tokenizer, - string, - range, - ); + DartNSURLFileResourceType get NSURLFileResourceTypeSymbolicLink => + objc.NSString.castFromPointer(_NSURLFileResourceTypeSymbolicLink.value, + retain: true, release: true); + + set NSURLFileResourceTypeSymbolicLink(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeSymbolicLink.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeSymbolicLink.value = + value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerSetStringPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFStringTokenizerRef, CFStringRef, - CFRange)>>('CFStringTokenizerSetString'); - late final _CFStringTokenizerSetString = _CFStringTokenizerSetStringPtr - .asFunction(); + late final ffi.Pointer _NSURLFileResourceTypeSocket = + _lookup('NSURLFileResourceTypeSocket'); - int CFStringTokenizerGoToTokenAtIndex( - CFStringTokenizerRef tokenizer, - int index, - ) { - return _CFStringTokenizerGoToTokenAtIndex( - tokenizer, - index, - ); + DartNSURLFileResourceType get NSURLFileResourceTypeSocket => + objc.NSString.castFromPointer(_NSURLFileResourceTypeSocket.value, + retain: true, release: true); + + set NSURLFileResourceTypeSocket(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeSocket.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeSocket.value = value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerGoToTokenAtIndexPtr = _lookup< - ffi - .NativeFunction>( - 'CFStringTokenizerGoToTokenAtIndex'); - late final _CFStringTokenizerGoToTokenAtIndex = - _CFStringTokenizerGoToTokenAtIndexPtr.asFunction< - int Function(CFStringTokenizerRef, int)>(); + late final ffi.Pointer _NSURLFileResourceTypeUnknown = + _lookup('NSURLFileResourceTypeUnknown'); - int CFStringTokenizerAdvanceToNextToken( - CFStringTokenizerRef tokenizer, - ) { - return _CFStringTokenizerAdvanceToNextToken( - tokenizer, - ); + DartNSURLFileResourceType get NSURLFileResourceTypeUnknown => + objc.NSString.castFromPointer(_NSURLFileResourceTypeUnknown.value, + retain: true, release: true); + + set NSURLFileResourceTypeUnknown(DartNSURLFileResourceType value) { + objc.NSString.castFromPointer(_NSURLFileResourceTypeUnknown.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileResourceTypeUnknown.value = value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerAdvanceToNextTokenPtr = - _lookup>( - 'CFStringTokenizerAdvanceToNextToken'); - late final _CFStringTokenizerAdvanceToNextToken = - _CFStringTokenizerAdvanceToNextTokenPtr.asFunction< - int Function(CFStringTokenizerRef)>(); + /// dictionary of NSImage/UIImage objects keyed by size + late final ffi.Pointer _NSURLThumbnailDictionaryKey = + _lookup('NSURLThumbnailDictionaryKey'); - CFRange CFStringTokenizerGetCurrentTokenRange( - CFStringTokenizerRef tokenizer, - ) { - return _CFStringTokenizerGetCurrentTokenRange( - tokenizer, - ); + DartNSURLResourceKey get NSURLThumbnailDictionaryKey => + objc.NSString.castFromPointer(_NSURLThumbnailDictionaryKey.value, + retain: true, release: true); + + set NSURLThumbnailDictionaryKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLThumbnailDictionaryKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLThumbnailDictionaryKey.value = value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerGetCurrentTokenRangePtr = - _lookup>( - 'CFStringTokenizerGetCurrentTokenRange'); - late final _CFStringTokenizerGetCurrentTokenRange = - _CFStringTokenizerGetCurrentTokenRangePtr.asFunction< - CFRange Function(CFStringTokenizerRef)>(); + /// returns all thumbnails as a single NSImage + late final ffi.Pointer _NSURLThumbnailKey = + _lookup('NSURLThumbnailKey'); - CFTypeRef CFStringTokenizerCopyCurrentTokenAttribute( - CFStringTokenizerRef tokenizer, - int attribute, - ) { - return _CFStringTokenizerCopyCurrentTokenAttribute( - tokenizer, - attribute, - ); + DartNSURLResourceKey get NSURLThumbnailKey => + objc.NSString.castFromPointer(_NSURLThumbnailKey.value, + retain: true, release: true); + + set NSURLThumbnailKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLThumbnailKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLThumbnailKey.value = value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerCopyCurrentTokenAttributePtr = _lookup< - ffi.NativeFunction< - CFTypeRef Function(CFStringTokenizerRef, - CFOptionFlags)>>('CFStringTokenizerCopyCurrentTokenAttribute'); - late final _CFStringTokenizerCopyCurrentTokenAttribute = - _CFStringTokenizerCopyCurrentTokenAttributePtr.asFunction< - CFTypeRef Function(CFStringTokenizerRef, int)>(); + /// size key for a 1024 x 1024 thumbnail image + late final ffi.Pointer + _NSThumbnail1024x1024SizeKey = + _lookup('NSThumbnail1024x1024SizeKey'); - int CFStringTokenizerGetCurrentSubTokens( - CFStringTokenizerRef tokenizer, - ffi.Pointer ranges, - int maxRangeLength, - CFMutableArrayRef derivedSubTokens, - ) { - return _CFStringTokenizerGetCurrentSubTokens( - tokenizer, - ranges, - maxRangeLength, - derivedSubTokens, - ); + DartNSURLThumbnailDictionaryItem get NSThumbnail1024x1024SizeKey => + objc.NSString.castFromPointer(_NSThumbnail1024x1024SizeKey.value, + retain: true, release: true); + + set NSThumbnail1024x1024SizeKey(DartNSURLThumbnailDictionaryItem value) { + objc.NSString.castFromPointer(_NSThumbnail1024x1024SizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSThumbnail1024x1024SizeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFStringTokenizerGetCurrentSubTokensPtr = _lookup< - ffi.NativeFunction< - CFIndex Function(CFStringTokenizerRef, ffi.Pointer, CFIndex, - CFMutableArrayRef)>>('CFStringTokenizerGetCurrentSubTokens'); - late final _CFStringTokenizerGetCurrentSubTokens = - _CFStringTokenizerGetCurrentSubTokensPtr.asFunction< - int Function(CFStringTokenizerRef, ffi.Pointer, int, - CFMutableArrayRef)>(); + /// Total file size in bytes (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLFileSizeKey = + _lookup('NSURLFileSizeKey'); - int CFFileDescriptorGetTypeID() { - return _CFFileDescriptorGetTypeID(); + DartNSURLResourceKey get NSURLFileSizeKey => + objc.NSString.castFromPointer(_NSURLFileSizeKey.value, + retain: true, release: true); + + set NSURLFileSizeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileSizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileSizeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorGetTypeIDPtr = - _lookup>( - 'CFFileDescriptorGetTypeID'); - late final _CFFileDescriptorGetTypeID = - _CFFileDescriptorGetTypeIDPtr.asFunction(); + /// Total size allocated on disk for the file in bytes (number of blocks times block size) (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLFileAllocatedSizeKey = + _lookup('NSURLFileAllocatedSizeKey'); - CFFileDescriptorRef CFFileDescriptorCreate( - CFAllocatorRef allocator, - int fd, - int closeOnInvalidate, - CFFileDescriptorCallBack callout, - ffi.Pointer context, - ) { - return _CFFileDescriptorCreate( - allocator, - fd, - closeOnInvalidate, - callout, - context, - ); + DartNSURLResourceKey get NSURLFileAllocatedSizeKey => + objc.NSString.castFromPointer(_NSURLFileAllocatedSizeKey.value, + retain: true, release: true); + + set NSURLFileAllocatedSizeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileAllocatedSizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileAllocatedSizeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorCreatePtr = _lookup< - ffi.NativeFunction< - CFFileDescriptorRef Function( - CFAllocatorRef, - CFFileDescriptorNativeDescriptor, - Boolean, - CFFileDescriptorCallBack, - ffi.Pointer)>>('CFFileDescriptorCreate'); - late final _CFFileDescriptorCreate = _CFFileDescriptorCreatePtr.asFunction< - CFFileDescriptorRef Function(CFAllocatorRef, int, int, - CFFileDescriptorCallBack, ffi.Pointer)>(); + /// Total displayable size of the file in bytes (this may include space used by metadata), or nil if not available. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLTotalFileSizeKey = + _lookup('NSURLTotalFileSizeKey'); - int CFFileDescriptorGetNativeDescriptor( - CFFileDescriptorRef f, - ) { - return _CFFileDescriptorGetNativeDescriptor( - f, - ); + DartNSURLResourceKey get NSURLTotalFileSizeKey => + objc.NSString.castFromPointer(_NSURLTotalFileSizeKey.value, + retain: true, release: true); + + set NSURLTotalFileSizeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLTotalFileSizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLTotalFileSizeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorGetNativeDescriptorPtr = _lookup< - ffi.NativeFunction< - CFFileDescriptorNativeDescriptor Function( - CFFileDescriptorRef)>>('CFFileDescriptorGetNativeDescriptor'); - late final _CFFileDescriptorGetNativeDescriptor = - _CFFileDescriptorGetNativeDescriptorPtr.asFunction< - int Function(CFFileDescriptorRef)>(); + /// Total allocated size of the file in bytes (this may include space used by metadata), or nil if not available. This can be less than the value returned by NSURLTotalFileSizeKey if the resource is compressed. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLTotalFileAllocatedSizeKey = + _lookup('NSURLTotalFileAllocatedSizeKey'); - void CFFileDescriptorGetContext( - CFFileDescriptorRef f, - ffi.Pointer context, - ) { - return _CFFileDescriptorGetContext( - f, - context, - ); + DartNSURLResourceKey get NSURLTotalFileAllocatedSizeKey => + objc.NSString.castFromPointer(_NSURLTotalFileAllocatedSizeKey.value, + retain: true, release: true); + + set NSURLTotalFileAllocatedSizeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLTotalFileAllocatedSizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLTotalFileAllocatedSizeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorGetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFFileDescriptorRef, ffi.Pointer)>>( - 'CFFileDescriptorGetContext'); - late final _CFFileDescriptorGetContext = - _CFFileDescriptorGetContextPtr.asFunction< - void Function( - CFFileDescriptorRef, ffi.Pointer)>(); + /// true if the resource is a Finder alias file or a symlink, false otherwise ( Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsAliasFileKey = + _lookup('NSURLIsAliasFileKey'); - void CFFileDescriptorEnableCallBacks( - CFFileDescriptorRef f, - int callBackTypes, - ) { - return _CFFileDescriptorEnableCallBacks( - f, - callBackTypes, - ); + DartNSURLResourceKey get NSURLIsAliasFileKey => + objc.NSString.castFromPointer(_NSURLIsAliasFileKey.value, + retain: true, release: true); + + set NSURLIsAliasFileKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsAliasFileKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsAliasFileKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorEnableCallBacksPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFFileDescriptorRef, - CFOptionFlags)>>('CFFileDescriptorEnableCallBacks'); - late final _CFFileDescriptorEnableCallBacks = - _CFFileDescriptorEnableCallBacksPtr.asFunction< - void Function(CFFileDescriptorRef, int)>(); + /// The protection level for this file + late final ffi.Pointer _NSURLFileProtectionKey = + _lookup('NSURLFileProtectionKey'); - void CFFileDescriptorDisableCallBacks( - CFFileDescriptorRef f, - int callBackTypes, - ) { - return _CFFileDescriptorDisableCallBacks( - f, - callBackTypes, - ); + DartNSURLResourceKey get NSURLFileProtectionKey => + objc.NSString.castFromPointer(_NSURLFileProtectionKey.value, + retain: true, release: true); + + set NSURLFileProtectionKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLFileProtectionKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileProtectionKey.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorDisableCallBacksPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFFileDescriptorRef, - CFOptionFlags)>>('CFFileDescriptorDisableCallBacks'); - late final _CFFileDescriptorDisableCallBacks = - _CFFileDescriptorDisableCallBacksPtr.asFunction< - void Function(CFFileDescriptorRef, int)>(); + /// The file has no special protections associated with it. It can be read from or written to at any time. + late final ffi.Pointer _NSURLFileProtectionNone = + _lookup('NSURLFileProtectionNone'); - void CFFileDescriptorInvalidate( - CFFileDescriptorRef f, - ) { - return _CFFileDescriptorInvalidate( - f, - ); + DartNSURLFileProtectionType get NSURLFileProtectionNone => + objc.NSString.castFromPointer(_NSURLFileProtectionNone.value, + retain: true, release: true); + + set NSURLFileProtectionNone(DartNSURLFileProtectionType value) { + objc.NSString.castFromPointer(_NSURLFileProtectionNone.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileProtectionNone.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorInvalidatePtr = - _lookup>( - 'CFFileDescriptorInvalidate'); - late final _CFFileDescriptorInvalidate = _CFFileDescriptorInvalidatePtr - .asFunction(); + /// The file is stored in an encrypted format on disk and cannot be read from or written to while the device is locked or booting. Transient data files with this protection type should be excluded from backups using NSURLIsExcludedFromBackupKey. + late final ffi.Pointer _NSURLFileProtectionComplete = + _lookup('NSURLFileProtectionComplete'); - int CFFileDescriptorIsValid( - CFFileDescriptorRef f, - ) { - return _CFFileDescriptorIsValid( - f, - ); + DartNSURLFileProtectionType get NSURLFileProtectionComplete => + objc.NSString.castFromPointer(_NSURLFileProtectionComplete.value, + retain: true, release: true); + + set NSURLFileProtectionComplete(DartNSURLFileProtectionType value) { + objc.NSString.castFromPointer(_NSURLFileProtectionComplete.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileProtectionComplete.value = value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorIsValidPtr = - _lookup>( - 'CFFileDescriptorIsValid'); - late final _CFFileDescriptorIsValid = _CFFileDescriptorIsValidPtr.asFunction< - int Function(CFFileDescriptorRef)>(); + /// The file is stored in an encrypted format on disk. Files can be created while the device is locked, but once closed, cannot be opened again until the device is unlocked. If the file is opened when unlocked, you may continue to access the file normally, even if the user locks the device. There is a small performance penalty when the file is created and opened, though not when being written to or read from. This can be mitigated by changing the file protection to NSURLFileProtectionComplete when the device is unlocked. Transient data files with this protection type should be excluded from backups using NSURLIsExcludedFromBackupKey. + late final ffi.Pointer + _NSURLFileProtectionCompleteUnlessOpen = + _lookup('NSURLFileProtectionCompleteUnlessOpen'); - CFRunLoopSourceRef CFFileDescriptorCreateRunLoopSource( - CFAllocatorRef allocator, - CFFileDescriptorRef f, - int order, - ) { - return _CFFileDescriptorCreateRunLoopSource( - allocator, - f, - order, - ); + DartNSURLFileProtectionType get NSURLFileProtectionCompleteUnlessOpen => + objc.NSString.castFromPointer( + _NSURLFileProtectionCompleteUnlessOpen.value, + retain: true, + release: true); + + set NSURLFileProtectionCompleteUnlessOpen(DartNSURLFileProtectionType value) { + objc.NSString.castFromPointer(_NSURLFileProtectionCompleteUnlessOpen.value, + retain: false, release: true) + .ref + .release(); + _NSURLFileProtectionCompleteUnlessOpen.value = + value.ref.retainAndReturnPointer(); } - late final _CFFileDescriptorCreateRunLoopSourcePtr = _lookup< - ffi.NativeFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFFileDescriptorRef, - CFIndex)>>('CFFileDescriptorCreateRunLoopSource'); - late final _CFFileDescriptorCreateRunLoopSource = - _CFFileDescriptorCreateRunLoopSourcePtr.asFunction< - CFRunLoopSourceRef Function( - CFAllocatorRef, CFFileDescriptorRef, int)>(); + /// The file is stored in an encrypted format on disk and cannot be accessed until after the device has booted. After the user unlocks the device for the first time, your app can access the file and continue to access it even if the user subsequently locks the device. + late final ffi.Pointer + _NSURLFileProtectionCompleteUntilFirstUserAuthentication = + _lookup( + 'NSURLFileProtectionCompleteUntilFirstUserAuthentication'); - int CFUserNotificationGetTypeID() { - return _CFUserNotificationGetTypeID(); + DartNSURLFileProtectionType + get NSURLFileProtectionCompleteUntilFirstUserAuthentication => + objc.NSString.castFromPointer( + _NSURLFileProtectionCompleteUntilFirstUserAuthentication.value, + retain: true, + release: true); + + set NSURLFileProtectionCompleteUntilFirstUserAuthentication( + DartNSURLFileProtectionType value) { + objc.NSString.castFromPointer( + _NSURLFileProtectionCompleteUntilFirstUserAuthentication.value, + retain: false, + release: true) + .ref + .release(); + _NSURLFileProtectionCompleteUntilFirstUserAuthentication.value = + value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationGetTypeIDPtr = - _lookup>( - 'CFUserNotificationGetTypeID'); - late final _CFUserNotificationGetTypeID = - _CFUserNotificationGetTypeIDPtr.asFunction(); + /// The file is stored in an encrypted format on disk and cannot be accessed until after first unlock after the device has booted. After this first unlock, your app can access the file even while the device is locked until access expiry. Access is renewed once the user unlocks the device again. + late final ffi.Pointer + _NSURLFileProtectionCompleteWhenUserInactive = + _lookup( + 'NSURLFileProtectionCompleteWhenUserInactive'); - CFUserNotificationRef CFUserNotificationCreate( - CFAllocatorRef allocator, - double timeout, - int flags, - ffi.Pointer error, - CFDictionaryRef dictionary, - ) { - return _CFUserNotificationCreate( - allocator, - timeout, - flags, - error, - dictionary, - ); + DartNSURLFileProtectionType get NSURLFileProtectionCompleteWhenUserInactive => + objc.NSString.castFromPointer( + _NSURLFileProtectionCompleteWhenUserInactive.value, + retain: true, + release: true); + + set NSURLFileProtectionCompleteWhenUserInactive( + DartNSURLFileProtectionType value) { + objc.NSString.castFromPointer( + _NSURLFileProtectionCompleteWhenUserInactive.value, + retain: false, + release: true) + .ref + .release(); + _NSURLFileProtectionCompleteWhenUserInactive.value = + value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationCreatePtr = _lookup< - ffi.NativeFunction< - CFUserNotificationRef Function( - CFAllocatorRef, - CFTimeInterval, - CFOptionFlags, - ffi.Pointer, - CFDictionaryRef)>>('CFUserNotificationCreate'); - late final _CFUserNotificationCreate = - _CFUserNotificationCreatePtr.asFunction< - CFUserNotificationRef Function(CFAllocatorRef, double, int, - ffi.Pointer, CFDictionaryRef)>(); + /// Returns the count of file system objects contained in the directory. This is a count of objects actually stored in the file system, so excludes virtual items like "." and "..". The property is useful for quickly identifying an empty directory for backup and syncing. If the URL is not a directory or the file system cannot cheaply compute the value, `nil` is returned. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLDirectoryEntryCountKey = + _lookup('NSURLDirectoryEntryCountKey'); - int CFUserNotificationReceiveResponse( - CFUserNotificationRef userNotification, - double timeout, - ffi.Pointer responseFlags, - ) { - return _CFUserNotificationReceiveResponse( - userNotification, - timeout, - responseFlags, - ); + DartNSURLResourceKey get NSURLDirectoryEntryCountKey => + objc.NSString.castFromPointer(_NSURLDirectoryEntryCountKey.value, + retain: true, release: true); + + set NSURLDirectoryEntryCountKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLDirectoryEntryCountKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLDirectoryEntryCountKey.value = value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationReceiveResponsePtr = _lookup< - ffi.NativeFunction< - SInt32 Function(CFUserNotificationRef, CFTimeInterval, - ffi.Pointer)>>( - 'CFUserNotificationReceiveResponse'); - late final _CFUserNotificationReceiveResponse = - _CFUserNotificationReceiveResponsePtr.asFunction< - int Function( - CFUserNotificationRef, double, ffi.Pointer)>(); + /// The user-visible volume format (Read-only, value type NSString) + late final ffi.Pointer + _NSURLVolumeLocalizedFormatDescriptionKey = + _lookup('NSURLVolumeLocalizedFormatDescriptionKey'); - CFStringRef CFUserNotificationGetResponseValue( - CFUserNotificationRef userNotification, - CFStringRef key, - int idx, - ) { - return _CFUserNotificationGetResponseValue( - userNotification, - key, - idx, - ); + DartNSURLResourceKey get NSURLVolumeLocalizedFormatDescriptionKey => + objc.NSString.castFromPointer( + _NSURLVolumeLocalizedFormatDescriptionKey.value, + retain: true, + release: true); + + set NSURLVolumeLocalizedFormatDescriptionKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeLocalizedFormatDescriptionKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeLocalizedFormatDescriptionKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationGetResponseValuePtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFUserNotificationRef, CFStringRef, - CFIndex)>>('CFUserNotificationGetResponseValue'); - late final _CFUserNotificationGetResponseValue = - _CFUserNotificationGetResponseValuePtr.asFunction< - CFStringRef Function(CFUserNotificationRef, CFStringRef, int)>(); + /// Total volume capacity in bytes (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLVolumeTotalCapacityKey = + _lookup('NSURLVolumeTotalCapacityKey'); - CFDictionaryRef CFUserNotificationGetResponseDictionary( - CFUserNotificationRef userNotification, - ) { - return _CFUserNotificationGetResponseDictionary( - userNotification, - ); + DartNSURLResourceKey get NSURLVolumeTotalCapacityKey => + objc.NSString.castFromPointer(_NSURLVolumeTotalCapacityKey.value, + retain: true, release: true); + + set NSURLVolumeTotalCapacityKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeTotalCapacityKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeTotalCapacityKey.value = value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationGetResponseDictionaryPtr = _lookup< - ffi.NativeFunction>( - 'CFUserNotificationGetResponseDictionary'); - late final _CFUserNotificationGetResponseDictionary = - _CFUserNotificationGetResponseDictionaryPtr.asFunction< - CFDictionaryRef Function(CFUserNotificationRef)>(); + /// Total free space in bytes (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLVolumeAvailableCapacityKey = + _lookup('NSURLVolumeAvailableCapacityKey'); - int CFUserNotificationUpdate( - CFUserNotificationRef userNotification, - double timeout, - int flags, - CFDictionaryRef dictionary, - ) { - return _CFUserNotificationUpdate( - userNotification, - timeout, - flags, - dictionary, - ); + DartNSURLResourceKey get NSURLVolumeAvailableCapacityKey => + objc.NSString.castFromPointer(_NSURLVolumeAvailableCapacityKey.value, + retain: true, release: true); + + set NSURLVolumeAvailableCapacityKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeAvailableCapacityKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeAvailableCapacityKey.value = value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationUpdatePtr = _lookup< - ffi.NativeFunction< - SInt32 Function(CFUserNotificationRef, CFTimeInterval, CFOptionFlags, - CFDictionaryRef)>>('CFUserNotificationUpdate'); - late final _CFUserNotificationUpdate = - _CFUserNotificationUpdatePtr.asFunction< - int Function(CFUserNotificationRef, double, int, CFDictionaryRef)>(); + /// Total number of resources on the volume (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLVolumeResourceCountKey = + _lookup('NSURLVolumeResourceCountKey'); - int CFUserNotificationCancel( - CFUserNotificationRef userNotification, - ) { - return _CFUserNotificationCancel( - userNotification, - ); + DartNSURLResourceKey get NSURLVolumeResourceCountKey => + objc.NSString.castFromPointer(_NSURLVolumeResourceCountKey.value, + retain: true, release: true); + + set NSURLVolumeResourceCountKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeResourceCountKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeResourceCountKey.value = value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationCancelPtr = - _lookup>( - 'CFUserNotificationCancel'); - late final _CFUserNotificationCancel = _CFUserNotificationCancelPtr - .asFunction(); + /// true if the volume format supports persistent object identifiers and can look up file system objects by their IDs (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsPersistentIDsKey = + _lookup('NSURLVolumeSupportsPersistentIDsKey'); - CFRunLoopSourceRef CFUserNotificationCreateRunLoopSource( - CFAllocatorRef allocator, - CFUserNotificationRef userNotification, - CFUserNotificationCallBack callout, - int order, - ) { - return _CFUserNotificationCreateRunLoopSource( - allocator, - userNotification, - callout, - order, - ); + DartNSURLResourceKey get NSURLVolumeSupportsPersistentIDsKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsPersistentIDsKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsPersistentIDsKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsPersistentIDsKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsPersistentIDsKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationCreateRunLoopSourcePtr = _lookup< - ffi.NativeFunction< - CFRunLoopSourceRef Function( - CFAllocatorRef, - CFUserNotificationRef, - CFUserNotificationCallBack, - CFIndex)>>('CFUserNotificationCreateRunLoopSource'); - late final _CFUserNotificationCreateRunLoopSource = - _CFUserNotificationCreateRunLoopSourcePtr.asFunction< - CFRunLoopSourceRef Function(CFAllocatorRef, CFUserNotificationRef, - CFUserNotificationCallBack, int)>(); + /// true if the volume format supports symbolic links (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsSymbolicLinksKey = + _lookup('NSURLVolumeSupportsSymbolicLinksKey'); - int CFUserNotificationDisplayNotice( - double timeout, - int flags, - CFURLRef iconURL, - CFURLRef soundURL, - CFURLRef localizationURL, - CFStringRef alertHeader, - CFStringRef alertMessage, - CFStringRef defaultButtonTitle, - ) { - return _CFUserNotificationDisplayNotice( - timeout, - flags, - iconURL, - soundURL, - localizationURL, - alertHeader, - alertMessage, - defaultButtonTitle, - ); + DartNSURLResourceKey get NSURLVolumeSupportsSymbolicLinksKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsSymbolicLinksKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsSymbolicLinksKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsSymbolicLinksKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsSymbolicLinksKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationDisplayNoticePtr = _lookup< - ffi.NativeFunction< - SInt32 Function( - CFTimeInterval, - CFOptionFlags, - CFURLRef, - CFURLRef, - CFURLRef, - CFStringRef, - CFStringRef, - CFStringRef)>>('CFUserNotificationDisplayNotice'); - late final _CFUserNotificationDisplayNotice = - _CFUserNotificationDisplayNoticePtr.asFunction< - int Function(double, int, CFURLRef, CFURLRef, CFURLRef, CFStringRef, - CFStringRef, CFStringRef)>(); + /// true if the volume format supports hard links (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsHardLinksKey = + _lookup('NSURLVolumeSupportsHardLinksKey'); - int CFUserNotificationDisplayAlert( - double timeout, - int flags, - CFURLRef iconURL, - CFURLRef soundURL, - CFURLRef localizationURL, - CFStringRef alertHeader, - CFStringRef alertMessage, - CFStringRef defaultButtonTitle, - CFStringRef alternateButtonTitle, - CFStringRef otherButtonTitle, - ffi.Pointer responseFlags, - ) { - return _CFUserNotificationDisplayAlert( - timeout, - flags, - iconURL, - soundURL, - localizationURL, - alertHeader, - alertMessage, - defaultButtonTitle, - alternateButtonTitle, - otherButtonTitle, - responseFlags, - ); + DartNSURLResourceKey get NSURLVolumeSupportsHardLinksKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsHardLinksKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsHardLinksKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsHardLinksKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsHardLinksKey.value = value.ref.retainAndReturnPointer(); } - late final _CFUserNotificationDisplayAlertPtr = _lookup< - ffi.NativeFunction< - SInt32 Function( - CFTimeInterval, - CFOptionFlags, - CFURLRef, - CFURLRef, - CFURLRef, - CFStringRef, - CFStringRef, - CFStringRef, - CFStringRef, - CFStringRef, - ffi.Pointer)>>('CFUserNotificationDisplayAlert'); - late final _CFUserNotificationDisplayAlert = - _CFUserNotificationDisplayAlertPtr.asFunction< - int Function( - double, - int, - CFURLRef, - CFURLRef, - CFURLRef, - CFStringRef, - CFStringRef, - CFStringRef, - CFStringRef, - CFStringRef, - ffi.Pointer)>(); + /// true if the volume format supports a journal used to speed recovery in case of unplanned restart (such as a power outage or crash). This does not necessarily mean the volume is actively using a journal. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsJournalingKey = + _lookup('NSURLVolumeSupportsJournalingKey'); - late final ffi.Pointer _kCFUserNotificationIconURLKey = - _lookup('kCFUserNotificationIconURLKey'); + DartNSURLResourceKey get NSURLVolumeSupportsJournalingKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsJournalingKey.value, + retain: true, release: true); - CFStringRef get kCFUserNotificationIconURLKey => - _kCFUserNotificationIconURLKey.value; + set NSURLVolumeSupportsJournalingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsJournalingKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsJournalingKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _kCFUserNotificationSoundURLKey = - _lookup('kCFUserNotificationSoundURLKey'); + /// true if the volume is currently using a journal for speedy recovery after an unplanned restart. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsJournalingKey = + _lookup('NSURLVolumeIsJournalingKey'); - CFStringRef get kCFUserNotificationSoundURLKey => - _kCFUserNotificationSoundURLKey.value; + DartNSURLResourceKey get NSURLVolumeIsJournalingKey => + objc.NSString.castFromPointer(_NSURLVolumeIsJournalingKey.value, + retain: true, release: true); - late final ffi.Pointer _kCFUserNotificationLocalizationURLKey = - _lookup('kCFUserNotificationLocalizationURLKey'); + set NSURLVolumeIsJournalingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsJournalingKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsJournalingKey.value = value.ref.retainAndReturnPointer(); + } - CFStringRef get kCFUserNotificationLocalizationURLKey => - _kCFUserNotificationLocalizationURLKey.value; + /// true if the volume format supports sparse files, that is, files which can have 'holes' that have never been written to, and thus do not consume space on disk. A sparse file may have an allocated size on disk that is less than its logical length (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsSparseFilesKey = + _lookup('NSURLVolumeSupportsSparseFilesKey'); - late final ffi.Pointer _kCFUserNotificationAlertHeaderKey = - _lookup('kCFUserNotificationAlertHeaderKey'); + DartNSURLResourceKey get NSURLVolumeSupportsSparseFilesKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsSparseFilesKey.value, + retain: true, release: true); - CFStringRef get kCFUserNotificationAlertHeaderKey => - _kCFUserNotificationAlertHeaderKey.value; + set NSURLVolumeSupportsSparseFilesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsSparseFilesKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsSparseFilesKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _kCFUserNotificationAlertMessageKey = - _lookup('kCFUserNotificationAlertMessageKey'); + /// For security reasons, parts of a file (runs) that have never been written to must appear to contain zeroes. true if the volume keeps track of allocated but unwritten runs of a file so that it can substitute zeroes without actually writing zeroes to the media. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsZeroRunsKey = + _lookup('NSURLVolumeSupportsZeroRunsKey'); - CFStringRef get kCFUserNotificationAlertMessageKey => - _kCFUserNotificationAlertMessageKey.value; + DartNSURLResourceKey get NSURLVolumeSupportsZeroRunsKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsZeroRunsKey.value, + retain: true, release: true); - late final ffi.Pointer - _kCFUserNotificationDefaultButtonTitleKey = - _lookup('kCFUserNotificationDefaultButtonTitleKey'); + set NSURLVolumeSupportsZeroRunsKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsZeroRunsKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsZeroRunsKey.value = value.ref.retainAndReturnPointer(); + } - CFStringRef get kCFUserNotificationDefaultButtonTitleKey => - _kCFUserNotificationDefaultButtonTitleKey.value; + /// true if the volume format treats upper and lower case characters in file and directory names as different. Otherwise an upper case character is equivalent to a lower case character, and you can't have two names that differ solely in the case of the characters. (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsCaseSensitiveNamesKey = + _lookup('NSURLVolumeSupportsCaseSensitiveNamesKey'); - late final ffi.Pointer - _kCFUserNotificationAlternateButtonTitleKey = - _lookup('kCFUserNotificationAlternateButtonTitleKey'); + DartNSURLResourceKey get NSURLVolumeSupportsCaseSensitiveNamesKey => + objc.NSString.castFromPointer( + _NSURLVolumeSupportsCaseSensitiveNamesKey.value, + retain: true, + release: true); - CFStringRef get kCFUserNotificationAlternateButtonTitleKey => - _kCFUserNotificationAlternateButtonTitleKey.value; + set NSURLVolumeSupportsCaseSensitiveNamesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeSupportsCaseSensitiveNamesKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeSupportsCaseSensitiveNamesKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _kCFUserNotificationOtherButtonTitleKey = - _lookup('kCFUserNotificationOtherButtonTitleKey'); + /// true if the volume format preserves the case of file and directory names. Otherwise the volume may change the case of some characters (typically making them all upper or all lower case). (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsCasePreservedNamesKey = + _lookup('NSURLVolumeSupportsCasePreservedNamesKey'); - CFStringRef get kCFUserNotificationOtherButtonTitleKey => - _kCFUserNotificationOtherButtonTitleKey.value; + DartNSURLResourceKey get NSURLVolumeSupportsCasePreservedNamesKey => + objc.NSString.castFromPointer( + _NSURLVolumeSupportsCasePreservedNamesKey.value, + retain: true, + release: true); - late final ffi.Pointer - _kCFUserNotificationProgressIndicatorValueKey = - _lookup('kCFUserNotificationProgressIndicatorValueKey'); + set NSURLVolumeSupportsCasePreservedNamesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeSupportsCasePreservedNamesKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeSupportsCasePreservedNamesKey.value = + value.ref.retainAndReturnPointer(); + } - CFStringRef get kCFUserNotificationProgressIndicatorValueKey => - _kCFUserNotificationProgressIndicatorValueKey.value; + /// true if the volume supports reliable storage of times for the root directory. (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsRootDirectoryDatesKey = + _lookup('NSURLVolumeSupportsRootDirectoryDatesKey'); - late final ffi.Pointer _kCFUserNotificationPopUpTitlesKey = - _lookup('kCFUserNotificationPopUpTitlesKey'); + DartNSURLResourceKey get NSURLVolumeSupportsRootDirectoryDatesKey => + objc.NSString.castFromPointer( + _NSURLVolumeSupportsRootDirectoryDatesKey.value, + retain: true, + release: true); - CFStringRef get kCFUserNotificationPopUpTitlesKey => - _kCFUserNotificationPopUpTitlesKey.value; + set NSURLVolumeSupportsRootDirectoryDatesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeSupportsRootDirectoryDatesKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeSupportsRootDirectoryDatesKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _kCFUserNotificationTextFieldTitlesKey = - _lookup('kCFUserNotificationTextFieldTitlesKey'); + /// true if the volume supports returning volume size values (NSURLVolumeTotalCapacityKey and NSURLVolumeAvailableCapacityKey). (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsVolumeSizesKey = + _lookup('NSURLVolumeSupportsVolumeSizesKey'); - CFStringRef get kCFUserNotificationTextFieldTitlesKey => - _kCFUserNotificationTextFieldTitlesKey.value; + DartNSURLResourceKey get NSURLVolumeSupportsVolumeSizesKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsVolumeSizesKey.value, + retain: true, release: true); - late final ffi.Pointer _kCFUserNotificationCheckBoxTitlesKey = - _lookup('kCFUserNotificationCheckBoxTitlesKey'); + set NSURLVolumeSupportsVolumeSizesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsVolumeSizesKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsVolumeSizesKey.value = + value.ref.retainAndReturnPointer(); + } - CFStringRef get kCFUserNotificationCheckBoxTitlesKey => - _kCFUserNotificationCheckBoxTitlesKey.value; + /// true if the volume can be renamed. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsRenamingKey = + _lookup('NSURLVolumeSupportsRenamingKey'); - late final ffi.Pointer _kCFUserNotificationTextFieldValuesKey = - _lookup('kCFUserNotificationTextFieldValuesKey'); + DartNSURLResourceKey get NSURLVolumeSupportsRenamingKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsRenamingKey.value, + retain: true, release: true); - CFStringRef get kCFUserNotificationTextFieldValuesKey => - _kCFUserNotificationTextFieldValuesKey.value; + set NSURLVolumeSupportsRenamingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsRenamingKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsRenamingKey.value = value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _kCFUserNotificationPopUpSelectionKey = - _lookup('kCFUserNotificationPopUpSelectionKey'); + /// true if the volume implements whole-file flock(2) style advisory locks, and the O_EXLOCK and O_SHLOCK flags of the open(2) call. (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsAdvisoryFileLockingKey = + _lookup('NSURLVolumeSupportsAdvisoryFileLockingKey'); - CFStringRef get kCFUserNotificationPopUpSelectionKey => - _kCFUserNotificationPopUpSelectionKey.value; + DartNSURLResourceKey get NSURLVolumeSupportsAdvisoryFileLockingKey => + objc.NSString.castFromPointer( + _NSURLVolumeSupportsAdvisoryFileLockingKey.value, + retain: true, + release: true); - late final ffi.Pointer _kCFUserNotificationAlertTopMostKey = - _lookup('kCFUserNotificationAlertTopMostKey'); + set NSURLVolumeSupportsAdvisoryFileLockingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeSupportsAdvisoryFileLockingKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeSupportsAdvisoryFileLockingKey.value = + value.ref.retainAndReturnPointer(); + } - CFStringRef get kCFUserNotificationAlertTopMostKey => - _kCFUserNotificationAlertTopMostKey.value; + /// true if the volume implements extended security (ACLs). (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsExtendedSecurityKey = + _lookup('NSURLVolumeSupportsExtendedSecurityKey'); - late final ffi.Pointer _kCFUserNotificationKeyboardTypesKey = - _lookup('kCFUserNotificationKeyboardTypesKey'); + DartNSURLResourceKey get NSURLVolumeSupportsExtendedSecurityKey => + objc.NSString.castFromPointer( + _NSURLVolumeSupportsExtendedSecurityKey.value, + retain: true, + release: true); - CFStringRef get kCFUserNotificationKeyboardTypesKey => - _kCFUserNotificationKeyboardTypesKey.value; + set NSURLVolumeSupportsExtendedSecurityKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsExtendedSecurityKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsExtendedSecurityKey.value = + value.ref.retainAndReturnPointer(); + } - int CFXMLNodeGetTypeID() { - return _CFXMLNodeGetTypeID(); + /// true if the volume should be visible via the GUI (i.e., appear on the Desktop as a separate volume). (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsBrowsableKey = + _lookup('NSURLVolumeIsBrowsableKey'); + + DartNSURLResourceKey get NSURLVolumeIsBrowsableKey => + objc.NSString.castFromPointer(_NSURLVolumeIsBrowsableKey.value, + retain: true, release: true); + + set NSURLVolumeIsBrowsableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsBrowsableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsBrowsableKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLNodeGetTypeIDPtr = - _lookup>('CFXMLNodeGetTypeID'); - late final _CFXMLNodeGetTypeID = - _CFXMLNodeGetTypeIDPtr.asFunction(); + /// The largest file size (in bytes) supported by this file system, or nil if this cannot be determined. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLVolumeMaximumFileSizeKey = + _lookup('NSURLVolumeMaximumFileSizeKey'); - CFXMLNodeRef CFXMLNodeCreate( - CFAllocatorRef alloc, - int xmlType, - CFStringRef dataString, - ffi.Pointer additionalInfoPtr, - int version, - ) { - return _CFXMLNodeCreate( - alloc, - xmlType, - dataString, - additionalInfoPtr, - version, - ); + DartNSURLResourceKey get NSURLVolumeMaximumFileSizeKey => + objc.NSString.castFromPointer(_NSURLVolumeMaximumFileSizeKey.value, + retain: true, release: true); + + set NSURLVolumeMaximumFileSizeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeMaximumFileSizeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeMaximumFileSizeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLNodeCreatePtr = _lookup< - ffi.NativeFunction< - CFXMLNodeRef Function(CFAllocatorRef, ffi.Int32, CFStringRef, - ffi.Pointer, CFIndex)>>('CFXMLNodeCreate'); - late final _CFXMLNodeCreate = _CFXMLNodeCreatePtr.asFunction< - CFXMLNodeRef Function( - CFAllocatorRef, int, CFStringRef, ffi.Pointer, int)>(); + /// true if the volume's media is ejectable from the drive mechanism under software control. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsEjectableKey = + _lookup('NSURLVolumeIsEjectableKey'); - CFXMLNodeRef CFXMLNodeCreateCopy( - CFAllocatorRef alloc, - CFXMLNodeRef origNode, - ) { - return _CFXMLNodeCreateCopy( - alloc, - origNode, - ); + DartNSURLResourceKey get NSURLVolumeIsEjectableKey => + objc.NSString.castFromPointer(_NSURLVolumeIsEjectableKey.value, + retain: true, release: true); + + set NSURLVolumeIsEjectableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsEjectableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsEjectableKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLNodeCreateCopyPtr = _lookup< - ffi - .NativeFunction>( - 'CFXMLNodeCreateCopy'); - late final _CFXMLNodeCreateCopy = _CFXMLNodeCreateCopyPtr.asFunction< - CFXMLNodeRef Function(CFAllocatorRef, CFXMLNodeRef)>(); + /// true if the volume's media is removable from the drive mechanism. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsRemovableKey = + _lookup('NSURLVolumeIsRemovableKey'); - int CFXMLNodeGetTypeCode( - CFXMLNodeRef node, - ) { - return _CFXMLNodeGetTypeCode( - node, - ); + DartNSURLResourceKey get NSURLVolumeIsRemovableKey => + objc.NSString.castFromPointer(_NSURLVolumeIsRemovableKey.value, + retain: true, release: true); + + set NSURLVolumeIsRemovableKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsRemovableKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsRemovableKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLNodeGetTypeCodePtr = - _lookup>( - 'CFXMLNodeGetTypeCode'); - late final _CFXMLNodeGetTypeCode = - _CFXMLNodeGetTypeCodePtr.asFunction(); + /// true if the volume's device is connected to an internal bus, false if connected to an external bus, or nil if not available. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsInternalKey = + _lookup('NSURLVolumeIsInternalKey'); - CFStringRef CFXMLNodeGetString( - CFXMLNodeRef node, - ) { - return _CFXMLNodeGetString( - node, - ); + DartNSURLResourceKey get NSURLVolumeIsInternalKey => + objc.NSString.castFromPointer(_NSURLVolumeIsInternalKey.value, + retain: true, release: true); + + set NSURLVolumeIsInternalKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsInternalKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsInternalKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLNodeGetStringPtr = - _lookup>( - 'CFXMLNodeGetString'); - late final _CFXMLNodeGetString = - _CFXMLNodeGetStringPtr.asFunction(); + /// true if the volume is automounted. Note: do not mistake this with the functionality provided by kCFURLVolumeSupportsBrowsingKey. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsAutomountedKey = + _lookup('NSURLVolumeIsAutomountedKey'); - ffi.Pointer CFXMLNodeGetInfoPtr( - CFXMLNodeRef node, - ) { - return _CFXMLNodeGetInfoPtr( - node, - ); + DartNSURLResourceKey get NSURLVolumeIsAutomountedKey => + objc.NSString.castFromPointer(_NSURLVolumeIsAutomountedKey.value, + retain: true, release: true); + + set NSURLVolumeIsAutomountedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsAutomountedKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsAutomountedKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLNodeGetInfoPtrPtr = - _lookup Function(CFXMLNodeRef)>>( - 'CFXMLNodeGetInfoPtr'); - late final _CFXMLNodeGetInfoPtr = _CFXMLNodeGetInfoPtrPtr.asFunction< - ffi.Pointer Function(CFXMLNodeRef)>(); + /// true if the volume is stored on a local device. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsLocalKey = + _lookup('NSURLVolumeIsLocalKey'); - int CFXMLNodeGetVersion( - CFXMLNodeRef node, - ) { - return _CFXMLNodeGetVersion( - node, - ); + DartNSURLResourceKey get NSURLVolumeIsLocalKey => + objc.NSString.castFromPointer(_NSURLVolumeIsLocalKey.value, + retain: true, release: true); + + set NSURLVolumeIsLocalKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsLocalKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsLocalKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLNodeGetVersionPtr = - _lookup>( - 'CFXMLNodeGetVersion'); - late final _CFXMLNodeGetVersion = - _CFXMLNodeGetVersionPtr.asFunction(); + /// true if the volume is read-only. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsReadOnlyKey = + _lookup('NSURLVolumeIsReadOnlyKey'); - CFXMLTreeRef CFXMLTreeCreateWithNode( - CFAllocatorRef allocator, - CFXMLNodeRef node, - ) { - return _CFXMLTreeCreateWithNode( - allocator, - node, - ); + DartNSURLResourceKey get NSURLVolumeIsReadOnlyKey => + objc.NSString.castFromPointer(_NSURLVolumeIsReadOnlyKey.value, + retain: true, release: true); + + set NSURLVolumeIsReadOnlyKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsReadOnlyKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsReadOnlyKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLTreeCreateWithNodePtr = _lookup< - ffi - .NativeFunction>( - 'CFXMLTreeCreateWithNode'); - late final _CFXMLTreeCreateWithNode = _CFXMLTreeCreateWithNodePtr.asFunction< - CFXMLTreeRef Function(CFAllocatorRef, CFXMLNodeRef)>(); + /// The volume's creation date, or nil if this cannot be determined. (Read-only, value type NSDate) + late final ffi.Pointer _NSURLVolumeCreationDateKey = + _lookup('NSURLVolumeCreationDateKey'); - CFXMLNodeRef CFXMLTreeGetNode( - CFXMLTreeRef xmlTree, - ) { - return _CFXMLTreeGetNode( - xmlTree, - ); + DartNSURLResourceKey get NSURLVolumeCreationDateKey => + objc.NSString.castFromPointer(_NSURLVolumeCreationDateKey.value, + retain: true, release: true); + + set NSURLVolumeCreationDateKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeCreationDateKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeCreationDateKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLTreeGetNodePtr = - _lookup>( - 'CFXMLTreeGetNode'); - late final _CFXMLTreeGetNode = - _CFXMLTreeGetNodePtr.asFunction(); + /// The NSURL needed to remount a network volume, or nil if not available. (Read-only, value type NSURL) + late final ffi.Pointer _NSURLVolumeURLForRemountingKey = + _lookup('NSURLVolumeURLForRemountingKey'); - int CFXMLParserGetTypeID() { - return _CFXMLParserGetTypeID(); + DartNSURLResourceKey get NSURLVolumeURLForRemountingKey => + objc.NSString.castFromPointer(_NSURLVolumeURLForRemountingKey.value, + retain: true, release: true); + + set NSURLVolumeURLForRemountingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeURLForRemountingKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeURLForRemountingKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetTypeIDPtr = - _lookup>('CFXMLParserGetTypeID'); - late final _CFXMLParserGetTypeID = - _CFXMLParserGetTypeIDPtr.asFunction(); + /// The volume's persistent UUID as a string, or nil if a persistent UUID is not available for the volume. (Read-only, value type NSString) + late final ffi.Pointer _NSURLVolumeUUIDStringKey = + _lookup('NSURLVolumeUUIDStringKey'); - CFXMLParserRef CFXMLParserCreate( - CFAllocatorRef allocator, - CFDataRef xmlData, - CFURLRef dataSource, - int parseOptions, - int versionOfNodes, - ffi.Pointer callBacks, - ffi.Pointer context, - ) { - return _CFXMLParserCreate( - allocator, - xmlData, - dataSource, - parseOptions, - versionOfNodes, - callBacks, - context, - ); + DartNSURLResourceKey get NSURLVolumeUUIDStringKey => + objc.NSString.castFromPointer(_NSURLVolumeUUIDStringKey.value, + retain: true, release: true); + + set NSURLVolumeUUIDStringKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeUUIDStringKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeUUIDStringKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLParserCreatePtr = _lookup< - ffi.NativeFunction< - CFXMLParserRef Function( - CFAllocatorRef, - CFDataRef, - CFURLRef, - CFOptionFlags, - CFIndex, - ffi.Pointer, - ffi.Pointer)>>('CFXMLParserCreate'); - late final _CFXMLParserCreate = _CFXMLParserCreatePtr.asFunction< - CFXMLParserRef Function( - CFAllocatorRef, - CFDataRef, - CFURLRef, - int, - int, - ffi.Pointer, - ffi.Pointer)>(); + /// The name of the volume (Read-write if NSURLVolumeSupportsRenamingKey is YES, otherwise read-only, value type NSString) + late final ffi.Pointer _NSURLVolumeNameKey = + _lookup('NSURLVolumeNameKey'); - CFXMLParserRef CFXMLParserCreateWithDataFromURL( - CFAllocatorRef allocator, - CFURLRef dataSource, - int parseOptions, - int versionOfNodes, - ffi.Pointer callBacks, - ffi.Pointer context, - ) { - return _CFXMLParserCreateWithDataFromURL( - allocator, - dataSource, - parseOptions, - versionOfNodes, - callBacks, - context, - ); + DartNSURLResourceKey get NSURLVolumeNameKey => + objc.NSString.castFromPointer(_NSURLVolumeNameKey.value, + retain: true, release: true); + + set NSURLVolumeNameKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeNameKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeNameKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLParserCreateWithDataFromURLPtr = _lookup< - ffi.NativeFunction< - CFXMLParserRef Function( - CFAllocatorRef, - CFURLRef, - CFOptionFlags, - CFIndex, - ffi.Pointer, - ffi.Pointer)>>( - 'CFXMLParserCreateWithDataFromURL'); - late final _CFXMLParserCreateWithDataFromURL = - _CFXMLParserCreateWithDataFromURLPtr.asFunction< - CFXMLParserRef Function( - CFAllocatorRef, - CFURLRef, - int, - int, - ffi.Pointer, - ffi.Pointer)>(); + /// The user-presentable name of the volume (Read-only, value type NSString) + late final ffi.Pointer _NSURLVolumeLocalizedNameKey = + _lookup('NSURLVolumeLocalizedNameKey'); - void CFXMLParserGetContext( - CFXMLParserRef parser, - ffi.Pointer context, - ) { - return _CFXMLParserGetContext( - parser, - context, - ); + DartNSURLResourceKey get NSURLVolumeLocalizedNameKey => + objc.NSString.castFromPointer(_NSURLVolumeLocalizedNameKey.value, + retain: true, release: true); + + set NSURLVolumeLocalizedNameKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeLocalizedNameKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeLocalizedNameKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetContextPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFXMLParserRef, - ffi.Pointer)>>('CFXMLParserGetContext'); - late final _CFXMLParserGetContext = _CFXMLParserGetContextPtr.asFunction< - void Function(CFXMLParserRef, ffi.Pointer)>(); + /// true if the volume is encrypted. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsEncryptedKey = + _lookup('NSURLVolumeIsEncryptedKey'); - void CFXMLParserGetCallBacks( - CFXMLParserRef parser, - ffi.Pointer callBacks, - ) { - return _CFXMLParserGetCallBacks( - parser, - callBacks, - ); + DartNSURLResourceKey get NSURLVolumeIsEncryptedKey => + objc.NSString.castFromPointer(_NSURLVolumeIsEncryptedKey.value, + retain: true, release: true); + + set NSURLVolumeIsEncryptedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsEncryptedKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsEncryptedKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetCallBacksPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(CFXMLParserRef, - ffi.Pointer)>>('CFXMLParserGetCallBacks'); - late final _CFXMLParserGetCallBacks = _CFXMLParserGetCallBacksPtr.asFunction< - void Function(CFXMLParserRef, ffi.Pointer)>(); + /// true if the volume is the root filesystem. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeIsRootFileSystemKey = + _lookup('NSURLVolumeIsRootFileSystemKey'); - CFURLRef CFXMLParserGetSourceURL( - CFXMLParserRef parser, - ) { - return _CFXMLParserGetSourceURL( - parser, - ); + DartNSURLResourceKey get NSURLVolumeIsRootFileSystemKey => + objc.NSString.castFromPointer(_NSURLVolumeIsRootFileSystemKey.value, + retain: true, release: true); + + set NSURLVolumeIsRootFileSystemKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeIsRootFileSystemKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeIsRootFileSystemKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetSourceURLPtr = - _lookup>( - 'CFXMLParserGetSourceURL'); - late final _CFXMLParserGetSourceURL = _CFXMLParserGetSourceURLPtr.asFunction< - CFURLRef Function(CFXMLParserRef)>(); + /// true if the volume supports transparent decompression of compressed files using decmpfs. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsCompressionKey = + _lookup('NSURLVolumeSupportsCompressionKey'); - int CFXMLParserGetLocation( - CFXMLParserRef parser, - ) { - return _CFXMLParserGetLocation( - parser, - ); + DartNSURLResourceKey get NSURLVolumeSupportsCompressionKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsCompressionKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsCompressionKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsCompressionKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsCompressionKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetLocationPtr = - _lookup>( - 'CFXMLParserGetLocation'); - late final _CFXMLParserGetLocation = - _CFXMLParserGetLocationPtr.asFunction(); + /// true if the volume supports clonefile(2) (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsFileCloningKey = + _lookup('NSURLVolumeSupportsFileCloningKey'); - int CFXMLParserGetLineNumber( - CFXMLParserRef parser, - ) { - return _CFXMLParserGetLineNumber( - parser, - ); + DartNSURLResourceKey get NSURLVolumeSupportsFileCloningKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsFileCloningKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsFileCloningKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsFileCloningKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsFileCloningKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetLineNumberPtr = - _lookup>( - 'CFXMLParserGetLineNumber'); - late final _CFXMLParserGetLineNumber = - _CFXMLParserGetLineNumberPtr.asFunction(); + /// true if the volume supports renamex_np(2)'s RENAME_SWAP option (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLVolumeSupportsSwapRenamingKey = + _lookup('NSURLVolumeSupportsSwapRenamingKey'); - ffi.Pointer CFXMLParserGetDocument( - CFXMLParserRef parser, - ) { - return _CFXMLParserGetDocument( - parser, - ); + DartNSURLResourceKey get NSURLVolumeSupportsSwapRenamingKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsSwapRenamingKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsSwapRenamingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsSwapRenamingKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsSwapRenamingKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetDocumentPtr = _lookup< - ffi.NativeFunction Function(CFXMLParserRef)>>( - 'CFXMLParserGetDocument'); - late final _CFXMLParserGetDocument = _CFXMLParserGetDocumentPtr.asFunction< - ffi.Pointer Function(CFXMLParserRef)>(); + /// true if the volume supports renamex_np(2)'s RENAME_EXCL option (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsExclusiveRenamingKey = + _lookup('NSURLVolumeSupportsExclusiveRenamingKey'); - int CFXMLParserGetStatusCode( - CFXMLParserRef parser, - ) { - return _CFXMLParserGetStatusCode( - parser, - ); + DartNSURLResourceKey get NSURLVolumeSupportsExclusiveRenamingKey => + objc.NSString.castFromPointer( + _NSURLVolumeSupportsExclusiveRenamingKey.value, + retain: true, + release: true); + + set NSURLVolumeSupportsExclusiveRenamingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeSupportsExclusiveRenamingKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeSupportsExclusiveRenamingKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLParserGetStatusCodePtr = - _lookup>( - 'CFXMLParserGetStatusCode'); - late final _CFXMLParserGetStatusCode = - _CFXMLParserGetStatusCodePtr.asFunction(); + /// true if the volume supports making files immutable with the NSURLIsUserImmutableKey or NSURLIsSystemImmutableKey properties (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsImmutableFilesKey = + _lookup('NSURLVolumeSupportsImmutableFilesKey'); - CFStringRef CFXMLParserCopyErrorDescription( - CFXMLParserRef parser, - ) { - return _CFXMLParserCopyErrorDescription( - parser, - ); + DartNSURLResourceKey get NSURLVolumeSupportsImmutableFilesKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsImmutableFilesKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsImmutableFilesKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsImmutableFilesKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsImmutableFilesKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLParserCopyErrorDescriptionPtr = - _lookup>( - 'CFXMLParserCopyErrorDescription'); - late final _CFXMLParserCopyErrorDescription = - _CFXMLParserCopyErrorDescriptionPtr.asFunction< - CFStringRef Function(CFXMLParserRef)>(); + /// true if the volume supports setting POSIX access permissions with the NSURLFileSecurityKey property (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsAccessPermissionsKey = + _lookup('NSURLVolumeSupportsAccessPermissionsKey'); - void CFXMLParserAbort( - CFXMLParserRef parser, - int errorCode, - CFStringRef errorDescription, - ) { - return _CFXMLParserAbort( - parser, - errorCode, - errorDescription, - ); + DartNSURLResourceKey get NSURLVolumeSupportsAccessPermissionsKey => + objc.NSString.castFromPointer( + _NSURLVolumeSupportsAccessPermissionsKey.value, + retain: true, + release: true); + + set NSURLVolumeSupportsAccessPermissionsKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeSupportsAccessPermissionsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeSupportsAccessPermissionsKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLParserAbortPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - CFXMLParserRef, ffi.Int32, CFStringRef)>>('CFXMLParserAbort'); - late final _CFXMLParserAbort = _CFXMLParserAbortPtr.asFunction< - void Function(CFXMLParserRef, int, CFStringRef)>(); + /// True if the volume supports the File Protection attribute (see NSURLFileProtectionKey). (Read-only, value type NSNumber) + late final ffi.Pointer + _NSURLVolumeSupportsFileProtectionKey = + _lookup('NSURLVolumeSupportsFileProtectionKey'); - int CFXMLParserParse( - CFXMLParserRef parser, - ) { - return _CFXMLParserParse( - parser, - ); + DartNSURLResourceKey get NSURLVolumeSupportsFileProtectionKey => + objc.NSString.castFromPointer(_NSURLVolumeSupportsFileProtectionKey.value, + retain: true, release: true); + + set NSURLVolumeSupportsFileProtectionKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSupportsFileProtectionKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSupportsFileProtectionKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLParserParsePtr = - _lookup>( - 'CFXMLParserParse'); - late final _CFXMLParserParse = - _CFXMLParserParsePtr.asFunction(); + /// (Read-only, value type NSNumber) + late final ffi.Pointer + _NSURLVolumeAvailableCapacityForImportantUsageKey = + _lookup( + 'NSURLVolumeAvailableCapacityForImportantUsageKey'); - CFXMLTreeRef CFXMLTreeCreateFromData( - CFAllocatorRef allocator, - CFDataRef xmlData, - CFURLRef dataSource, - int parseOptions, - int versionOfNodes, - ) { - return _CFXMLTreeCreateFromData( - allocator, - xmlData, - dataSource, - parseOptions, - versionOfNodes, - ); + DartNSURLResourceKey get NSURLVolumeAvailableCapacityForImportantUsageKey => + objc.NSString.castFromPointer( + _NSURLVolumeAvailableCapacityForImportantUsageKey.value, + retain: true, + release: true); + + set NSURLVolumeAvailableCapacityForImportantUsageKey( + DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeAvailableCapacityForImportantUsageKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeAvailableCapacityForImportantUsageKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLTreeCreateFromDataPtr = _lookup< - ffi.NativeFunction< - CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, - CFOptionFlags, CFIndex)>>('CFXMLTreeCreateFromData'); - late final _CFXMLTreeCreateFromData = _CFXMLTreeCreateFromDataPtr.asFunction< - CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, int, int)>(); + /// (Read-only, value type NSNumber) + late final ffi.Pointer + _NSURLVolumeAvailableCapacityForOpportunisticUsageKey = + _lookup( + 'NSURLVolumeAvailableCapacityForOpportunisticUsageKey'); - CFXMLTreeRef CFXMLTreeCreateFromDataWithError( - CFAllocatorRef allocator, - CFDataRef xmlData, - CFURLRef dataSource, - int parseOptions, - int versionOfNodes, - ffi.Pointer errorDict, - ) { - return _CFXMLTreeCreateFromDataWithError( - allocator, - xmlData, - dataSource, - parseOptions, - versionOfNodes, - errorDict, - ); + DartNSURLResourceKey + get NSURLVolumeAvailableCapacityForOpportunisticUsageKey => + objc.NSString.castFromPointer( + _NSURLVolumeAvailableCapacityForOpportunisticUsageKey.value, + retain: true, + release: true); + + set NSURLVolumeAvailableCapacityForOpportunisticUsageKey( + DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLVolumeAvailableCapacityForOpportunisticUsageKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLVolumeAvailableCapacityForOpportunisticUsageKey.value = + value.ref.retainAndReturnPointer(); } - late final _CFXMLTreeCreateFromDataWithErrorPtr = _lookup< - ffi.NativeFunction< - CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, - CFOptionFlags, CFIndex, ffi.Pointer)>>( - 'CFXMLTreeCreateFromDataWithError'); - late final _CFXMLTreeCreateFromDataWithError = - _CFXMLTreeCreateFromDataWithErrorPtr.asFunction< - CFXMLTreeRef Function(CFAllocatorRef, CFDataRef, CFURLRef, int, int, - ffi.Pointer)>(); + /// The name of the file system type. (Read-only, value type NSString) + late final ffi.Pointer _NSURLVolumeTypeNameKey = + _lookup('NSURLVolumeTypeNameKey'); - CFXMLTreeRef CFXMLTreeCreateWithDataFromURL( - CFAllocatorRef allocator, - CFURLRef dataSource, - int parseOptions, - int versionOfNodes, - ) { - return _CFXMLTreeCreateWithDataFromURL( - allocator, - dataSource, - parseOptions, - versionOfNodes, - ); + DartNSURLResourceKey get NSURLVolumeTypeNameKey => + objc.NSString.castFromPointer(_NSURLVolumeTypeNameKey.value, + retain: true, release: true); + + set NSURLVolumeTypeNameKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeTypeNameKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeTypeNameKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLTreeCreateWithDataFromURLPtr = _lookup< - ffi.NativeFunction< - CFXMLTreeRef Function(CFAllocatorRef, CFURLRef, CFOptionFlags, - CFIndex)>>('CFXMLTreeCreateWithDataFromURL'); - late final _CFXMLTreeCreateWithDataFromURL = - _CFXMLTreeCreateWithDataFromURLPtr.asFunction< - CFXMLTreeRef Function(CFAllocatorRef, CFURLRef, int, int)>(); + /// The file system subtype value. (Read-only, value type NSNumber) + late final ffi.Pointer _NSURLVolumeSubtypeKey = + _lookup('NSURLVolumeSubtypeKey'); - CFDataRef CFXMLTreeCreateXMLData( - CFAllocatorRef allocator, - CFXMLTreeRef xmlTree, - ) { - return _CFXMLTreeCreateXMLData( - allocator, - xmlTree, - ); + DartNSURLResourceKey get NSURLVolumeSubtypeKey => + objc.NSString.castFromPointer(_NSURLVolumeSubtypeKey.value, + retain: true, release: true); + + set NSURLVolumeSubtypeKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeSubtypeKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeSubtypeKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLTreeCreateXMLDataPtr = _lookup< - ffi.NativeFunction>( - 'CFXMLTreeCreateXMLData'); - late final _CFXMLTreeCreateXMLData = _CFXMLTreeCreateXMLDataPtr.asFunction< - CFDataRef Function(CFAllocatorRef, CFXMLTreeRef)>(); + /// The volume mounted from location. (Read-only, value type NSString) + late final ffi.Pointer _NSURLVolumeMountFromLocationKey = + _lookup('NSURLVolumeMountFromLocationKey'); - CFStringRef CFXMLCreateStringByEscapingEntities( - CFAllocatorRef allocator, - CFStringRef string, - CFDictionaryRef entitiesDictionary, - ) { - return _CFXMLCreateStringByEscapingEntities( - allocator, - string, - entitiesDictionary, - ); + DartNSURLResourceKey get NSURLVolumeMountFromLocationKey => + objc.NSString.castFromPointer(_NSURLVolumeMountFromLocationKey.value, + retain: true, release: true); + + set NSURLVolumeMountFromLocationKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLVolumeMountFromLocationKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLVolumeMountFromLocationKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLCreateStringByEscapingEntitiesPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, - CFDictionaryRef)>>('CFXMLCreateStringByEscapingEntities'); - late final _CFXMLCreateStringByEscapingEntities = - _CFXMLCreateStringByEscapingEntitiesPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, CFDictionaryRef)>(); + /// true if this item is synced to the cloud, false if it is only a local file. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLIsUbiquitousItemKey = + _lookup('NSURLIsUbiquitousItemKey'); - CFStringRef CFXMLCreateStringByUnescapingEntities( - CFAllocatorRef allocator, - CFStringRef string, - CFDictionaryRef entitiesDictionary, - ) { - return _CFXMLCreateStringByUnescapingEntities( - allocator, - string, - entitiesDictionary, - ); + DartNSURLResourceKey get NSURLIsUbiquitousItemKey => + objc.NSString.castFromPointer(_NSURLIsUbiquitousItemKey.value, + retain: true, release: true); + + set NSURLIsUbiquitousItemKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLIsUbiquitousItemKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLIsUbiquitousItemKey.value = value.ref.retainAndReturnPointer(); } - late final _CFXMLCreateStringByUnescapingEntitiesPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, - CFDictionaryRef)>>('CFXMLCreateStringByUnescapingEntities'); - late final _CFXMLCreateStringByUnescapingEntities = - _CFXMLCreateStringByUnescapingEntitiesPtr.asFunction< - CFStringRef Function(CFAllocatorRef, CFStringRef, CFDictionaryRef)>(); + /// true if this item has conflicts outstanding. (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLUbiquitousItemHasUnresolvedConflictsKey = + _lookup('NSURLUbiquitousItemHasUnresolvedConflictsKey'); - late final ffi.Pointer _kCFXMLTreeErrorDescription = - _lookup('kCFXMLTreeErrorDescription'); + DartNSURLResourceKey get NSURLUbiquitousItemHasUnresolvedConflictsKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemHasUnresolvedConflictsKey.value, + retain: true, + release: true); - CFStringRef get kCFXMLTreeErrorDescription => - _kCFXMLTreeErrorDescription.value; + set NSURLUbiquitousItemHasUnresolvedConflictsKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemHasUnresolvedConflictsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemHasUnresolvedConflictsKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _kCFXMLTreeErrorLineNumber = - _lookup('kCFXMLTreeErrorLineNumber'); + /// equivalent to NSURLUbiquitousItemDownloadingStatusKey == NSURLUbiquitousItemDownloadingStatusCurrent. Has never behaved as documented in earlier releases, hence deprecated. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLUbiquitousItemIsDownloadedKey = + _lookup('NSURLUbiquitousItemIsDownloadedKey'); - CFStringRef get kCFXMLTreeErrorLineNumber => _kCFXMLTreeErrorLineNumber.value; + DartNSURLResourceKey get NSURLUbiquitousItemIsDownloadedKey => + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsDownloadedKey.value, + retain: true, release: true); - late final ffi.Pointer _kCFXMLTreeErrorLocation = - _lookup('kCFXMLTreeErrorLocation'); + set NSURLUbiquitousItemIsDownloadedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsDownloadedKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemIsDownloadedKey.value = + value.ref.retainAndReturnPointer(); + } - CFStringRef get kCFXMLTreeErrorLocation => _kCFXMLTreeErrorLocation.value; + /// true if data is being downloaded for this item. (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLUbiquitousItemIsDownloadingKey = + _lookup('NSURLUbiquitousItemIsDownloadingKey'); - late final ffi.Pointer _kCFXMLTreeErrorStatusCode = - _lookup('kCFXMLTreeErrorStatusCode'); + DartNSURLResourceKey get NSURLUbiquitousItemIsDownloadingKey => + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsDownloadingKey.value, + retain: true, release: true); - CFStringRef get kCFXMLTreeErrorStatusCode => _kCFXMLTreeErrorStatusCode.value; + set NSURLUbiquitousItemIsDownloadingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsDownloadingKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemIsDownloadingKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _gGuidCssm = - _lookup('gGuidCssm'); + /// true if there is data present in the cloud for this item. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLUbiquitousItemIsUploadedKey = + _lookup('NSURLUbiquitousItemIsUploadedKey'); - CSSM_GUID get gGuidCssm => _gGuidCssm.ref; + DartNSURLResourceKey get NSURLUbiquitousItemIsUploadedKey => + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsUploadedKey.value, + retain: true, release: true); - late final ffi.Pointer _gGuidAppleFileDL = - _lookup('gGuidAppleFileDL'); + set NSURLUbiquitousItemIsUploadedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsUploadedKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemIsUploadedKey.value = + value.ref.retainAndReturnPointer(); + } - CSSM_GUID get gGuidAppleFileDL => _gGuidAppleFileDL.ref; + /// true if data is being uploaded for this item. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLUbiquitousItemIsUploadingKey = + _lookup('NSURLUbiquitousItemIsUploadingKey'); - late final ffi.Pointer _gGuidAppleCSP = - _lookup('gGuidAppleCSP'); + DartNSURLResourceKey get NSURLUbiquitousItemIsUploadingKey => + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsUploadingKey.value, + retain: true, release: true); - CSSM_GUID get gGuidAppleCSP => _gGuidAppleCSP.ref; + set NSURLUbiquitousItemIsUploadingKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsUploadingKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemIsUploadingKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _gGuidAppleCSPDL = - _lookup('gGuidAppleCSPDL'); + /// Use NSMetadataQuery and NSMetadataUbiquitousItemPercentDownloadedKey on NSMetadataItem instead + late final ffi.Pointer + _NSURLUbiquitousItemPercentDownloadedKey = + _lookup('NSURLUbiquitousItemPercentDownloadedKey'); - CSSM_GUID get gGuidAppleCSPDL => _gGuidAppleCSPDL.ref; + DartNSURLResourceKey get NSURLUbiquitousItemPercentDownloadedKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemPercentDownloadedKey.value, + retain: true, + release: true); - late final ffi.Pointer _gGuidAppleX509CL = - _lookup('gGuidAppleX509CL'); + set NSURLUbiquitousItemPercentDownloadedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemPercentDownloadedKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemPercentDownloadedKey.value = + value.ref.retainAndReturnPointer(); + } - CSSM_GUID get gGuidAppleX509CL => _gGuidAppleX509CL.ref; + /// Use NSMetadataQuery and NSMetadataUbiquitousItemPercentUploadedKey on NSMetadataItem instead + late final ffi.Pointer + _NSURLUbiquitousItemPercentUploadedKey = + _lookup('NSURLUbiquitousItemPercentUploadedKey'); - late final ffi.Pointer _gGuidAppleX509TP = - _lookup('gGuidAppleX509TP'); + DartNSURLResourceKey get NSURLUbiquitousItemPercentUploadedKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemPercentUploadedKey.value, + retain: true, + release: true); - CSSM_GUID get gGuidAppleX509TP => _gGuidAppleX509TP.ref; + set NSURLUbiquitousItemPercentUploadedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemPercentUploadedKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemPercentUploadedKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _gGuidAppleLDAPDL = - _lookup('gGuidAppleLDAPDL'); + /// returns the download status of this item. (Read-only, value type NSString). Possible values below. + late final ffi.Pointer + _NSURLUbiquitousItemDownloadingStatusKey = + _lookup('NSURLUbiquitousItemDownloadingStatusKey'); - CSSM_GUID get gGuidAppleLDAPDL => _gGuidAppleLDAPDL.ref; + DartNSURLResourceKey get NSURLUbiquitousItemDownloadingStatusKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusKey.value, + retain: true, + release: true); - late final ffi.Pointer _gGuidAppleDotMacTP = - _lookup('gGuidAppleDotMacTP'); + set NSURLUbiquitousItemDownloadingStatusKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemDownloadingStatusKey.value = + value.ref.retainAndReturnPointer(); + } - CSSM_GUID get gGuidAppleDotMacTP => _gGuidAppleDotMacTP.ref; + /// returns the error when downloading the item from iCloud failed, see the NSUbiquitousFile section in FoundationErrors.h (Read-only, value type NSError) + late final ffi.Pointer + _NSURLUbiquitousItemDownloadingErrorKey = + _lookup('NSURLUbiquitousItemDownloadingErrorKey'); - late final ffi.Pointer _gGuidAppleSdCSPDL = - _lookup('gGuidAppleSdCSPDL'); + DartNSURLResourceKey get NSURLUbiquitousItemDownloadingErrorKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingErrorKey.value, + retain: true, + release: true); - CSSM_GUID get gGuidAppleSdCSPDL => _gGuidAppleSdCSPDL.ref; + set NSURLUbiquitousItemDownloadingErrorKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemDownloadingErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemDownloadingErrorKey.value = + value.ref.retainAndReturnPointer(); + } - late final ffi.Pointer _gGuidAppleDotMacDL = - _lookup('gGuidAppleDotMacDL'); + /// returns the error when uploading the item to iCloud failed, see the NSUbiquitousFile section in FoundationErrors.h (Read-only, value type NSError) + late final ffi.Pointer + _NSURLUbiquitousItemUploadingErrorKey = + _lookup('NSURLUbiquitousItemUploadingErrorKey'); - CSSM_GUID get gGuidAppleDotMacDL => _gGuidAppleDotMacDL.ref; + DartNSURLResourceKey get NSURLUbiquitousItemUploadingErrorKey => + objc.NSString.castFromPointer(_NSURLUbiquitousItemUploadingErrorKey.value, + retain: true, release: true); - void cssmPerror( - ffi.Pointer how, - int error, - ) { - return _cssmPerror( - how, - error, - ); + set NSURLUbiquitousItemUploadingErrorKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemUploadingErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemUploadingErrorKey.value = + value.ref.retainAndReturnPointer(); } - late final _cssmPerrorPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, CSSM_RETURN)>>('cssmPerror'); - late final _cssmPerror = - _cssmPerrorPtr.asFunction, int)>(); + /// returns whether a download of this item has already been requested with an API like -startDownloadingUbiquitousItemAtURL:error: (Read-only, value type boolean NSNumber) + late final ffi.Pointer + _NSURLUbiquitousItemDownloadRequestedKey = + _lookup('NSURLUbiquitousItemDownloadRequestedKey'); - bool cssmOidToAlg( - ffi.Pointer oid, - ffi.Pointer alg, - ) { - return _cssmOidToAlg( - oid, - alg, - ); + DartNSURLResourceKey get NSURLUbiquitousItemDownloadRequestedKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadRequestedKey.value, + retain: true, + release: true); + + set NSURLUbiquitousItemDownloadRequestedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadRequestedKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemDownloadRequestedKey.value = + value.ref.retainAndReturnPointer(); } - late final _cssmOidToAlgPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, - ffi.Pointer)>>('cssmOidToAlg'); - late final _cssmOidToAlg = _cssmOidToAlgPtr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer)>(); + /// returns the name of this item's container as displayed to users. + late final ffi.Pointer + _NSURLUbiquitousItemContainerDisplayNameKey = + _lookup('NSURLUbiquitousItemContainerDisplayNameKey'); - ffi.Pointer cssmAlgToOid( - int algId, - ) { - return _cssmAlgToOid( - algId, - ); + DartNSURLResourceKey get NSURLUbiquitousItemContainerDisplayNameKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemContainerDisplayNameKey.value, + retain: true, + release: true); + + set NSURLUbiquitousItemContainerDisplayNameKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemContainerDisplayNameKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemContainerDisplayNameKey.value = + value.ref.retainAndReturnPointer(); } - late final _cssmAlgToOidPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(CSSM_ALGORITHMS)>>('cssmAlgToOid'); - late final _cssmAlgToOid = - _cssmAlgToOidPtr.asFunction Function(int)>(); + /// true if the item is excluded from sync, which means it is locally on disk but won't be available on the server. An excluded item is no longer ubiquitous. (Read-write, value type boolean NSNumber + late final ffi.Pointer + _NSURLUbiquitousItemIsExcludedFromSyncKey = + _lookup('NSURLUbiquitousItemIsExcludedFromSyncKey'); - late final ffi.Pointer _kSecPropertyTypeTitle = - _lookup('kSecPropertyTypeTitle'); + DartNSURLResourceKey get NSURLUbiquitousItemIsExcludedFromSyncKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemIsExcludedFromSyncKey.value, + retain: true, + release: true); - CFStringRef get kSecPropertyTypeTitle => _kSecPropertyTypeTitle.value; + set NSURLUbiquitousItemIsExcludedFromSyncKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemIsExcludedFromSyncKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemIsExcludedFromSyncKey.value = + value.ref.retainAndReturnPointer(); + } - set kSecPropertyTypeTitle(CFStringRef value) => - _kSecPropertyTypeTitle.value = value; + /// true if the ubiquitous item is shared. (Read-only, value type boolean NSNumber) + late final ffi.Pointer _NSURLUbiquitousItemIsSharedKey = + _lookup('NSURLUbiquitousItemIsSharedKey'); - late final ffi.Pointer _kSecPropertyTypeError = - _lookup('kSecPropertyTypeError'); + DartNSURLResourceKey get NSURLUbiquitousItemIsSharedKey => + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsSharedKey.value, + retain: true, release: true); - CFStringRef get kSecPropertyTypeError => _kSecPropertyTypeError.value; + set NSURLUbiquitousItemIsSharedKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer(_NSURLUbiquitousItemIsSharedKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousItemIsSharedKey.value = value.ref.retainAndReturnPointer(); + } - set kSecPropertyTypeError(CFStringRef value) => - _kSecPropertyTypeError.value = value; + /// returns the current user's role for this shared item, or nil if not shared. (Read-only, value type NSString). Possible values below. + late final ffi.Pointer + _NSURLUbiquitousSharedItemCurrentUserRoleKey = + _lookup('NSURLUbiquitousSharedItemCurrentUserRoleKey'); - late final ffi.Pointer _kSecTrustEvaluationDate = - _lookup('kSecTrustEvaluationDate'); + DartNSURLResourceKey get NSURLUbiquitousSharedItemCurrentUserRoleKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemCurrentUserRoleKey.value, + retain: true, + release: true); - CFStringRef get kSecTrustEvaluationDate => _kSecTrustEvaluationDate.value; + set NSURLUbiquitousSharedItemCurrentUserRoleKey(DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemCurrentUserRoleKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemCurrentUserRoleKey.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustEvaluationDate(CFStringRef value) => - _kSecTrustEvaluationDate.value = value; + /// returns the permissions for the current user, or nil if not shared. (Read-only, value type NSString). Possible values below. + late final ffi.Pointer + _NSURLUbiquitousSharedItemCurrentUserPermissionsKey = + _lookup( + 'NSURLUbiquitousSharedItemCurrentUserPermissionsKey'); - late final ffi.Pointer _kSecTrustExtendedValidation = - _lookup('kSecTrustExtendedValidation'); + DartNSURLResourceKey get NSURLUbiquitousSharedItemCurrentUserPermissionsKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemCurrentUserPermissionsKey.value, + retain: true, + release: true); - CFStringRef get kSecTrustExtendedValidation => - _kSecTrustExtendedValidation.value; + set NSURLUbiquitousSharedItemCurrentUserPermissionsKey( + DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemCurrentUserPermissionsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemCurrentUserPermissionsKey.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustExtendedValidation(CFStringRef value) => - _kSecTrustExtendedValidation.value = value; + /// returns a NSPersonNameComponents, or nil if the current user. (Read-only, value type NSPersonNameComponents) + late final ffi.Pointer + _NSURLUbiquitousSharedItemOwnerNameComponentsKey = + _lookup( + 'NSURLUbiquitousSharedItemOwnerNameComponentsKey'); - late final ffi.Pointer _kSecTrustOrganizationName = - _lookup('kSecTrustOrganizationName'); + DartNSURLResourceKey get NSURLUbiquitousSharedItemOwnerNameComponentsKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemOwnerNameComponentsKey.value, + retain: true, + release: true); - CFStringRef get kSecTrustOrganizationName => _kSecTrustOrganizationName.value; + set NSURLUbiquitousSharedItemOwnerNameComponentsKey( + DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemOwnerNameComponentsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemOwnerNameComponentsKey.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustOrganizationName(CFStringRef value) => - _kSecTrustOrganizationName.value = value; + /// returns a NSPersonNameComponents for the most recent editor of the document, or nil if it is the current user. (Read-only, value type NSPersonNameComponents) + late final ffi.Pointer + _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey = + _lookup( + 'NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey'); - late final ffi.Pointer _kSecTrustResultValue = - _lookup('kSecTrustResultValue'); + DartNSURLResourceKey + get NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey => + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey.value, + retain: true, + release: true); - CFStringRef get kSecTrustResultValue => _kSecTrustResultValue.value; + set NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey( + DartNSURLResourceKey value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustResultValue(CFStringRef value) => - _kSecTrustResultValue.value = value; + /// this item has not been downloaded yet. Use startDownloadingUbiquitousItemAtURL:error: to download it. + late final ffi.Pointer + _NSURLUbiquitousItemDownloadingStatusNotDownloaded = + _lookup( + 'NSURLUbiquitousItemDownloadingStatusNotDownloaded'); - late final ffi.Pointer _kSecTrustRevocationChecked = - _lookup('kSecTrustRevocationChecked'); + DartNSURLUbiquitousItemDownloadingStatus + get NSURLUbiquitousItemDownloadingStatusNotDownloaded => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusNotDownloaded.value, + retain: true, + release: true); - CFStringRef get kSecTrustRevocationChecked => - _kSecTrustRevocationChecked.value; + set NSURLUbiquitousItemDownloadingStatusNotDownloaded( + DartNSURLUbiquitousItemDownloadingStatus value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusNotDownloaded.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemDownloadingStatusNotDownloaded.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustRevocationChecked(CFStringRef value) => - _kSecTrustRevocationChecked.value = value; + /// there is a local version of this item available. The most current version will get downloaded as soon as possible. + late final ffi.Pointer + _NSURLUbiquitousItemDownloadingStatusDownloaded = + _lookup( + 'NSURLUbiquitousItemDownloadingStatusDownloaded'); - late final ffi.Pointer _kSecTrustRevocationValidUntilDate = - _lookup('kSecTrustRevocationValidUntilDate'); + DartNSURLUbiquitousItemDownloadingStatus + get NSURLUbiquitousItemDownloadingStatusDownloaded => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusDownloaded.value, + retain: true, + release: true); - CFStringRef get kSecTrustRevocationValidUntilDate => - _kSecTrustRevocationValidUntilDate.value; + set NSURLUbiquitousItemDownloadingStatusDownloaded( + DartNSURLUbiquitousItemDownloadingStatus value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusDownloaded.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemDownloadingStatusDownloaded.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustRevocationValidUntilDate(CFStringRef value) => - _kSecTrustRevocationValidUntilDate.value = value; + /// there is a local version of this item and it is the most up-to-date version known to this device. + late final ffi.Pointer + _NSURLUbiquitousItemDownloadingStatusCurrent = + _lookup( + 'NSURLUbiquitousItemDownloadingStatusCurrent'); - late final ffi.Pointer _kSecTrustCertificateTransparency = - _lookup('kSecTrustCertificateTransparency'); + DartNSURLUbiquitousItemDownloadingStatus + get NSURLUbiquitousItemDownloadingStatusCurrent => + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusCurrent.value, + retain: true, + release: true); - CFStringRef get kSecTrustCertificateTransparency => - _kSecTrustCertificateTransparency.value; + set NSURLUbiquitousItemDownloadingStatusCurrent( + DartNSURLUbiquitousItemDownloadingStatus value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousItemDownloadingStatusCurrent.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousItemDownloadingStatusCurrent.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustCertificateTransparency(CFStringRef value) => - _kSecTrustCertificateTransparency.value = value; + /// the current user is the owner of this shared item. + late final ffi.Pointer + _NSURLUbiquitousSharedItemRoleOwner = + _lookup( + 'NSURLUbiquitousSharedItemRoleOwner'); - late final ffi.Pointer - _kSecTrustCertificateTransparencyWhiteList = - _lookup('kSecTrustCertificateTransparencyWhiteList'); + DartNSURLUbiquitousSharedItemRole get NSURLUbiquitousSharedItemRoleOwner => + objc.NSString.castFromPointer(_NSURLUbiquitousSharedItemRoleOwner.value, + retain: true, release: true); - CFStringRef get kSecTrustCertificateTransparencyWhiteList => - _kSecTrustCertificateTransparencyWhiteList.value; + set NSURLUbiquitousSharedItemRoleOwner( + DartNSURLUbiquitousSharedItemRole value) { + objc.NSString.castFromPointer(_NSURLUbiquitousSharedItemRoleOwner.value, + retain: false, release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemRoleOwner.value = + value.ref.retainAndReturnPointer(); + } - set kSecTrustCertificateTransparencyWhiteList(CFStringRef value) => - _kSecTrustCertificateTransparencyWhiteList.value = value; + /// the current user is a participant of this shared item. + late final ffi.Pointer + _NSURLUbiquitousSharedItemRoleParticipant = + _lookup( + 'NSURLUbiquitousSharedItemRoleParticipant'); - int SecTrustGetTypeID() { - return _SecTrustGetTypeID(); + DartNSURLUbiquitousSharedItemRole + get NSURLUbiquitousSharedItemRoleParticipant => + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemRoleParticipant.value, + retain: true, + release: true); + + set NSURLUbiquitousSharedItemRoleParticipant( + DartNSURLUbiquitousSharedItemRole value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemRoleParticipant.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemRoleParticipant.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustGetTypeIDPtr = - _lookup>('SecTrustGetTypeID'); - late final _SecTrustGetTypeID = - _SecTrustGetTypeIDPtr.asFunction(); + /// the current user is only allowed to read this item + late final ffi.Pointer + _NSURLUbiquitousSharedItemPermissionsReadOnly = + _lookup( + 'NSURLUbiquitousSharedItemPermissionsReadOnly'); - int SecTrustCreateWithCertificates( - CFTypeRef certificates, - CFTypeRef policies, - ffi.Pointer trust, - ) { - return _SecTrustCreateWithCertificates( - certificates, - policies, - trust, - ); + DartNSURLUbiquitousSharedItemPermissions + get NSURLUbiquitousSharedItemPermissionsReadOnly => + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemPermissionsReadOnly.value, + retain: true, + release: true); + + set NSURLUbiquitousSharedItemPermissionsReadOnly( + DartNSURLUbiquitousSharedItemPermissions value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemPermissionsReadOnly.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemPermissionsReadOnly.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustCreateWithCertificatesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(CFTypeRef, CFTypeRef, - ffi.Pointer)>>('SecTrustCreateWithCertificates'); - late final _SecTrustCreateWithCertificates = - _SecTrustCreateWithCertificatesPtr.asFunction< - int Function(CFTypeRef, CFTypeRef, ffi.Pointer)>(); + /// the current user is allowed to both read and write this item + late final ffi.Pointer + _NSURLUbiquitousSharedItemPermissionsReadWrite = + _lookup( + 'NSURLUbiquitousSharedItemPermissionsReadWrite'); - int SecTrustSetPolicies( - SecTrustRef trust, - CFTypeRef policies, - ) { - return _SecTrustSetPolicies( - trust, - policies, - ); + DartNSURLUbiquitousSharedItemPermissions + get NSURLUbiquitousSharedItemPermissionsReadWrite => + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemPermissionsReadWrite.value, + retain: true, + release: true); + + set NSURLUbiquitousSharedItemPermissionsReadWrite( + DartNSURLUbiquitousSharedItemPermissions value) { + objc.NSString.castFromPointer( + _NSURLUbiquitousSharedItemPermissionsReadWrite.value, + retain: false, + release: true) + .ref + .release(); + _NSURLUbiquitousSharedItemPermissionsReadWrite.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustSetPoliciesPtr = - _lookup>( - 'SecTrustSetPolicies'); - late final _SecTrustSetPolicies = _SecTrustSetPoliciesPtr.asFunction< - int Function(SecTrustRef, CFTypeRef)>(); + late final ffi.Pointer _NSGenericException = + _lookup('NSGenericException'); - int SecTrustCopyPolicies( - SecTrustRef trust, - ffi.Pointer policies, - ) { - return _SecTrustCopyPolicies( - trust, - policies, - ); + DartNSExceptionName get NSGenericException => + objc.NSString.castFromPointer(_NSGenericException.value, + retain: true, release: true); + + set NSGenericException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSGenericException.value, + retain: false, release: true) + .ref + .release(); + _NSGenericException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustCopyPoliciesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SecTrustRef, ffi.Pointer)>>('SecTrustCopyPolicies'); - late final _SecTrustCopyPolicies = _SecTrustCopyPoliciesPtr.asFunction< - int Function(SecTrustRef, ffi.Pointer)>(); + late final ffi.Pointer _NSRangeException = + _lookup('NSRangeException'); - int SecTrustSetNetworkFetchAllowed( - SecTrustRef trust, - int allowFetch, - ) { - return _SecTrustSetNetworkFetchAllowed( - trust, - allowFetch, - ); + DartNSExceptionName get NSRangeException => + objc.NSString.castFromPointer(_NSRangeException.value, + retain: true, release: true); + + set NSRangeException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSRangeException.value, + retain: false, release: true) + .ref + .release(); + _NSRangeException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetNetworkFetchAllowedPtr = - _lookup>( - 'SecTrustSetNetworkFetchAllowed'); - late final _SecTrustSetNetworkFetchAllowed = - _SecTrustSetNetworkFetchAllowedPtr.asFunction< - int Function(SecTrustRef, int)>(); + late final ffi.Pointer _NSInvalidArgumentException = + _lookup('NSInvalidArgumentException'); - int SecTrustGetNetworkFetchAllowed( - SecTrustRef trust, - ffi.Pointer allowFetch, - ) { - return _SecTrustGetNetworkFetchAllowed( - trust, - allowFetch, - ); + DartNSExceptionName get NSInvalidArgumentException => + objc.NSString.castFromPointer(_NSInvalidArgumentException.value, + retain: true, release: true); + + set NSInvalidArgumentException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSInvalidArgumentException.value, + retain: false, release: true) + .ref + .release(); + _NSInvalidArgumentException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustGetNetworkFetchAllowedPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, - ffi.Pointer)>>('SecTrustGetNetworkFetchAllowed'); - late final _SecTrustGetNetworkFetchAllowed = - _SecTrustGetNetworkFetchAllowedPtr.asFunction< - int Function(SecTrustRef, ffi.Pointer)>(); + late final ffi.Pointer _NSInternalInconsistencyException = + _lookup('NSInternalInconsistencyException'); - int SecTrustSetAnchorCertificates( - SecTrustRef trust, - CFArrayRef anchorCertificates, - ) { - return _SecTrustSetAnchorCertificates( - trust, - anchorCertificates, - ); + DartNSExceptionName get NSInternalInconsistencyException => + objc.NSString.castFromPointer(_NSInternalInconsistencyException.value, + retain: true, release: true); + + set NSInternalInconsistencyException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSInternalInconsistencyException.value, + retain: false, release: true) + .ref + .release(); + _NSInternalInconsistencyException.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustSetAnchorCertificatesPtr = - _lookup>( - 'SecTrustSetAnchorCertificates'); - late final _SecTrustSetAnchorCertificates = _SecTrustSetAnchorCertificatesPtr - .asFunction(); + late final ffi.Pointer _NSMallocException = + _lookup('NSMallocException'); - int SecTrustSetAnchorCertificatesOnly( - SecTrustRef trust, - int anchorCertificatesOnly, - ) { - return _SecTrustSetAnchorCertificatesOnly( - trust, - anchorCertificatesOnly, - ); + DartNSExceptionName get NSMallocException => + objc.NSString.castFromPointer(_NSMallocException.value, + retain: true, release: true); + + set NSMallocException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSMallocException.value, + retain: false, release: true) + .ref + .release(); + _NSMallocException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetAnchorCertificatesOnlyPtr = - _lookup>( - 'SecTrustSetAnchorCertificatesOnly'); - late final _SecTrustSetAnchorCertificatesOnly = - _SecTrustSetAnchorCertificatesOnlyPtr.asFunction< - int Function(SecTrustRef, int)>(); + late final ffi.Pointer _NSObjectInaccessibleException = + _lookup('NSObjectInaccessibleException'); - int SecTrustCopyCustomAnchorCertificates( - SecTrustRef trust, - ffi.Pointer anchors, - ) { - return _SecTrustCopyCustomAnchorCertificates( - trust, - anchors, - ); + DartNSExceptionName get NSObjectInaccessibleException => + objc.NSString.castFromPointer(_NSObjectInaccessibleException.value, + retain: true, release: true); + + set NSObjectInaccessibleException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSObjectInaccessibleException.value, + retain: false, release: true) + .ref + .release(); + _NSObjectInaccessibleException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustCopyCustomAnchorCertificatesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, ffi.Pointer)>>( - 'SecTrustCopyCustomAnchorCertificates'); - late final _SecTrustCopyCustomAnchorCertificates = - _SecTrustCopyCustomAnchorCertificatesPtr.asFunction< - int Function(SecTrustRef, ffi.Pointer)>(); + late final ffi.Pointer _NSObjectNotAvailableException = + _lookup('NSObjectNotAvailableException'); - int SecTrustSetVerifyDate( - SecTrustRef trust, - CFDateRef verifyDate, - ) { - return _SecTrustSetVerifyDate( - trust, - verifyDate, - ); + DartNSExceptionName get NSObjectNotAvailableException => + objc.NSString.castFromPointer(_NSObjectNotAvailableException.value, + retain: true, release: true); + + set NSObjectNotAvailableException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSObjectNotAvailableException.value, + retain: false, release: true) + .ref + .release(); + _NSObjectNotAvailableException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetVerifyDatePtr = - _lookup>( - 'SecTrustSetVerifyDate'); - late final _SecTrustSetVerifyDate = _SecTrustSetVerifyDatePtr.asFunction< - int Function(SecTrustRef, CFDateRef)>(); + late final ffi.Pointer _NSDestinationInvalidException = + _lookup('NSDestinationInvalidException'); - double SecTrustGetVerifyTime( - SecTrustRef trust, - ) { - return _SecTrustGetVerifyTime( - trust, - ); + DartNSExceptionName get NSDestinationInvalidException => + objc.NSString.castFromPointer(_NSDestinationInvalidException.value, + retain: true, release: true); + + set NSDestinationInvalidException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSDestinationInvalidException.value, + retain: false, release: true) + .ref + .release(); + _NSDestinationInvalidException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustGetVerifyTimePtr = - _lookup>( - 'SecTrustGetVerifyTime'); - late final _SecTrustGetVerifyTime = - _SecTrustGetVerifyTimePtr.asFunction(); + late final ffi.Pointer _NSPortTimeoutException = + _lookup('NSPortTimeoutException'); - int SecTrustEvaluate( - SecTrustRef trust, - ffi.Pointer result, - ) { - return _SecTrustEvaluate( - trust, - result, - ); + DartNSExceptionName get NSPortTimeoutException => + objc.NSString.castFromPointer(_NSPortTimeoutException.value, + retain: true, release: true); + + set NSPortTimeoutException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSPortTimeoutException.value, + retain: false, release: true) + .ref + .release(); + _NSPortTimeoutException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustEvaluatePtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SecTrustRef, ffi.Pointer)>>('SecTrustEvaluate'); - late final _SecTrustEvaluate = _SecTrustEvaluatePtr.asFunction< - int Function(SecTrustRef, ffi.Pointer)>(); + late final ffi.Pointer _NSInvalidSendPortException = + _lookup('NSInvalidSendPortException'); - DartSInt32 SecTrustEvaluateAsync( - SecTrustRef trust, - dispatch_queue_t queue, - DartSecTrustCallback result, - ) { - return _SecTrustEvaluateAsync( - trust, - queue, - result._id, - ); + DartNSExceptionName get NSInvalidSendPortException => + objc.NSString.castFromPointer(_NSInvalidSendPortException.value, + retain: true, release: true); + + set NSInvalidSendPortException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSInvalidSendPortException.value, + retain: false, release: true) + .ref + .release(); + _NSInvalidSendPortException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustEvaluateAsyncPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, dispatch_queue_t, - SecTrustCallback)>>('SecTrustEvaluateAsync'); - late final _SecTrustEvaluateAsync = _SecTrustEvaluateAsyncPtr.asFunction< - int Function(SecTrustRef, dispatch_queue_t, SecTrustCallback)>(); + late final ffi.Pointer _NSInvalidReceivePortException = + _lookup('NSInvalidReceivePortException'); - bool SecTrustEvaluateWithError( - SecTrustRef trust, - ffi.Pointer error, - ) { - return _SecTrustEvaluateWithError( - trust, - error, - ); + DartNSExceptionName get NSInvalidReceivePortException => + objc.NSString.castFromPointer(_NSInvalidReceivePortException.value, + retain: true, release: true); + + set NSInvalidReceivePortException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSInvalidReceivePortException.value, + retain: false, release: true) + .ref + .release(); + _NSInvalidReceivePortException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustEvaluateWithErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(SecTrustRef, - ffi.Pointer)>>('SecTrustEvaluateWithError'); - late final _SecTrustEvaluateWithError = _SecTrustEvaluateWithErrorPtr - .asFunction)>(); + late final ffi.Pointer _NSPortSendException = + _lookup('NSPortSendException'); - DartSInt32 SecTrustEvaluateAsyncWithError( - SecTrustRef trust, - dispatch_queue_t queue, - DartSecTrustWithErrorCallback result, - ) { - return _SecTrustEvaluateAsyncWithError( - trust, - queue, - result._id, - ); + DartNSExceptionName get NSPortSendException => + objc.NSString.castFromPointer(_NSPortSendException.value, + retain: true, release: true); + + set NSPortSendException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSPortSendException.value, + retain: false, release: true) + .ref + .release(); + _NSPortSendException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustEvaluateAsyncWithErrorPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, dispatch_queue_t, - SecTrustWithErrorCallback)>>('SecTrustEvaluateAsyncWithError'); - late final _SecTrustEvaluateAsyncWithError = - _SecTrustEvaluateAsyncWithErrorPtr.asFunction< - int Function( - SecTrustRef, dispatch_queue_t, SecTrustWithErrorCallback)>(); + late final ffi.Pointer _NSPortReceiveException = + _lookup('NSPortReceiveException'); - int SecTrustGetTrustResult( - SecTrustRef trust, - ffi.Pointer result, - ) { - return _SecTrustGetTrustResult( - trust, - result, - ); + DartNSExceptionName get NSPortReceiveException => + objc.NSString.castFromPointer(_NSPortReceiveException.value, + retain: true, release: true); + + set NSPortReceiveException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSPortReceiveException.value, + retain: false, release: true) + .ref + .release(); + _NSPortReceiveException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustGetTrustResultPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SecTrustRef, ffi.Pointer)>>('SecTrustGetTrustResult'); - late final _SecTrustGetTrustResult = _SecTrustGetTrustResultPtr.asFunction< - int Function(SecTrustRef, ffi.Pointer)>(); + late final ffi.Pointer _NSOldStyleException = + _lookup('NSOldStyleException'); - SecKeyRef SecTrustCopyPublicKey( - SecTrustRef trust, - ) { - return _SecTrustCopyPublicKey( - trust, - ); + DartNSExceptionName get NSOldStyleException => + objc.NSString.castFromPointer(_NSOldStyleException.value, + retain: true, release: true); + + set NSOldStyleException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSOldStyleException.value, + retain: false, release: true) + .ref + .release(); + _NSOldStyleException.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustCopyPublicKeyPtr = - _lookup>( - 'SecTrustCopyPublicKey'); - late final _SecTrustCopyPublicKey = - _SecTrustCopyPublicKeyPtr.asFunction(); + late final ffi.Pointer _NSInconsistentArchiveException = + _lookup('NSInconsistentArchiveException'); - SecKeyRef SecTrustCopyKey( - SecTrustRef trust, - ) { - return _SecTrustCopyKey( - trust, - ); - } + DartNSExceptionName get NSInconsistentArchiveException => + objc.NSString.castFromPointer(_NSInconsistentArchiveException.value, + retain: true, release: true); - late final _SecTrustCopyKeyPtr = - _lookup>( - 'SecTrustCopyKey'); - late final _SecTrustCopyKey = - _SecTrustCopyKeyPtr.asFunction(); + set NSInconsistentArchiveException(DartNSExceptionName value) { + objc.NSString.castFromPointer(_NSInconsistentArchiveException.value, + retain: false, release: true) + .ref + .release(); + _NSInconsistentArchiveException.value = value.ref.retainAndReturnPointer(); + } - int SecTrustGetCertificateCount( - SecTrustRef trust, - ) { - return _SecTrustGetCertificateCount( - trust, - ); + ffi.Pointer NSGetUncaughtExceptionHandler() { + return _NSGetUncaughtExceptionHandler(); } - late final _SecTrustGetCertificateCountPtr = - _lookup>( - 'SecTrustGetCertificateCount'); - late final _SecTrustGetCertificateCount = - _SecTrustGetCertificateCountPtr.asFunction(); + late final _NSGetUncaughtExceptionHandlerPtr = _lookup< + ffi + .NativeFunction Function()>>( + 'NSGetUncaughtExceptionHandler'); + late final _NSGetUncaughtExceptionHandler = _NSGetUncaughtExceptionHandlerPtr + .asFunction Function()>(); - SecCertificateRef SecTrustGetCertificateAtIndex( - SecTrustRef trust, - int ix, + void NSSetUncaughtExceptionHandler( + ffi.Pointer arg0, ) { - return _SecTrustGetCertificateAtIndex( - trust, - ix, + return _NSSetUncaughtExceptionHandler( + arg0, ); } - late final _SecTrustGetCertificateAtIndexPtr = _lookup< - ffi.NativeFunction>( - 'SecTrustGetCertificateAtIndex'); - late final _SecTrustGetCertificateAtIndex = _SecTrustGetCertificateAtIndexPtr - .asFunction(); + late final _NSSetUncaughtExceptionHandlerPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer)>>( + 'NSSetUncaughtExceptionHandler'); + late final _NSSetUncaughtExceptionHandler = _NSSetUncaughtExceptionHandlerPtr + .asFunction)>(); - CFDataRef SecTrustCopyExceptions( - SecTrustRef trust, - ) { - return _SecTrustCopyExceptions( - trust, - ); - } + late final ffi.Pointer> _NSAssertionHandlerKey = + _lookup>('NSAssertionHandlerKey'); - late final _SecTrustCopyExceptionsPtr = - _lookup>( - 'SecTrustCopyExceptions'); - late final _SecTrustCopyExceptions = - _SecTrustCopyExceptionsPtr.asFunction(); + objc.NSString get NSAssertionHandlerKey => + objc.NSString.castFromPointer(_NSAssertionHandlerKey.value, + retain: true, release: true); - bool SecTrustSetExceptions( - SecTrustRef trust, - CFDataRef exceptions, - ) { - return _SecTrustSetExceptions( - trust, - exceptions, - ); + set NSAssertionHandlerKey(objc.NSString value) { + objc.NSString.castFromPointer(_NSAssertionHandlerKey.value, + retain: false, release: true) + .ref + .release(); + _NSAssertionHandlerKey.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetExceptionsPtr = - _lookup>( - 'SecTrustSetExceptions'); - late final _SecTrustSetExceptions = _SecTrustSetExceptionsPtr.asFunction< - bool Function(SecTrustRef, CFDataRef)>(); + late final ffi.Pointer + _NSInvocationOperationVoidResultException = + _lookup('NSInvocationOperationVoidResultException'); - CFArrayRef SecTrustCopyProperties( - SecTrustRef trust, - ) { - return _SecTrustCopyProperties( - trust, - ); + DartNSExceptionName get NSInvocationOperationVoidResultException => + objc.NSString.castFromPointer( + _NSInvocationOperationVoidResultException.value, + retain: true, + release: true); + + set NSInvocationOperationVoidResultException(DartNSExceptionName value) { + objc.NSString.castFromPointer( + _NSInvocationOperationVoidResultException.value, + retain: false, + release: true) + .ref + .release(); + _NSInvocationOperationVoidResultException.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustCopyPropertiesPtr = - _lookup>( - 'SecTrustCopyProperties'); - late final _SecTrustCopyProperties = - _SecTrustCopyPropertiesPtr.asFunction(); + late final ffi.Pointer + _NSInvocationOperationCancelledException = + _lookup('NSInvocationOperationCancelledException'); - CFDictionaryRef SecTrustCopyResult( - SecTrustRef trust, - ) { - return _SecTrustCopyResult( - trust, - ); + DartNSExceptionName get NSInvocationOperationCancelledException => + objc.NSString.castFromPointer( + _NSInvocationOperationCancelledException.value, + retain: true, + release: true); + + set NSInvocationOperationCancelledException(DartNSExceptionName value) { + objc.NSString.castFromPointer( + _NSInvocationOperationCancelledException.value, + retain: false, + release: true) + .ref + .release(); + _NSInvocationOperationCancelledException.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustCopyResultPtr = - _lookup>( - 'SecTrustCopyResult'); - late final _SecTrustCopyResult = _SecTrustCopyResultPtr.asFunction< - CFDictionaryRef Function(SecTrustRef)>(); + late final ffi.Pointer + _NSOperationQueueDefaultMaxConcurrentOperationCount = + _lookup('NSOperationQueueDefaultMaxConcurrentOperationCount'); - int SecTrustSetOCSPResponse( - SecTrustRef trust, - CFTypeRef responseData, - ) { - return _SecTrustSetOCSPResponse( - trust, - responseData, - ); - } + DartNSInteger get NSOperationQueueDefaultMaxConcurrentOperationCount => + _NSOperationQueueDefaultMaxConcurrentOperationCount.value; - late final _SecTrustSetOCSPResponsePtr = - _lookup>( - 'SecTrustSetOCSPResponse'); - late final _SecTrustSetOCSPResponse = _SecTrustSetOCSPResponsePtr.asFunction< - int Function(SecTrustRef, CFTypeRef)>(); + /// Predefined domain for errors from most AppKit and Foundation APIs. + late final ffi.Pointer _NSCocoaErrorDomain = + _lookup('NSCocoaErrorDomain'); - int SecTrustSetSignedCertificateTimestamps( - SecTrustRef trust, - CFArrayRef sctArray, - ) { - return _SecTrustSetSignedCertificateTimestamps( - trust, - sctArray, - ); + DartNSErrorDomain get NSCocoaErrorDomain => + objc.NSString.castFromPointer(_NSCocoaErrorDomain.value, + retain: true, release: true); + + set NSCocoaErrorDomain(DartNSErrorDomain value) { + objc.NSString.castFromPointer(_NSCocoaErrorDomain.value, + retain: false, release: true) + .ref + .release(); + _NSCocoaErrorDomain.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetSignedCertificateTimestampsPtr = - _lookup>( - 'SecTrustSetSignedCertificateTimestamps'); - late final _SecTrustSetSignedCertificateTimestamps = - _SecTrustSetSignedCertificateTimestampsPtr.asFunction< - int Function(SecTrustRef, CFArrayRef)>(); + /// Other predefined domains; value of "code" will correspond to preexisting values in these domains. + late final ffi.Pointer _NSPOSIXErrorDomain = + _lookup('NSPOSIXErrorDomain'); - CFArrayRef SecTrustCopyCertificateChain( - SecTrustRef trust, - ) { - return _SecTrustCopyCertificateChain( - trust, - ); + DartNSErrorDomain get NSPOSIXErrorDomain => + objc.NSString.castFromPointer(_NSPOSIXErrorDomain.value, + retain: true, release: true); + + set NSPOSIXErrorDomain(DartNSErrorDomain value) { + objc.NSString.castFromPointer(_NSPOSIXErrorDomain.value, + retain: false, release: true) + .ref + .release(); + _NSPOSIXErrorDomain.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustCopyCertificateChainPtr = - _lookup>( - 'SecTrustCopyCertificateChain'); - late final _SecTrustCopyCertificateChain = _SecTrustCopyCertificateChainPtr - .asFunction(); + late final ffi.Pointer _NSOSStatusErrorDomain = + _lookup('NSOSStatusErrorDomain'); - int SecTrustSetOptions( - SecTrustRef trustRef, - int options, - ) { - return _SecTrustSetOptions( - trustRef, - options, - ); + DartNSErrorDomain get NSOSStatusErrorDomain => + objc.NSString.castFromPointer(_NSOSStatusErrorDomain.value, + retain: true, release: true); + + set NSOSStatusErrorDomain(DartNSErrorDomain value) { + objc.NSString.castFromPointer(_NSOSStatusErrorDomain.value, + retain: false, release: true) + .ref + .release(); + _NSOSStatusErrorDomain.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetOptionsPtr = - _lookup>( - 'SecTrustSetOptions'); - late final _SecTrustSetOptions = - _SecTrustSetOptionsPtr.asFunction(); + late final ffi.Pointer _NSMachErrorDomain = + _lookup('NSMachErrorDomain'); - int SecTrustSetParameters( - SecTrustRef trustRef, - int action, - CFDataRef actionData, - ) { - return _SecTrustSetParameters( - trustRef, - action, - actionData, - ); + DartNSErrorDomain get NSMachErrorDomain => + objc.NSString.castFromPointer(_NSMachErrorDomain.value, + retain: true, release: true); + + set NSMachErrorDomain(DartNSErrorDomain value) { + objc.NSString.castFromPointer(_NSMachErrorDomain.value, + retain: false, release: true) + .ref + .release(); + _NSMachErrorDomain.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetParametersPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, CSSM_TP_ACTION, - CFDataRef)>>('SecTrustSetParameters'); - late final _SecTrustSetParameters = _SecTrustSetParametersPtr.asFunction< - int Function(SecTrustRef, int, CFDataRef)>(); + /// Key in userInfo. A recommended standard way to embed NSErrors from underlying calls. The value of this key should be an NSError. + late final ffi.Pointer _NSUnderlyingErrorKey = + _lookup('NSUnderlyingErrorKey'); - int SecTrustSetKeychains( - SecTrustRef trust, - CFTypeRef keychainOrArray, - ) { - return _SecTrustSetKeychains( - trust, - keychainOrArray, - ); + DartNSErrorUserInfoKey get NSUnderlyingErrorKey => + objc.NSString.castFromPointer(_NSUnderlyingErrorKey.value, + retain: true, release: true); + + set NSUnderlyingErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSUnderlyingErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSUnderlyingErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustSetKeychainsPtr = - _lookup>( - 'SecTrustSetKeychains'); - late final _SecTrustSetKeychains = _SecTrustSetKeychainsPtr.asFunction< - int Function(SecTrustRef, CFTypeRef)>(); + /// Key in userInfo. A recommended standard way to embed a list of several NSErrors from underlying calls. The value of this key should be an NSArray of NSError. This value is independent from the value of `NSUnderlyingErrorKey` - neither, one, or both may be set. + late final ffi.Pointer _NSMultipleUnderlyingErrorsKey = + _lookup('NSMultipleUnderlyingErrorsKey'); - int SecTrustGetResult( - SecTrustRef trustRef, - ffi.Pointer result, - ffi.Pointer certChain, - ffi.Pointer> statusChain, - ) { - return _SecTrustGetResult( - trustRef, - result, - certChain, - statusChain, - ); + DartNSErrorUserInfoKey get NSMultipleUnderlyingErrorsKey => + objc.NSString.castFromPointer(_NSMultipleUnderlyingErrorsKey.value, + retain: true, release: true); + + set NSMultipleUnderlyingErrorsKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSMultipleUnderlyingErrorsKey.value, + retain: false, release: true) + .ref + .release(); + _NSMultipleUnderlyingErrorsKey.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustGetResultPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SecTrustRef, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>( - 'SecTrustGetResult'); - late final _SecTrustGetResult = _SecTrustGetResultPtr.asFunction< - int Function(SecTrustRef, ffi.Pointer, ffi.Pointer, - ffi.Pointer>)>(); + /// NSString, a complete sentence (or more) describing ideally both what failed and why it failed. + late final ffi.Pointer _NSLocalizedDescriptionKey = + _lookup('NSLocalizedDescriptionKey'); - int SecTrustGetCssmResult( - SecTrustRef trust, - ffi.Pointer result, - ) { - return _SecTrustGetCssmResult( - trust, - result, - ); + DartNSErrorUserInfoKey get NSLocalizedDescriptionKey => + objc.NSString.castFromPointer(_NSLocalizedDescriptionKey.value, + retain: true, release: true); + + set NSLocalizedDescriptionKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSLocalizedDescriptionKey.value, + retain: false, release: true) + .ref + .release(); + _NSLocalizedDescriptionKey.value = value.ref.retainAndReturnPointer(); } - late final _SecTrustGetCssmResultPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, - ffi.Pointer)>>( - 'SecTrustGetCssmResult'); - late final _SecTrustGetCssmResult = _SecTrustGetCssmResultPtr.asFunction< - int Function( - SecTrustRef, ffi.Pointer)>(); + /// NSString, a complete sentence (or more) describing why the operation failed. + late final ffi.Pointer _NSLocalizedFailureReasonErrorKey = + _lookup('NSLocalizedFailureReasonErrorKey'); - int SecTrustGetCssmResultCode( - SecTrustRef trust, - ffi.Pointer resultCode, - ) { - return _SecTrustGetCssmResultCode( - trust, - resultCode, - ); + DartNSErrorUserInfoKey get NSLocalizedFailureReasonErrorKey => + objc.NSString.castFromPointer(_NSLocalizedFailureReasonErrorKey.value, + retain: true, release: true); + + set NSLocalizedFailureReasonErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSLocalizedFailureReasonErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSLocalizedFailureReasonErrorKey.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustGetCssmResultCodePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, - ffi.Pointer)>>('SecTrustGetCssmResultCode'); - late final _SecTrustGetCssmResultCode = _SecTrustGetCssmResultCodePtr - .asFunction)>(); + /// NSString, a complete sentence (or more) describing what the user can do to fix the problem. + late final ffi.Pointer + _NSLocalizedRecoverySuggestionErrorKey = + _lookup('NSLocalizedRecoverySuggestionErrorKey'); - int SecTrustGetTPHandle( - SecTrustRef trust, - ffi.Pointer handle, - ) { - return _SecTrustGetTPHandle( - trust, - handle, - ); + DartNSErrorUserInfoKey get NSLocalizedRecoverySuggestionErrorKey => + objc.NSString.castFromPointer( + _NSLocalizedRecoverySuggestionErrorKey.value, + retain: true, + release: true); + + set NSLocalizedRecoverySuggestionErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSLocalizedRecoverySuggestionErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSLocalizedRecoverySuggestionErrorKey.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustGetTPHandlePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecTrustRef, - ffi.Pointer)>>('SecTrustGetTPHandle'); - late final _SecTrustGetTPHandle = _SecTrustGetTPHandlePtr.asFunction< - int Function(SecTrustRef, ffi.Pointer)>(); + /// NSArray of NSStrings corresponding to button titles. + late final ffi.Pointer + _NSLocalizedRecoveryOptionsErrorKey = + _lookup('NSLocalizedRecoveryOptionsErrorKey'); - int SecTrustCopyAnchorCertificates( - ffi.Pointer anchors, - ) { - return _SecTrustCopyAnchorCertificates( - anchors, - ); + DartNSErrorUserInfoKey get NSLocalizedRecoveryOptionsErrorKey => + objc.NSString.castFromPointer(_NSLocalizedRecoveryOptionsErrorKey.value, + retain: true, release: true); + + set NSLocalizedRecoveryOptionsErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSLocalizedRecoveryOptionsErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSLocalizedRecoveryOptionsErrorKey.value = + value.ref.retainAndReturnPointer(); } - late final _SecTrustCopyAnchorCertificatesPtr = - _lookup)>>( - 'SecTrustCopyAnchorCertificates'); - late final _SecTrustCopyAnchorCertificates = - _SecTrustCopyAnchorCertificatesPtr.asFunction< - int Function(ffi.Pointer)>(); + /// Instance of a subclass of NSObject that conforms to the NSErrorRecoveryAttempting informal protocol + late final ffi.Pointer _NSRecoveryAttempterErrorKey = + _lookup('NSRecoveryAttempterErrorKey'); - int SecCertificateGetTypeID() { - return _SecCertificateGetTypeID(); + DartNSErrorUserInfoKey get NSRecoveryAttempterErrorKey => + objc.NSString.castFromPointer(_NSRecoveryAttempterErrorKey.value, + retain: true, release: true); + + set NSRecoveryAttempterErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSRecoveryAttempterErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSRecoveryAttempterErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecCertificateGetTypeIDPtr = - _lookup>( - 'SecCertificateGetTypeID'); - late final _SecCertificateGetTypeID = - _SecCertificateGetTypeIDPtr.asFunction(); + /// NSString containing a help anchor + late final ffi.Pointer _NSHelpAnchorErrorKey = + _lookup('NSHelpAnchorErrorKey'); - SecCertificateRef SecCertificateCreateWithData( - CFAllocatorRef allocator, - CFDataRef data, - ) { - return _SecCertificateCreateWithData( - allocator, - data, - ); + DartNSErrorUserInfoKey get NSHelpAnchorErrorKey => + objc.NSString.castFromPointer(_NSHelpAnchorErrorKey.value, + retain: true, release: true); + + set NSHelpAnchorErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSHelpAnchorErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSHelpAnchorErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecCertificateCreateWithDataPtr = _lookup< - ffi.NativeFunction< - SecCertificateRef Function( - CFAllocatorRef, CFDataRef)>>('SecCertificateCreateWithData'); - late final _SecCertificateCreateWithData = _SecCertificateCreateWithDataPtr - .asFunction(); - - CFDataRef SecCertificateCopyData( - SecCertificateRef certificate, - ) { - return _SecCertificateCopyData( - certificate, - ); - } + /// NSString. This provides a string which will be shown when constructing the debugDescription of the NSError, to be used when debugging or when formatting the error with %@. This string will never be used in localizedDescription, so will not be shown to the user. + late final ffi.Pointer _NSDebugDescriptionErrorKey = + _lookup('NSDebugDescriptionErrorKey'); - late final _SecCertificateCopyDataPtr = - _lookup>( - 'SecCertificateCopyData'); - late final _SecCertificateCopyData = _SecCertificateCopyDataPtr.asFunction< - CFDataRef Function(SecCertificateRef)>(); + DartNSErrorUserInfoKey get NSDebugDescriptionErrorKey => + objc.NSString.castFromPointer(_NSDebugDescriptionErrorKey.value, + retain: true, release: true); - CFStringRef SecCertificateCopySubjectSummary( - SecCertificateRef certificate, - ) { - return _SecCertificateCopySubjectSummary( - certificate, - ); + set NSDebugDescriptionErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSDebugDescriptionErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSDebugDescriptionErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecCertificateCopySubjectSummaryPtr = - _lookup>( - 'SecCertificateCopySubjectSummary'); - late final _SecCertificateCopySubjectSummary = - _SecCertificateCopySubjectSummaryPtr.asFunction< - CFStringRef Function(SecCertificateRef)>(); - - int SecCertificateCopyCommonName( - SecCertificateRef certificate, - ffi.Pointer commonName, - ) { - return _SecCertificateCopyCommonName( - certificate, - commonName, - ); - } + /// NSString, a complete sentence (or more) describing what failed. Setting a value for this key in userInfo dictionary of errors received from framework APIs is a good way to customize and fine tune the localizedDescription of an NSError. As an example, for Foundation error code NSFileWriteOutOfSpaceError, setting the value of this key to "The image library could not be saved." will allow the localizedDescription of the error to come out as "The image library could not be saved. The volume Macintosh HD is out of space." rather than the default (say) “You can't save the file ImgDatabaseV2 because the volume Macintosh HD is out of space." + late final ffi.Pointer _NSLocalizedFailureErrorKey = + _lookup('NSLocalizedFailureErrorKey'); - late final _SecCertificateCopyCommonNamePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - ffi.Pointer)>>('SecCertificateCopyCommonName'); - late final _SecCertificateCopyCommonName = _SecCertificateCopyCommonNamePtr - .asFunction)>(); + DartNSErrorUserInfoKey get NSLocalizedFailureErrorKey => + objc.NSString.castFromPointer(_NSLocalizedFailureErrorKey.value, + retain: true, release: true); - int SecCertificateCopyEmailAddresses( - SecCertificateRef certificate, - ffi.Pointer emailAddresses, - ) { - return _SecCertificateCopyEmailAddresses( - certificate, - emailAddresses, - ); + set NSLocalizedFailureErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSLocalizedFailureErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSLocalizedFailureErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecCertificateCopyEmailAddressesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - ffi.Pointer)>>('SecCertificateCopyEmailAddresses'); - late final _SecCertificateCopyEmailAddresses = - _SecCertificateCopyEmailAddressesPtr.asFunction< - int Function(SecCertificateRef, ffi.Pointer)>(); - - CFDataRef SecCertificateCopyNormalizedIssuerSequence( - SecCertificateRef certificate, - ) { - return _SecCertificateCopyNormalizedIssuerSequence( - certificate, - ); - } + /// NSNumber containing NSStringEncoding + late final ffi.Pointer _NSStringEncodingErrorKey = + _lookup('NSStringEncodingErrorKey'); - late final _SecCertificateCopyNormalizedIssuerSequencePtr = - _lookup>( - 'SecCertificateCopyNormalizedIssuerSequence'); - late final _SecCertificateCopyNormalizedIssuerSequence = - _SecCertificateCopyNormalizedIssuerSequencePtr.asFunction< - CFDataRef Function(SecCertificateRef)>(); + DartNSErrorUserInfoKey get NSStringEncodingErrorKey => + objc.NSString.castFromPointer(_NSStringEncodingErrorKey.value, + retain: true, release: true); - CFDataRef SecCertificateCopyNormalizedSubjectSequence( - SecCertificateRef certificate, - ) { - return _SecCertificateCopyNormalizedSubjectSequence( - certificate, - ); + set NSStringEncodingErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSStringEncodingErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSStringEncodingErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecCertificateCopyNormalizedSubjectSequencePtr = - _lookup>( - 'SecCertificateCopyNormalizedSubjectSequence'); - late final _SecCertificateCopyNormalizedSubjectSequence = - _SecCertificateCopyNormalizedSubjectSequencePtr.asFunction< - CFDataRef Function(SecCertificateRef)>(); - - SecKeyRef SecCertificateCopyKey( - SecCertificateRef certificate, - ) { - return _SecCertificateCopyKey( - certificate, - ); - } + /// NSURL + late final ffi.Pointer _NSURLErrorKey = + _lookup('NSURLErrorKey'); - late final _SecCertificateCopyKeyPtr = - _lookup>( - 'SecCertificateCopyKey'); - late final _SecCertificateCopyKey = _SecCertificateCopyKeyPtr.asFunction< - SecKeyRef Function(SecCertificateRef)>(); + DartNSErrorUserInfoKey get NSURLErrorKey => + objc.NSString.castFromPointer(_NSURLErrorKey.value, + retain: true, release: true); - int SecCertificateCopyPublicKey( - SecCertificateRef certificate, - ffi.Pointer key, - ) { - return _SecCertificateCopyPublicKey( - certificate, - key, - ); + set NSURLErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSURLErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSURLErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecCertificateCopyPublicKeyPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - ffi.Pointer)>>('SecCertificateCopyPublicKey'); - late final _SecCertificateCopyPublicKey = _SecCertificateCopyPublicKeyPtr - .asFunction)>(); - - CFDataRef SecCertificateCopySerialNumberData( - SecCertificateRef certificate, - ffi.Pointer error, - ) { - return _SecCertificateCopySerialNumberData( - certificate, - error, - ); - } + /// NSString + late final ffi.Pointer _NSFilePathErrorKey = + _lookup('NSFilePathErrorKey'); - late final _SecCertificateCopySerialNumberDataPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(SecCertificateRef, - ffi.Pointer)>>('SecCertificateCopySerialNumberData'); - late final _SecCertificateCopySerialNumberData = - _SecCertificateCopySerialNumberDataPtr.asFunction< - CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); + DartNSErrorUserInfoKey get NSFilePathErrorKey => + objc.NSString.castFromPointer(_NSFilePathErrorKey.value, + retain: true, release: true); - CFDataRef SecCertificateCopySerialNumber( - SecCertificateRef certificate, - ffi.Pointer error, - ) { - return _SecCertificateCopySerialNumber( - certificate, - error, - ); + set NSFilePathErrorKey(DartNSErrorUserInfoKey value) { + objc.NSString.castFromPointer(_NSFilePathErrorKey.value, + retain: false, release: true) + .ref + .release(); + _NSFilePathErrorKey.value = value.ref.retainAndReturnPointer(); } - late final _SecCertificateCopySerialNumberPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(SecCertificateRef, - ffi.Pointer)>>('SecCertificateCopySerialNumber'); - late final _SecCertificateCopySerialNumber = - _SecCertificateCopySerialNumberPtr.asFunction< - CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); - - int SecCertificateCreateFromData( - ffi.Pointer data, - int type, - int encoding, - ffi.Pointer certificate, + /// Create a block useable as a + /// `URLSession:downloadTask:didFinishDownloadingToURL:` that can be used to + /// make an async Dart callback behave synchronously. + Dart_DidFinish adaptFinishWithLock( + Dart_DidFinishWithLock block, ) { - return _SecCertificateCreateFromData( - data, - type, - encoding, - certificate, - ); + return ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + .castFromPointer( + _adaptFinishWithLock( + block.ref.pointer, + ), + retain: true, + release: true); } - late final _SecCertificateCreateFromDataPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - ffi.Pointer, - CSSM_CERT_TYPE, - CSSM_CERT_ENCODING, - ffi.Pointer)>>('SecCertificateCreateFromData'); - late final _SecCertificateCreateFromData = - _SecCertificateCreateFromDataPtr.asFunction< - int Function(ffi.Pointer, int, int, - ffi.Pointer)>(); - - int SecCertificateAddToKeychain( - SecCertificateRef certificate, - SecKeychainRef keychain, - ) { - return _SecCertificateAddToKeychain( - certificate, - keychain, - ); - } + late final _adaptFinishWithLockPtr = + _lookup>( + 'adaptFinishWithLock'); + late final _adaptFinishWithLock = _adaptFinishWithLockPtr + .asFunction<_DidFinish Function(_DidFinishWithLock)>(); +} + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_ksby9f( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_hepzs( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_sjfpmz( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_ukcdfq( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_ttt6u1( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1txhfzs( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1hmngv6( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_108ugvk( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1afulej( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_elldw5( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_129ffij( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1458n52( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_yo3tv0( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1tjlcwl( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_10t0qpd( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_cmbt6k( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_117qins( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_tenbla( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_hfhq9m( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_tm2na8( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1najo2h( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1wmulza( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_wnmjgj( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1nnj9ov( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_dmve6( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_qxeqyf( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_jzggzf( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1a6kixf( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_ci81hw( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_1wl7fts( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_no6pyg( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_10hgvcc( + ffi.Pointer block, +); + +@ffi.Native< + ffi.Pointer Function( + ffi.Pointer)>(isLeaf: true) +external ffi.Pointer _wrapListenerBlock_19b8ge5( + ffi.Pointer block, +); - late final _SecCertificateAddToKeychainPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - SecKeychainRef)>>('SecCertificateAddToKeychain'); - late final _SecCertificateAddToKeychain = _SecCertificateAddToKeychainPtr - .asFunction(); +final class __mbstate_t extends ffi.Union { + @ffi.Array.multi([128]) + external ffi.Array __mbstate8; - int SecCertificateGetData( - SecCertificateRef certificate, - CSSM_DATA_PTR data, - ) { - return _SecCertificateGetData( - certificate, - data, - ); - } + @ffi.LongLong() + external int _mbstateL; +} - late final _SecCertificateGetDataPtr = _lookup< - ffi - .NativeFunction>( - 'SecCertificateGetData'); - late final _SecCertificateGetData = _SecCertificateGetDataPtr.asFunction< - int Function(SecCertificateRef, CSSM_DATA_PTR)>(); +final class __darwin_pthread_handler_rec extends ffi.Struct { + external ffi + .Pointer)>> + __routine; - int SecCertificateGetType( - SecCertificateRef certificate, - ffi.Pointer certificateType, - ) { - return _SecCertificateGetType( - certificate, - certificateType, - ); - } + external ffi.Pointer __arg; - late final _SecCertificateGetTypePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - ffi.Pointer)>>('SecCertificateGetType'); - late final _SecCertificateGetType = _SecCertificateGetTypePtr.asFunction< - int Function(SecCertificateRef, ffi.Pointer)>(); + external ffi.Pointer<__darwin_pthread_handler_rec> __next; +} - int SecCertificateGetSubject( - SecCertificateRef certificate, - ffi.Pointer> subject, - ) { - return _SecCertificateGetSubject( - certificate, - subject, - ); - } +final class _opaque_pthread_attr_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateGetSubjectPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - ffi.Pointer>)>>( - 'SecCertificateGetSubject'); - late final _SecCertificateGetSubject = - _SecCertificateGetSubjectPtr.asFunction< - int Function( - SecCertificateRef, ffi.Pointer>)>(); + @ffi.Array.multi([56]) + external ffi.Array __opaque; +} - int SecCertificateGetIssuer( - SecCertificateRef certificate, - ffi.Pointer> issuer, - ) { - return _SecCertificateGetIssuer( - certificate, - issuer, - ); - } +final class _opaque_pthread_cond_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateGetIssuerPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - ffi.Pointer>)>>( - 'SecCertificateGetIssuer'); - late final _SecCertificateGetIssuer = _SecCertificateGetIssuerPtr.asFunction< - int Function( - SecCertificateRef, ffi.Pointer>)>(); + @ffi.Array.multi([40]) + external ffi.Array __opaque; +} - int SecCertificateGetCLHandle( - SecCertificateRef certificate, - ffi.Pointer clHandle, - ) { - return _SecCertificateGetCLHandle( - certificate, - clHandle, - ); - } +final class _opaque_pthread_condattr_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateGetCLHandlePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, - ffi.Pointer)>>('SecCertificateGetCLHandle'); - late final _SecCertificateGetCLHandle = - _SecCertificateGetCLHandlePtr.asFunction< - int Function(SecCertificateRef, ffi.Pointer)>(); + @ffi.Array.multi([8]) + external ffi.Array __opaque; +} - int SecCertificateGetAlgorithmID( - SecCertificateRef certificate, - ffi.Pointer> algid, - ) { - return _SecCertificateGetAlgorithmID( - certificate, - algid, - ); - } +final class _opaque_pthread_mutex_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateGetAlgorithmIDPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SecCertificateRef, ffi.Pointer>)>>( - 'SecCertificateGetAlgorithmID'); - late final _SecCertificateGetAlgorithmID = - _SecCertificateGetAlgorithmIDPtr.asFunction< - int Function( - SecCertificateRef, ffi.Pointer>)>(); + @ffi.Array.multi([56]) + external ffi.Array __opaque; +} - int SecCertificateCopyPreference( - CFStringRef name, - int keyUsage, - ffi.Pointer certificate, - ) { - return _SecCertificateCopyPreference( - name, - keyUsage, - certificate, - ); - } +final class _opaque_pthread_mutexattr_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateCopyPreferencePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(CFStringRef, uint32, - ffi.Pointer)>>('SecCertificateCopyPreference'); - late final _SecCertificateCopyPreference = - _SecCertificateCopyPreferencePtr.asFunction< - int Function(CFStringRef, int, ffi.Pointer)>(); + @ffi.Array.multi([8]) + external ffi.Array __opaque; +} - SecCertificateRef SecCertificateCopyPreferred( - CFStringRef name, - CFArrayRef keyUsage, - ) { - return _SecCertificateCopyPreferred( - name, - keyUsage, - ); - } +final class _opaque_pthread_once_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateCopyPreferredPtr = _lookup< - ffi - .NativeFunction>( - 'SecCertificateCopyPreferred'); - late final _SecCertificateCopyPreferred = _SecCertificateCopyPreferredPtr - .asFunction(); + @ffi.Array.multi([8]) + external ffi.Array __opaque; +} - int SecCertificateSetPreference( - SecCertificateRef certificate, - CFStringRef name, - int keyUsage, - CFDateRef date, - ) { - return _SecCertificateSetPreference( - certificate, - name, - keyUsage, - date, - ); - } +final class _opaque_pthread_rwlock_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateSetPreferencePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, CFStringRef, uint32, - CFDateRef)>>('SecCertificateSetPreference'); - late final _SecCertificateSetPreference = - _SecCertificateSetPreferencePtr.asFunction< - int Function(SecCertificateRef, CFStringRef, int, CFDateRef)>(); + @ffi.Array.multi([192]) + external ffi.Array __opaque; +} - int SecCertificateSetPreferred( - SecCertificateRef certificate, - CFStringRef name, - CFArrayRef keyUsage, - ) { - return _SecCertificateSetPreferred( - certificate, - name, - keyUsage, - ); - } +final class _opaque_pthread_rwlockattr_t extends ffi.Struct { + @ffi.Long() + external int __sig; - late final _SecCertificateSetPreferredPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecCertificateRef, CFStringRef, - CFArrayRef)>>('SecCertificateSetPreferred'); - late final _SecCertificateSetPreferred = _SecCertificateSetPreferredPtr - .asFunction(); + @ffi.Array.multi([16]) + external ffi.Array __opaque; +} - late final ffi.Pointer _kSecPropertyKeyType = - _lookup('kSecPropertyKeyType'); +final class _opaque_pthread_t extends ffi.Struct { + @ffi.Long() + external int __sig; - CFStringRef get kSecPropertyKeyType => _kSecPropertyKeyType.value; + external ffi.Pointer<__darwin_pthread_handler_rec> __cleanup_stack; - set kSecPropertyKeyType(CFStringRef value) => - _kSecPropertyKeyType.value = value; + @ffi.Array.multi([8176]) + external ffi.Array __opaque; +} - late final ffi.Pointer _kSecPropertyKeyLabel = - _lookup('kSecPropertyKeyLabel'); +final class __darwin_arm_exception_state extends ffi.Struct { + @__uint32_t() + external int __exception; - CFStringRef get kSecPropertyKeyLabel => _kSecPropertyKeyLabel.value; + @__uint32_t() + external int __fsr; - set kSecPropertyKeyLabel(CFStringRef value) => - _kSecPropertyKeyLabel.value = value; + @__uint32_t() + external int __far; +} - late final ffi.Pointer _kSecPropertyKeyLocalizedLabel = - _lookup('kSecPropertyKeyLocalizedLabel'); +typedef __uint32_t = ffi.UnsignedInt; +typedef Dart__uint32_t = int; - CFStringRef get kSecPropertyKeyLocalizedLabel => - _kSecPropertyKeyLocalizedLabel.value; +final class __darwin_arm_exception_state64 extends ffi.Struct { + @__uint64_t() + external int __far; - set kSecPropertyKeyLocalizedLabel(CFStringRef value) => - _kSecPropertyKeyLocalizedLabel.value = value; + @__uint32_t() + external int __esr; - late final ffi.Pointer _kSecPropertyKeyValue = - _lookup('kSecPropertyKeyValue'); + @__uint32_t() + external int __exception; +} - CFStringRef get kSecPropertyKeyValue => _kSecPropertyKeyValue.value; +typedef __uint64_t = ffi.UnsignedLongLong; +typedef Dart__uint64_t = int; - set kSecPropertyKeyValue(CFStringRef value) => - _kSecPropertyKeyValue.value = value; +final class __darwin_arm_thread_state extends ffi.Struct { + @ffi.Array.multi([13]) + external ffi.Array<__uint32_t> __r; - late final ffi.Pointer _kSecPropertyTypeWarning = - _lookup('kSecPropertyTypeWarning'); + @__uint32_t() + external int __sp; - CFStringRef get kSecPropertyTypeWarning => _kSecPropertyTypeWarning.value; + @__uint32_t() + external int __lr; - set kSecPropertyTypeWarning(CFStringRef value) => - _kSecPropertyTypeWarning.value = value; + @__uint32_t() + external int __pc; - late final ffi.Pointer _kSecPropertyTypeSuccess = - _lookup('kSecPropertyTypeSuccess'); + @__uint32_t() + external int __cpsr; +} - CFStringRef get kSecPropertyTypeSuccess => _kSecPropertyTypeSuccess.value; +final class __darwin_arm_thread_state64 extends ffi.Struct { + @ffi.Array.multi([29]) + external ffi.Array<__uint64_t> __x; - set kSecPropertyTypeSuccess(CFStringRef value) => - _kSecPropertyTypeSuccess.value = value; + @__uint64_t() + external int __fp; - late final ffi.Pointer _kSecPropertyTypeSection = - _lookup('kSecPropertyTypeSection'); + @__uint64_t() + external int __lr; - CFStringRef get kSecPropertyTypeSection => _kSecPropertyTypeSection.value; + @__uint64_t() + external int __sp; - set kSecPropertyTypeSection(CFStringRef value) => - _kSecPropertyTypeSection.value = value; + @__uint64_t() + external int __pc; - late final ffi.Pointer _kSecPropertyTypeData = - _lookup('kSecPropertyTypeData'); + @__uint32_t() + external int __cpsr; - CFStringRef get kSecPropertyTypeData => _kSecPropertyTypeData.value; + @__uint32_t() + external int __pad; +} - set kSecPropertyTypeData(CFStringRef value) => - _kSecPropertyTypeData.value = value; +final class __darwin_arm_vfp_state extends ffi.Struct { + @ffi.Array.multi([64]) + external ffi.Array<__uint32_t> __r; - late final ffi.Pointer _kSecPropertyTypeString = - _lookup('kSecPropertyTypeString'); + @__uint32_t() + external int __fpscr; +} - CFStringRef get kSecPropertyTypeString => _kSecPropertyTypeString.value; +final class __darwin_arm_neon_state64 extends ffi.Opaque {} - set kSecPropertyTypeString(CFStringRef value) => - _kSecPropertyTypeString.value = value; +final class __darwin_arm_neon_state extends ffi.Opaque {} - late final ffi.Pointer _kSecPropertyTypeURL = - _lookup('kSecPropertyTypeURL'); +final class __arm_pagein_state extends ffi.Struct { + @ffi.Int() + external int __pagein_error; +} - CFStringRef get kSecPropertyTypeURL => _kSecPropertyTypeURL.value; +final class __arm_legacy_debug_state extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bvr; - set kSecPropertyTypeURL(CFStringRef value) => - _kSecPropertyTypeURL.value = value; + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bcr; - late final ffi.Pointer _kSecPropertyTypeDate = - _lookup('kSecPropertyTypeDate'); + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wvr; - CFStringRef get kSecPropertyTypeDate => _kSecPropertyTypeDate.value; + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wcr; +} - set kSecPropertyTypeDate(CFStringRef value) => - _kSecPropertyTypeDate.value = value; +final class __darwin_arm_debug_state32 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bvr; - late final ffi.Pointer _kSecPropertyTypeArray = - _lookup('kSecPropertyTypeArray'); + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bcr; - CFStringRef get kSecPropertyTypeArray => _kSecPropertyTypeArray.value; + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wvr; - set kSecPropertyTypeArray(CFStringRef value) => - _kSecPropertyTypeArray.value = value; + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wcr; - late final ffi.Pointer _kSecPropertyTypeNumber = - _lookup('kSecPropertyTypeNumber'); + @__uint64_t() + external int __mdscr_el1; +} - CFStringRef get kSecPropertyTypeNumber => _kSecPropertyTypeNumber.value; +final class __darwin_arm_debug_state64 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __bvr; - set kSecPropertyTypeNumber(CFStringRef value) => - _kSecPropertyTypeNumber.value = value; + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __bcr; - CFDictionaryRef SecCertificateCopyValues( - SecCertificateRef certificate, - CFArrayRef keys, - ffi.Pointer error, - ) { - return _SecCertificateCopyValues( - certificate, - keys, - error, - ); - } + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __wvr; - late final _SecCertificateCopyValuesPtr = _lookup< - ffi.NativeFunction< - CFDictionaryRef Function(SecCertificateRef, CFArrayRef, - ffi.Pointer)>>('SecCertificateCopyValues'); - late final _SecCertificateCopyValues = - _SecCertificateCopyValuesPtr.asFunction< - CFDictionaryRef Function( - SecCertificateRef, CFArrayRef, ffi.Pointer)>(); + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __wcr; - CFStringRef SecCertificateCopyLongDescription( - CFAllocatorRef alloc, - SecCertificateRef certificate, - ffi.Pointer error, - ) { - return _SecCertificateCopyLongDescription( - alloc, - certificate, - error, - ); - } + @__uint64_t() + external int __mdscr_el1; +} - late final _SecCertificateCopyLongDescriptionPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, SecCertificateRef, - ffi.Pointer)>>('SecCertificateCopyLongDescription'); - late final _SecCertificateCopyLongDescription = - _SecCertificateCopyLongDescriptionPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, SecCertificateRef, ffi.Pointer)>(); +final class __darwin_arm_cpmu_state64 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __ctrs; +} - CFStringRef SecCertificateCopyShortDescription( - CFAllocatorRef alloc, - SecCertificateRef certificate, - ffi.Pointer error, - ) { - return _SecCertificateCopyShortDescription( - alloc, - certificate, - error, - ); - } +final class __darwin_mcontext32 extends ffi.Struct { + external __darwin_arm_exception_state __es; - late final _SecCertificateCopyShortDescriptionPtr = _lookup< - ffi.NativeFunction< - CFStringRef Function(CFAllocatorRef, SecCertificateRef, - ffi.Pointer)>>('SecCertificateCopyShortDescription'); - late final _SecCertificateCopyShortDescription = - _SecCertificateCopyShortDescriptionPtr.asFunction< - CFStringRef Function( - CFAllocatorRef, SecCertificateRef, ffi.Pointer)>(); + external __darwin_arm_thread_state __ss; - CFDataRef SecCertificateCopyNormalizedIssuerContent( - SecCertificateRef certificate, - ffi.Pointer error, - ) { - return _SecCertificateCopyNormalizedIssuerContent( - certificate, - error, - ); - } + external __darwin_arm_vfp_state __fs; +} - late final _SecCertificateCopyNormalizedIssuerContentPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(SecCertificateRef, ffi.Pointer)>>( - 'SecCertificateCopyNormalizedIssuerContent'); - late final _SecCertificateCopyNormalizedIssuerContent = - _SecCertificateCopyNormalizedIssuerContentPtr.asFunction< - CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); +final class __darwin_mcontext64 extends ffi.Opaque {} - CFDataRef SecCertificateCopyNormalizedSubjectContent( - SecCertificateRef certificate, - ffi.Pointer error, - ) { - return _SecCertificateCopyNormalizedSubjectContent( - certificate, - error, - ); - } +final class __darwin_sigaltstack extends ffi.Struct { + external ffi.Pointer ss_sp; - late final _SecCertificateCopyNormalizedSubjectContentPtr = _lookup< - ffi.NativeFunction< - CFDataRef Function(SecCertificateRef, ffi.Pointer)>>( - 'SecCertificateCopyNormalizedSubjectContent'); - late final _SecCertificateCopyNormalizedSubjectContent = - _SecCertificateCopyNormalizedSubjectContentPtr.asFunction< - CFDataRef Function(SecCertificateRef, ffi.Pointer)>(); + @__darwin_size_t() + external int ss_size; - int SecIdentityGetTypeID() { - return _SecIdentityGetTypeID(); - } + @ffi.Int() + external int ss_flags; +} - late final _SecIdentityGetTypeIDPtr = - _lookup>('SecIdentityGetTypeID'); - late final _SecIdentityGetTypeID = - _SecIdentityGetTypeIDPtr.asFunction(); +typedef __darwin_size_t = ffi.UnsignedLong; +typedef Dart__darwin_size_t = int; - int SecIdentityCreateWithCertificate( - CFTypeRef keychainOrArray, - SecCertificateRef certificateRef, - ffi.Pointer identityRef, - ) { - return _SecIdentityCreateWithCertificate( - keychainOrArray, - certificateRef, - identityRef, - ); - } +final class __darwin_ucontext extends ffi.Struct { + @ffi.Int() + external int uc_onstack; - late final _SecIdentityCreateWithCertificatePtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - CFTypeRef, SecCertificateRef, ffi.Pointer)>>( - 'SecIdentityCreateWithCertificate'); - late final _SecIdentityCreateWithCertificate = - _SecIdentityCreateWithCertificatePtr.asFunction< - int Function( - CFTypeRef, SecCertificateRef, ffi.Pointer)>(); + @__darwin_sigset_t() + external int uc_sigmask; - int SecIdentityCopyCertificate( - SecIdentityRef identityRef, - ffi.Pointer certificateRef, - ) { - return _SecIdentityCopyCertificate( - identityRef, - certificateRef, - ); - } + external __darwin_sigaltstack uc_stack; - late final _SecIdentityCopyCertificatePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecIdentityRef, - ffi.Pointer)>>('SecIdentityCopyCertificate'); - late final _SecIdentityCopyCertificate = - _SecIdentityCopyCertificatePtr.asFunction< - int Function(SecIdentityRef, ffi.Pointer)>(); + external ffi.Pointer<__darwin_ucontext> uc_link; - int SecIdentityCopyPrivateKey( - SecIdentityRef identityRef, - ffi.Pointer privateKeyRef, - ) { - return _SecIdentityCopyPrivateKey( - identityRef, - privateKeyRef, - ); - } + @__darwin_size_t() + external int uc_mcsize; - late final _SecIdentityCopyPrivateKeyPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecIdentityRef, - ffi.Pointer)>>('SecIdentityCopyPrivateKey'); - late final _SecIdentityCopyPrivateKey = _SecIdentityCopyPrivateKeyPtr - .asFunction)>(); + external ffi.Pointer<__darwin_mcontext64> uc_mcontext; +} - int SecIdentityCopyPreference( - CFStringRef name, - int keyUsage, - CFArrayRef validIssuers, - ffi.Pointer identity, - ) { - return _SecIdentityCopyPreference( - name, - keyUsage, - validIssuers, - identity, - ); - } +typedef __darwin_sigset_t = __uint32_t; - late final _SecIdentityCopyPreferencePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(CFStringRef, CSSM_KEYUSE, CFArrayRef, - ffi.Pointer)>>('SecIdentityCopyPreference'); - late final _SecIdentityCopyPreference = - _SecIdentityCopyPreferencePtr.asFunction< - int Function( - CFStringRef, int, CFArrayRef, ffi.Pointer)>(); +final class sigval extends ffi.Union { + @ffi.Int() + external int sival_int; - SecIdentityRef SecIdentityCopyPreferred( - CFStringRef name, - CFArrayRef keyUsage, - CFArrayRef validIssuers, - ) { - return _SecIdentityCopyPreferred( - name, - keyUsage, - validIssuers, - ); - } + external ffi.Pointer sival_ptr; +} - late final _SecIdentityCopyPreferredPtr = _lookup< - ffi.NativeFunction< - SecIdentityRef Function(CFStringRef, CFArrayRef, - CFArrayRef)>>('SecIdentityCopyPreferred'); - late final _SecIdentityCopyPreferred = - _SecIdentityCopyPreferredPtr.asFunction< - SecIdentityRef Function(CFStringRef, CFArrayRef, CFArrayRef)>(); +final class sigevent extends ffi.Struct { + @ffi.Int() + external int sigev_notify; - int SecIdentitySetPreference( - SecIdentityRef identity, - CFStringRef name, - int keyUsage, - ) { - return _SecIdentitySetPreference( - identity, - name, - keyUsage, - ); - } + @ffi.Int() + external int sigev_signo; - late final _SecIdentitySetPreferencePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecIdentityRef, CFStringRef, - CSSM_KEYUSE)>>('SecIdentitySetPreference'); - late final _SecIdentitySetPreference = _SecIdentitySetPreferencePtr - .asFunction(); + external sigval sigev_value; - int SecIdentitySetPreferred( - SecIdentityRef identity, - CFStringRef name, - CFArrayRef keyUsage, - ) { - return _SecIdentitySetPreferred( - identity, - name, - keyUsage, - ); - } + external ffi.Pointer> + sigev_notify_function; - late final _SecIdentitySetPreferredPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SecIdentityRef, CFStringRef, - CFArrayRef)>>('SecIdentitySetPreferred'); - late final _SecIdentitySetPreferred = _SecIdentitySetPreferredPtr.asFunction< - int Function(SecIdentityRef, CFStringRef, CFArrayRef)>(); + external ffi.Pointer sigev_notify_attributes; +} - int SecIdentityCopySystemIdentity( - CFStringRef domain, - ffi.Pointer idRef, - ffi.Pointer actualDomain, - ) { - return _SecIdentityCopySystemIdentity( - domain, - idRef, - actualDomain, - ); - } +typedef pthread_attr_t = __darwin_pthread_attr_t; +typedef __darwin_pthread_attr_t = _opaque_pthread_attr_t; - late final _SecIdentityCopySystemIdentityPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(CFStringRef, ffi.Pointer, - ffi.Pointer)>>('SecIdentityCopySystemIdentity'); - late final _SecIdentityCopySystemIdentity = - _SecIdentityCopySystemIdentityPtr.asFunction< - int Function(CFStringRef, ffi.Pointer, - ffi.Pointer)>(); +final class __siginfo extends ffi.Struct { + @ffi.Int() + external int si_signo; - int SecIdentitySetSystemIdentity( - CFStringRef domain, - SecIdentityRef idRef, - ) { - return _SecIdentitySetSystemIdentity( - domain, - idRef, - ); - } + @ffi.Int() + external int si_errno; - late final _SecIdentitySetSystemIdentityPtr = _lookup< - ffi.NativeFunction>( - 'SecIdentitySetSystemIdentity'); - late final _SecIdentitySetSystemIdentity = _SecIdentitySetSystemIdentityPtr - .asFunction(); + @ffi.Int() + external int si_code; - late final ffi.Pointer _kSecIdentityDomainDefault = - _lookup('kSecIdentityDomainDefault'); + @pid_t() + external int si_pid; - CFStringRef get kSecIdentityDomainDefault => _kSecIdentityDomainDefault.value; + @uid_t() + external int si_uid; - set kSecIdentityDomainDefault(CFStringRef value) => - _kSecIdentityDomainDefault.value = value; + @ffi.Int() + external int si_status; - late final ffi.Pointer _kSecIdentityDomainKerberosKDC = - _lookup('kSecIdentityDomainKerberosKDC'); + external ffi.Pointer si_addr; - CFStringRef get kSecIdentityDomainKerberosKDC => - _kSecIdentityDomainKerberosKDC.value; + external sigval si_value; - set kSecIdentityDomainKerberosKDC(CFStringRef value) => - _kSecIdentityDomainKerberosKDC.value = value; + @ffi.Long() + external int si_band; - sec_trust_t sec_trust_create( - SecTrustRef trust, - ) { - return _sec_trust_create( - trust, - ); - } + @ffi.Array.multi([7]) + external ffi.Array __pad; +} - late final _sec_trust_createPtr = - _lookup>( - 'sec_trust_create'); - late final _sec_trust_create = - _sec_trust_createPtr.asFunction(); +typedef pid_t = __darwin_pid_t; +typedef __darwin_pid_t = __int32_t; +typedef __int32_t = ffi.Int; +typedef Dart__int32_t = int; +typedef uid_t = __darwin_uid_t; +typedef __darwin_uid_t = __uint32_t; - SecTrustRef sec_trust_copy_ref( - sec_trust_t trust, - ) { - return _sec_trust_copy_ref( - trust, - ); - } +final class __sigaction_u extends ffi.Union { + external ffi.Pointer> + __sa_handler; - late final _sec_trust_copy_refPtr = - _lookup>( - 'sec_trust_copy_ref'); - late final _sec_trust_copy_ref = - _sec_trust_copy_refPtr.asFunction(); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int, ffi.Pointer<__siginfo>, ffi.Pointer)>> + __sa_sigaction; +} - sec_identity_t sec_identity_create( - SecIdentityRef identity, - ) { - return _sec_identity_create( - identity, - ); - } +final class __sigaction extends ffi.Struct { + external __sigaction_u __sigaction_u1; - late final _sec_identity_createPtr = - _lookup>( - 'sec_identity_create'); - late final _sec_identity_create = _sec_identity_createPtr - .asFunction(); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Int, + ffi.Pointer, ffi.Pointer)>> sa_tramp; - sec_identity_t sec_identity_create_with_certificates( - SecIdentityRef identity, - CFArrayRef certificates, - ) { - return _sec_identity_create_with_certificates( - identity, - certificates, - ); - } + @sigset_t() + external int sa_mask; - late final _sec_identity_create_with_certificatesPtr = _lookup< - ffi - .NativeFunction>( - 'sec_identity_create_with_certificates'); - late final _sec_identity_create_with_certificates = - _sec_identity_create_with_certificatesPtr - .asFunction(); + @ffi.Int() + external int sa_flags; +} - bool sec_identity_access_certificates( - sec_identity_t identity, - ObjCBlock_ffiVoid_seccertificatet handler, - ) { - return _sec_identity_access_certificates( - identity, - handler._id, - ); - } +typedef siginfo_t = __siginfo; +typedef sigset_t = __darwin_sigset_t; - late final _sec_identity_access_certificatesPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(sec_identity_t, - ffi.Pointer<_ObjCBlock>)>>('sec_identity_access_certificates'); - late final _sec_identity_access_certificates = - _sec_identity_access_certificatesPtr - .asFunction)>(); +final class sigaction extends ffi.Struct { + external __sigaction_u __sigaction_u1; - SecIdentityRef sec_identity_copy_ref( - sec_identity_t identity, - ) { - return _sec_identity_copy_ref( - identity, - ); - } + @sigset_t() + external int sa_mask; - late final _sec_identity_copy_refPtr = - _lookup>( - 'sec_identity_copy_ref'); - late final _sec_identity_copy_ref = _sec_identity_copy_refPtr - .asFunction(); + @ffi.Int() + external int sa_flags; +} - CFArrayRef sec_identity_copy_certificates_ref( - sec_identity_t identity, - ) { - return _sec_identity_copy_certificates_ref( - identity, - ); - } +final class sigvec extends ffi.Struct { + external ffi.Pointer> + sv_handler; - late final _sec_identity_copy_certificates_refPtr = - _lookup>( - 'sec_identity_copy_certificates_ref'); - late final _sec_identity_copy_certificates_ref = - _sec_identity_copy_certificates_refPtr - .asFunction(); + @ffi.Int() + external int sv_mask; - sec_certificate_t sec_certificate_create( - SecCertificateRef certificate, - ) { - return _sec_certificate_create( - certificate, - ); - } + @ffi.Int() + external int sv_flags; +} - late final _sec_certificate_createPtr = _lookup< - ffi.NativeFunction>( - 'sec_certificate_create'); - late final _sec_certificate_create = _sec_certificate_createPtr - .asFunction(); +final class sigstack extends ffi.Struct { + external ffi.Pointer ss_sp; - SecCertificateRef sec_certificate_copy_ref( - sec_certificate_t certificate, - ) { - return _sec_certificate_copy_ref( - certificate, - ); - } + @ffi.Int() + external int ss_onstack; +} - late final _sec_certificate_copy_refPtr = _lookup< - ffi.NativeFunction>( - 'sec_certificate_copy_ref'); - late final _sec_certificate_copy_ref = _sec_certificate_copy_refPtr - .asFunction(); +final class timeval extends ffi.Struct { + @__darwin_time_t() + external int tv_sec; - ffi.Pointer sec_protocol_metadata_get_negotiated_protocol( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_get_negotiated_protocol( - metadata, - ); - } + @__darwin_suseconds_t() + external int tv_usec; +} - late final _sec_protocol_metadata_get_negotiated_protocolPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(sec_protocol_metadata_t)>>( - 'sec_protocol_metadata_get_negotiated_protocol'); - late final _sec_protocol_metadata_get_negotiated_protocol = - _sec_protocol_metadata_get_negotiated_protocolPtr.asFunction< - ffi.Pointer Function(sec_protocol_metadata_t)>(); +typedef __darwin_time_t = ffi.Long; +typedef Dart__darwin_time_t = int; +typedef __darwin_suseconds_t = __int32_t; - dispatch_data_t sec_protocol_metadata_copy_peer_public_key( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_copy_peer_public_key( - metadata, - ); - } +final class rusage extends ffi.Struct { + external timeval ru_utime; - late final _sec_protocol_metadata_copy_peer_public_keyPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_metadata_copy_peer_public_key'); - late final _sec_protocol_metadata_copy_peer_public_key = - _sec_protocol_metadata_copy_peer_public_keyPtr - .asFunction(); + external timeval ru_stime; - int sec_protocol_metadata_get_negotiated_tls_protocol_version( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_get_negotiated_tls_protocol_version( - metadata, - ); - } + @ffi.Long() + external int ru_maxrss; - late final _sec_protocol_metadata_get_negotiated_tls_protocol_versionPtr = - _lookup>( - 'sec_protocol_metadata_get_negotiated_tls_protocol_version'); - late final _sec_protocol_metadata_get_negotiated_tls_protocol_version = - _sec_protocol_metadata_get_negotiated_tls_protocol_versionPtr - .asFunction(); + @ffi.Long() + external int ru_ixrss; - int sec_protocol_metadata_get_negotiated_protocol_version( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_get_negotiated_protocol_version( - metadata, - ); - } + @ffi.Long() + external int ru_idrss; - late final _sec_protocol_metadata_get_negotiated_protocol_versionPtr = - _lookup>( - 'sec_protocol_metadata_get_negotiated_protocol_version'); - late final _sec_protocol_metadata_get_negotiated_protocol_version = - _sec_protocol_metadata_get_negotiated_protocol_versionPtr - .asFunction(); + @ffi.Long() + external int ru_isrss; - int sec_protocol_metadata_get_negotiated_tls_ciphersuite( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_get_negotiated_tls_ciphersuite( - metadata, - ); - } + @ffi.Long() + external int ru_minflt; - late final _sec_protocol_metadata_get_negotiated_tls_ciphersuitePtr = - _lookup>( - 'sec_protocol_metadata_get_negotiated_tls_ciphersuite'); - late final _sec_protocol_metadata_get_negotiated_tls_ciphersuite = - _sec_protocol_metadata_get_negotiated_tls_ciphersuitePtr - .asFunction(); + @ffi.Long() + external int ru_majflt; - int sec_protocol_metadata_get_negotiated_ciphersuite( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_get_negotiated_ciphersuite( - metadata, - ); - } + @ffi.Long() + external int ru_nswap; - late final _sec_protocol_metadata_get_negotiated_ciphersuitePtr = _lookup< - ffi.NativeFunction>( - 'sec_protocol_metadata_get_negotiated_ciphersuite'); - late final _sec_protocol_metadata_get_negotiated_ciphersuite = - _sec_protocol_metadata_get_negotiated_ciphersuitePtr - .asFunction(); + @ffi.Long() + external int ru_inblock; - bool sec_protocol_metadata_get_early_data_accepted( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_get_early_data_accepted( - metadata, - ); - } + @ffi.Long() + external int ru_oublock; - late final _sec_protocol_metadata_get_early_data_acceptedPtr = - _lookup>( - 'sec_protocol_metadata_get_early_data_accepted'); - late final _sec_protocol_metadata_get_early_data_accepted = - _sec_protocol_metadata_get_early_data_acceptedPtr - .asFunction(); + @ffi.Long() + external int ru_msgsnd; - bool sec_protocol_metadata_access_peer_certificate_chain( - sec_protocol_metadata_t metadata, - ObjCBlock_ffiVoid_seccertificatet handler, - ) { - return _sec_protocol_metadata_access_peer_certificate_chain( - metadata, - handler._id, - ); - } + @ffi.Long() + external int ru_msgrcv; - late final _sec_protocol_metadata_access_peer_certificate_chainPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>>( - 'sec_protocol_metadata_access_peer_certificate_chain'); - late final _sec_protocol_metadata_access_peer_certificate_chain = - _sec_protocol_metadata_access_peer_certificate_chainPtr.asFunction< - bool Function(sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>(); + @ffi.Long() + external int ru_nsignals; - bool sec_protocol_metadata_access_ocsp_response( - sec_protocol_metadata_t metadata, - ObjCBlock_ffiVoid_dispatchdatat handler, - ) { - return _sec_protocol_metadata_access_ocsp_response( - metadata, - handler._id, - ); - } + @ffi.Long() + external int ru_nvcsw; - late final _sec_protocol_metadata_access_ocsp_responsePtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>>( - 'sec_protocol_metadata_access_ocsp_response'); - late final _sec_protocol_metadata_access_ocsp_response = - _sec_protocol_metadata_access_ocsp_responsePtr.asFunction< - bool Function(sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>(); + @ffi.Long() + external int ru_nivcsw; +} - bool sec_protocol_metadata_access_supported_signature_algorithms( - sec_protocol_metadata_t metadata, - ObjCBlock_ffiVoid_Uint16 handler, - ) { - return _sec_protocol_metadata_access_supported_signature_algorithms( - metadata, - handler._id, - ); - } +final class rusage_info_v0 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; - late final _sec_protocol_metadata_access_supported_signature_algorithmsPtr = - _lookup< - ffi.NativeFunction< - ffi.Bool Function( - sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>>( - 'sec_protocol_metadata_access_supported_signature_algorithms'); - late final _sec_protocol_metadata_access_supported_signature_algorithms = - _sec_protocol_metadata_access_supported_signature_algorithmsPtr - .asFunction< - bool Function( - sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>(); + @ffi.Uint64() + external int ri_user_time; - bool sec_protocol_metadata_access_distinguished_names( - sec_protocol_metadata_t metadata, - ObjCBlock_ffiVoid_dispatchdatat handler, - ) { - return _sec_protocol_metadata_access_distinguished_names( - metadata, - handler._id, - ); - } + @ffi.Uint64() + external int ri_system_time; - late final _sec_protocol_metadata_access_distinguished_namesPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>>( - 'sec_protocol_metadata_access_distinguished_names'); - late final _sec_protocol_metadata_access_distinguished_names = - _sec_protocol_metadata_access_distinguished_namesPtr.asFunction< - bool Function(sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>(); + @ffi.Uint64() + external int ri_pkg_idle_wkups; - bool sec_protocol_metadata_access_pre_shared_keys( - sec_protocol_metadata_t metadata, - ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat handler, - ) { - return _sec_protocol_metadata_access_pre_shared_keys( - metadata, - handler._id, - ); - } + @ffi.Uint64() + external int ri_interrupt_wkups; - late final _sec_protocol_metadata_access_pre_shared_keysPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>>( - 'sec_protocol_metadata_access_pre_shared_keys'); - late final _sec_protocol_metadata_access_pre_shared_keys = - _sec_protocol_metadata_access_pre_shared_keysPtr.asFunction< - bool Function(sec_protocol_metadata_t, ffi.Pointer<_ObjCBlock>)>(); + @ffi.Uint64() + external int ri_pageins; - ffi.Pointer sec_protocol_metadata_get_server_name( - sec_protocol_metadata_t metadata, - ) { - return _sec_protocol_metadata_get_server_name( - metadata, - ); - } + @ffi.Uint64() + external int ri_wired_size; - late final _sec_protocol_metadata_get_server_namePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(sec_protocol_metadata_t)>>( - 'sec_protocol_metadata_get_server_name'); - late final _sec_protocol_metadata_get_server_name = - _sec_protocol_metadata_get_server_namePtr.asFunction< - ffi.Pointer Function(sec_protocol_metadata_t)>(); + @ffi.Uint64() + external int ri_resident_size; - bool sec_protocol_metadata_peers_are_equal( - sec_protocol_metadata_t metadataA, - sec_protocol_metadata_t metadataB, - ) { - return _sec_protocol_metadata_peers_are_equal( - metadataA, - metadataB, - ); - } + @ffi.Uint64() + external int ri_phys_footprint; - late final _sec_protocol_metadata_peers_are_equalPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - sec_protocol_metadata_t, sec_protocol_metadata_t)>>( - 'sec_protocol_metadata_peers_are_equal'); - late final _sec_protocol_metadata_peers_are_equal = - _sec_protocol_metadata_peers_are_equalPtr.asFunction< - bool Function(sec_protocol_metadata_t, sec_protocol_metadata_t)>(); + @ffi.Uint64() + external int ri_proc_start_abstime; - bool sec_protocol_metadata_challenge_parameters_are_equal( - sec_protocol_metadata_t metadataA, - sec_protocol_metadata_t metadataB, - ) { - return _sec_protocol_metadata_challenge_parameters_are_equal( - metadataA, - metadataB, - ); - } + @ffi.Uint64() + external int ri_proc_exit_abstime; +} - late final _sec_protocol_metadata_challenge_parameters_are_equalPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - sec_protocol_metadata_t, sec_protocol_metadata_t)>>( - 'sec_protocol_metadata_challenge_parameters_are_equal'); - late final _sec_protocol_metadata_challenge_parameters_are_equal = - _sec_protocol_metadata_challenge_parameters_are_equalPtr.asFunction< - bool Function(sec_protocol_metadata_t, sec_protocol_metadata_t)>(); +final class rusage_info_v1 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; - dispatch_data_t sec_protocol_metadata_create_secret( - sec_protocol_metadata_t metadata, - int label_len, - ffi.Pointer label, - int exporter_length, - ) { - return _sec_protocol_metadata_create_secret( - metadata, - label_len, - label, - exporter_length, - ); - } + @ffi.Uint64() + external int ri_user_time; - late final _sec_protocol_metadata_create_secretPtr = _lookup< - ffi.NativeFunction< - dispatch_data_t Function( - sec_protocol_metadata_t, - ffi.Size, - ffi.Pointer, - ffi.Size)>>('sec_protocol_metadata_create_secret'); - late final _sec_protocol_metadata_create_secret = - _sec_protocol_metadata_create_secretPtr.asFunction< - dispatch_data_t Function( - sec_protocol_metadata_t, int, ffi.Pointer, int)>(); + @ffi.Uint64() + external int ri_system_time; - dispatch_data_t sec_protocol_metadata_create_secret_with_context( - sec_protocol_metadata_t metadata, - int label_len, - ffi.Pointer label, - int context_len, - ffi.Pointer context, - int exporter_length, - ) { - return _sec_protocol_metadata_create_secret_with_context( - metadata, - label_len, - label, - context_len, - context, - exporter_length, - ); - } + @ffi.Uint64() + external int ri_pkg_idle_wkups; - late final _sec_protocol_metadata_create_secret_with_contextPtr = _lookup< - ffi.NativeFunction< - dispatch_data_t Function( - sec_protocol_metadata_t, - ffi.Size, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size)>>('sec_protocol_metadata_create_secret_with_context'); - late final _sec_protocol_metadata_create_secret_with_context = - _sec_protocol_metadata_create_secret_with_contextPtr.asFunction< - dispatch_data_t Function(sec_protocol_metadata_t, int, - ffi.Pointer, int, ffi.Pointer, int)>(); + @ffi.Uint64() + external int ri_interrupt_wkups; - bool sec_protocol_options_are_equal( - sec_protocol_options_t optionsA, - sec_protocol_options_t optionsB, - ) { - return _sec_protocol_options_are_equal( - optionsA, - optionsB, - ); - } + @ffi.Uint64() + external int ri_pageins; - late final _sec_protocol_options_are_equalPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(sec_protocol_options_t, - sec_protocol_options_t)>>('sec_protocol_options_are_equal'); - late final _sec_protocol_options_are_equal = - _sec_protocol_options_are_equalPtr.asFunction< - bool Function(sec_protocol_options_t, sec_protocol_options_t)>(); + @ffi.Uint64() + external int ri_wired_size; - void sec_protocol_options_set_local_identity( - sec_protocol_options_t options, - sec_identity_t identity, - ) { - return _sec_protocol_options_set_local_identity( - options, - identity, - ); - } + @ffi.Uint64() + external int ri_resident_size; - late final _sec_protocol_options_set_local_identityPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - sec_identity_t)>>('sec_protocol_options_set_local_identity'); - late final _sec_protocol_options_set_local_identity = - _sec_protocol_options_set_local_identityPtr - .asFunction(); + @ffi.Uint64() + external int ri_phys_footprint; - void sec_protocol_options_append_tls_ciphersuite( - sec_protocol_options_t options, - int ciphersuite, - ) { - return _sec_protocol_options_append_tls_ciphersuite( - options, - ciphersuite, - ); - } + @ffi.Uint64() + external int ri_proc_start_abstime; - late final _sec_protocol_options_append_tls_ciphersuitePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - ffi.Int32)>>('sec_protocol_options_append_tls_ciphersuite'); - late final _sec_protocol_options_append_tls_ciphersuite = - _sec_protocol_options_append_tls_ciphersuitePtr - .asFunction(); + @ffi.Uint64() + external int ri_proc_exit_abstime; - void sec_protocol_options_add_tls_ciphersuite( - sec_protocol_options_t options, - int ciphersuite, - ) { - return _sec_protocol_options_add_tls_ciphersuite( - options, - ciphersuite, - ); - } + @ffi.Uint64() + external int ri_child_user_time; - late final _sec_protocol_options_add_tls_ciphersuitePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - SSLCipherSuite)>>('sec_protocol_options_add_tls_ciphersuite'); - late final _sec_protocol_options_add_tls_ciphersuite = - _sec_protocol_options_add_tls_ciphersuitePtr - .asFunction(); + @ffi.Uint64() + external int ri_child_system_time; - void sec_protocol_options_append_tls_ciphersuite_group( - sec_protocol_options_t options, - int group, - ) { - return _sec_protocol_options_append_tls_ciphersuite_group( - options, - group, - ); - } + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; - late final _sec_protocol_options_append_tls_ciphersuite_groupPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - ffi.Int32)>>('sec_protocol_options_append_tls_ciphersuite_group'); - late final _sec_protocol_options_append_tls_ciphersuite_group = - _sec_protocol_options_append_tls_ciphersuite_groupPtr - .asFunction(); + @ffi.Uint64() + external int ri_child_interrupt_wkups; - void sec_protocol_options_add_tls_ciphersuite_group( - sec_protocol_options_t options, - int group, - ) { - return _sec_protocol_options_add_tls_ciphersuite_group( - options, - group, - ); - } + @ffi.Uint64() + external int ri_child_pageins; - late final _sec_protocol_options_add_tls_ciphersuite_groupPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - ffi.Int32)>>('sec_protocol_options_add_tls_ciphersuite_group'); - late final _sec_protocol_options_add_tls_ciphersuite_group = - _sec_protocol_options_add_tls_ciphersuite_groupPtr - .asFunction(); + @ffi.Uint64() + external int ri_child_elapsed_abstime; +} - void sec_protocol_options_set_tls_min_version( - sec_protocol_options_t options, - int version, - ) { - return _sec_protocol_options_set_tls_min_version( - options, - version, - ); - } +final class rusage_info_v2 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; - late final _sec_protocol_options_set_tls_min_versionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - ffi.Int32)>>('sec_protocol_options_set_tls_min_version'); - late final _sec_protocol_options_set_tls_min_version = - _sec_protocol_options_set_tls_min_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_user_time; - void sec_protocol_options_set_min_tls_protocol_version( - sec_protocol_options_t options, - int version, - ) { - return _sec_protocol_options_set_min_tls_protocol_version( - options, - version, - ); - } + @ffi.Uint64() + external int ri_system_time; - late final _sec_protocol_options_set_min_tls_protocol_versionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - ffi.Int32)>>('sec_protocol_options_set_min_tls_protocol_version'); - late final _sec_protocol_options_set_min_tls_protocol_version = - _sec_protocol_options_set_min_tls_protocol_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_pkg_idle_wkups; - int sec_protocol_options_get_default_min_tls_protocol_version() { - return _sec_protocol_options_get_default_min_tls_protocol_version(); - } + @ffi.Uint64() + external int ri_interrupt_wkups; - late final _sec_protocol_options_get_default_min_tls_protocol_versionPtr = - _lookup>( - 'sec_protocol_options_get_default_min_tls_protocol_version'); - late final _sec_protocol_options_get_default_min_tls_protocol_version = - _sec_protocol_options_get_default_min_tls_protocol_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_pageins; - int sec_protocol_options_get_default_min_dtls_protocol_version() { - return _sec_protocol_options_get_default_min_dtls_protocol_version(); - } + @ffi.Uint64() + external int ri_wired_size; - late final _sec_protocol_options_get_default_min_dtls_protocol_versionPtr = - _lookup>( - 'sec_protocol_options_get_default_min_dtls_protocol_version'); - late final _sec_protocol_options_get_default_min_dtls_protocol_version = - _sec_protocol_options_get_default_min_dtls_protocol_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_resident_size; - void sec_protocol_options_set_tls_max_version( - sec_protocol_options_t options, - int version, - ) { - return _sec_protocol_options_set_tls_max_version( - options, - version, - ); - } + @ffi.Uint64() + external int ri_phys_footprint; - late final _sec_protocol_options_set_tls_max_versionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - ffi.Int32)>>('sec_protocol_options_set_tls_max_version'); - late final _sec_protocol_options_set_tls_max_version = - _sec_protocol_options_set_tls_max_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_proc_start_abstime; - void sec_protocol_options_set_max_tls_protocol_version( - sec_protocol_options_t options, - int version, - ) { - return _sec_protocol_options_set_max_tls_protocol_version( - options, - version, - ); - } + @ffi.Uint64() + external int ri_proc_exit_abstime; - late final _sec_protocol_options_set_max_tls_protocol_versionPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, - ffi.Int32)>>('sec_protocol_options_set_max_tls_protocol_version'); - late final _sec_protocol_options_set_max_tls_protocol_version = - _sec_protocol_options_set_max_tls_protocol_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_child_user_time; - int sec_protocol_options_get_default_max_tls_protocol_version() { - return _sec_protocol_options_get_default_max_tls_protocol_version(); - } + @ffi.Uint64() + external int ri_child_system_time; - late final _sec_protocol_options_get_default_max_tls_protocol_versionPtr = - _lookup>( - 'sec_protocol_options_get_default_max_tls_protocol_version'); - late final _sec_protocol_options_get_default_max_tls_protocol_version = - _sec_protocol_options_get_default_max_tls_protocol_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; - int sec_protocol_options_get_default_max_dtls_protocol_version() { - return _sec_protocol_options_get_default_max_dtls_protocol_version(); - } + @ffi.Uint64() + external int ri_child_interrupt_wkups; - late final _sec_protocol_options_get_default_max_dtls_protocol_versionPtr = - _lookup>( - 'sec_protocol_options_get_default_max_dtls_protocol_version'); - late final _sec_protocol_options_get_default_max_dtls_protocol_version = - _sec_protocol_options_get_default_max_dtls_protocol_versionPtr - .asFunction(); + @ffi.Uint64() + external int ri_child_pageins; - bool sec_protocol_options_get_enable_encrypted_client_hello( - sec_protocol_options_t options, - ) { - return _sec_protocol_options_get_enable_encrypted_client_hello( - options, - ); - } + @ffi.Uint64() + external int ri_child_elapsed_abstime; - late final _sec_protocol_options_get_enable_encrypted_client_helloPtr = - _lookup>( - 'sec_protocol_options_get_enable_encrypted_client_hello'); - late final _sec_protocol_options_get_enable_encrypted_client_hello = - _sec_protocol_options_get_enable_encrypted_client_helloPtr - .asFunction(); + @ffi.Uint64() + external int ri_diskio_bytesread; - bool sec_protocol_options_get_quic_use_legacy_codepoint( - sec_protocol_options_t options, - ) { - return _sec_protocol_options_get_quic_use_legacy_codepoint( - options, - ); - } + @ffi.Uint64() + external int ri_diskio_byteswritten; +} - late final _sec_protocol_options_get_quic_use_legacy_codepointPtr = - _lookup>( - 'sec_protocol_options_get_quic_use_legacy_codepoint'); - late final _sec_protocol_options_get_quic_use_legacy_codepoint = - _sec_protocol_options_get_quic_use_legacy_codepointPtr - .asFunction(); +final class rusage_info_v3 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; - void sec_protocol_options_add_tls_application_protocol( - sec_protocol_options_t options, - ffi.Pointer application_protocol, - ) { - return _sec_protocol_options_add_tls_application_protocol( - options, - application_protocol, - ); - } + @ffi.Uint64() + external int ri_user_time; - late final _sec_protocol_options_add_tls_application_protocolPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_options_t, ffi.Pointer)>>( - 'sec_protocol_options_add_tls_application_protocol'); - late final _sec_protocol_options_add_tls_application_protocol = - _sec_protocol_options_add_tls_application_protocolPtr.asFunction< - void Function(sec_protocol_options_t, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_system_time; - void sec_protocol_options_set_tls_server_name( - sec_protocol_options_t options, - ffi.Pointer server_name, - ) { - return _sec_protocol_options_set_tls_server_name( - options, - server_name, - ); - } + @ffi.Uint64() + external int ri_pkg_idle_wkups; - late final _sec_protocol_options_set_tls_server_namePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_options_t, ffi.Pointer)>>( - 'sec_protocol_options_set_tls_server_name'); - late final _sec_protocol_options_set_tls_server_name = - _sec_protocol_options_set_tls_server_namePtr.asFunction< - void Function(sec_protocol_options_t, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_interrupt_wkups; - void sec_protocol_options_set_tls_diffie_hellman_parameters( - sec_protocol_options_t options, - dispatch_data_t params, - ) { - return _sec_protocol_options_set_tls_diffie_hellman_parameters( - options, - params, - ); - } + @ffi.Uint64() + external int ri_pageins; - late final _sec_protocol_options_set_tls_diffie_hellman_parametersPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, dispatch_data_t)>>( - 'sec_protocol_options_set_tls_diffie_hellman_parameters'); - late final _sec_protocol_options_set_tls_diffie_hellman_parameters = - _sec_protocol_options_set_tls_diffie_hellman_parametersPtr - .asFunction(); + @ffi.Uint64() + external int ri_wired_size; - void sec_protocol_options_add_pre_shared_key( - sec_protocol_options_t options, - dispatch_data_t psk, - dispatch_data_t psk_identity, - ) { - return _sec_protocol_options_add_pre_shared_key( - options, - psk, - psk_identity, - ); - } + @ffi.Uint64() + external int ri_resident_size; - late final _sec_protocol_options_add_pre_shared_keyPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, dispatch_data_t, - dispatch_data_t)>>('sec_protocol_options_add_pre_shared_key'); - late final _sec_protocol_options_add_pre_shared_key = - _sec_protocol_options_add_pre_shared_keyPtr.asFunction< - void Function( - sec_protocol_options_t, dispatch_data_t, dispatch_data_t)>(); + @ffi.Uint64() + external int ri_phys_footprint; - void sec_protocol_options_set_tls_pre_shared_key_identity_hint( - sec_protocol_options_t options, - dispatch_data_t psk_identity_hint, - ) { - return _sec_protocol_options_set_tls_pre_shared_key_identity_hint( - options, - psk_identity_hint, - ); - } + @ffi.Uint64() + external int ri_proc_start_abstime; - late final _sec_protocol_options_set_tls_pre_shared_key_identity_hintPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, dispatch_data_t)>>( - 'sec_protocol_options_set_tls_pre_shared_key_identity_hint'); - late final _sec_protocol_options_set_tls_pre_shared_key_identity_hint = - _sec_protocol_options_set_tls_pre_shared_key_identity_hintPtr - .asFunction(); + @ffi.Uint64() + external int ri_proc_exit_abstime; - void sec_protocol_options_set_pre_shared_key_selection_block( - sec_protocol_options_t options, - Dartsec_protocol_pre_shared_key_selection_t psk_selection_block, - dispatch_queue_t psk_selection_queue, - ) { - return _sec_protocol_options_set_pre_shared_key_selection_block( - options, - psk_selection_block._id, - psk_selection_queue, - ); - } + @ffi.Uint64() + external int ri_child_user_time; - late final _sec_protocol_options_set_pre_shared_key_selection_blockPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_options_t, - sec_protocol_pre_shared_key_selection_t, - dispatch_queue_t)>>( - 'sec_protocol_options_set_pre_shared_key_selection_block'); - late final _sec_protocol_options_set_pre_shared_key_selection_block = - _sec_protocol_options_set_pre_shared_key_selection_blockPtr.asFunction< - void Function(sec_protocol_options_t, - sec_protocol_pre_shared_key_selection_t, dispatch_queue_t)>(); + @ffi.Uint64() + external int ri_child_system_time; - void sec_protocol_options_set_tls_tickets_enabled( - sec_protocol_options_t options, - bool tickets_enabled, - ) { - return _sec_protocol_options_set_tls_tickets_enabled( - options, - tickets_enabled, - ); - } + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; - late final _sec_protocol_options_set_tls_tickets_enabledPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_tls_tickets_enabled'); - late final _sec_protocol_options_set_tls_tickets_enabled = - _sec_protocol_options_set_tls_tickets_enabledPtr - .asFunction(); + @ffi.Uint64() + external int ri_child_interrupt_wkups; - void sec_protocol_options_set_tls_is_fallback_attempt( - sec_protocol_options_t options, - bool is_fallback_attempt, - ) { - return _sec_protocol_options_set_tls_is_fallback_attempt( - options, - is_fallback_attempt, - ); - } + @ffi.Uint64() + external int ri_child_pageins; - late final _sec_protocol_options_set_tls_is_fallback_attemptPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_tls_is_fallback_attempt'); - late final _sec_protocol_options_set_tls_is_fallback_attempt = - _sec_protocol_options_set_tls_is_fallback_attemptPtr - .asFunction(); + @ffi.Uint64() + external int ri_child_elapsed_abstime; - void sec_protocol_options_set_tls_resumption_enabled( - sec_protocol_options_t options, - bool resumption_enabled, - ) { - return _sec_protocol_options_set_tls_resumption_enabled( - options, - resumption_enabled, - ); - } + @ffi.Uint64() + external int ri_diskio_bytesread; - late final _sec_protocol_options_set_tls_resumption_enabledPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_tls_resumption_enabled'); - late final _sec_protocol_options_set_tls_resumption_enabled = - _sec_protocol_options_set_tls_resumption_enabledPtr - .asFunction(); + @ffi.Uint64() + external int ri_diskio_byteswritten; - void sec_protocol_options_set_tls_false_start_enabled( - sec_protocol_options_t options, - bool false_start_enabled, - ) { - return _sec_protocol_options_set_tls_false_start_enabled( - options, - false_start_enabled, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_default; - late final _sec_protocol_options_set_tls_false_start_enabledPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_tls_false_start_enabled'); - late final _sec_protocol_options_set_tls_false_start_enabled = - _sec_protocol_options_set_tls_false_start_enabledPtr - .asFunction(); + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; - void sec_protocol_options_set_tls_ocsp_enabled( - sec_protocol_options_t options, - bool ocsp_enabled, - ) { - return _sec_protocol_options_set_tls_ocsp_enabled( - options, - ocsp_enabled, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_background; - late final _sec_protocol_options_set_tls_ocsp_enabledPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_tls_ocsp_enabled'); - late final _sec_protocol_options_set_tls_ocsp_enabled = - _sec_protocol_options_set_tls_ocsp_enabledPtr - .asFunction(); + @ffi.Uint64() + external int ri_cpu_time_qos_utility; - void sec_protocol_options_set_tls_sct_enabled( - sec_protocol_options_t options, - bool sct_enabled, - ) { - return _sec_protocol_options_set_tls_sct_enabled( - options, - sct_enabled, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; - late final _sec_protocol_options_set_tls_sct_enabledPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_tls_sct_enabled'); - late final _sec_protocol_options_set_tls_sct_enabled = - _sec_protocol_options_set_tls_sct_enabledPtr - .asFunction(); + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; - void sec_protocol_options_set_tls_renegotiation_enabled( - sec_protocol_options_t options, - bool renegotiation_enabled, - ) { - return _sec_protocol_options_set_tls_renegotiation_enabled( - options, - renegotiation_enabled, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; - late final _sec_protocol_options_set_tls_renegotiation_enabledPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_tls_renegotiation_enabled'); - late final _sec_protocol_options_set_tls_renegotiation_enabled = - _sec_protocol_options_set_tls_renegotiation_enabledPtr - .asFunction(); + @ffi.Uint64() + external int ri_billed_system_time; - void sec_protocol_options_set_peer_authentication_required( - sec_protocol_options_t options, - bool peer_authentication_required, - ) { - return _sec_protocol_options_set_peer_authentication_required( - options, - peer_authentication_required, - ); - } + @ffi.Uint64() + external int ri_serviced_system_time; +} - late final _sec_protocol_options_set_peer_authentication_requiredPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, ffi.Bool)>>( - 'sec_protocol_options_set_peer_authentication_required'); - late final _sec_protocol_options_set_peer_authentication_required = - _sec_protocol_options_set_peer_authentication_requiredPtr - .asFunction(); +final class rusage_info_v4 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; - void sec_protocol_options_set_peer_authentication_optional( - sec_protocol_options_t options, - bool peer_authentication_optional, - ) { - return _sec_protocol_options_set_peer_authentication_optional( - options, - peer_authentication_optional, - ); - } + @ffi.Uint64() + external int ri_user_time; - late final _sec_protocol_options_set_peer_authentication_optionalPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, ffi.Bool)>>( - 'sec_protocol_options_set_peer_authentication_optional'); - late final _sec_protocol_options_set_peer_authentication_optional = - _sec_protocol_options_set_peer_authentication_optionalPtr - .asFunction(); + @ffi.Uint64() + external int ri_system_time; - void sec_protocol_options_set_enable_encrypted_client_hello( - sec_protocol_options_t options, - bool enable_encrypted_client_hello, - ) { - return _sec_protocol_options_set_enable_encrypted_client_hello( - options, - enable_encrypted_client_hello, - ); - } + @ffi.Uint64() + external int ri_pkg_idle_wkups; - late final _sec_protocol_options_set_enable_encrypted_client_helloPtr = - _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, ffi.Bool)>>( - 'sec_protocol_options_set_enable_encrypted_client_hello'); - late final _sec_protocol_options_set_enable_encrypted_client_hello = - _sec_protocol_options_set_enable_encrypted_client_helloPtr - .asFunction(); + @ffi.Uint64() + external int ri_interrupt_wkups; - void sec_protocol_options_set_quic_use_legacy_codepoint( - sec_protocol_options_t options, - bool quic_use_legacy_codepoint, - ) { - return _sec_protocol_options_set_quic_use_legacy_codepoint( - options, - quic_use_legacy_codepoint, - ); - } + @ffi.Uint64() + external int ri_pageins; - late final _sec_protocol_options_set_quic_use_legacy_codepointPtr = _lookup< - ffi - .NativeFunction>( - 'sec_protocol_options_set_quic_use_legacy_codepoint'); - late final _sec_protocol_options_set_quic_use_legacy_codepoint = - _sec_protocol_options_set_quic_use_legacy_codepointPtr - .asFunction(); + @ffi.Uint64() + external int ri_wired_size; - void sec_protocol_options_set_key_update_block( - sec_protocol_options_t options, - Dartsec_protocol_key_update_t key_update_block, - dispatch_queue_t key_update_queue, - ) { - return _sec_protocol_options_set_key_update_block( - options, - key_update_block._id, - key_update_queue, - ); - } + @ffi.Uint64() + external int ri_resident_size; - late final _sec_protocol_options_set_key_update_blockPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, sec_protocol_key_update_t, - dispatch_queue_t)>>('sec_protocol_options_set_key_update_block'); - late final _sec_protocol_options_set_key_update_block = - _sec_protocol_options_set_key_update_blockPtr.asFunction< - void Function(sec_protocol_options_t, sec_protocol_key_update_t, - dispatch_queue_t)>(); + @ffi.Uint64() + external int ri_phys_footprint; - void sec_protocol_options_set_challenge_block( - sec_protocol_options_t options, - Dartsec_protocol_challenge_t challenge_block, - dispatch_queue_t challenge_queue, - ) { - return _sec_protocol_options_set_challenge_block( - options, - challenge_block._id, - challenge_queue, - ); - } + @ffi.Uint64() + external int ri_proc_start_abstime; - late final _sec_protocol_options_set_challenge_blockPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, sec_protocol_challenge_t, - dispatch_queue_t)>>('sec_protocol_options_set_challenge_block'); - late final _sec_protocol_options_set_challenge_block = - _sec_protocol_options_set_challenge_blockPtr.asFunction< - void Function(sec_protocol_options_t, sec_protocol_challenge_t, - dispatch_queue_t)>(); + @ffi.Uint64() + external int ri_proc_exit_abstime; - void sec_protocol_options_set_verify_block( - sec_protocol_options_t options, - Dartsec_protocol_verify_t verify_block, - dispatch_queue_t verify_block_queue, - ) { - return _sec_protocol_options_set_verify_block( - options, - verify_block._id, - verify_block_queue, - ); - } + @ffi.Uint64() + external int ri_child_user_time; - late final _sec_protocol_options_set_verify_blockPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_options_t, sec_protocol_verify_t, - dispatch_queue_t)>>('sec_protocol_options_set_verify_block'); - late final _sec_protocol_options_set_verify_block = - _sec_protocol_options_set_verify_blockPtr.asFunction< - void Function(sec_protocol_options_t, sec_protocol_verify_t, - dispatch_queue_t)>(); + @ffi.Uint64() + external int ri_child_system_time; - late final ffi.Pointer _kSSLSessionConfig_default = - _lookup('kSSLSessionConfig_default'); + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; - CFStringRef get kSSLSessionConfig_default => _kSSLSessionConfig_default.value; + @ffi.Uint64() + external int ri_child_interrupt_wkups; - set kSSLSessionConfig_default(CFStringRef value) => - _kSSLSessionConfig_default.value = value; + @ffi.Uint64() + external int ri_child_pageins; - late final ffi.Pointer _kSSLSessionConfig_ATSv1 = - _lookup('kSSLSessionConfig_ATSv1'); + @ffi.Uint64() + external int ri_child_elapsed_abstime; - CFStringRef get kSSLSessionConfig_ATSv1 => _kSSLSessionConfig_ATSv1.value; + @ffi.Uint64() + external int ri_diskio_bytesread; - set kSSLSessionConfig_ATSv1(CFStringRef value) => - _kSSLSessionConfig_ATSv1.value = value; + @ffi.Uint64() + external int ri_diskio_byteswritten; - late final ffi.Pointer _kSSLSessionConfig_ATSv1_noPFS = - _lookup('kSSLSessionConfig_ATSv1_noPFS'); + @ffi.Uint64() + external int ri_cpu_time_qos_default; - CFStringRef get kSSLSessionConfig_ATSv1_noPFS => - _kSSLSessionConfig_ATSv1_noPFS.value; + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; - set kSSLSessionConfig_ATSv1_noPFS(CFStringRef value) => - _kSSLSessionConfig_ATSv1_noPFS.value = value; + @ffi.Uint64() + external int ri_cpu_time_qos_background; - late final ffi.Pointer _kSSLSessionConfig_standard = - _lookup('kSSLSessionConfig_standard'); + @ffi.Uint64() + external int ri_cpu_time_qos_utility; - CFStringRef get kSSLSessionConfig_standard => - _kSSLSessionConfig_standard.value; + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; - set kSSLSessionConfig_standard(CFStringRef value) => - _kSSLSessionConfig_standard.value = value; + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; - late final ffi.Pointer _kSSLSessionConfig_RC4_fallback = - _lookup('kSSLSessionConfig_RC4_fallback'); + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; - CFStringRef get kSSLSessionConfig_RC4_fallback => - _kSSLSessionConfig_RC4_fallback.value; + @ffi.Uint64() + external int ri_billed_system_time; - set kSSLSessionConfig_RC4_fallback(CFStringRef value) => - _kSSLSessionConfig_RC4_fallback.value = value; + @ffi.Uint64() + external int ri_serviced_system_time; - late final ffi.Pointer _kSSLSessionConfig_TLSv1_fallback = - _lookup('kSSLSessionConfig_TLSv1_fallback'); + @ffi.Uint64() + external int ri_logical_writes; - CFStringRef get kSSLSessionConfig_TLSv1_fallback => - _kSSLSessionConfig_TLSv1_fallback.value; + @ffi.Uint64() + external int ri_lifetime_max_phys_footprint; - set kSSLSessionConfig_TLSv1_fallback(CFStringRef value) => - _kSSLSessionConfig_TLSv1_fallback.value = value; + @ffi.Uint64() + external int ri_instructions; - late final ffi.Pointer _kSSLSessionConfig_TLSv1_RC4_fallback = - _lookup('kSSLSessionConfig_TLSv1_RC4_fallback'); + @ffi.Uint64() + external int ri_cycles; - CFStringRef get kSSLSessionConfig_TLSv1_RC4_fallback => - _kSSLSessionConfig_TLSv1_RC4_fallback.value; + @ffi.Uint64() + external int ri_billed_energy; - set kSSLSessionConfig_TLSv1_RC4_fallback(CFStringRef value) => - _kSSLSessionConfig_TLSv1_RC4_fallback.value = value; + @ffi.Uint64() + external int ri_serviced_energy; - late final ffi.Pointer _kSSLSessionConfig_legacy = - _lookup('kSSLSessionConfig_legacy'); + @ffi.Uint64() + external int ri_interval_max_phys_footprint; - CFStringRef get kSSLSessionConfig_legacy => _kSSLSessionConfig_legacy.value; + @ffi.Uint64() + external int ri_runnable_time; +} - set kSSLSessionConfig_legacy(CFStringRef value) => - _kSSLSessionConfig_legacy.value = value; +final class rusage_info_v5 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; - late final ffi.Pointer _kSSLSessionConfig_legacy_DHE = - _lookup('kSSLSessionConfig_legacy_DHE'); + @ffi.Uint64() + external int ri_user_time; - CFStringRef get kSSLSessionConfig_legacy_DHE => - _kSSLSessionConfig_legacy_DHE.value; + @ffi.Uint64() + external int ri_system_time; - set kSSLSessionConfig_legacy_DHE(CFStringRef value) => - _kSSLSessionConfig_legacy_DHE.value = value; + @ffi.Uint64() + external int ri_pkg_idle_wkups; - late final ffi.Pointer _kSSLSessionConfig_anonymous = - _lookup('kSSLSessionConfig_anonymous'); + @ffi.Uint64() + external int ri_interrupt_wkups; - CFStringRef get kSSLSessionConfig_anonymous => - _kSSLSessionConfig_anonymous.value; + @ffi.Uint64() + external int ri_pageins; - set kSSLSessionConfig_anonymous(CFStringRef value) => - _kSSLSessionConfig_anonymous.value = value; + @ffi.Uint64() + external int ri_wired_size; - late final ffi.Pointer _kSSLSessionConfig_3DES_fallback = - _lookup('kSSLSessionConfig_3DES_fallback'); + @ffi.Uint64() + external int ri_resident_size; - CFStringRef get kSSLSessionConfig_3DES_fallback => - _kSSLSessionConfig_3DES_fallback.value; + @ffi.Uint64() + external int ri_phys_footprint; - set kSSLSessionConfig_3DES_fallback(CFStringRef value) => - _kSSLSessionConfig_3DES_fallback.value = value; + @ffi.Uint64() + external int ri_proc_start_abstime; - late final ffi.Pointer _kSSLSessionConfig_TLSv1_3DES_fallback = - _lookup('kSSLSessionConfig_TLSv1_3DES_fallback'); + @ffi.Uint64() + external int ri_proc_exit_abstime; - CFStringRef get kSSLSessionConfig_TLSv1_3DES_fallback => - _kSSLSessionConfig_TLSv1_3DES_fallback.value; + @ffi.Uint64() + external int ri_child_user_time; - set kSSLSessionConfig_TLSv1_3DES_fallback(CFStringRef value) => - _kSSLSessionConfig_TLSv1_3DES_fallback.value = value; + @ffi.Uint64() + external int ri_child_system_time; - int SSLContextGetTypeID() { - return _SSLContextGetTypeID(); - } + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; - late final _SSLContextGetTypeIDPtr = - _lookup>('SSLContextGetTypeID'); - late final _SSLContextGetTypeID = - _SSLContextGetTypeIDPtr.asFunction(); + @ffi.Uint64() + external int ri_child_interrupt_wkups; - SSLContextRef SSLCreateContext( - CFAllocatorRef alloc, - int protocolSide, - int connectionType, - ) { - return _SSLCreateContext( - alloc, - protocolSide, - connectionType, - ); - } + @ffi.Uint64() + external int ri_child_pageins; - late final _SSLCreateContextPtr = _lookup< - ffi.NativeFunction< - SSLContextRef Function( - CFAllocatorRef, ffi.Int32, ffi.Int32)>>('SSLCreateContext'); - late final _SSLCreateContext = _SSLCreateContextPtr.asFunction< - SSLContextRef Function(CFAllocatorRef, int, int)>(); + @ffi.Uint64() + external int ri_child_elapsed_abstime; - int SSLNewContext( - int isServer, - ffi.Pointer contextPtr, - ) { - return _SSLNewContext( - isServer, - contextPtr, - ); - } + @ffi.Uint64() + external int ri_diskio_bytesread; - late final _SSLNewContextPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - Boolean, ffi.Pointer)>>('SSLNewContext'); - late final _SSLNewContext = _SSLNewContextPtr.asFunction< - int Function(int, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_diskio_byteswritten; - int SSLDisposeContext( - SSLContextRef context, - ) { - return _SSLDisposeContext( - context, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_default; - late final _SSLDisposeContextPtr = - _lookup>( - 'SSLDisposeContext'); - late final _SSLDisposeContext = - _SSLDisposeContextPtr.asFunction(); + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; - int SSLGetSessionState( - SSLContextRef context, - ffi.Pointer state, - ) { - return _SSLGetSessionState( - context, - state, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_background; - late final _SSLGetSessionStatePtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLGetSessionState'); - late final _SSLGetSessionState = _SSLGetSessionStatePtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_cpu_time_qos_utility; - int SSLSetSessionOption( - SSLContextRef context, - int option, - int value, - ) { - return _SSLSetSessionOption( - context, - option, - value, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; - late final _SSLSetSessionOptionPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Int32, Boolean)>>('SSLSetSessionOption'); - late final _SSLSetSessionOption = _SSLSetSessionOptionPtr.asFunction< - int Function(SSLContextRef, int, int)>(); + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; - int SSLGetSessionOption( - SSLContextRef context, - int option, - ffi.Pointer value, - ) { - return _SSLGetSessionOption( - context, - option, - value, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; - late final _SSLGetSessionOptionPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Int32, - ffi.Pointer)>>('SSLGetSessionOption'); - late final _SSLGetSessionOption = _SSLGetSessionOptionPtr.asFunction< - int Function(SSLContextRef, int, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_billed_system_time; - int SSLSetIOFuncs( - SSLContextRef context, - SSLReadFunc readFunc, - SSLWriteFunc writeFunc, - ) { - return _SSLSetIOFuncs( - context, - readFunc, - writeFunc, - ); - } + @ffi.Uint64() + external int ri_serviced_system_time; - late final _SSLSetIOFuncsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, SSLReadFunc, SSLWriteFunc)>>('SSLSetIOFuncs'); - late final _SSLSetIOFuncs = _SSLSetIOFuncsPtr.asFunction< - int Function(SSLContextRef, SSLReadFunc, SSLWriteFunc)>(); + @ffi.Uint64() + external int ri_logical_writes; - int SSLSetSessionConfig( - SSLContextRef context, - CFStringRef config, - ) { - return _SSLSetSessionConfig( - context, - config, - ); - } + @ffi.Uint64() + external int ri_lifetime_max_phys_footprint; - late final _SSLSetSessionConfigPtr = _lookup< - ffi.NativeFunction>( - 'SSLSetSessionConfig'); - late final _SSLSetSessionConfig = _SSLSetSessionConfigPtr.asFunction< - int Function(SSLContextRef, CFStringRef)>(); + @ffi.Uint64() + external int ri_instructions; - int SSLSetProtocolVersionMin( - SSLContextRef context, - int minVersion, - ) { - return _SSLSetProtocolVersionMin( - context, - minVersion, - ); - } + @ffi.Uint64() + external int ri_cycles; - late final _SSLSetProtocolVersionMinPtr = - _lookup>( - 'SSLSetProtocolVersionMin'); - late final _SSLSetProtocolVersionMin = _SSLSetProtocolVersionMinPtr - .asFunction(); + @ffi.Uint64() + external int ri_billed_energy; - int SSLGetProtocolVersionMin( - SSLContextRef context, - ffi.Pointer minVersion, - ) { - return _SSLGetProtocolVersionMin( - context, - minVersion, - ); - } + @ffi.Uint64() + external int ri_serviced_energy; - late final _SSLGetProtocolVersionMinPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetProtocolVersionMin'); - late final _SSLGetProtocolVersionMin = _SSLGetProtocolVersionMinPtr - .asFunction)>(); + @ffi.Uint64() + external int ri_interval_max_phys_footprint; - int SSLSetProtocolVersionMax( - SSLContextRef context, - int maxVersion, - ) { - return _SSLSetProtocolVersionMax( - context, - maxVersion, - ); - } + @ffi.Uint64() + external int ri_runnable_time; - late final _SSLSetProtocolVersionMaxPtr = - _lookup>( - 'SSLSetProtocolVersionMax'); - late final _SSLSetProtocolVersionMax = _SSLSetProtocolVersionMaxPtr - .asFunction(); + @ffi.Uint64() + external int ri_flags; +} - int SSLGetProtocolVersionMax( - SSLContextRef context, - ffi.Pointer maxVersion, - ) { - return _SSLGetProtocolVersionMax( - context, - maxVersion, - ); - } +final class rusage_info_v6 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; - late final _SSLGetProtocolVersionMaxPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetProtocolVersionMax'); - late final _SSLGetProtocolVersionMax = _SSLGetProtocolVersionMaxPtr - .asFunction)>(); + @ffi.Uint64() + external int ri_user_time; - int SSLSetProtocolVersionEnabled( - SSLContextRef context, - int protocol, - int enable, - ) { - return _SSLSetProtocolVersionEnabled( - context, - protocol, - enable, - ); - } + @ffi.Uint64() + external int ri_system_time; - late final _SSLSetProtocolVersionEnabledPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Int32, - Boolean)>>('SSLSetProtocolVersionEnabled'); - late final _SSLSetProtocolVersionEnabled = _SSLSetProtocolVersionEnabledPtr - .asFunction(); + @ffi.Uint64() + external int ri_pkg_idle_wkups; - int SSLGetProtocolVersionEnabled( - SSLContextRef context, - int protocol, - ffi.Pointer enable, - ) { - return _SSLGetProtocolVersionEnabled( - context, - protocol, - enable, - ); - } + @ffi.Uint64() + external int ri_interrupt_wkups; - late final _SSLGetProtocolVersionEnabledPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Int32, - ffi.Pointer)>>('SSLGetProtocolVersionEnabled'); - late final _SSLGetProtocolVersionEnabled = _SSLGetProtocolVersionEnabledPtr - .asFunction)>(); + @ffi.Uint64() + external int ri_pageins; - int SSLSetProtocolVersion( - SSLContextRef context, - int version, - ) { - return _SSLSetProtocolVersion( - context, - version, - ); - } + @ffi.Uint64() + external int ri_wired_size; - late final _SSLSetProtocolVersionPtr = - _lookup>( - 'SSLSetProtocolVersion'); - late final _SSLSetProtocolVersion = - _SSLSetProtocolVersionPtr.asFunction(); + @ffi.Uint64() + external int ri_resident_size; - int SSLGetProtocolVersion( - SSLContextRef context, - ffi.Pointer protocol, - ) { - return _SSLGetProtocolVersion( - context, - protocol, - ); - } + @ffi.Uint64() + external int ri_phys_footprint; - late final _SSLGetProtocolVersionPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLGetProtocolVersion'); - late final _SSLGetProtocolVersion = _SSLGetProtocolVersionPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_proc_start_abstime; - int SSLSetCertificate( - SSLContextRef context, - CFArrayRef certRefs, - ) { - return _SSLSetCertificate( - context, - certRefs, - ); - } + @ffi.Uint64() + external int ri_proc_exit_abstime; - late final _SSLSetCertificatePtr = - _lookup>( - 'SSLSetCertificate'); - late final _SSLSetCertificate = _SSLSetCertificatePtr.asFunction< - int Function(SSLContextRef, CFArrayRef)>(); + @ffi.Uint64() + external int ri_child_user_time; - int SSLSetConnection( - SSLContextRef context, - SSLConnectionRef connection, - ) { - return _SSLSetConnection( - context, - connection, - ); - } + @ffi.Uint64() + external int ri_child_system_time; - late final _SSLSetConnectionPtr = _lookup< - ffi - .NativeFunction>( - 'SSLSetConnection'); - late final _SSLSetConnection = _SSLSetConnectionPtr.asFunction< - int Function(SSLContextRef, SSLConnectionRef)>(); + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; - int SSLGetConnection( - SSLContextRef context, - ffi.Pointer connection, - ) { - return _SSLGetConnection( - context, - connection, - ); - } + @ffi.Uint64() + external int ri_child_interrupt_wkups; - late final _SSLGetConnectionPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetConnection'); - late final _SSLGetConnection = _SSLGetConnectionPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_child_pageins; - int SSLSetPeerDomainName( - SSLContextRef context, - ffi.Pointer peerName, - int peerNameLen, - ) { - return _SSLSetPeerDomainName( - context, - peerName, - peerNameLen, - ); - } + @ffi.Uint64() + external int ri_child_elapsed_abstime; - late final _SSLSetPeerDomainNamePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Size)>>('SSLSetPeerDomainName'); - late final _SSLSetPeerDomainName = _SSLSetPeerDomainNamePtr.asFunction< - int Function(SSLContextRef, ffi.Pointer, int)>(); + @ffi.Uint64() + external int ri_diskio_bytesread; - int SSLGetPeerDomainNameLength( - SSLContextRef context, - ffi.Pointer peerNameLen, - ) { - return _SSLGetPeerDomainNameLength( - context, - peerNameLen, - ); - } + @ffi.Uint64() + external int ri_diskio_byteswritten; - late final _SSLGetPeerDomainNameLengthPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetPeerDomainNameLength'); - late final _SSLGetPeerDomainNameLength = _SSLGetPeerDomainNameLengthPtr - .asFunction)>(); + @ffi.Uint64() + external int ri_cpu_time_qos_default; - int SSLGetPeerDomainName( - SSLContextRef context, - ffi.Pointer peerName, - ffi.Pointer peerNameLen, - ) { - return _SSLGetPeerDomainName( - context, - peerName, - peerNameLen, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; - late final _SSLGetPeerDomainNamePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Pointer)>>('SSLGetPeerDomainName'); - late final _SSLGetPeerDomainName = _SSLGetPeerDomainNamePtr.asFunction< - int Function( - SSLContextRef, ffi.Pointer, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_cpu_time_qos_background; - int SSLCopyRequestedPeerNameLength( - SSLContextRef ctx, - ffi.Pointer peerNameLen, - ) { - return _SSLCopyRequestedPeerNameLength( - ctx, - peerNameLen, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_utility; - late final _SSLCopyRequestedPeerNameLengthPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLCopyRequestedPeerNameLength'); - late final _SSLCopyRequestedPeerNameLength = - _SSLCopyRequestedPeerNameLengthPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; - int SSLCopyRequestedPeerName( - SSLContextRef context, - ffi.Pointer peerName, - ffi.Pointer peerNameLen, - ) { - return _SSLCopyRequestedPeerName( - context, - peerName, - peerNameLen, - ); - } + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; - late final _SSLCopyRequestedPeerNamePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Pointer)>>('SSLCopyRequestedPeerName'); - late final _SSLCopyRequestedPeerName = - _SSLCopyRequestedPeerNamePtr.asFunction< - int Function( - SSLContextRef, ffi.Pointer, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; - int SSLSetDatagramHelloCookie( - SSLContextRef dtlsContext, - ffi.Pointer cookie, - int cookieLen, - ) { - return _SSLSetDatagramHelloCookie( - dtlsContext, - cookie, - cookieLen, - ); - } + @ffi.Uint64() + external int ri_billed_system_time; - late final _SSLSetDatagramHelloCookiePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Size)>>('SSLSetDatagramHelloCookie'); - late final _SSLSetDatagramHelloCookie = _SSLSetDatagramHelloCookiePtr - .asFunction, int)>(); + @ffi.Uint64() + external int ri_serviced_system_time; - int SSLSetMaxDatagramRecordSize( - SSLContextRef dtlsContext, - int maxSize, - ) { - return _SSLSetMaxDatagramRecordSize( - dtlsContext, - maxSize, - ); - } + @ffi.Uint64() + external int ri_logical_writes; - late final _SSLSetMaxDatagramRecordSizePtr = - _lookup>( - 'SSLSetMaxDatagramRecordSize'); - late final _SSLSetMaxDatagramRecordSize = _SSLSetMaxDatagramRecordSizePtr - .asFunction(); + @ffi.Uint64() + external int ri_lifetime_max_phys_footprint; - int SSLGetMaxDatagramRecordSize( - SSLContextRef dtlsContext, - ffi.Pointer maxSize, - ) { - return _SSLGetMaxDatagramRecordSize( - dtlsContext, - maxSize, - ); - } + @ffi.Uint64() + external int ri_instructions; - late final _SSLGetMaxDatagramRecordSizePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetMaxDatagramRecordSize'); - late final _SSLGetMaxDatagramRecordSize = _SSLGetMaxDatagramRecordSizePtr - .asFunction)>(); + @ffi.Uint64() + external int ri_cycles; - int SSLGetNegotiatedProtocolVersion( - SSLContextRef context, - ffi.Pointer protocol, - ) { - return _SSLGetNegotiatedProtocolVersion( - context, - protocol, - ); - } + @ffi.Uint64() + external int ri_billed_energy; - late final _SSLGetNegotiatedProtocolVersionPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetNegotiatedProtocolVersion'); - late final _SSLGetNegotiatedProtocolVersion = - _SSLGetNegotiatedProtocolVersionPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_serviced_energy; - int SSLGetNumberSupportedCiphers( - SSLContextRef context, - ffi.Pointer numCiphers, - ) { - return _SSLGetNumberSupportedCiphers( - context, - numCiphers, - ); - } + @ffi.Uint64() + external int ri_interval_max_phys_footprint; - late final _SSLGetNumberSupportedCiphersPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetNumberSupportedCiphers'); - late final _SSLGetNumberSupportedCiphers = _SSLGetNumberSupportedCiphersPtr - .asFunction)>(); + @ffi.Uint64() + external int ri_runnable_time; - int SSLGetSupportedCiphers( - SSLContextRef context, - ffi.Pointer ciphers, - ffi.Pointer numCiphers, - ) { - return _SSLGetSupportedCiphers( - context, - ciphers, - numCiphers, - ); - } + @ffi.Uint64() + external int ri_flags; - late final _SSLGetSupportedCiphersPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Pointer)>>('SSLGetSupportedCiphers'); - late final _SSLGetSupportedCiphers = _SSLGetSupportedCiphersPtr.asFunction< - int Function( - SSLContextRef, ffi.Pointer, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_user_ptime; - int SSLGetNumberEnabledCiphers( - SSLContextRef context, - ffi.Pointer numCiphers, - ) { - return _SSLGetNumberEnabledCiphers( - context, - numCiphers, - ); - } + @ffi.Uint64() + external int ri_system_ptime; - late final _SSLGetNumberEnabledCiphersPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetNumberEnabledCiphers'); - late final _SSLGetNumberEnabledCiphers = _SSLGetNumberEnabledCiphersPtr - .asFunction)>(); + @ffi.Uint64() + external int ri_pinstructions; - int SSLSetEnabledCiphers( - SSLContextRef context, - ffi.Pointer ciphers, - int numCiphers, - ) { - return _SSLSetEnabledCiphers( - context, - ciphers, - numCiphers, - ); - } + @ffi.Uint64() + external int ri_pcycles; - late final _SSLSetEnabledCiphersPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Size)>>('SSLSetEnabledCiphers'); - late final _SSLSetEnabledCiphers = _SSLSetEnabledCiphersPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer, int)>(); + @ffi.Uint64() + external int ri_energy_nj; - int SSLGetEnabledCiphers( - SSLContextRef context, - ffi.Pointer ciphers, - ffi.Pointer numCiphers, - ) { - return _SSLGetEnabledCiphers( - context, - ciphers, - numCiphers, - ); - } + @ffi.Uint64() + external int ri_penergy_nj; - late final _SSLGetEnabledCiphersPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Pointer)>>('SSLGetEnabledCiphers'); - late final _SSLGetEnabledCiphers = _SSLGetEnabledCiphersPtr.asFunction< - int Function( - SSLContextRef, ffi.Pointer, ffi.Pointer)>(); + @ffi.Uint64() + external int ri_secure_time_in_system; - int SSLSetSessionTicketsEnabled( - SSLContextRef context, - int enabled, - ) { - return _SSLSetSessionTicketsEnabled( - context, - enabled, - ); - } + @ffi.Uint64() + external int ri_secure_ptime_in_system; - late final _SSLSetSessionTicketsEnabledPtr = - _lookup>( - 'SSLSetSessionTicketsEnabled'); - late final _SSLSetSessionTicketsEnabled = _SSLSetSessionTicketsEnabledPtr - .asFunction(); + @ffi.Array.multi([12]) + external ffi.Array ri_reserved; +} - int SSLSetEnableCertVerify( - SSLContextRef context, - int enableVerify, - ) { - return _SSLSetEnableCertVerify( - context, - enableVerify, - ); - } +final class rlimit extends ffi.Struct { + @rlim_t() + external int rlim_cur; - late final _SSLSetEnableCertVerifyPtr = - _lookup>( - 'SSLSetEnableCertVerify'); - late final _SSLSetEnableCertVerify = - _SSLSetEnableCertVerifyPtr.asFunction(); + @rlim_t() + external int rlim_max; +} - int SSLGetEnableCertVerify( - SSLContextRef context, - ffi.Pointer enableVerify, - ) { - return _SSLGetEnableCertVerify( - context, - enableVerify, - ); - } +typedef rlim_t = __uint64_t; - late final _SSLGetEnableCertVerifyPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLGetEnableCertVerify'); - late final _SSLGetEnableCertVerify = _SSLGetEnableCertVerifyPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); +final class proc_rlimit_control_wakeupmon extends ffi.Struct { + @ffi.Uint32() + external int wm_flags; - int SSLSetAllowsExpiredCerts( - SSLContextRef context, - int allowsExpired, - ) { - return _SSLSetAllowsExpiredCerts( - context, - allowsExpired, - ); - } + @ffi.Int32() + external int wm_rate; +} - late final _SSLSetAllowsExpiredCertsPtr = - _lookup>( - 'SSLSetAllowsExpiredCerts'); - late final _SSLSetAllowsExpiredCerts = _SSLSetAllowsExpiredCertsPtr - .asFunction(); +typedef id_t = __darwin_id_t; +typedef __darwin_id_t = __uint32_t; - int SSLGetAllowsExpiredCerts( - SSLContextRef context, - ffi.Pointer allowsExpired, - ) { - return _SSLGetAllowsExpiredCerts( - context, - allowsExpired, - ); - } +@ffi.Packed(1) +final class _OSUnalignedU16 extends ffi.Struct { + @ffi.Uint16() + external int __val; +} - late final _SSLGetAllowsExpiredCertsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetAllowsExpiredCerts'); - late final _SSLGetAllowsExpiredCerts = _SSLGetAllowsExpiredCertsPtr - .asFunction)>(); +@ffi.Packed(1) +final class _OSUnalignedU32 extends ffi.Struct { + @ffi.Uint32() + external int __val; +} - int SSLSetAllowsExpiredRoots( - SSLContextRef context, - int allowsExpired, - ) { - return _SSLSetAllowsExpiredRoots( - context, - allowsExpired, - ); - } +@ffi.Packed(1) +final class _OSUnalignedU64 extends ffi.Struct { + @ffi.Uint64() + external int __val; +} - late final _SSLSetAllowsExpiredRootsPtr = - _lookup>( - 'SSLSetAllowsExpiredRoots'); - late final _SSLSetAllowsExpiredRoots = _SSLSetAllowsExpiredRootsPtr - .asFunction(); +final class wait extends ffi.Opaque {} - int SSLGetAllowsExpiredRoots( - SSLContextRef context, - ffi.Pointer allowsExpired, - ) { - return _SSLGetAllowsExpiredRoots( - context, - allowsExpired, - ); - } +enum idtype_t { + P_ALL(0), + P_PID(1), + P_PGID(2); - late final _SSLGetAllowsExpiredRootsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetAllowsExpiredRoots'); - late final _SSLGetAllowsExpiredRoots = _SSLGetAllowsExpiredRootsPtr - .asFunction)>(); + final int value; + const idtype_t(this.value); - int SSLSetAllowsAnyRoot( - SSLContextRef context, - int anyRoot, - ) { - return _SSLSetAllowsAnyRoot( - context, - anyRoot, - ); - } + static idtype_t fromValue(int value) => switch (value) { + 0 => P_ALL, + 1 => P_PID, + 2 => P_PGID, + _ => throw ArgumentError("Unknown value for idtype_t: $value"), + }; +} - late final _SSLSetAllowsAnyRootPtr = - _lookup>( - 'SSLSetAllowsAnyRoot'); - late final _SSLSetAllowsAnyRoot = - _SSLSetAllowsAnyRootPtr.asFunction(); +final class div_t extends ffi.Struct { + @ffi.Int() + external int quot; - int SSLGetAllowsAnyRoot( - SSLContextRef context, - ffi.Pointer anyRoot, - ) { - return _SSLGetAllowsAnyRoot( - context, - anyRoot, - ); - } + @ffi.Int() + external int rem; +} - late final _SSLGetAllowsAnyRootPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLGetAllowsAnyRoot'); - late final _SSLGetAllowsAnyRoot = _SSLGetAllowsAnyRootPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); +final class ldiv_t extends ffi.Struct { + @ffi.Long() + external int quot; - int SSLSetTrustedRoots( - SSLContextRef context, - CFArrayRef trustedRoots, - int replaceExisting, - ) { - return _SSLSetTrustedRoots( - context, - trustedRoots, - replaceExisting, - ); - } + @ffi.Long() + external int rem; +} - late final _SSLSetTrustedRootsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, CFArrayRef, Boolean)>>('SSLSetTrustedRoots'); - late final _SSLSetTrustedRoots = _SSLSetTrustedRootsPtr.asFunction< - int Function(SSLContextRef, CFArrayRef, int)>(); +final class lldiv_t extends ffi.Struct { + @ffi.LongLong() + external int quot; - int SSLCopyTrustedRoots( - SSLContextRef context, - ffi.Pointer trustedRoots, - ) { - return _SSLCopyTrustedRoots( - context, - trustedRoots, - ); - } + @ffi.LongLong() + external int rem; +} - late final _SSLCopyTrustedRootsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLCopyTrustedRoots'); - late final _SSLCopyTrustedRoots = _SSLCopyTrustedRootsPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); +typedef malloc_type_id_t = ffi.UnsignedLongLong; +typedef Dartmalloc_type_id_t = int; - int SSLCopyPeerCertificates( - SSLContextRef context, - ffi.Pointer certs, - ) { - return _SSLCopyPeerCertificates( - context, - certs, - ); - } +final class _malloc_zone_t extends ffi.Opaque {} - late final _SSLCopyPeerCertificatesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLCopyPeerCertificates'); - late final _SSLCopyPeerCertificates = _SSLCopyPeerCertificatesPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); +typedef malloc_zone_t = _malloc_zone_t; +void _ObjCBlock_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, +) => + block.ref.target + .cast>() + .asFunction()(); +ffi.Pointer _ObjCBlock_ffiVoid_fnPtrCallable = ffi.Pointer + .fromFunction)>( + _ObjCBlock_ffiVoid_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_closureTrampoline( + ffi.Pointer block, +) => + (objc.getBlockClosure(block) as void Function())(); +ffi.Pointer _ObjCBlock_ffiVoid_closureCallable = ffi.Pointer + .fromFunction)>( + _ObjCBlock_ffiVoid_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_listenerTrampoline( + ffi.Pointer block, +) { + (objc.getBlockClosure(block) as void Function())(); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable)> + _ObjCBlock_ffiVoid_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - int SSLCopyPeerTrust( - SSLContextRef context, - ffi.Pointer trust, - ) { - return _SSLCopyPeerTrust( - context, - trust, - ); - } + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - late final _SSLCopyPeerTrustPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLCopyPeerTrust'); - late final _SSLCopyPeerTrust = _SSLCopyPeerTrustPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); + /// 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. + static objc.ObjCBlock fromFunction(void Function() fn) => + objc.ObjCBlock( + objc.newClosureBlock(_ObjCBlock_ffiVoid_closureCallable, () => fn()), + retain: false, + release: true); - int SSLSetPeerID( - SSLContextRef context, - ffi.Pointer peerID, - int peerIDLen, - ) { - return _SSLSetPeerID( - context, - peerID, - peerIDLen, - ); + /// 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. + static objc.ObjCBlock listener(void Function() fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_listenerCallable.nativeFunction.cast(), () => fn()); + final wrapper = _wrapListenerBlock_ksby9f(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - late final _SSLSetPeerIDPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer, ffi.Size)>>('SSLSetPeerID'); - late final _SSLSetPeerID = _SSLSetPeerIDPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer, int)>(); - - int SSLGetPeerID( - SSLContextRef context, - ffi.Pointer> peerID, - ffi.Pointer peerIDLen, - ) { - return _SSLGetPeerID( - context, - peerID, - peerIDLen, - ); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_CallExtension + on objc.ObjCBlock { + void call() => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block)>>() + .asFunction)>()( + ref.pointer, + ); +} - late final _SSLGetPeerIDPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer>, - ffi.Pointer)>>('SSLGetPeerID'); - late final _SSLGetPeerID = _SSLGetPeerIDPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer>, - ffi.Pointer)>(); - - int SSLGetNegotiatedCipher( - SSLContextRef context, - ffi.Pointer cipherSuite, - ) { - return _SSLGetNegotiatedCipher( - context, - cipherSuite, - ); - } - - late final _SSLGetNegotiatedCipherPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetNegotiatedCipher'); - late final _SSLGetNegotiatedCipher = _SSLGetNegotiatedCipherPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); - - int SSLSetALPNProtocols( - SSLContextRef context, - CFArrayRef protocols, - ) { - return _SSLSetALPNProtocols( - context, - protocols, - ); - } - - late final _SSLSetALPNProtocolsPtr = - _lookup>( - 'SSLSetALPNProtocols'); - late final _SSLSetALPNProtocols = _SSLSetALPNProtocolsPtr.asFunction< - int Function(SSLContextRef, CFArrayRef)>(); - - int SSLCopyALPNProtocols( - SSLContextRef context, - ffi.Pointer protocols, - ) { - return _SSLCopyALPNProtocols( - context, - protocols, - ); - } - - late final _SSLCopyALPNProtocolsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLCopyALPNProtocols'); - late final _SSLCopyALPNProtocols = _SSLCopyALPNProtocolsPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); - - int SSLSetOCSPResponse( - SSLContextRef context, - CFDataRef response, - ) { - return _SSLSetOCSPResponse( - context, - response, - ); - } - - late final _SSLSetOCSPResponsePtr = - _lookup>( - 'SSLSetOCSPResponse'); - late final _SSLSetOCSPResponse = _SSLSetOCSPResponsePtr.asFunction< - int Function(SSLContextRef, CFDataRef)>(); - - int SSLSetEncryptionCertificate( - SSLContextRef context, - CFArrayRef certRefs, - ) { - return _SSLSetEncryptionCertificate( - context, - certRefs, - ); - } - - late final _SSLSetEncryptionCertificatePtr = - _lookup>( - 'SSLSetEncryptionCertificate'); - late final _SSLSetEncryptionCertificate = _SSLSetEncryptionCertificatePtr - .asFunction(); - - int SSLSetClientSideAuthenticate( - SSLContextRef context, - int auth, - ) { - return _SSLSetClientSideAuthenticate( - context, - auth, - ); - } - - late final _SSLSetClientSideAuthenticatePtr = - _lookup>( - 'SSLSetClientSideAuthenticate'); - late final _SSLSetClientSideAuthenticate = _SSLSetClientSideAuthenticatePtr - .asFunction(); - - int SSLAddDistinguishedName( - SSLContextRef context, - ffi.Pointer derDN, - int derDNLen, - ) { - return _SSLAddDistinguishedName( - context, - derDN, - derDNLen, - ); - } - - late final _SSLAddDistinguishedNamePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Size)>>('SSLAddDistinguishedName'); - late final _SSLAddDistinguishedName = _SSLAddDistinguishedNamePtr.asFunction< - int Function(SSLContextRef, ffi.Pointer, int)>(); - - int SSLSetCertificateAuthorities( - SSLContextRef context, - CFTypeRef certificateOrArray, - int replaceExisting, - ) { - return _SSLSetCertificateAuthorities( - context, - certificateOrArray, - replaceExisting, - ); - } - - late final _SSLSetCertificateAuthoritiesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, CFTypeRef, - Boolean)>>('SSLSetCertificateAuthorities'); - late final _SSLSetCertificateAuthorities = _SSLSetCertificateAuthoritiesPtr - .asFunction(); - - int SSLCopyCertificateAuthorities( - SSLContextRef context, - ffi.Pointer certificates, - ) { - return _SSLCopyCertificateAuthorities( - context, - certificates, - ); - } - - late final _SSLCopyCertificateAuthoritiesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLCopyCertificateAuthorities'); - late final _SSLCopyCertificateAuthorities = _SSLCopyCertificateAuthoritiesPtr - .asFunction)>(); - - int SSLCopyDistinguishedNames( - SSLContextRef context, - ffi.Pointer names, - ) { - return _SSLCopyDistinguishedNames( - context, - names, - ); - } - - late final _SSLCopyDistinguishedNamesPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLCopyDistinguishedNames'); - late final _SSLCopyDistinguishedNames = _SSLCopyDistinguishedNamesPtr - .asFunction)>(); - - int SSLGetClientCertificateState( - SSLContextRef context, - ffi.Pointer clientState, - ) { - return _SSLGetClientCertificateState( - context, - clientState, - ); - } - - late final _SSLGetClientCertificateStatePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetClientCertificateState'); - late final _SSLGetClientCertificateState = _SSLGetClientCertificateStatePtr - .asFunction)>(); - - int SSLSetDiffieHellmanParams( - SSLContextRef context, - ffi.Pointer dhParams, - int dhParamsLen, - ) { - return _SSLSetDiffieHellmanParams( - context, - dhParams, - dhParamsLen, - ); - } - - late final _SSLSetDiffieHellmanParamsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, - ffi.Size)>>('SSLSetDiffieHellmanParams'); - late final _SSLSetDiffieHellmanParams = _SSLSetDiffieHellmanParamsPtr - .asFunction, int)>(); - - int SSLGetDiffieHellmanParams( - SSLContextRef context, - ffi.Pointer> dhParams, - ffi.Pointer dhParamsLen, - ) { - return _SSLGetDiffieHellmanParams( - context, - dhParams, - dhParamsLen, - ); - } - - late final _SSLGetDiffieHellmanParamsPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer>, - ffi.Pointer)>>('SSLGetDiffieHellmanParams'); - late final _SSLGetDiffieHellmanParams = - _SSLGetDiffieHellmanParamsPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer>, - ffi.Pointer)>(); - - int SSLSetRsaBlinding( - SSLContextRef context, - int blinding, - ) { - return _SSLSetRsaBlinding( - context, - blinding, - ); - } - - late final _SSLSetRsaBlindingPtr = - _lookup>( - 'SSLSetRsaBlinding'); - late final _SSLSetRsaBlinding = - _SSLSetRsaBlindingPtr.asFunction(); - - int SSLGetRsaBlinding( - SSLContextRef context, - ffi.Pointer blinding, - ) { - return _SSLGetRsaBlinding( - context, - blinding, - ); - } - - late final _SSLGetRsaBlindingPtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLGetRsaBlinding'); - late final _SSLGetRsaBlinding = _SSLGetRsaBlindingPtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); - - int SSLHandshake( - SSLContextRef context, - ) { - return _SSLHandshake( - context, - ); - } - - late final _SSLHandshakePtr = - _lookup>( - 'SSLHandshake'); - late final _SSLHandshake = - _SSLHandshakePtr.asFunction(); - - int SSLReHandshake( - SSLContextRef context, - ) { - return _SSLReHandshake( - context, - ); - } - - late final _SSLReHandshakePtr = - _lookup>( - 'SSLReHandshake'); - late final _SSLReHandshake = - _SSLReHandshakePtr.asFunction(); - - int SSLWrite( - SSLContextRef context, - ffi.Pointer data, - int dataLength, - ffi.Pointer processed, - ) { - return _SSLWrite( - context, - data, - dataLength, - processed, - ); - } - - late final _SSLWritePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, ffi.Size, - ffi.Pointer)>>('SSLWrite'); - late final _SSLWrite = _SSLWritePtr.asFunction< - int Function( - SSLContextRef, ffi.Pointer, int, ffi.Pointer)>(); - - int SSLRead( - SSLContextRef context, - ffi.Pointer data, - int dataLength, - ffi.Pointer processed, - ) { - return _SSLRead( - context, - data, - dataLength, - processed, - ); - } - - late final _SSLReadPtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, ffi.Pointer, ffi.Size, - ffi.Pointer)>>('SSLRead'); - late final _SSLRead = _SSLReadPtr.asFunction< - int Function( - SSLContextRef, ffi.Pointer, int, ffi.Pointer)>(); - - int SSLGetBufferedReadSize( - SSLContextRef context, - ffi.Pointer bufferSize, - ) { - return _SSLGetBufferedReadSize( - context, - bufferSize, - ); - } - - late final _SSLGetBufferedReadSizePtr = _lookup< - ffi.NativeFunction< - OSStatus Function( - SSLContextRef, ffi.Pointer)>>('SSLGetBufferedReadSize'); - late final _SSLGetBufferedReadSize = _SSLGetBufferedReadSizePtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); - - int SSLGetDatagramWriteSize( - SSLContextRef dtlsContext, - ffi.Pointer bufSize, - ) { - return _SSLGetDatagramWriteSize( - dtlsContext, - bufSize, - ); - } - - late final _SSLGetDatagramWriteSizePtr = _lookup< - ffi.NativeFunction< - OSStatus Function(SSLContextRef, - ffi.Pointer)>>('SSLGetDatagramWriteSize'); - late final _SSLGetDatagramWriteSize = _SSLGetDatagramWriteSizePtr.asFunction< - int Function(SSLContextRef, ffi.Pointer)>(); - - int SSLClose( - SSLContextRef context, - ) { - return _SSLClose( - context, - ); - } - - late final _SSLClosePtr = - _lookup>('SSLClose'); - late final _SSLClose = _SSLClosePtr.asFunction(); - - int SSLSetError( - SSLContextRef context, - int status, - ) { - return _SSLSetError( - context, - status, - ); - } - - late final _SSLSetErrorPtr = - _lookup>( - 'SSLSetError'); - late final _SSLSetError = - _SSLSetErrorPtr.asFunction(); - - /// -1LL - late final ffi.Pointer _NSURLSessionTransferSizeUnknown = - _lookup('NSURLSessionTransferSizeUnknown'); - - int get NSURLSessionTransferSizeUnknown => - _NSURLSessionTransferSizeUnknown.value; - - late final _class_NSURLSession1 = _getClass1("NSURLSession"); - late final _sel_sharedSession1 = _registerName1("sharedSession"); - ffi.Pointer _objc_msgSend_438( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_438( - obj, - sel, - ); - } - - late final __objc_msgSend_438Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_438 = __objc_msgSend_438Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionConfiguration1 = - _getClass1("NSURLSessionConfiguration"); - late final _sel_defaultSessionConfiguration1 = - _registerName1("defaultSessionConfiguration"); - ffi.Pointer _objc_msgSend_439( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_439( - obj, - sel, - ); - } - - late final __objc_msgSend_439Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_439 = __objc_msgSend_439Ptr.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_440( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer identifier, - ) { - return __objc_msgSend_440( - obj, - sel, - identifier, - ); - } - - late final __objc_msgSend_440Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_440 = __objc_msgSend_440Ptr.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_441( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_441( - obj, - sel, - ); - } - - late final __objc_msgSend_441Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_441 = __objc_msgSend_441Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setTLSMinimumSupportedProtocol_1 = - _registerName1("setTLSMinimumSupportedProtocol:"); - void _objc_msgSend_442( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_442( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_442Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_442 = __objc_msgSend_442Ptr.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_443( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_443( - obj, - sel, - ); - } - - late final __objc_msgSend_443Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_443 = __objc_msgSend_443Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setTLSMinimumSupportedProtocolVersion_1 = - _registerName1("setTLSMinimumSupportedProtocolVersion:"); - void _objc_msgSend_444( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_444( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_444Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_444 = __objc_msgSend_444Ptr.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"); - ffi.Pointer _objc_msgSend_445( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_445( - obj, - sel, - ); - } - - late final __objc_msgSend_445Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_445 = __objc_msgSend_445Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setHTTPCookieStorage_1 = - _registerName1("setHTTPCookieStorage:"); - void _objc_msgSend_446( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_446( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_446Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_446 = __objc_msgSend_446Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _class_NSURLCredentialStorage1 = - _getClass1("NSURLCredentialStorage"); - late final _sel_URLCredentialStorage1 = - _registerName1("URLCredentialStorage"); - ffi.Pointer _objc_msgSend_447( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_447( - obj, - sel, - ); - } - - late final __objc_msgSend_447Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_447 = __objc_msgSend_447Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setURLCredentialStorage_1 = - _registerName1("setURLCredentialStorage:"); - 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_URLCache1 = _registerName1("URLCache"); - ffi.Pointer _objc_msgSend_449( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_449( - obj, - sel, - ); - } - - late final __objc_msgSend_449Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_449 = __objc_msgSend_449Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setURLCache_1 = _registerName1("setURLCache:"); - void _objc_msgSend_450( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_450( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_450Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_450 = __objc_msgSend_450Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - 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:"); - void _objc_msgSend_451( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer value, - ) { - return __objc_msgSend_451( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_451Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_451 = __objc_msgSend_451Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_multipathServiceType1 = - _registerName1("multipathServiceType"); - int _objc_msgSend_452( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_452( - obj, - sel, - ); - } - - late final __objc_msgSend_452Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_452 = __objc_msgSend_452Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setMultipathServiceType_1 = - _registerName1("setMultipathServiceType:"); - void _objc_msgSend_453( - ffi.Pointer obj, - ffi.Pointer sel, - int value, - ) { - return __objc_msgSend_453( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_453Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_453 = __objc_msgSend_453Ptr.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_454( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer configuration, - ) { - return __objc_msgSend_454( - obj, - sel, - configuration, - ); - } - - late final __objc_msgSend_454Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_454 = __objc_msgSend_454Ptr.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_455( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer configuration, - ffi.Pointer delegate, - ffi.Pointer queue, - ) { - return __objc_msgSend_455( - obj, - sel, - configuration, - delegate, - queue, - ); - } - - late final __objc_msgSend_455Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_455 = __objc_msgSend_455Ptr.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_456( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_456( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_456Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_456 = __objc_msgSend_456Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_getAllTasksWithCompletionHandler_1 = - _registerName1("getAllTasksWithCompletionHandler:"); - void _objc_msgSend_457( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_457( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_457Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_457 = __objc_msgSend_457Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_dataTaskWithRequest_1 = - _registerName1("dataTaskWithRequest:"); - ffi.Pointer _objc_msgSend_458( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_458( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_458Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_458 = __objc_msgSend_458Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dataTaskWithURL_1 = _registerName1("dataTaskWithURL:"); - ffi.Pointer _objc_msgSend_459( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_459( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_459Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_459 = __objc_msgSend_459Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionUploadTask1 = - _getClass1("NSURLSessionUploadTask"); - late final _sel_cancelByProducingResumeData_1 = - _registerName1("cancelByProducingResumeData:"); - void _objc_msgSend_460( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_460( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_460Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_460 = __objc_msgSend_460Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_uploadTaskWithRequest_fromFile_1 = - _registerName1("uploadTaskWithRequest:fromFile:"); - ffi.Pointer _objc_msgSend_461( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer fileURL, - ) { - return __objc_msgSend_461( - obj, - sel, - request, - fileURL, - ); - } - - late final __objc_msgSend_461Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - 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, - ffi.Pointer)>(); - - late final _sel_uploadTaskWithRequest_fromData_1 = - _registerName1("uploadTaskWithRequest:fromData:"); - ffi.Pointer _objc_msgSend_462( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer bodyData, - ) { - return __objc_msgSend_462( - obj, - sel, - request, - bodyData, - ); - } - - late final __objc_msgSend_462Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_462 = __objc_msgSend_462Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_uploadTaskWithResumeData_1 = - _registerName1("uploadTaskWithResumeData:"); - ffi.Pointer _objc_msgSend_463( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer resumeData, - ) { - return __objc_msgSend_463( - obj, - sel, - resumeData, - ); - } - - late final __objc_msgSend_463Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_463 = __objc_msgSend_463Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_uploadTaskWithStreamedRequest_1 = - _registerName1("uploadTaskWithStreamedRequest:"); - ffi.Pointer _objc_msgSend_464( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_464( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_464Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_464 = __objc_msgSend_464Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionDownloadTask1 = - _getClass1("NSURLSessionDownloadTask"); - late final _sel_downloadTaskWithRequest_1 = - _registerName1("downloadTaskWithRequest:"); - ffi.Pointer _objc_msgSend_465( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_465( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_465Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_465 = __objc_msgSend_465Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_downloadTaskWithURL_1 = - _registerName1("downloadTaskWithURL:"); - ffi.Pointer _objc_msgSend_466( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_466( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_466Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_466 = __objc_msgSend_466Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_downloadTaskWithResumeData_1 = - _registerName1("downloadTaskWithResumeData:"); - ffi.Pointer _objc_msgSend_467( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer resumeData, - ) { - return __objc_msgSend_467( - obj, - sel, - resumeData, - ); - } - - late final __objc_msgSend_467Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_467 = __objc_msgSend_467Ptr.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_468( - ffi.Pointer obj, - ffi.Pointer sel, - int minBytes, - int maxBytes, - double timeout, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_468( - obj, - sel, - minBytes, - maxBytes, - timeout, - completionHandler, - ); - } - - late final __objc_msgSend_468Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSUInteger, - NSUInteger, - NSTimeInterval, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_468 = __objc_msgSend_468Ptr.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_469( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - double timeout, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_469( - obj, - sel, - data, - timeout, - completionHandler, - ); - } - - late final __objc_msgSend_469Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSTimeInterval, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_469 = __objc_msgSend_469Ptr.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_470( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer hostname, - int port, - ) { - return __objc_msgSend_470( - obj, - sel, - hostname, - port, - ); - } - - late final __objc_msgSend_470Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_470 = __objc_msgSend_470Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer, int)>(); - - late final _class_NSNetService1 = _getClass1("NSNetService"); - late final _sel_streamTaskWithNetService_1 = - _registerName1("streamTaskWithNetService:"); - ffi.Pointer _objc_msgSend_471( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer service, - ) { - return __objc_msgSend_471( - obj, - sel, - service, - ); - } - - late final __objc_msgSend_471Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_471 = __objc_msgSend_471Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionWebSocketTask1 = - _getClass1("NSURLSessionWebSocketTask"); - late final _class_NSURLSessionWebSocketMessage1 = - _getClass1("NSURLSessionWebSocketMessage"); - late final _sel_type1 = _registerName1("type"); - int _objc_msgSend_472( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_472( - obj, - sel, - ); - } - - late final __objc_msgSend_472Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_472 = __objc_msgSend_472Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_sendMessage_completionHandler_1 = - _registerName1("sendMessage:completionHandler:"); - void _objc_msgSend_473( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer message, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_473( - obj, - sel, - message, - completionHandler, - ); - } - - late final __objc_msgSend_473Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_473 = __objc_msgSend_473Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_receiveMessageWithCompletionHandler_1 = - _registerName1("receiveMessageWithCompletionHandler:"); - void _objc_msgSend_474( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_474( - obj, - sel, - completionHandler, - ); - } - - late final __objc_msgSend_474Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_474 = __objc_msgSend_474Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_sendPingWithPongReceiveHandler_1 = - _registerName1("sendPingWithPongReceiveHandler:"); - void _objc_msgSend_475( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> pongReceiveHandler, - ) { - return __objc_msgSend_475( - obj, - sel, - pongReceiveHandler, - ); - } - - late final __objc_msgSend_475Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_475 = __objc_msgSend_475Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_cancelWithCloseCode_reason_1 = - _registerName1("cancelWithCloseCode:reason:"); - void _objc_msgSend_476( - ffi.Pointer obj, - ffi.Pointer sel, - int closeCode, - ffi.Pointer reason, - ) { - return __objc_msgSend_476( - obj, - sel, - closeCode, - reason, - ); - } - - late final __objc_msgSend_476Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_476 = __objc_msgSend_476Ptr.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_477( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_477( - obj, - sel, - ); - } - - late final __objc_msgSend_477Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_477 = __objc_msgSend_477Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_closeReason1 = _registerName1("closeReason"); - late final _sel_webSocketTaskWithURL_1 = - _registerName1("webSocketTaskWithURL:"); - ffi.Pointer _objc_msgSend_478( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ) { - return __objc_msgSend_478( - obj, - sel, - url, - ); - } - - late final __objc_msgSend_478Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_478 = __objc_msgSend_478Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_webSocketTaskWithURL_protocols_1 = - _registerName1("webSocketTaskWithURL:protocols:"); - ffi.Pointer _objc_msgSend_479( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer protocols, - ) { - return __objc_msgSend_479( - obj, - sel, - url, - protocols, - ); - } - - late final __objc_msgSend_479Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_479 = __objc_msgSend_479Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_webSocketTaskWithRequest_1 = - _registerName1("webSocketTaskWithRequest:"); - ffi.Pointer _objc_msgSend_480( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_480( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_480Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_480 = __objc_msgSend_480Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_dataTaskWithRequest_completionHandler_1 = - _registerName1("dataTaskWithRequest:completionHandler:"); - ffi.Pointer _objc_msgSend_481( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_481( - obj, - sel, - request, - completionHandler, - ); - } - - late final __objc_msgSend_481Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_481 = __objc_msgSend_481Ptr.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_482( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_482( - obj, - sel, - url, - completionHandler, - ); - } - - late final __objc_msgSend_482Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_482 = __objc_msgSend_482Ptr.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_483( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer fileURL, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_483( - obj, - sel, - request, - fileURL, - completionHandler, - ); - } - - late final __objc_msgSend_483Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_483 = __objc_msgSend_483Ptr.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_484( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer bodyData, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_484( - obj, - sel, - request, - bodyData, - completionHandler, - ); - } - - late final __objc_msgSend_484Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_484 = __objc_msgSend_484Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_uploadTaskWithResumeData_completionHandler_1 = - _registerName1("uploadTaskWithResumeData:completionHandler:"); - ffi.Pointer _objc_msgSend_485( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer resumeData, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_485( - obj, - sel, - resumeData, - completionHandler, - ); - } - - late final __objc_msgSend_485Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_485 = __objc_msgSend_485Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_downloadTaskWithRequest_completionHandler_1 = - _registerName1("downloadTaskWithRequest:completionHandler:"); - ffi.Pointer _objc_msgSend_486( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_486( - obj, - sel, - request, - completionHandler, - ); - } - - late final __objc_msgSend_486Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_486 = __objc_msgSend_486Ptr.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_487( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_487( - obj, - sel, - url, - completionHandler, - ); - } - - late final __objc_msgSend_487Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_487 = __objc_msgSend_487Ptr.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_488( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer resumeData, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_488( - obj, - sel, - resumeData, - completionHandler, - ); - } - - late final __objc_msgSend_488Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_488 = __objc_msgSend_488Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final ffi.Pointer _NSURLSessionTaskPriorityDefault = - _lookup('NSURLSessionTaskPriorityDefault'); - - double get NSURLSessionTaskPriorityDefault => - _NSURLSessionTaskPriorityDefault.value; - - late final ffi.Pointer _NSURLSessionTaskPriorityLow = - _lookup('NSURLSessionTaskPriorityLow'); - - double get NSURLSessionTaskPriorityLow => _NSURLSessionTaskPriorityLow.value; - - late final ffi.Pointer _NSURLSessionTaskPriorityHigh = - _lookup('NSURLSessionTaskPriorityHigh'); - - double get NSURLSessionTaskPriorityHigh => - _NSURLSessionTaskPriorityHigh.value; - - /// Key in the userInfo dictionary of an NSError received during a failed download. - late final ffi.Pointer> - _NSURLSessionDownloadTaskResumeData = - _lookup>('NSURLSessionDownloadTaskResumeData'); - - ffi.Pointer get NSURLSessionDownloadTaskResumeData => - _NSURLSessionDownloadTaskResumeData.value; - - set NSURLSessionDownloadTaskResumeData(ffi.Pointer value) => - _NSURLSessionDownloadTaskResumeData.value = value; - - /// Key in the userInfo dictionary of an NSError received during a failed upload. - late final ffi.Pointer> - _NSURLSessionUploadTaskResumeData = - _lookup>('NSURLSessionUploadTaskResumeData'); - - ffi.Pointer get NSURLSessionUploadTaskResumeData => - _NSURLSessionUploadTaskResumeData.value; - - set NSURLSessionUploadTaskResumeData(ffi.Pointer value) => - _NSURLSessionUploadTaskResumeData.value = value; - - late final _class_NSURLSessionTaskTransactionMetrics1 = - _getClass1("NSURLSessionTaskTransactionMetrics"); - late final _sel_request1 = _registerName1("request"); - ffi.Pointer _objc_msgSend_489( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_489( - obj, - sel, - ); - } - - late final __objc_msgSend_489Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_489 = __objc_msgSend_489Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_fetchStartDate1 = _registerName1("fetchStartDate"); - late final _sel_domainLookupStartDate1 = - _registerName1("domainLookupStartDate"); - late final _sel_domainLookupEndDate1 = _registerName1("domainLookupEndDate"); - late final _sel_connectStartDate1 = _registerName1("connectStartDate"); - late final _sel_secureConnectionStartDate1 = - _registerName1("secureConnectionStartDate"); - late final _sel_secureConnectionEndDate1 = - _registerName1("secureConnectionEndDate"); - late final _sel_connectEndDate1 = _registerName1("connectEndDate"); - late final _sel_requestStartDate1 = _registerName1("requestStartDate"); - late final _sel_requestEndDate1 = _registerName1("requestEndDate"); - late final _sel_responseStartDate1 = _registerName1("responseStartDate"); - late final _sel_responseEndDate1 = _registerName1("responseEndDate"); - late final _sel_networkProtocolName1 = _registerName1("networkProtocolName"); - late final _sel_isProxyConnection1 = _registerName1("isProxyConnection"); - late final _sel_isReusedConnection1 = _registerName1("isReusedConnection"); - late final _sel_resourceFetchType1 = _registerName1("resourceFetchType"); - int _objc_msgSend_490( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_490( - obj, - sel, - ); - } - - late final __objc_msgSend_490Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_490 = __objc_msgSend_490Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _sel_countOfRequestHeaderBytesSent1 = - _registerName1("countOfRequestHeaderBytesSent"); - late final _sel_countOfRequestBodyBytesSent1 = - _registerName1("countOfRequestBodyBytesSent"); - late final _sel_countOfRequestBodyBytesBeforeEncoding1 = - _registerName1("countOfRequestBodyBytesBeforeEncoding"); - late final _sel_countOfResponseHeaderBytesReceived1 = - _registerName1("countOfResponseHeaderBytesReceived"); - late final _sel_countOfResponseBodyBytesReceived1 = - _registerName1("countOfResponseBodyBytesReceived"); - late final _sel_countOfResponseBodyBytesAfterDecoding1 = - _registerName1("countOfResponseBodyBytesAfterDecoding"); - late final _sel_localAddress1 = _registerName1("localAddress"); - late final _sel_localPort1 = _registerName1("localPort"); - late final _sel_remoteAddress1 = _registerName1("remoteAddress"); - late final _sel_remotePort1 = _registerName1("remotePort"); - late final _sel_negotiatedTLSProtocolVersion1 = - _registerName1("negotiatedTLSProtocolVersion"); - late final _sel_negotiatedTLSCipherSuite1 = - _registerName1("negotiatedTLSCipherSuite"); - late final _sel_isCellular1 = _registerName1("isCellular"); - late final _sel_isExpensive1 = _registerName1("isExpensive"); - late final _sel_isConstrained1 = _registerName1("isConstrained"); - late final _sel_isMultipath1 = _registerName1("isMultipath"); - late final _sel_domainResolutionProtocol1 = - _registerName1("domainResolutionProtocol"); - int _objc_msgSend_491( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_491( - obj, - sel, - ); - } - - late final __objc_msgSend_491Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_491 = __objc_msgSend_491Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSURLSessionTaskMetrics1 = - _getClass1("NSURLSessionTaskMetrics"); - late final _sel_transactionMetrics1 = _registerName1("transactionMetrics"); - late final _class_NSDateInterval1 = _getClass1("NSDateInterval"); - late final _sel_taskInterval1 = _registerName1("taskInterval"); - ffi.Pointer _objc_msgSend_492( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_492( - obj, - sel, - ); - } - - late final __objc_msgSend_492Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_492 = __objc_msgSend_492Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_redirectCount1 = _registerName1("redirectCount"); - late final _class_NSItemProvider1 = _getClass1("NSItemProvider"); - late final _sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1 = - _registerName1( - "registerDataRepresentationForTypeIdentifier:visibility:loadHandler:"); - void _objc_msgSend_493( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_493( - obj, - sel, - typeIdentifier, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_493Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_493 = __objc_msgSend_493Ptr.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_494( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_494( - obj, - sel, - typeIdentifier, - fileOptions, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_494Ptr = _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_494 = __objc_msgSend_494Ptr.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_495( - ffi.Pointer obj, - ffi.Pointer sel, - int fileOptions, - ) { - return __objc_msgSend_495( - obj, - sel, - fileOptions, - ); - } - - late final __objc_msgSend_495Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_495 = __objc_msgSend_495Ptr.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_496( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - int fileOptions, - ) { - return __objc_msgSend_496( - obj, - sel, - typeIdentifier, - fileOptions, - ); - } - - late final __objc_msgSend_496Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_496 = __objc_msgSend_496Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_loadDataRepresentationForTypeIdentifier_completionHandler_1 = - _registerName1( - "loadDataRepresentationForTypeIdentifier:completionHandler:"); - ffi.Pointer _objc_msgSend_497( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_497( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_497Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_497 = __objc_msgSend_497Ptr.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_498( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_498( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_498Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_498 = __objc_msgSend_498Ptr.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_499( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_499( - obj, - sel, - typeIdentifier, - completionHandler, - ); - } - - late final __objc_msgSend_499Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_499 = __objc_msgSend_499Ptr.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_initWithObject_1 = _registerName1("initWithObject:"); - late final _sel_registerObject_visibility_1 = - _registerName1("registerObject:visibility:"); - void _objc_msgSend_500( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer object, - int visibility, - ) { - return __objc_msgSend_500( - obj, - sel, - object, - visibility, - ); - } - - late final __objc_msgSend_500Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_500 = __objc_msgSend_500Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - late final _sel_registerObjectOfClass_visibility_loadHandler_1 = - _registerName1("registerObjectOfClass:visibility:loadHandler:"); - void _objc_msgSend_501( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - int visibility, - ffi.Pointer<_ObjCBlock> loadHandler, - ) { - return __objc_msgSend_501( - obj, - sel, - aClass, - visibility, - loadHandler, - ); - } - - late final __objc_msgSend_501Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_501 = __objc_msgSend_501Ptr.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_502( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aClass, - ffi.Pointer<_ObjCBlock> completionHandler, - ) { - return __objc_msgSend_502( - obj, - sel, - aClass, - completionHandler, - ); - } - - late final __objc_msgSend_502Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_502 = __objc_msgSend_502Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_initWithItem_typeIdentifier_1 = - _registerName1("initWithItem:typeIdentifier:"); - instancetype _objc_msgSend_503( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer item, - ffi.Pointer typeIdentifier, - ) { - return __objc_msgSend_503( - obj, - sel, - item, - typeIdentifier, - ); - } - - late final __objc_msgSend_503Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_503 = __objc_msgSend_503Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_registerItemForTypeIdentifier_loadHandler_1 = - _registerName1("registerItemForTypeIdentifier:loadHandler:"); - void _objc_msgSend_504( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - NSItemProviderLoadHandler loadHandler, - ) { - return __objc_msgSend_504( - obj, - sel, - typeIdentifier, - loadHandler, - ); - } - - late final __objc_msgSend_504Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_504 = __objc_msgSend_504Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSItemProviderLoadHandler)>(); - - late final _sel_loadItemForTypeIdentifier_options_completionHandler_1 = - _registerName1("loadItemForTypeIdentifier:options:completionHandler:"); - void _objc_msgSend_505( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer typeIdentifier, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, - ) { - return __objc_msgSend_505( - obj, - sel, - typeIdentifier, - options, - completionHandler, - ); - } - - late final __objc_msgSend_505Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_505 = __objc_msgSend_505Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>(); - - late final _sel_previewImageHandler1 = _registerName1("previewImageHandler"); - NSItemProviderLoadHandler _objc_msgSend_506( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_506( - obj, - sel, - ); - } - - late final __objc_msgSend_506Ptr = _lookup< - ffi.NativeFunction< - NSItemProviderLoadHandler Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_506 = __objc_msgSend_506Ptr.asFunction< - NSItemProviderLoadHandler Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setPreviewImageHandler_1 = - _registerName1("setPreviewImageHandler:"); - void _objc_msgSend_507( - ffi.Pointer obj, - ffi.Pointer sel, - NSItemProviderLoadHandler value, - ) { - return __objc_msgSend_507( - obj, - sel, - value, - ); - } - - late final __objc_msgSend_507Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSItemProviderLoadHandler)>>('objc_msgSend'); - late final __objc_msgSend_507 = __objc_msgSend_507Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - NSItemProviderLoadHandler)>(); - - late final _sel_loadPreviewImageWithOptions_completionHandler_1 = - _registerName1("loadPreviewImageWithOptions:completionHandler:"); - void _objc_msgSend_508( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer options, - NSItemProviderCompletionHandler completionHandler, - ) { - return __objc_msgSend_508( - obj, - sel, - options, - completionHandler, - ); - } - - late final __objc_msgSend_508Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSItemProviderCompletionHandler)>>('objc_msgSend'); - late final __objc_msgSend_508 = __objc_msgSend_508Ptr.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 _class_NSMutableString1 = _getClass1("NSMutableString"); - late final _sel_replaceCharactersInRange_withString_1 = - _registerName1("replaceCharactersInRange:withString:"); - void _objc_msgSend_509( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange range, - ffi.Pointer aString, - ) { - return __objc_msgSend_509( - obj, - sel, - range, - aString, - ); - } - - late final __objc_msgSend_509Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - NSRange, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_509 = __objc_msgSend_509Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, NSRange, - ffi.Pointer)>(); - - late final _sel_insertString_atIndex_1 = - _registerName1("insertString:atIndex:"); - void _objc_msgSend_510( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - int loc, - ) { - return __objc_msgSend_510( - obj, - sel, - aString, - loc, - ); - } - - late final __objc_msgSend_510Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_510 = __objc_msgSend_510Ptr.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_511( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer replacement, - int options, - NSRange searchRange, - ) { - return __objc_msgSend_511( - obj, - sel, - target, - replacement, - options, - searchRange, - ); - } - - late final __objc_msgSend_511Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - NSRange)>>('objc_msgSend'); - late final __objc_msgSend_511 = __objc_msgSend_511Ptr.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_512( - ffi.Pointer obj, - ffi.Pointer sel, - NSStringTransform transform, - bool reverse, - NSRange range, - NSRangePointer resultingRange, - ) { - return __objc_msgSend_512( - obj, - sel, - transform, - reverse, - range, - resultingRange, - ); - } - - late final __objc_msgSend_512Ptr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - NSStringTransform, - ffi.Bool, - NSRange, - NSRangePointer)>>('objc_msgSend'); - late final __objc_msgSend_512 = __objc_msgSend_512Ptr.asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - NSStringTransform, bool, NSRange, NSRangePointer)>(); - - ffi.Pointer _objc_msgSend_513( - ffi.Pointer obj, - ffi.Pointer sel, - int capacity, - ) { - return __objc_msgSend_513( - obj, - sel, - capacity, - ); - } - - late final __objc_msgSend_513Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSUInteger)>>('objc_msgSend'); - late final __objc_msgSend_513 = __objc_msgSend_513Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _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 _class_NSSimpleCString1 = _getClass1("NSSimpleCString"); - late final _class_NSConstantString1 = _getClass1("NSConstantString"); - late final _class_NSMutableCharacterSet1 = - _getClass1("NSMutableCharacterSet"); - late final _sel_addCharactersInRange_1 = - _registerName1("addCharactersInRange:"); - late final _sel_removeCharactersInRange_1 = - _registerName1("removeCharactersInRange:"); - late final _sel_addCharactersInString_1 = - _registerName1("addCharactersInString:"); - late final _sel_removeCharactersInString_1 = - _registerName1("removeCharactersInString:"); - late final _sel_formUnionWithCharacterSet_1 = - _registerName1("formUnionWithCharacterSet:"); - void _objc_msgSend_514( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer otherSet, - ) { - return __objc_msgSend_514( - obj, - sel, - otherSet, - ); - } - - late final __objc_msgSend_514Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_514 = __objc_msgSend_514Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_formIntersectionWithCharacterSet_1 = - _registerName1("formIntersectionWithCharacterSet:"); - late final _sel_invert1 = _registerName1("invert"); - ffi.Pointer _objc_msgSend_515( - ffi.Pointer obj, - ffi.Pointer sel, - NSRange aRange, - ) { - return __objc_msgSend_515( - obj, - sel, - aRange, - ); - } - - late final __objc_msgSend_515Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSRange)>>('objc_msgSend'); - late final __objc_msgSend_515 = __objc_msgSend_515Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, NSRange)>(); - - ffi.Pointer _objc_msgSend_516( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer aString, - ) { - return __objc_msgSend_516( - obj, - sel, - aString, - ); - } - - late final __objc_msgSend_516Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_516 = __objc_msgSend_516Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_517( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_517( - obj, - sel, - data, - ); - } - - late final __objc_msgSend_517Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_517 = __objc_msgSend_517Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_518( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer fName, - ) { - return __objc_msgSend_518( - obj, - sel, - fName, - ); - } - - late final __objc_msgSend_518Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_518 = __objc_msgSend_518Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final ffi.Pointer> _NSHTTPPropertyStatusCodeKey = - _lookup>('NSHTTPPropertyStatusCodeKey'); - - ffi.Pointer get NSHTTPPropertyStatusCodeKey => - _NSHTTPPropertyStatusCodeKey.value; - - late final ffi.Pointer> - _NSHTTPPropertyStatusReasonKey = - _lookup>('NSHTTPPropertyStatusReasonKey'); - - ffi.Pointer get NSHTTPPropertyStatusReasonKey => - _NSHTTPPropertyStatusReasonKey.value; - - late final ffi.Pointer> - _NSHTTPPropertyServerHTTPVersionKey = - _lookup>('NSHTTPPropertyServerHTTPVersionKey'); - - ffi.Pointer get NSHTTPPropertyServerHTTPVersionKey => - _NSHTTPPropertyServerHTTPVersionKey.value; - - late final ffi.Pointer> - _NSHTTPPropertyRedirectionHeadersKey = - _lookup>('NSHTTPPropertyRedirectionHeadersKey'); - - ffi.Pointer get NSHTTPPropertyRedirectionHeadersKey => - _NSHTTPPropertyRedirectionHeadersKey.value; - - late final ffi.Pointer> - _NSHTTPPropertyErrorPageDataKey = - _lookup>('NSHTTPPropertyErrorPageDataKey'); - - ffi.Pointer get NSHTTPPropertyErrorPageDataKey => - _NSHTTPPropertyErrorPageDataKey.value; - - late final ffi.Pointer> _NSHTTPPropertyHTTPProxy = - _lookup>('NSHTTPPropertyHTTPProxy'); - - ffi.Pointer get NSHTTPPropertyHTTPProxy => - _NSHTTPPropertyHTTPProxy.value; - - late final ffi.Pointer> _NSFTPPropertyUserLoginKey = - _lookup>('NSFTPPropertyUserLoginKey'); - - ffi.Pointer get NSFTPPropertyUserLoginKey => - _NSFTPPropertyUserLoginKey.value; - - late final ffi.Pointer> - _NSFTPPropertyUserPasswordKey = - _lookup>('NSFTPPropertyUserPasswordKey'); - - ffi.Pointer get NSFTPPropertyUserPasswordKey => - _NSFTPPropertyUserPasswordKey.value; - - late final ffi.Pointer> - _NSFTPPropertyActiveTransferModeKey = - _lookup>('NSFTPPropertyActiveTransferModeKey'); - - ffi.Pointer get NSFTPPropertyActiveTransferModeKey => - _NSFTPPropertyActiveTransferModeKey.value; - - late final ffi.Pointer> _NSFTPPropertyFileOffsetKey = - _lookup>('NSFTPPropertyFileOffsetKey'); - - ffi.Pointer get NSFTPPropertyFileOffsetKey => - _NSFTPPropertyFileOffsetKey.value; - - late final ffi.Pointer> _NSFTPPropertyFTPProxy = - _lookup>('NSFTPPropertyFTPProxy'); - - ffi.Pointer get NSFTPPropertyFTPProxy => - _NSFTPPropertyFTPProxy.value; - - /// A string constant for the "file" URL scheme. If you are using this to compare to a URL's scheme to see if it is a file URL, you should instead use the NSURL fileURL property -- the fileURL property is much faster. - late final ffi.Pointer> _NSURLFileScheme = - _lookup>('NSURLFileScheme'); - - ffi.Pointer get NSURLFileScheme => _NSURLFileScheme.value; - - set NSURLFileScheme(ffi.Pointer value) => - _NSURLFileScheme.value = value; - - /// Key for the resource properties that have not been set after setResourceValues:error: returns an error, returned as an array of of strings. - late final ffi.Pointer _NSURLKeysOfUnsetValuesKey = - _lookup('NSURLKeysOfUnsetValuesKey'); - - NSURLResourceKey get NSURLKeysOfUnsetValuesKey => - _NSURLKeysOfUnsetValuesKey.value; - - set NSURLKeysOfUnsetValuesKey(NSURLResourceKey value) => - _NSURLKeysOfUnsetValuesKey.value = value; - - /// The resource name provided by the file system (Read-write, value type NSString) - late final ffi.Pointer _NSURLNameKey = - _lookup('NSURLNameKey'); - - NSURLResourceKey get NSURLNameKey => _NSURLNameKey.value; - - set NSURLNameKey(NSURLResourceKey value) => _NSURLNameKey.value = value; - - /// Localized or extension-hidden name as displayed to users (Read-only, value type NSString) - late final ffi.Pointer _NSURLLocalizedNameKey = - _lookup('NSURLLocalizedNameKey'); - - NSURLResourceKey get NSURLLocalizedNameKey => _NSURLLocalizedNameKey.value; - - set NSURLLocalizedNameKey(NSURLResourceKey value) => - _NSURLLocalizedNameKey.value = value; - - /// True for regular files (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsRegularFileKey = - _lookup('NSURLIsRegularFileKey'); - - NSURLResourceKey get NSURLIsRegularFileKey => _NSURLIsRegularFileKey.value; - - set NSURLIsRegularFileKey(NSURLResourceKey value) => - _NSURLIsRegularFileKey.value = value; - - /// True for directories (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsDirectoryKey = - _lookup('NSURLIsDirectoryKey'); - - NSURLResourceKey get NSURLIsDirectoryKey => _NSURLIsDirectoryKey.value; - - set NSURLIsDirectoryKey(NSURLResourceKey value) => - _NSURLIsDirectoryKey.value = value; - - /// True for symlinks (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsSymbolicLinkKey = - _lookup('NSURLIsSymbolicLinkKey'); - - NSURLResourceKey get NSURLIsSymbolicLinkKey => _NSURLIsSymbolicLinkKey.value; - - set NSURLIsSymbolicLinkKey(NSURLResourceKey value) => - _NSURLIsSymbolicLinkKey.value = value; - - /// True for the root directory of a volume (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsVolumeKey = - _lookup('NSURLIsVolumeKey'); - - NSURLResourceKey get NSURLIsVolumeKey => _NSURLIsVolumeKey.value; - - set NSURLIsVolumeKey(NSURLResourceKey value) => - _NSURLIsVolumeKey.value = value; - - /// True for packaged directories (Read-only 10_6 and 10_7, read-write 10_8, value type boolean NSNumber). Note: You can only set or clear this property on directories; if you try to set this property on non-directory objects, the property is ignored. If the directory is a package for some other reason (extension type, etc), setting this property to false will have no effect. - late final ffi.Pointer _NSURLIsPackageKey = - _lookup('NSURLIsPackageKey'); - - NSURLResourceKey get NSURLIsPackageKey => _NSURLIsPackageKey.value; - - set NSURLIsPackageKey(NSURLResourceKey value) => - _NSURLIsPackageKey.value = value; - - /// True if resource is an application (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsApplicationKey = - _lookup('NSURLIsApplicationKey'); - - NSURLResourceKey get NSURLIsApplicationKey => _NSURLIsApplicationKey.value; - - set NSURLIsApplicationKey(NSURLResourceKey value) => - _NSURLIsApplicationKey.value = value; - - /// True if the resource is scriptable. Only applies to applications (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLApplicationIsScriptableKey = - _lookup('NSURLApplicationIsScriptableKey'); - - NSURLResourceKey get NSURLApplicationIsScriptableKey => - _NSURLApplicationIsScriptableKey.value; - - set NSURLApplicationIsScriptableKey(NSURLResourceKey value) => - _NSURLApplicationIsScriptableKey.value = value; - - /// True for system-immutable resources (Read-write, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsSystemImmutableKey = - _lookup('NSURLIsSystemImmutableKey'); - - NSURLResourceKey get NSURLIsSystemImmutableKey => - _NSURLIsSystemImmutableKey.value; - - set NSURLIsSystemImmutableKey(NSURLResourceKey value) => - _NSURLIsSystemImmutableKey.value = value; - - /// True for user-immutable resources (Read-write, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsUserImmutableKey = - _lookup('NSURLIsUserImmutableKey'); - - NSURLResourceKey get NSURLIsUserImmutableKey => - _NSURLIsUserImmutableKey.value; - - set NSURLIsUserImmutableKey(NSURLResourceKey value) => - _NSURLIsUserImmutableKey.value = value; - - /// True for resources normally not displayed to users (Read-write, value type boolean NSNumber). Note: If the resource is a hidden because its name starts with a period, setting this property to false will not change the property. - late final ffi.Pointer _NSURLIsHiddenKey = - _lookup('NSURLIsHiddenKey'); - - NSURLResourceKey get NSURLIsHiddenKey => _NSURLIsHiddenKey.value; - - set NSURLIsHiddenKey(NSURLResourceKey value) => - _NSURLIsHiddenKey.value = value; - - /// True for resources whose filename extension is removed from the localized name property (Read-write, value type boolean NSNumber) - late final ffi.Pointer _NSURLHasHiddenExtensionKey = - _lookup('NSURLHasHiddenExtensionKey'); - - NSURLResourceKey get NSURLHasHiddenExtensionKey => - _NSURLHasHiddenExtensionKey.value; - - set NSURLHasHiddenExtensionKey(NSURLResourceKey value) => - _NSURLHasHiddenExtensionKey.value = value; - - /// The date the resource was created (Read-write, value type NSDate) - late final ffi.Pointer _NSURLCreationDateKey = - _lookup('NSURLCreationDateKey'); - - NSURLResourceKey get NSURLCreationDateKey => _NSURLCreationDateKey.value; - - set NSURLCreationDateKey(NSURLResourceKey value) => - _NSURLCreationDateKey.value = value; - - /// The date the resource was last accessed (Read-write, value type NSDate) - late final ffi.Pointer _NSURLContentAccessDateKey = - _lookup('NSURLContentAccessDateKey'); - - NSURLResourceKey get NSURLContentAccessDateKey => - _NSURLContentAccessDateKey.value; - - set NSURLContentAccessDateKey(NSURLResourceKey value) => - _NSURLContentAccessDateKey.value = value; - - /// The time the resource content was last modified (Read-write, value type NSDate) - late final ffi.Pointer _NSURLContentModificationDateKey = - _lookup('NSURLContentModificationDateKey'); - - NSURLResourceKey get NSURLContentModificationDateKey => - _NSURLContentModificationDateKey.value; - - set NSURLContentModificationDateKey(NSURLResourceKey value) => - _NSURLContentModificationDateKey.value = value; - - /// The time the resource's attributes were last modified (Read-only, value type NSDate) - late final ffi.Pointer _NSURLAttributeModificationDateKey = - _lookup('NSURLAttributeModificationDateKey'); - - NSURLResourceKey get NSURLAttributeModificationDateKey => - _NSURLAttributeModificationDateKey.value; - - set NSURLAttributeModificationDateKey(NSURLResourceKey value) => - _NSURLAttributeModificationDateKey.value = value; - - /// Number of hard links to the resource (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLLinkCountKey = - _lookup('NSURLLinkCountKey'); - - NSURLResourceKey get NSURLLinkCountKey => _NSURLLinkCountKey.value; - - set NSURLLinkCountKey(NSURLResourceKey value) => - _NSURLLinkCountKey.value = value; - - /// The resource's parent directory, if any (Read-only, value type NSURL) - late final ffi.Pointer _NSURLParentDirectoryURLKey = - _lookup('NSURLParentDirectoryURLKey'); - - NSURLResourceKey get NSURLParentDirectoryURLKey => - _NSURLParentDirectoryURLKey.value; - - set NSURLParentDirectoryURLKey(NSURLResourceKey value) => - _NSURLParentDirectoryURLKey.value = value; - - /// URL of the volume on which the resource is stored (Read-only, value type NSURL) - late final ffi.Pointer _NSURLVolumeURLKey = - _lookup('NSURLVolumeURLKey'); - - NSURLResourceKey get NSURLVolumeURLKey => _NSURLVolumeURLKey.value; - - set NSURLVolumeURLKey(NSURLResourceKey value) => - _NSURLVolumeURLKey.value = value; - - /// Uniform type identifier (UTI) for the resource (Read-only, value type NSString) - late final ffi.Pointer _NSURLTypeIdentifierKey = - _lookup('NSURLTypeIdentifierKey'); - - NSURLResourceKey get NSURLTypeIdentifierKey => _NSURLTypeIdentifierKey.value; - - set NSURLTypeIdentifierKey(NSURLResourceKey value) => - _NSURLTypeIdentifierKey.value = value; - - /// File type (UTType) for the resource (Read-only, value type UTType) - late final ffi.Pointer _NSURLContentTypeKey = - _lookup('NSURLContentTypeKey'); - - NSURLResourceKey get NSURLContentTypeKey => _NSURLContentTypeKey.value; - - set NSURLContentTypeKey(NSURLResourceKey value) => - _NSURLContentTypeKey.value = value; - - /// User-visible type or "kind" description (Read-only, value type NSString) - late final ffi.Pointer _NSURLLocalizedTypeDescriptionKey = - _lookup('NSURLLocalizedTypeDescriptionKey'); - - NSURLResourceKey get NSURLLocalizedTypeDescriptionKey => - _NSURLLocalizedTypeDescriptionKey.value; - - set NSURLLocalizedTypeDescriptionKey(NSURLResourceKey value) => - _NSURLLocalizedTypeDescriptionKey.value = value; - - /// The label number assigned to the resource (Read-write, value type NSNumber) - late final ffi.Pointer _NSURLLabelNumberKey = - _lookup('NSURLLabelNumberKey'); - - NSURLResourceKey get NSURLLabelNumberKey => _NSURLLabelNumberKey.value; - - set NSURLLabelNumberKey(NSURLResourceKey value) => - _NSURLLabelNumberKey.value = value; - - /// The color of the assigned label (Read-only, value type NSColor) - late final ffi.Pointer _NSURLLabelColorKey = - _lookup('NSURLLabelColorKey'); - - NSURLResourceKey get NSURLLabelColorKey => _NSURLLabelColorKey.value; - - set NSURLLabelColorKey(NSURLResourceKey value) => - _NSURLLabelColorKey.value = value; - - /// The user-visible label text (Read-only, value type NSString) - late final ffi.Pointer _NSURLLocalizedLabelKey = - _lookup('NSURLLocalizedLabelKey'); - - NSURLResourceKey get NSURLLocalizedLabelKey => _NSURLLocalizedLabelKey.value; - - set NSURLLocalizedLabelKey(NSURLResourceKey value) => - _NSURLLocalizedLabelKey.value = value; - - /// The icon normally displayed for the resource (Read-only, value type NSImage) - late final ffi.Pointer _NSURLEffectiveIconKey = - _lookup('NSURLEffectiveIconKey'); - - NSURLResourceKey get NSURLEffectiveIconKey => _NSURLEffectiveIconKey.value; - - set NSURLEffectiveIconKey(NSURLResourceKey value) => - _NSURLEffectiveIconKey.value = value; - - /// The custom icon assigned to the resource, if any (Currently not implemented, value type NSImage) - late final ffi.Pointer _NSURLCustomIconKey = - _lookup('NSURLCustomIconKey'); - - NSURLResourceKey get NSURLCustomIconKey => _NSURLCustomIconKey.value; - - set NSURLCustomIconKey(NSURLResourceKey value) => - _NSURLCustomIconKey.value = value; - - /// An identifier which can be used to compare two file system objects for equality using -isEqual (i.e, two object identifiers are equal if they have the same file system path or if the paths are linked to same inode on the same file system). This identifier is not persistent across system restarts. (Read-only, value type id ) - late final ffi.Pointer _NSURLFileResourceIdentifierKey = - _lookup('NSURLFileResourceIdentifierKey'); - - NSURLResourceKey get NSURLFileResourceIdentifierKey => - _NSURLFileResourceIdentifierKey.value; - - set NSURLFileResourceIdentifierKey(NSURLResourceKey value) => - _NSURLFileResourceIdentifierKey.value = value; - - /// An identifier that can be used to identify the volume the file system object is on. Other objects on the same volume will have the same volume identifier and can be compared using for equality using -isEqual. This identifier is not persistent across system restarts. (Read-only, value type id ) - late final ffi.Pointer _NSURLVolumeIdentifierKey = - _lookup('NSURLVolumeIdentifierKey'); - - NSURLResourceKey get NSURLVolumeIdentifierKey => - _NSURLVolumeIdentifierKey.value; - - set NSURLVolumeIdentifierKey(NSURLResourceKey value) => - _NSURLVolumeIdentifierKey.value = value; - - /// The optimal block size when reading or writing this file's data, or nil if not available. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLPreferredIOBlockSizeKey = - _lookup('NSURLPreferredIOBlockSizeKey'); - - NSURLResourceKey get NSURLPreferredIOBlockSizeKey => - _NSURLPreferredIOBlockSizeKey.value; - - set NSURLPreferredIOBlockSizeKey(NSURLResourceKey value) => - _NSURLPreferredIOBlockSizeKey.value = value; - - /// true if this process (as determined by EUID) can read the resource. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsReadableKey = - _lookup('NSURLIsReadableKey'); - - NSURLResourceKey get NSURLIsReadableKey => _NSURLIsReadableKey.value; - - set NSURLIsReadableKey(NSURLResourceKey value) => - _NSURLIsReadableKey.value = value; - - /// true if this process (as determined by EUID) can write to the resource. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsWritableKey = - _lookup('NSURLIsWritableKey'); - - NSURLResourceKey get NSURLIsWritableKey => _NSURLIsWritableKey.value; - - set NSURLIsWritableKey(NSURLResourceKey value) => - _NSURLIsWritableKey.value = value; - - /// true if this process (as determined by EUID) can execute a file resource or search a directory resource. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsExecutableKey = - _lookup('NSURLIsExecutableKey'); - - NSURLResourceKey get NSURLIsExecutableKey => _NSURLIsExecutableKey.value; - - set NSURLIsExecutableKey(NSURLResourceKey value) => - _NSURLIsExecutableKey.value = value; - - /// The file system object's security information encapsulated in a NSFileSecurity object. (Read-write, Value type NSFileSecurity) - late final ffi.Pointer _NSURLFileSecurityKey = - _lookup('NSURLFileSecurityKey'); - - NSURLResourceKey get NSURLFileSecurityKey => _NSURLFileSecurityKey.value; - - set NSURLFileSecurityKey(NSURLResourceKey value) => - _NSURLFileSecurityKey.value = value; - - /// true if resource should be excluded from backups, false otherwise (Read-write, value type boolean NSNumber). This property is only useful for excluding cache and other application support files which are not needed in a backup. Some operations commonly made to user documents will cause this property to be reset to false and so this property should not be used on user documents. - late final ffi.Pointer _NSURLIsExcludedFromBackupKey = - _lookup('NSURLIsExcludedFromBackupKey'); - - NSURLResourceKey get NSURLIsExcludedFromBackupKey => - _NSURLIsExcludedFromBackupKey.value; - - set NSURLIsExcludedFromBackupKey(NSURLResourceKey value) => - _NSURLIsExcludedFromBackupKey.value = value; - - /// The array of Tag names (Read-write, value type NSArray of NSString) - late final ffi.Pointer _NSURLTagNamesKey = - _lookup('NSURLTagNamesKey'); - - NSURLResourceKey get NSURLTagNamesKey => _NSURLTagNamesKey.value; - - set NSURLTagNamesKey(NSURLResourceKey value) => - _NSURLTagNamesKey.value = value; - - /// the URL's path as a file system path (Read-only, value type NSString) - late final ffi.Pointer _NSURLPathKey = - _lookup('NSURLPathKey'); - - NSURLResourceKey get NSURLPathKey => _NSURLPathKey.value; - - set NSURLPathKey(NSURLResourceKey value) => _NSURLPathKey.value = value; - - /// the URL's path as a canonical absolute file system path (Read-only, value type NSString) - late final ffi.Pointer _NSURLCanonicalPathKey = - _lookup('NSURLCanonicalPathKey'); - - NSURLResourceKey get NSURLCanonicalPathKey => _NSURLCanonicalPathKey.value; - - set NSURLCanonicalPathKey(NSURLResourceKey value) => - _NSURLCanonicalPathKey.value = value; - - /// true if this URL is a file system trigger directory. Traversing or opening a file system trigger will cause an attempt to mount a file system on the trigger directory. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsMountTriggerKey = - _lookup('NSURLIsMountTriggerKey'); - - NSURLResourceKey get NSURLIsMountTriggerKey => _NSURLIsMountTriggerKey.value; - - set NSURLIsMountTriggerKey(NSURLResourceKey value) => - _NSURLIsMountTriggerKey.value = value; - - /// An opaque generation identifier which can be compared using isEqual: to determine if the data in a document has been modified. For URLs which refer to the same file inode, the generation identifier will change when the data in the file's data fork is changed (changes to extended attributes or other file system metadata do not change the generation identifier). For URLs which refer to the same directory inode, the generation identifier will change when direct children of that directory are added, removed or renamed (changes to the data of the direct children of that directory will not change the generation identifier). The generation identifier is persistent across system restarts. The generation identifier is tied to a specific document on a specific volume and is not transferred when the document is copied to another volume. This property is not supported by all volumes. (Read-only, value type id ) - late final ffi.Pointer _NSURLGenerationIdentifierKey = - _lookup('NSURLGenerationIdentifierKey'); - - NSURLResourceKey get NSURLGenerationIdentifierKey => - _NSURLGenerationIdentifierKey.value; - - set NSURLGenerationIdentifierKey(NSURLResourceKey value) => - _NSURLGenerationIdentifierKey.value = value; - - /// The document identifier -- a value assigned by the kernel to a document (which can be either a file or directory) and is used to identify the document regardless of where it gets moved on a volume. The document identifier survives "safe save” operations; i.e it is sticky to the path it was assigned to (-replaceItemAtURL:withItemAtURL:backupItemName:options:resultingItemURL:error: is the preferred safe-save API). The document identifier is persistent across system restarts. The document identifier is not transferred when the file is copied. Document identifiers are only unique within a single volume. This property is not supported by all volumes. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLDocumentIdentifierKey = - _lookup('NSURLDocumentIdentifierKey'); - - NSURLResourceKey get NSURLDocumentIdentifierKey => - _NSURLDocumentIdentifierKey.value; - - set NSURLDocumentIdentifierKey(NSURLResourceKey value) => - _NSURLDocumentIdentifierKey.value = value; - - /// The date the resource was created, or renamed into or within its parent directory. Note that inconsistent behavior may be observed when this attribute is requested on hard-linked items. This property is not supported by all volumes. (Read-only before macOS 10.15, iOS 13.0, watchOS 6.0, and tvOS 13.0; Read-write after, value type NSDate) - late final ffi.Pointer _NSURLAddedToDirectoryDateKey = - _lookup('NSURLAddedToDirectoryDateKey'); - - NSURLResourceKey get NSURLAddedToDirectoryDateKey => - _NSURLAddedToDirectoryDateKey.value; - - set NSURLAddedToDirectoryDateKey(NSURLResourceKey value) => - _NSURLAddedToDirectoryDateKey.value = value; - - /// The quarantine properties as defined in LSQuarantine.h. To remove quarantine information from a file, pass NSNull as the value when setting this property. (Read-write, value type NSDictionary) - late final ffi.Pointer _NSURLQuarantinePropertiesKey = - _lookup('NSURLQuarantinePropertiesKey'); - - NSURLResourceKey get NSURLQuarantinePropertiesKey => - _NSURLQuarantinePropertiesKey.value; - - set NSURLQuarantinePropertiesKey(NSURLResourceKey value) => - _NSURLQuarantinePropertiesKey.value = value; - - /// Returns the file system object type. (Read-only, value type NSString) - late final ffi.Pointer _NSURLFileResourceTypeKey = - _lookup('NSURLFileResourceTypeKey'); - - NSURLResourceKey get NSURLFileResourceTypeKey => - _NSURLFileResourceTypeKey.value; - - set NSURLFileResourceTypeKey(NSURLResourceKey value) => - _NSURLFileResourceTypeKey.value = value; - - /// The file system's internal inode identifier for the item. This value is not stable for all file systems or across all mounts, so it should be used sparingly and not persisted. It is useful, for example, to match URLs from the URL enumerator with paths from FSEvents. (Read-only, value type NSNumber containing an unsigned long long). - late final ffi.Pointer _NSURLFileIdentifierKey = - _lookup('NSURLFileIdentifierKey'); - - NSURLResourceKey get NSURLFileIdentifierKey => _NSURLFileIdentifierKey.value; - - set NSURLFileIdentifierKey(NSURLResourceKey value) => - _NSURLFileIdentifierKey.value = value; - - /// A 64-bit value assigned by APFS that identifies a file's content data stream. Only cloned files and their originals can have the same identifier. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLFileContentIdentifierKey = - _lookup('NSURLFileContentIdentifierKey'); - - NSURLResourceKey get NSURLFileContentIdentifierKey => - _NSURLFileContentIdentifierKey.value; - - set NSURLFileContentIdentifierKey(NSURLResourceKey value) => - _NSURLFileContentIdentifierKey.value = value; - - /// True for cloned files and their originals that may share all, some, or no data blocks. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLMayShareFileContentKey = - _lookup('NSURLMayShareFileContentKey'); - - NSURLResourceKey get NSURLMayShareFileContentKey => - _NSURLMayShareFileContentKey.value; - - set NSURLMayShareFileContentKey(NSURLResourceKey value) => - _NSURLMayShareFileContentKey.value = value; - - /// True if the file has extended attributes. False guarantees there are none. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLMayHaveExtendedAttributesKey = - _lookup('NSURLMayHaveExtendedAttributesKey'); - - NSURLResourceKey get NSURLMayHaveExtendedAttributesKey => - _NSURLMayHaveExtendedAttributesKey.value; - - set NSURLMayHaveExtendedAttributesKey(NSURLResourceKey value) => - _NSURLMayHaveExtendedAttributesKey.value = value; - - /// True if the file can be deleted by the file system when asked to free space. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLIsPurgeableKey = - _lookup('NSURLIsPurgeableKey'); - - NSURLResourceKey get NSURLIsPurgeableKey => _NSURLIsPurgeableKey.value; - - set NSURLIsPurgeableKey(NSURLResourceKey value) => - _NSURLIsPurgeableKey.value = value; - - /// True if the file has sparse regions. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLIsSparseKey = - _lookup('NSURLIsSparseKey'); - - NSURLResourceKey get NSURLIsSparseKey => _NSURLIsSparseKey.value; - - set NSURLIsSparseKey(NSURLResourceKey value) => - _NSURLIsSparseKey.value = value; - - /// The file system object type values returned for the NSURLFileResourceTypeKey - late final ffi.Pointer - _NSURLFileResourceTypeNamedPipe = - _lookup('NSURLFileResourceTypeNamedPipe'); - - NSURLFileResourceType get NSURLFileResourceTypeNamedPipe => - _NSURLFileResourceTypeNamedPipe.value; - - set NSURLFileResourceTypeNamedPipe(NSURLFileResourceType value) => - _NSURLFileResourceTypeNamedPipe.value = value; - - late final ffi.Pointer - _NSURLFileResourceTypeCharacterSpecial = - _lookup('NSURLFileResourceTypeCharacterSpecial'); - - NSURLFileResourceType get NSURLFileResourceTypeCharacterSpecial => - _NSURLFileResourceTypeCharacterSpecial.value; - - set NSURLFileResourceTypeCharacterSpecial(NSURLFileResourceType value) => - _NSURLFileResourceTypeCharacterSpecial.value = value; - - late final ffi.Pointer - _NSURLFileResourceTypeDirectory = - _lookup('NSURLFileResourceTypeDirectory'); - - NSURLFileResourceType get NSURLFileResourceTypeDirectory => - _NSURLFileResourceTypeDirectory.value; - - set NSURLFileResourceTypeDirectory(NSURLFileResourceType value) => - _NSURLFileResourceTypeDirectory.value = value; - - late final ffi.Pointer - _NSURLFileResourceTypeBlockSpecial = - _lookup('NSURLFileResourceTypeBlockSpecial'); - - NSURLFileResourceType get NSURLFileResourceTypeBlockSpecial => - _NSURLFileResourceTypeBlockSpecial.value; - - set NSURLFileResourceTypeBlockSpecial(NSURLFileResourceType value) => - _NSURLFileResourceTypeBlockSpecial.value = value; - - late final ffi.Pointer _NSURLFileResourceTypeRegular = - _lookup('NSURLFileResourceTypeRegular'); - - NSURLFileResourceType get NSURLFileResourceTypeRegular => - _NSURLFileResourceTypeRegular.value; - - set NSURLFileResourceTypeRegular(NSURLFileResourceType value) => - _NSURLFileResourceTypeRegular.value = value; - - late final ffi.Pointer - _NSURLFileResourceTypeSymbolicLink = - _lookup('NSURLFileResourceTypeSymbolicLink'); - - NSURLFileResourceType get NSURLFileResourceTypeSymbolicLink => - _NSURLFileResourceTypeSymbolicLink.value; - - set NSURLFileResourceTypeSymbolicLink(NSURLFileResourceType value) => - _NSURLFileResourceTypeSymbolicLink.value = value; - - late final ffi.Pointer _NSURLFileResourceTypeSocket = - _lookup('NSURLFileResourceTypeSocket'); - - NSURLFileResourceType get NSURLFileResourceTypeSocket => - _NSURLFileResourceTypeSocket.value; - - set NSURLFileResourceTypeSocket(NSURLFileResourceType value) => - _NSURLFileResourceTypeSocket.value = value; - - late final ffi.Pointer _NSURLFileResourceTypeUnknown = - _lookup('NSURLFileResourceTypeUnknown'); - - NSURLFileResourceType get NSURLFileResourceTypeUnknown => - _NSURLFileResourceTypeUnknown.value; - - set NSURLFileResourceTypeUnknown(NSURLFileResourceType value) => - _NSURLFileResourceTypeUnknown.value = value; - - /// dictionary of NSImage/UIImage objects keyed by size - late final ffi.Pointer _NSURLThumbnailDictionaryKey = - _lookup('NSURLThumbnailDictionaryKey'); - - NSURLResourceKey get NSURLThumbnailDictionaryKey => - _NSURLThumbnailDictionaryKey.value; - - set NSURLThumbnailDictionaryKey(NSURLResourceKey value) => - _NSURLThumbnailDictionaryKey.value = value; - - /// returns all thumbnails as a single NSImage - late final ffi.Pointer _NSURLThumbnailKey = - _lookup('NSURLThumbnailKey'); - - NSURLResourceKey get NSURLThumbnailKey => _NSURLThumbnailKey.value; - - set NSURLThumbnailKey(NSURLResourceKey value) => - _NSURLThumbnailKey.value = value; - - /// size key for a 1024 x 1024 thumbnail image - late final ffi.Pointer - _NSThumbnail1024x1024SizeKey = - _lookup('NSThumbnail1024x1024SizeKey'); - - NSURLThumbnailDictionaryItem get NSThumbnail1024x1024SizeKey => - _NSThumbnail1024x1024SizeKey.value; - - set NSThumbnail1024x1024SizeKey(NSURLThumbnailDictionaryItem value) => - _NSThumbnail1024x1024SizeKey.value = value; - - /// Total file size in bytes (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLFileSizeKey = - _lookup('NSURLFileSizeKey'); - - NSURLResourceKey get NSURLFileSizeKey => _NSURLFileSizeKey.value; - - set NSURLFileSizeKey(NSURLResourceKey value) => - _NSURLFileSizeKey.value = value; - - /// Total size allocated on disk for the file in bytes (number of blocks times block size) (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLFileAllocatedSizeKey = - _lookup('NSURLFileAllocatedSizeKey'); - - NSURLResourceKey get NSURLFileAllocatedSizeKey => - _NSURLFileAllocatedSizeKey.value; - - set NSURLFileAllocatedSizeKey(NSURLResourceKey value) => - _NSURLFileAllocatedSizeKey.value = value; - - /// Total displayable size of the file in bytes (this may include space used by metadata), or nil if not available. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLTotalFileSizeKey = - _lookup('NSURLTotalFileSizeKey'); - - NSURLResourceKey get NSURLTotalFileSizeKey => _NSURLTotalFileSizeKey.value; - - set NSURLTotalFileSizeKey(NSURLResourceKey value) => - _NSURLTotalFileSizeKey.value = value; - - /// Total allocated size of the file in bytes (this may include space used by metadata), or nil if not available. This can be less than the value returned by NSURLTotalFileSizeKey if the resource is compressed. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLTotalFileAllocatedSizeKey = - _lookup('NSURLTotalFileAllocatedSizeKey'); - - NSURLResourceKey get NSURLTotalFileAllocatedSizeKey => - _NSURLTotalFileAllocatedSizeKey.value; - - set NSURLTotalFileAllocatedSizeKey(NSURLResourceKey value) => - _NSURLTotalFileAllocatedSizeKey.value = value; - - /// true if the resource is a Finder alias file or a symlink, false otherwise ( Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsAliasFileKey = - _lookup('NSURLIsAliasFileKey'); - - NSURLResourceKey get NSURLIsAliasFileKey => _NSURLIsAliasFileKey.value; - - set NSURLIsAliasFileKey(NSURLResourceKey value) => - _NSURLIsAliasFileKey.value = value; - - /// The protection level for this file - late final ffi.Pointer _NSURLFileProtectionKey = - _lookup('NSURLFileProtectionKey'); - - NSURLResourceKey get NSURLFileProtectionKey => _NSURLFileProtectionKey.value; - - set NSURLFileProtectionKey(NSURLResourceKey value) => - _NSURLFileProtectionKey.value = value; - - /// The file has no special protections associated with it. It can be read from or written to at any time. - late final ffi.Pointer _NSURLFileProtectionNone = - _lookup('NSURLFileProtectionNone'); - - NSURLFileProtectionType get NSURLFileProtectionNone => - _NSURLFileProtectionNone.value; - - set NSURLFileProtectionNone(NSURLFileProtectionType value) => - _NSURLFileProtectionNone.value = value; - - /// The file is stored in an encrypted format on disk and cannot be read from or written to while the device is locked or booting. Transient data files with this protection type should be excluded from backups using NSURLIsExcludedFromBackupKey. - late final ffi.Pointer _NSURLFileProtectionComplete = - _lookup('NSURLFileProtectionComplete'); - - NSURLFileProtectionType get NSURLFileProtectionComplete => - _NSURLFileProtectionComplete.value; - - set NSURLFileProtectionComplete(NSURLFileProtectionType value) => - _NSURLFileProtectionComplete.value = value; - - /// The file is stored in an encrypted format on disk. Files can be created while the device is locked, but once closed, cannot be opened again until the device is unlocked. If the file is opened when unlocked, you may continue to access the file normally, even if the user locks the device. There is a small performance penalty when the file is created and opened, though not when being written to or read from. This can be mitigated by changing the file protection to NSURLFileProtectionComplete when the device is unlocked. Transient data files with this protection type should be excluded from backups using NSURLIsExcludedFromBackupKey. - late final ffi.Pointer - _NSURLFileProtectionCompleteUnlessOpen = - _lookup('NSURLFileProtectionCompleteUnlessOpen'); - - NSURLFileProtectionType get NSURLFileProtectionCompleteUnlessOpen => - _NSURLFileProtectionCompleteUnlessOpen.value; - - set NSURLFileProtectionCompleteUnlessOpen(NSURLFileProtectionType value) => - _NSURLFileProtectionCompleteUnlessOpen.value = value; - - /// The file is stored in an encrypted format on disk and cannot be accessed until after the device has booted. After the user unlocks the device for the first time, your app can access the file and continue to access it even if the user subsequently locks the device. - late final ffi.Pointer - _NSURLFileProtectionCompleteUntilFirstUserAuthentication = - _lookup( - 'NSURLFileProtectionCompleteUntilFirstUserAuthentication'); - - NSURLFileProtectionType - get NSURLFileProtectionCompleteUntilFirstUserAuthentication => - _NSURLFileProtectionCompleteUntilFirstUserAuthentication.value; - - set NSURLFileProtectionCompleteUntilFirstUserAuthentication( - NSURLFileProtectionType value) => - _NSURLFileProtectionCompleteUntilFirstUserAuthentication.value = value; - - /// The file is stored in an encrypted format on disk and cannot be accessed until after first unlock after the device has booted. After this first unlock, your app can access the file even while the device is locked until access expiry. Access is renewed once the user unlocks the device again. - late final ffi.Pointer - _NSURLFileProtectionCompleteWhenUserInactive = - _lookup( - 'NSURLFileProtectionCompleteWhenUserInactive'); - - NSURLFileProtectionType get NSURLFileProtectionCompleteWhenUserInactive => - _NSURLFileProtectionCompleteWhenUserInactive.value; - - set NSURLFileProtectionCompleteWhenUserInactive( - NSURLFileProtectionType value) => - _NSURLFileProtectionCompleteWhenUserInactive.value = value; - - /// Returns the count of file system objects contained in the directory. This is a count of objects actually stored in the file system, so excludes virtual items like "." and "..". The property is useful for quickly identifying an empty directory for backup and syncing. If the URL is not a directory or the file system cannot cheaply compute the value, `nil` is returned. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLDirectoryEntryCountKey = - _lookup('NSURLDirectoryEntryCountKey'); - - NSURLResourceKey get NSURLDirectoryEntryCountKey => - _NSURLDirectoryEntryCountKey.value; - - set NSURLDirectoryEntryCountKey(NSURLResourceKey value) => - _NSURLDirectoryEntryCountKey.value = value; - - /// The user-visible volume format (Read-only, value type NSString) - late final ffi.Pointer - _NSURLVolumeLocalizedFormatDescriptionKey = - _lookup('NSURLVolumeLocalizedFormatDescriptionKey'); - - NSURLResourceKey get NSURLVolumeLocalizedFormatDescriptionKey => - _NSURLVolumeLocalizedFormatDescriptionKey.value; - - set NSURLVolumeLocalizedFormatDescriptionKey(NSURLResourceKey value) => - _NSURLVolumeLocalizedFormatDescriptionKey.value = value; - - /// Total volume capacity in bytes (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLVolumeTotalCapacityKey = - _lookup('NSURLVolumeTotalCapacityKey'); - - NSURLResourceKey get NSURLVolumeTotalCapacityKey => - _NSURLVolumeTotalCapacityKey.value; - - set NSURLVolumeTotalCapacityKey(NSURLResourceKey value) => - _NSURLVolumeTotalCapacityKey.value = value; - - /// Total free space in bytes (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLVolumeAvailableCapacityKey = - _lookup('NSURLVolumeAvailableCapacityKey'); - - NSURLResourceKey get NSURLVolumeAvailableCapacityKey => - _NSURLVolumeAvailableCapacityKey.value; - - set NSURLVolumeAvailableCapacityKey(NSURLResourceKey value) => - _NSURLVolumeAvailableCapacityKey.value = value; - - /// Total number of resources on the volume (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLVolumeResourceCountKey = - _lookup('NSURLVolumeResourceCountKey'); - - NSURLResourceKey get NSURLVolumeResourceCountKey => - _NSURLVolumeResourceCountKey.value; - - set NSURLVolumeResourceCountKey(NSURLResourceKey value) => - _NSURLVolumeResourceCountKey.value = value; - - /// true if the volume format supports persistent object identifiers and can look up file system objects by their IDs (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsPersistentIDsKey = - _lookup('NSURLVolumeSupportsPersistentIDsKey'); - - NSURLResourceKey get NSURLVolumeSupportsPersistentIDsKey => - _NSURLVolumeSupportsPersistentIDsKey.value; - - set NSURLVolumeSupportsPersistentIDsKey(NSURLResourceKey value) => - _NSURLVolumeSupportsPersistentIDsKey.value = value; - - /// true if the volume format supports symbolic links (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsSymbolicLinksKey = - _lookup('NSURLVolumeSupportsSymbolicLinksKey'); - - NSURLResourceKey get NSURLVolumeSupportsSymbolicLinksKey => - _NSURLVolumeSupportsSymbolicLinksKey.value; - - set NSURLVolumeSupportsSymbolicLinksKey(NSURLResourceKey value) => - _NSURLVolumeSupportsSymbolicLinksKey.value = value; - - /// true if the volume format supports hard links (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsHardLinksKey = - _lookup('NSURLVolumeSupportsHardLinksKey'); - - NSURLResourceKey get NSURLVolumeSupportsHardLinksKey => - _NSURLVolumeSupportsHardLinksKey.value; - - set NSURLVolumeSupportsHardLinksKey(NSURLResourceKey value) => - _NSURLVolumeSupportsHardLinksKey.value = value; - - /// true if the volume format supports a journal used to speed recovery in case of unplanned restart (such as a power outage or crash). This does not necessarily mean the volume is actively using a journal. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsJournalingKey = - _lookup('NSURLVolumeSupportsJournalingKey'); - - NSURLResourceKey get NSURLVolumeSupportsJournalingKey => - _NSURLVolumeSupportsJournalingKey.value; - - set NSURLVolumeSupportsJournalingKey(NSURLResourceKey value) => - _NSURLVolumeSupportsJournalingKey.value = value; - - /// true if the volume is currently using a journal for speedy recovery after an unplanned restart. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsJournalingKey = - _lookup('NSURLVolumeIsJournalingKey'); - - NSURLResourceKey get NSURLVolumeIsJournalingKey => - _NSURLVolumeIsJournalingKey.value; - - set NSURLVolumeIsJournalingKey(NSURLResourceKey value) => - _NSURLVolumeIsJournalingKey.value = value; - - /// true if the volume format supports sparse files, that is, files which can have 'holes' that have never been written to, and thus do not consume space on disk. A sparse file may have an allocated size on disk that is less than its logical length (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsSparseFilesKey = - _lookup('NSURLVolumeSupportsSparseFilesKey'); - - NSURLResourceKey get NSURLVolumeSupportsSparseFilesKey => - _NSURLVolumeSupportsSparseFilesKey.value; - - set NSURLVolumeSupportsSparseFilesKey(NSURLResourceKey value) => - _NSURLVolumeSupportsSparseFilesKey.value = value; - - /// For security reasons, parts of a file (runs) that have never been written to must appear to contain zeroes. true if the volume keeps track of allocated but unwritten runs of a file so that it can substitute zeroes without actually writing zeroes to the media. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsZeroRunsKey = - _lookup('NSURLVolumeSupportsZeroRunsKey'); - - NSURLResourceKey get NSURLVolumeSupportsZeroRunsKey => - _NSURLVolumeSupportsZeroRunsKey.value; - - set NSURLVolumeSupportsZeroRunsKey(NSURLResourceKey value) => - _NSURLVolumeSupportsZeroRunsKey.value = value; - - /// true if the volume format treats upper and lower case characters in file and directory names as different. Otherwise an upper case character is equivalent to a lower case character, and you can't have two names that differ solely in the case of the characters. (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsCaseSensitiveNamesKey = - _lookup('NSURLVolumeSupportsCaseSensitiveNamesKey'); - - NSURLResourceKey get NSURLVolumeSupportsCaseSensitiveNamesKey => - _NSURLVolumeSupportsCaseSensitiveNamesKey.value; - - set NSURLVolumeSupportsCaseSensitiveNamesKey(NSURLResourceKey value) => - _NSURLVolumeSupportsCaseSensitiveNamesKey.value = value; - - /// true if the volume format preserves the case of file and directory names. Otherwise the volume may change the case of some characters (typically making them all upper or all lower case). (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsCasePreservedNamesKey = - _lookup('NSURLVolumeSupportsCasePreservedNamesKey'); - - NSURLResourceKey get NSURLVolumeSupportsCasePreservedNamesKey => - _NSURLVolumeSupportsCasePreservedNamesKey.value; - - set NSURLVolumeSupportsCasePreservedNamesKey(NSURLResourceKey value) => - _NSURLVolumeSupportsCasePreservedNamesKey.value = value; - - /// true if the volume supports reliable storage of times for the root directory. (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsRootDirectoryDatesKey = - _lookup('NSURLVolumeSupportsRootDirectoryDatesKey'); - - NSURLResourceKey get NSURLVolumeSupportsRootDirectoryDatesKey => - _NSURLVolumeSupportsRootDirectoryDatesKey.value; - - set NSURLVolumeSupportsRootDirectoryDatesKey(NSURLResourceKey value) => - _NSURLVolumeSupportsRootDirectoryDatesKey.value = value; - - /// true if the volume supports returning volume size values (NSURLVolumeTotalCapacityKey and NSURLVolumeAvailableCapacityKey). (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsVolumeSizesKey = - _lookup('NSURLVolumeSupportsVolumeSizesKey'); - - NSURLResourceKey get NSURLVolumeSupportsVolumeSizesKey => - _NSURLVolumeSupportsVolumeSizesKey.value; - - set NSURLVolumeSupportsVolumeSizesKey(NSURLResourceKey value) => - _NSURLVolumeSupportsVolumeSizesKey.value = value; - - /// true if the volume can be renamed. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsRenamingKey = - _lookup('NSURLVolumeSupportsRenamingKey'); - - NSURLResourceKey get NSURLVolumeSupportsRenamingKey => - _NSURLVolumeSupportsRenamingKey.value; - - set NSURLVolumeSupportsRenamingKey(NSURLResourceKey value) => - _NSURLVolumeSupportsRenamingKey.value = value; - - /// true if the volume implements whole-file flock(2) style advisory locks, and the O_EXLOCK and O_SHLOCK flags of the open(2) call. (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsAdvisoryFileLockingKey = - _lookup('NSURLVolumeSupportsAdvisoryFileLockingKey'); - - NSURLResourceKey get NSURLVolumeSupportsAdvisoryFileLockingKey => - _NSURLVolumeSupportsAdvisoryFileLockingKey.value; - - set NSURLVolumeSupportsAdvisoryFileLockingKey(NSURLResourceKey value) => - _NSURLVolumeSupportsAdvisoryFileLockingKey.value = value; - - /// true if the volume implements extended security (ACLs). (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsExtendedSecurityKey = - _lookup('NSURLVolumeSupportsExtendedSecurityKey'); - - NSURLResourceKey get NSURLVolumeSupportsExtendedSecurityKey => - _NSURLVolumeSupportsExtendedSecurityKey.value; - - set NSURLVolumeSupportsExtendedSecurityKey(NSURLResourceKey value) => - _NSURLVolumeSupportsExtendedSecurityKey.value = value; - - /// true if the volume should be visible via the GUI (i.e., appear on the Desktop as a separate volume). (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsBrowsableKey = - _lookup('NSURLVolumeIsBrowsableKey'); - - NSURLResourceKey get NSURLVolumeIsBrowsableKey => - _NSURLVolumeIsBrowsableKey.value; - - set NSURLVolumeIsBrowsableKey(NSURLResourceKey value) => - _NSURLVolumeIsBrowsableKey.value = value; - - /// The largest file size (in bytes) supported by this file system, or nil if this cannot be determined. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLVolumeMaximumFileSizeKey = - _lookup('NSURLVolumeMaximumFileSizeKey'); - - NSURLResourceKey get NSURLVolumeMaximumFileSizeKey => - _NSURLVolumeMaximumFileSizeKey.value; - - set NSURLVolumeMaximumFileSizeKey(NSURLResourceKey value) => - _NSURLVolumeMaximumFileSizeKey.value = value; - - /// true if the volume's media is ejectable from the drive mechanism under software control. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsEjectableKey = - _lookup('NSURLVolumeIsEjectableKey'); - - NSURLResourceKey get NSURLVolumeIsEjectableKey => - _NSURLVolumeIsEjectableKey.value; - - set NSURLVolumeIsEjectableKey(NSURLResourceKey value) => - _NSURLVolumeIsEjectableKey.value = value; - - /// true if the volume's media is removable from the drive mechanism. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsRemovableKey = - _lookup('NSURLVolumeIsRemovableKey'); - - NSURLResourceKey get NSURLVolumeIsRemovableKey => - _NSURLVolumeIsRemovableKey.value; - - set NSURLVolumeIsRemovableKey(NSURLResourceKey value) => - _NSURLVolumeIsRemovableKey.value = value; - - /// true if the volume's device is connected to an internal bus, false if connected to an external bus, or nil if not available. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsInternalKey = - _lookup('NSURLVolumeIsInternalKey'); - - NSURLResourceKey get NSURLVolumeIsInternalKey => - _NSURLVolumeIsInternalKey.value; - - set NSURLVolumeIsInternalKey(NSURLResourceKey value) => - _NSURLVolumeIsInternalKey.value = value; - - /// true if the volume is automounted. Note: do not mistake this with the functionality provided by kCFURLVolumeSupportsBrowsingKey. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsAutomountedKey = - _lookup('NSURLVolumeIsAutomountedKey'); - - NSURLResourceKey get NSURLVolumeIsAutomountedKey => - _NSURLVolumeIsAutomountedKey.value; - - set NSURLVolumeIsAutomountedKey(NSURLResourceKey value) => - _NSURLVolumeIsAutomountedKey.value = value; - - /// true if the volume is stored on a local device. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsLocalKey = - _lookup('NSURLVolumeIsLocalKey'); - - NSURLResourceKey get NSURLVolumeIsLocalKey => _NSURLVolumeIsLocalKey.value; - - set NSURLVolumeIsLocalKey(NSURLResourceKey value) => - _NSURLVolumeIsLocalKey.value = value; - - /// true if the volume is read-only. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsReadOnlyKey = - _lookup('NSURLVolumeIsReadOnlyKey'); - - NSURLResourceKey get NSURLVolumeIsReadOnlyKey => - _NSURLVolumeIsReadOnlyKey.value; - - set NSURLVolumeIsReadOnlyKey(NSURLResourceKey value) => - _NSURLVolumeIsReadOnlyKey.value = value; - - /// The volume's creation date, or nil if this cannot be determined. (Read-only, value type NSDate) - late final ffi.Pointer _NSURLVolumeCreationDateKey = - _lookup('NSURLVolumeCreationDateKey'); - - NSURLResourceKey get NSURLVolumeCreationDateKey => - _NSURLVolumeCreationDateKey.value; - - set NSURLVolumeCreationDateKey(NSURLResourceKey value) => - _NSURLVolumeCreationDateKey.value = value; - - /// The NSURL needed to remount a network volume, or nil if not available. (Read-only, value type NSURL) - late final ffi.Pointer _NSURLVolumeURLForRemountingKey = - _lookup('NSURLVolumeURLForRemountingKey'); - - NSURLResourceKey get NSURLVolumeURLForRemountingKey => - _NSURLVolumeURLForRemountingKey.value; - - set NSURLVolumeURLForRemountingKey(NSURLResourceKey value) => - _NSURLVolumeURLForRemountingKey.value = value; - - /// The volume's persistent UUID as a string, or nil if a persistent UUID is not available for the volume. (Read-only, value type NSString) - late final ffi.Pointer _NSURLVolumeUUIDStringKey = - _lookup('NSURLVolumeUUIDStringKey'); - - NSURLResourceKey get NSURLVolumeUUIDStringKey => - _NSURLVolumeUUIDStringKey.value; - - set NSURLVolumeUUIDStringKey(NSURLResourceKey value) => - _NSURLVolumeUUIDStringKey.value = value; - - /// The name of the volume (Read-write if NSURLVolumeSupportsRenamingKey is YES, otherwise read-only, value type NSString) - late final ffi.Pointer _NSURLVolumeNameKey = - _lookup('NSURLVolumeNameKey'); - - NSURLResourceKey get NSURLVolumeNameKey => _NSURLVolumeNameKey.value; - - set NSURLVolumeNameKey(NSURLResourceKey value) => - _NSURLVolumeNameKey.value = value; - - /// The user-presentable name of the volume (Read-only, value type NSString) - late final ffi.Pointer _NSURLVolumeLocalizedNameKey = - _lookup('NSURLVolumeLocalizedNameKey'); - - NSURLResourceKey get NSURLVolumeLocalizedNameKey => - _NSURLVolumeLocalizedNameKey.value; - - set NSURLVolumeLocalizedNameKey(NSURLResourceKey value) => - _NSURLVolumeLocalizedNameKey.value = value; - - /// true if the volume is encrypted. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsEncryptedKey = - _lookup('NSURLVolumeIsEncryptedKey'); - - NSURLResourceKey get NSURLVolumeIsEncryptedKey => - _NSURLVolumeIsEncryptedKey.value; - - set NSURLVolumeIsEncryptedKey(NSURLResourceKey value) => - _NSURLVolumeIsEncryptedKey.value = value; - - /// true if the volume is the root filesystem. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeIsRootFileSystemKey = - _lookup('NSURLVolumeIsRootFileSystemKey'); - - NSURLResourceKey get NSURLVolumeIsRootFileSystemKey => - _NSURLVolumeIsRootFileSystemKey.value; - - set NSURLVolumeIsRootFileSystemKey(NSURLResourceKey value) => - _NSURLVolumeIsRootFileSystemKey.value = value; - - /// true if the volume supports transparent decompression of compressed files using decmpfs. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsCompressionKey = - _lookup('NSURLVolumeSupportsCompressionKey'); - - NSURLResourceKey get NSURLVolumeSupportsCompressionKey => - _NSURLVolumeSupportsCompressionKey.value; - - set NSURLVolumeSupportsCompressionKey(NSURLResourceKey value) => - _NSURLVolumeSupportsCompressionKey.value = value; - - /// true if the volume supports clonefile(2) (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsFileCloningKey = - _lookup('NSURLVolumeSupportsFileCloningKey'); - - NSURLResourceKey get NSURLVolumeSupportsFileCloningKey => - _NSURLVolumeSupportsFileCloningKey.value; - - set NSURLVolumeSupportsFileCloningKey(NSURLResourceKey value) => - _NSURLVolumeSupportsFileCloningKey.value = value; - - /// true if the volume supports renamex_np(2)'s RENAME_SWAP option (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLVolumeSupportsSwapRenamingKey = - _lookup('NSURLVolumeSupportsSwapRenamingKey'); - - NSURLResourceKey get NSURLVolumeSupportsSwapRenamingKey => - _NSURLVolumeSupportsSwapRenamingKey.value; - - set NSURLVolumeSupportsSwapRenamingKey(NSURLResourceKey value) => - _NSURLVolumeSupportsSwapRenamingKey.value = value; - - /// true if the volume supports renamex_np(2)'s RENAME_EXCL option (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsExclusiveRenamingKey = - _lookup('NSURLVolumeSupportsExclusiveRenamingKey'); - - NSURLResourceKey get NSURLVolumeSupportsExclusiveRenamingKey => - _NSURLVolumeSupportsExclusiveRenamingKey.value; - - set NSURLVolumeSupportsExclusiveRenamingKey(NSURLResourceKey value) => - _NSURLVolumeSupportsExclusiveRenamingKey.value = value; - - /// true if the volume supports making files immutable with the NSURLIsUserImmutableKey or NSURLIsSystemImmutableKey properties (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsImmutableFilesKey = - _lookup('NSURLVolumeSupportsImmutableFilesKey'); - - NSURLResourceKey get NSURLVolumeSupportsImmutableFilesKey => - _NSURLVolumeSupportsImmutableFilesKey.value; - - set NSURLVolumeSupportsImmutableFilesKey(NSURLResourceKey value) => - _NSURLVolumeSupportsImmutableFilesKey.value = value; - - /// true if the volume supports setting POSIX access permissions with the NSURLFileSecurityKey property (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsAccessPermissionsKey = - _lookup('NSURLVolumeSupportsAccessPermissionsKey'); - - NSURLResourceKey get NSURLVolumeSupportsAccessPermissionsKey => - _NSURLVolumeSupportsAccessPermissionsKey.value; - - set NSURLVolumeSupportsAccessPermissionsKey(NSURLResourceKey value) => - _NSURLVolumeSupportsAccessPermissionsKey.value = value; - - /// True if the volume supports the File Protection attribute (see NSURLFileProtectionKey). (Read-only, value type NSNumber) - late final ffi.Pointer - _NSURLVolumeSupportsFileProtectionKey = - _lookup('NSURLVolumeSupportsFileProtectionKey'); - - NSURLResourceKey get NSURLVolumeSupportsFileProtectionKey => - _NSURLVolumeSupportsFileProtectionKey.value; - - set NSURLVolumeSupportsFileProtectionKey(NSURLResourceKey value) => - _NSURLVolumeSupportsFileProtectionKey.value = value; - - /// (Read-only, value type NSNumber) - late final ffi.Pointer - _NSURLVolumeAvailableCapacityForImportantUsageKey = - _lookup( - 'NSURLVolumeAvailableCapacityForImportantUsageKey'); - - NSURLResourceKey get NSURLVolumeAvailableCapacityForImportantUsageKey => - _NSURLVolumeAvailableCapacityForImportantUsageKey.value; - - set NSURLVolumeAvailableCapacityForImportantUsageKey( - NSURLResourceKey value) => - _NSURLVolumeAvailableCapacityForImportantUsageKey.value = value; - - /// (Read-only, value type NSNumber) - late final ffi.Pointer - _NSURLVolumeAvailableCapacityForOpportunisticUsageKey = - _lookup( - 'NSURLVolumeAvailableCapacityForOpportunisticUsageKey'); - - NSURLResourceKey get NSURLVolumeAvailableCapacityForOpportunisticUsageKey => - _NSURLVolumeAvailableCapacityForOpportunisticUsageKey.value; - - set NSURLVolumeAvailableCapacityForOpportunisticUsageKey( - NSURLResourceKey value) => - _NSURLVolumeAvailableCapacityForOpportunisticUsageKey.value = value; - - /// The name of the file system type. (Read-only, value type NSString) - late final ffi.Pointer _NSURLVolumeTypeNameKey = - _lookup('NSURLVolumeTypeNameKey'); - - NSURLResourceKey get NSURLVolumeTypeNameKey => _NSURLVolumeTypeNameKey.value; - - set NSURLVolumeTypeNameKey(NSURLResourceKey value) => - _NSURLVolumeTypeNameKey.value = value; - - /// The file system subtype value. (Read-only, value type NSNumber) - late final ffi.Pointer _NSURLVolumeSubtypeKey = - _lookup('NSURLVolumeSubtypeKey'); - - NSURLResourceKey get NSURLVolumeSubtypeKey => _NSURLVolumeSubtypeKey.value; - - set NSURLVolumeSubtypeKey(NSURLResourceKey value) => - _NSURLVolumeSubtypeKey.value = value; - - /// The volume mounted from location. (Read-only, value type NSString) - late final ffi.Pointer _NSURLVolumeMountFromLocationKey = - _lookup('NSURLVolumeMountFromLocationKey'); - - NSURLResourceKey get NSURLVolumeMountFromLocationKey => - _NSURLVolumeMountFromLocationKey.value; - - set NSURLVolumeMountFromLocationKey(NSURLResourceKey value) => - _NSURLVolumeMountFromLocationKey.value = value; - - /// true if this item is synced to the cloud, false if it is only a local file. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLIsUbiquitousItemKey = - _lookup('NSURLIsUbiquitousItemKey'); - - NSURLResourceKey get NSURLIsUbiquitousItemKey => - _NSURLIsUbiquitousItemKey.value; - - set NSURLIsUbiquitousItemKey(NSURLResourceKey value) => - _NSURLIsUbiquitousItemKey.value = value; - - /// true if this item has conflicts outstanding. (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLUbiquitousItemHasUnresolvedConflictsKey = - _lookup('NSURLUbiquitousItemHasUnresolvedConflictsKey'); - - NSURLResourceKey get NSURLUbiquitousItemHasUnresolvedConflictsKey => - _NSURLUbiquitousItemHasUnresolvedConflictsKey.value; - - set NSURLUbiquitousItemHasUnresolvedConflictsKey(NSURLResourceKey value) => - _NSURLUbiquitousItemHasUnresolvedConflictsKey.value = value; - - /// equivalent to NSURLUbiquitousItemDownloadingStatusKey == NSURLUbiquitousItemDownloadingStatusCurrent. Has never behaved as documented in earlier releases, hence deprecated. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLUbiquitousItemIsDownloadedKey = - _lookup('NSURLUbiquitousItemIsDownloadedKey'); - - NSURLResourceKey get NSURLUbiquitousItemIsDownloadedKey => - _NSURLUbiquitousItemIsDownloadedKey.value; - - set NSURLUbiquitousItemIsDownloadedKey(NSURLResourceKey value) => - _NSURLUbiquitousItemIsDownloadedKey.value = value; - - /// true if data is being downloaded for this item. (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLUbiquitousItemIsDownloadingKey = - _lookup('NSURLUbiquitousItemIsDownloadingKey'); - - NSURLResourceKey get NSURLUbiquitousItemIsDownloadingKey => - _NSURLUbiquitousItemIsDownloadingKey.value; - - set NSURLUbiquitousItemIsDownloadingKey(NSURLResourceKey value) => - _NSURLUbiquitousItemIsDownloadingKey.value = value; - - /// true if there is data present in the cloud for this item. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLUbiquitousItemIsUploadedKey = - _lookup('NSURLUbiquitousItemIsUploadedKey'); - - NSURLResourceKey get NSURLUbiquitousItemIsUploadedKey => - _NSURLUbiquitousItemIsUploadedKey.value; - - set NSURLUbiquitousItemIsUploadedKey(NSURLResourceKey value) => - _NSURLUbiquitousItemIsUploadedKey.value = value; - - /// true if data is being uploaded for this item. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLUbiquitousItemIsUploadingKey = - _lookup('NSURLUbiquitousItemIsUploadingKey'); - - NSURLResourceKey get NSURLUbiquitousItemIsUploadingKey => - _NSURLUbiquitousItemIsUploadingKey.value; - - set NSURLUbiquitousItemIsUploadingKey(NSURLResourceKey value) => - _NSURLUbiquitousItemIsUploadingKey.value = value; - - /// Use NSMetadataQuery and NSMetadataUbiquitousItemPercentDownloadedKey on NSMetadataItem instead - late final ffi.Pointer - _NSURLUbiquitousItemPercentDownloadedKey = - _lookup('NSURLUbiquitousItemPercentDownloadedKey'); - - NSURLResourceKey get NSURLUbiquitousItemPercentDownloadedKey => - _NSURLUbiquitousItemPercentDownloadedKey.value; - - set NSURLUbiquitousItemPercentDownloadedKey(NSURLResourceKey value) => - _NSURLUbiquitousItemPercentDownloadedKey.value = value; - - /// Use NSMetadataQuery and NSMetadataUbiquitousItemPercentUploadedKey on NSMetadataItem instead - late final ffi.Pointer - _NSURLUbiquitousItemPercentUploadedKey = - _lookup('NSURLUbiquitousItemPercentUploadedKey'); - - NSURLResourceKey get NSURLUbiquitousItemPercentUploadedKey => - _NSURLUbiquitousItemPercentUploadedKey.value; - - set NSURLUbiquitousItemPercentUploadedKey(NSURLResourceKey value) => - _NSURLUbiquitousItemPercentUploadedKey.value = value; - - /// returns the download status of this item. (Read-only, value type NSString). Possible values below. - late final ffi.Pointer - _NSURLUbiquitousItemDownloadingStatusKey = - _lookup('NSURLUbiquitousItemDownloadingStatusKey'); - - NSURLResourceKey get NSURLUbiquitousItemDownloadingStatusKey => - _NSURLUbiquitousItemDownloadingStatusKey.value; - - set NSURLUbiquitousItemDownloadingStatusKey(NSURLResourceKey value) => - _NSURLUbiquitousItemDownloadingStatusKey.value = value; - - /// returns the error when downloading the item from iCloud failed, see the NSUbiquitousFile section in FoundationErrors.h (Read-only, value type NSError) - late final ffi.Pointer - _NSURLUbiquitousItemDownloadingErrorKey = - _lookup('NSURLUbiquitousItemDownloadingErrorKey'); - - NSURLResourceKey get NSURLUbiquitousItemDownloadingErrorKey => - _NSURLUbiquitousItemDownloadingErrorKey.value; - - set NSURLUbiquitousItemDownloadingErrorKey(NSURLResourceKey value) => - _NSURLUbiquitousItemDownloadingErrorKey.value = value; - - /// returns the error when uploading the item to iCloud failed, see the NSUbiquitousFile section in FoundationErrors.h (Read-only, value type NSError) - late final ffi.Pointer - _NSURLUbiquitousItemUploadingErrorKey = - _lookup('NSURLUbiquitousItemUploadingErrorKey'); - - NSURLResourceKey get NSURLUbiquitousItemUploadingErrorKey => - _NSURLUbiquitousItemUploadingErrorKey.value; - - set NSURLUbiquitousItemUploadingErrorKey(NSURLResourceKey value) => - _NSURLUbiquitousItemUploadingErrorKey.value = value; - - /// returns whether a download of this item has already been requested with an API like -startDownloadingUbiquitousItemAtURL:error: (Read-only, value type boolean NSNumber) - late final ffi.Pointer - _NSURLUbiquitousItemDownloadRequestedKey = - _lookup('NSURLUbiquitousItemDownloadRequestedKey'); - - NSURLResourceKey get NSURLUbiquitousItemDownloadRequestedKey => - _NSURLUbiquitousItemDownloadRequestedKey.value; - - set NSURLUbiquitousItemDownloadRequestedKey(NSURLResourceKey value) => - _NSURLUbiquitousItemDownloadRequestedKey.value = value; - - /// returns the name of this item's container as displayed to users. - late final ffi.Pointer - _NSURLUbiquitousItemContainerDisplayNameKey = - _lookup('NSURLUbiquitousItemContainerDisplayNameKey'); - - NSURLResourceKey get NSURLUbiquitousItemContainerDisplayNameKey => - _NSURLUbiquitousItemContainerDisplayNameKey.value; - - set NSURLUbiquitousItemContainerDisplayNameKey(NSURLResourceKey value) => - _NSURLUbiquitousItemContainerDisplayNameKey.value = value; - - /// true if the item is excluded from sync, which means it is locally on disk but won't be available on the server. An excluded item is no longer ubiquitous. (Read-write, value type boolean NSNumber - late final ffi.Pointer - _NSURLUbiquitousItemIsExcludedFromSyncKey = - _lookup('NSURLUbiquitousItemIsExcludedFromSyncKey'); - - NSURLResourceKey get NSURLUbiquitousItemIsExcludedFromSyncKey => - _NSURLUbiquitousItemIsExcludedFromSyncKey.value; - - set NSURLUbiquitousItemIsExcludedFromSyncKey(NSURLResourceKey value) => - _NSURLUbiquitousItemIsExcludedFromSyncKey.value = value; - - /// true if the ubiquitous item is shared. (Read-only, value type boolean NSNumber) - late final ffi.Pointer _NSURLUbiquitousItemIsSharedKey = - _lookup('NSURLUbiquitousItemIsSharedKey'); - - NSURLResourceKey get NSURLUbiquitousItemIsSharedKey => - _NSURLUbiquitousItemIsSharedKey.value; - - set NSURLUbiquitousItemIsSharedKey(NSURLResourceKey value) => - _NSURLUbiquitousItemIsSharedKey.value = value; - - /// returns the current user's role for this shared item, or nil if not shared. (Read-only, value type NSString). Possible values below. - late final ffi.Pointer - _NSURLUbiquitousSharedItemCurrentUserRoleKey = - _lookup('NSURLUbiquitousSharedItemCurrentUserRoleKey'); - - NSURLResourceKey get NSURLUbiquitousSharedItemCurrentUserRoleKey => - _NSURLUbiquitousSharedItemCurrentUserRoleKey.value; - - set NSURLUbiquitousSharedItemCurrentUserRoleKey(NSURLResourceKey value) => - _NSURLUbiquitousSharedItemCurrentUserRoleKey.value = value; - - /// returns the permissions for the current user, or nil if not shared. (Read-only, value type NSString). Possible values below. - late final ffi.Pointer - _NSURLUbiquitousSharedItemCurrentUserPermissionsKey = - _lookup( - 'NSURLUbiquitousSharedItemCurrentUserPermissionsKey'); - - NSURLResourceKey get NSURLUbiquitousSharedItemCurrentUserPermissionsKey => - _NSURLUbiquitousSharedItemCurrentUserPermissionsKey.value; - - set NSURLUbiquitousSharedItemCurrentUserPermissionsKey( - NSURLResourceKey value) => - _NSURLUbiquitousSharedItemCurrentUserPermissionsKey.value = value; - - /// returns a NSPersonNameComponents, or nil if the current user. (Read-only, value type NSPersonNameComponents) - late final ffi.Pointer - _NSURLUbiquitousSharedItemOwnerNameComponentsKey = - _lookup( - 'NSURLUbiquitousSharedItemOwnerNameComponentsKey'); - - NSURLResourceKey get NSURLUbiquitousSharedItemOwnerNameComponentsKey => - _NSURLUbiquitousSharedItemOwnerNameComponentsKey.value; - - set NSURLUbiquitousSharedItemOwnerNameComponentsKey(NSURLResourceKey value) => - _NSURLUbiquitousSharedItemOwnerNameComponentsKey.value = value; - - /// returns a NSPersonNameComponents for the most recent editor of the document, or nil if it is the current user. (Read-only, value type NSPersonNameComponents) - late final ffi.Pointer - _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey = - _lookup( - 'NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey'); - - NSURLResourceKey - get NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey => - _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey.value; - - set NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey( - NSURLResourceKey value) => - _NSURLUbiquitousSharedItemMostRecentEditorNameComponentsKey.value = value; - - /// this item has not been downloaded yet. Use startDownloadingUbiquitousItemAtURL:error: to download it. - late final ffi.Pointer - _NSURLUbiquitousItemDownloadingStatusNotDownloaded = - _lookup( - 'NSURLUbiquitousItemDownloadingStatusNotDownloaded'); - - NSURLUbiquitousItemDownloadingStatus - get NSURLUbiquitousItemDownloadingStatusNotDownloaded => - _NSURLUbiquitousItemDownloadingStatusNotDownloaded.value; - - set NSURLUbiquitousItemDownloadingStatusNotDownloaded( - NSURLUbiquitousItemDownloadingStatus value) => - _NSURLUbiquitousItemDownloadingStatusNotDownloaded.value = value; - - /// there is a local version of this item available. The most current version will get downloaded as soon as possible. - late final ffi.Pointer - _NSURLUbiquitousItemDownloadingStatusDownloaded = - _lookup( - 'NSURLUbiquitousItemDownloadingStatusDownloaded'); - - NSURLUbiquitousItemDownloadingStatus - get NSURLUbiquitousItemDownloadingStatusDownloaded => - _NSURLUbiquitousItemDownloadingStatusDownloaded.value; - - set NSURLUbiquitousItemDownloadingStatusDownloaded( - NSURLUbiquitousItemDownloadingStatus value) => - _NSURLUbiquitousItemDownloadingStatusDownloaded.value = value; - - /// there is a local version of this item and it is the most up-to-date version known to this device. - late final ffi.Pointer - _NSURLUbiquitousItemDownloadingStatusCurrent = - _lookup( - 'NSURLUbiquitousItemDownloadingStatusCurrent'); - - NSURLUbiquitousItemDownloadingStatus - get NSURLUbiquitousItemDownloadingStatusCurrent => - _NSURLUbiquitousItemDownloadingStatusCurrent.value; - - set NSURLUbiquitousItemDownloadingStatusCurrent( - NSURLUbiquitousItemDownloadingStatus value) => - _NSURLUbiquitousItemDownloadingStatusCurrent.value = value; - - /// the current user is the owner of this shared item. - late final ffi.Pointer - _NSURLUbiquitousSharedItemRoleOwner = - _lookup( - 'NSURLUbiquitousSharedItemRoleOwner'); - - NSURLUbiquitousSharedItemRole get NSURLUbiquitousSharedItemRoleOwner => - _NSURLUbiquitousSharedItemRoleOwner.value; - - set NSURLUbiquitousSharedItemRoleOwner(NSURLUbiquitousSharedItemRole value) => - _NSURLUbiquitousSharedItemRoleOwner.value = value; - - /// the current user is a participant of this shared item. - late final ffi.Pointer - _NSURLUbiquitousSharedItemRoleParticipant = - _lookup( - 'NSURLUbiquitousSharedItemRoleParticipant'); - - NSURLUbiquitousSharedItemRole get NSURLUbiquitousSharedItemRoleParticipant => - _NSURLUbiquitousSharedItemRoleParticipant.value; - - set NSURLUbiquitousSharedItemRoleParticipant( - NSURLUbiquitousSharedItemRole value) => - _NSURLUbiquitousSharedItemRoleParticipant.value = value; - - /// the current user is only allowed to read this item - late final ffi.Pointer - _NSURLUbiquitousSharedItemPermissionsReadOnly = - _lookup( - 'NSURLUbiquitousSharedItemPermissionsReadOnly'); - - NSURLUbiquitousSharedItemPermissions - get NSURLUbiquitousSharedItemPermissionsReadOnly => - _NSURLUbiquitousSharedItemPermissionsReadOnly.value; - - set NSURLUbiquitousSharedItemPermissionsReadOnly( - NSURLUbiquitousSharedItemPermissions value) => - _NSURLUbiquitousSharedItemPermissionsReadOnly.value = value; - - /// the current user is allowed to both read and write this item - late final ffi.Pointer - _NSURLUbiquitousSharedItemPermissionsReadWrite = - _lookup( - 'NSURLUbiquitousSharedItemPermissionsReadWrite'); - - NSURLUbiquitousSharedItemPermissions - get NSURLUbiquitousSharedItemPermissionsReadWrite => - _NSURLUbiquitousSharedItemPermissionsReadWrite.value; - - set NSURLUbiquitousSharedItemPermissionsReadWrite( - NSURLUbiquitousSharedItemPermissions value) => - _NSURLUbiquitousSharedItemPermissionsReadWrite.value = value; - - late final _class_NSURLQueryItem1 = _getClass1("NSURLQueryItem"); - late final _sel_initWithName_value_1 = _registerName1("initWithName:value:"); - instancetype _objc_msgSend_519( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer name, - ffi.Pointer value, - ) { - return __objc_msgSend_519( - obj, - sel, - name, - value, - ); - } - - late final __objc_msgSend_519Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_519 = __objc_msgSend_519Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_queryItemWithName_value_1 = - _registerName1("queryItemWithName:value:"); - late final _sel_value1 = _registerName1("value"); - late final _class_NSURLComponents1 = _getClass1("NSURLComponents"); - late final _sel_initWithURL_resolvingAgainstBaseURL_1 = - _registerName1("initWithURL:resolvingAgainstBaseURL:"); - late final _sel_componentsWithURL_resolvingAgainstBaseURL_1 = - _registerName1("componentsWithURL:resolvingAgainstBaseURL:"); - late final _sel_componentsWithString_1 = - _registerName1("componentsWithString:"); - late final _sel_componentsWithString_encodingInvalidCharacters_1 = - _registerName1("componentsWithString:encodingInvalidCharacters:"); - late final _sel_URLRelativeToURL_1 = _registerName1("URLRelativeToURL:"); - ffi.Pointer _objc_msgSend_520( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer baseURL, - ) { - return __objc_msgSend_520( - obj, - sel, - baseURL, - ); - } - - late final __objc_msgSend_520Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_520 = __objc_msgSend_520Ptr.asFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_setScheme_1 = _registerName1("setScheme:"); - late final _sel_setUser_1 = _registerName1("setUser:"); - late final _sel_setPassword_1 = _registerName1("setPassword:"); - late final _sel_setHost_1 = _registerName1("setHost:"); - late final _sel_setPort_1 = _registerName1("setPort:"); - late final _sel_setPath_1 = _registerName1("setPath:"); - late final _sel_setQuery_1 = _registerName1("setQuery:"); - late final _sel_setFragment_1 = _registerName1("setFragment:"); - late final _sel_percentEncodedUser1 = _registerName1("percentEncodedUser"); - late final _sel_setPercentEncodedUser_1 = - _registerName1("setPercentEncodedUser:"); - late final _sel_percentEncodedPassword1 = - _registerName1("percentEncodedPassword"); - late final _sel_setPercentEncodedPassword_1 = - _registerName1("setPercentEncodedPassword:"); - late final _sel_percentEncodedHost1 = _registerName1("percentEncodedHost"); - late final _sel_setPercentEncodedHost_1 = - _registerName1("setPercentEncodedHost:"); - late final _sel_percentEncodedPath1 = _registerName1("percentEncodedPath"); - late final _sel_setPercentEncodedPath_1 = - _registerName1("setPercentEncodedPath:"); - late final _sel_percentEncodedQuery1 = _registerName1("percentEncodedQuery"); - late final _sel_setPercentEncodedQuery_1 = - _registerName1("setPercentEncodedQuery:"); - late final _sel_percentEncodedFragment1 = - _registerName1("percentEncodedFragment"); - late final _sel_setPercentEncodedFragment_1 = - _registerName1("setPercentEncodedFragment:"); - late final _sel_encodedHost1 = _registerName1("encodedHost"); - late final _sel_setEncodedHost_1 = _registerName1("setEncodedHost:"); - late final _sel_rangeOfScheme1 = _registerName1("rangeOfScheme"); - late final _sel_rangeOfUser1 = _registerName1("rangeOfUser"); - late final _sel_rangeOfPassword1 = _registerName1("rangeOfPassword"); - late final _sel_rangeOfHost1 = _registerName1("rangeOfHost"); - late final _sel_rangeOfPort1 = _registerName1("rangeOfPort"); - late final _sel_rangeOfPath1 = _registerName1("rangeOfPath"); - late final _sel_rangeOfQuery1 = _registerName1("rangeOfQuery"); - late final _sel_rangeOfFragment1 = _registerName1("rangeOfFragment"); - late final _sel_queryItems1 = _registerName1("queryItems"); - late final _sel_setQueryItems_1 = _registerName1("setQueryItems:"); - late final _sel_percentEncodedQueryItems1 = - _registerName1("percentEncodedQueryItems"); - late final _sel_setPercentEncodedQueryItems_1 = - _registerName1("setPercentEncodedQueryItems:"); - late final _class_NSFileSecurity1 = _getClass1("NSFileSecurity"); - late final _class_NSHTTPURLResponse1 = _getClass1("NSHTTPURLResponse"); - late final _sel_initWithURL_statusCode_HTTPVersion_headerFields_1 = - _registerName1("initWithURL:statusCode:HTTPVersion:headerFields:"); - instancetype _objc_msgSend_521( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer url, - int statusCode, - ffi.Pointer HTTPVersion, - ffi.Pointer headerFields, - ) { - return __objc_msgSend_521( - obj, - sel, - url, - statusCode, - HTTPVersion, - headerFields, - ); - } - - late final __objc_msgSend_521Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_521 = __objc_msgSend_521Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_statusCode1 = _registerName1("statusCode"); - late final _sel_allHeaderFields1 = _registerName1("allHeaderFields"); - late final _sel_localizedStringForStatusCode_1 = - _registerName1("localizedStringForStatusCode:"); - ffi.Pointer _objc_msgSend_522( - ffi.Pointer obj, - ffi.Pointer sel, - int statusCode, - ) { - return __objc_msgSend_522( - obj, - sel, - statusCode, - ); - } - - late final __objc_msgSend_522Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, NSInteger)>>('objc_msgSend'); - late final __objc_msgSend_522 = __objc_msgSend_522Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final ffi.Pointer _NSGenericException = - _lookup('NSGenericException'); - - NSExceptionName get NSGenericException => _NSGenericException.value; - - set NSGenericException(NSExceptionName value) => - _NSGenericException.value = value; - - late final ffi.Pointer _NSRangeException = - _lookup('NSRangeException'); - - NSExceptionName get NSRangeException => _NSRangeException.value; - - set NSRangeException(NSExceptionName value) => - _NSRangeException.value = value; - - late final ffi.Pointer _NSInvalidArgumentException = - _lookup('NSInvalidArgumentException'); - - NSExceptionName get NSInvalidArgumentException => - _NSInvalidArgumentException.value; - - set NSInvalidArgumentException(NSExceptionName value) => - _NSInvalidArgumentException.value = value; - - late final ffi.Pointer _NSInternalInconsistencyException = - _lookup('NSInternalInconsistencyException'); - - NSExceptionName get NSInternalInconsistencyException => - _NSInternalInconsistencyException.value; - - set NSInternalInconsistencyException(NSExceptionName value) => - _NSInternalInconsistencyException.value = value; - - late final ffi.Pointer _NSMallocException = - _lookup('NSMallocException'); - - NSExceptionName get NSMallocException => _NSMallocException.value; - - set NSMallocException(NSExceptionName value) => - _NSMallocException.value = value; - - late final ffi.Pointer _NSObjectInaccessibleException = - _lookup('NSObjectInaccessibleException'); - - NSExceptionName get NSObjectInaccessibleException => - _NSObjectInaccessibleException.value; - - set NSObjectInaccessibleException(NSExceptionName value) => - _NSObjectInaccessibleException.value = value; - - late final ffi.Pointer _NSObjectNotAvailableException = - _lookup('NSObjectNotAvailableException'); - - NSExceptionName get NSObjectNotAvailableException => - _NSObjectNotAvailableException.value; - - set NSObjectNotAvailableException(NSExceptionName value) => - _NSObjectNotAvailableException.value = value; - - late final ffi.Pointer _NSDestinationInvalidException = - _lookup('NSDestinationInvalidException'); - - NSExceptionName get NSDestinationInvalidException => - _NSDestinationInvalidException.value; - - set NSDestinationInvalidException(NSExceptionName value) => - _NSDestinationInvalidException.value = value; - - late final ffi.Pointer _NSPortTimeoutException = - _lookup('NSPortTimeoutException'); - - NSExceptionName get NSPortTimeoutException => _NSPortTimeoutException.value; - - set NSPortTimeoutException(NSExceptionName value) => - _NSPortTimeoutException.value = value; - - late final ffi.Pointer _NSInvalidSendPortException = - _lookup('NSInvalidSendPortException'); - - NSExceptionName get NSInvalidSendPortException => - _NSInvalidSendPortException.value; - - set NSInvalidSendPortException(NSExceptionName value) => - _NSInvalidSendPortException.value = value; - - late final ffi.Pointer _NSInvalidReceivePortException = - _lookup('NSInvalidReceivePortException'); - - NSExceptionName get NSInvalidReceivePortException => - _NSInvalidReceivePortException.value; - - set NSInvalidReceivePortException(NSExceptionName value) => - _NSInvalidReceivePortException.value = value; - - late final ffi.Pointer _NSPortSendException = - _lookup('NSPortSendException'); - - NSExceptionName get NSPortSendException => _NSPortSendException.value; - - set NSPortSendException(NSExceptionName value) => - _NSPortSendException.value = value; - - late final ffi.Pointer _NSPortReceiveException = - _lookup('NSPortReceiveException'); - - NSExceptionName get NSPortReceiveException => _NSPortReceiveException.value; - - set NSPortReceiveException(NSExceptionName value) => - _NSPortReceiveException.value = value; - - late final ffi.Pointer _NSOldStyleException = - _lookup('NSOldStyleException'); - - NSExceptionName get NSOldStyleException => _NSOldStyleException.value; - - set NSOldStyleException(NSExceptionName value) => - _NSOldStyleException.value = value; - - late final ffi.Pointer _NSInconsistentArchiveException = - _lookup('NSInconsistentArchiveException'); - - NSExceptionName get NSInconsistentArchiveException => - _NSInconsistentArchiveException.value; - - set NSInconsistentArchiveException(NSExceptionName value) => - _NSInconsistentArchiveException.value = value; - - late final _class_NSException1 = _getClass1("NSException"); - late final _sel_exceptionWithName_reason_userInfo_1 = - _registerName1("exceptionWithName:reason:userInfo:"); - ffi.Pointer _objc_msgSend_523( - ffi.Pointer obj, - ffi.Pointer sel, - NSExceptionName name, - ffi.Pointer reason, - ffi.Pointer userInfo, - ) { - return __objc_msgSend_523( - obj, - sel, - name, - reason, - userInfo, - ); - } - - late final __objc_msgSend_523Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSExceptionName, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_523 = __objc_msgSend_523Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - NSExceptionName, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithName_reason_userInfo_1 = - _registerName1("initWithName:reason:userInfo:"); - instancetype _objc_msgSend_524( - ffi.Pointer obj, - ffi.Pointer sel, - NSExceptionName aName, - ffi.Pointer aReason, - ffi.Pointer aUserInfo, - ) { - return __objc_msgSend_524( - obj, - sel, - aName, - aReason, - aUserInfo, - ); - } - - late final __objc_msgSend_524Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - NSExceptionName, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_524 = __objc_msgSend_524Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - NSExceptionName, ffi.Pointer, ffi.Pointer)>(); - - late final _sel_reason1 = _registerName1("reason"); - late final _sel_callStackReturnAddresses1 = - _registerName1("callStackReturnAddresses"); - late final _sel_callStackSymbols1 = _registerName1("callStackSymbols"); - 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_525( - ffi.Pointer obj, - ffi.Pointer sel, - NSExceptionName name, - ffi.Pointer format, - va_list argList, - ) { - return __objc_msgSend_525( - obj, - sel, - name, - format, - argList, - ); - } - - late final __objc_msgSend_525Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - NSExceptionName, - ffi.Pointer, - va_list)>>('objc_msgSend'); - late final __objc_msgSend_525 = __objc_msgSend_525Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - NSExceptionName, ffi.Pointer, va_list)>(); - - ffi.Pointer NSGetUncaughtExceptionHandler() { - return _NSGetUncaughtExceptionHandler(); - } - - late final _NSGetUncaughtExceptionHandlerPtr = _lookup< - ffi - .NativeFunction Function()>>( - 'NSGetUncaughtExceptionHandler'); - late final _NSGetUncaughtExceptionHandler = _NSGetUncaughtExceptionHandlerPtr - .asFunction Function()>(); - - void NSSetUncaughtExceptionHandler( - ffi.Pointer arg0, - ) { - return _NSSetUncaughtExceptionHandler( - arg0, - ); - } - - late final _NSSetUncaughtExceptionHandlerPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer)>>( - 'NSSetUncaughtExceptionHandler'); - late final _NSSetUncaughtExceptionHandler = _NSSetUncaughtExceptionHandlerPtr - .asFunction)>(); - - late final ffi.Pointer> _NSAssertionHandlerKey = - _lookup>('NSAssertionHandlerKey'); - - ffi.Pointer get NSAssertionHandlerKey => - _NSAssertionHandlerKey.value; - - set NSAssertionHandlerKey(ffi.Pointer value) => - _NSAssertionHandlerKey.value = value; - - late final _class_NSAssertionHandler1 = _getClass1("NSAssertionHandler"); - late final _sel_currentHandler1 = _registerName1("currentHandler"); - 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_handleFailureInMethod_object_file_lineNumber_description_1 = - _registerName1( - "handleFailureInMethod:object:file:lineNumber:description:"); - void _objc_msgSend_527( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer selector, - ffi.Pointer object, - ffi.Pointer fileName, - int line, - ffi.Pointer format, - ) { - return __objc_msgSend_527( - obj, - sel, - selector, - object, - fileName, - line, - format, - ); - } - - late final __objc_msgSend_527Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_527 = __objc_msgSend_527Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _sel_handleFailureInFunction_file_lineNumber_description_1 = - _registerName1("handleFailureInFunction:file:lineNumber:description:"); - void _objc_msgSend_528( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer functionName, - ffi.Pointer fileName, - int line, - ffi.Pointer format, - ) { - return __objc_msgSend_528( - obj, - sel, - functionName, - fileName, - line, - format, - ); - } - - late final __objc_msgSend_528Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - NSInteger, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_528 = __objc_msgSend_528Ptr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - late final _class_NSBlockOperation1 = _getClass1("NSBlockOperation"); - late final _sel_blockOperationWithBlock_1 = - _registerName1("blockOperationWithBlock:"); - instancetype _objc_msgSend_529( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer<_ObjCBlock> block, - ) { - return __objc_msgSend_529( - obj, - sel, - block, - ); - } - - late final __objc_msgSend_529Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>>('objc_msgSend'); - late final __objc_msgSend_529 = __objc_msgSend_529Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer<_ObjCBlock>)>(); - - late final _sel_addExecutionBlock_1 = _registerName1("addExecutionBlock:"); - late final _sel_executionBlocks1 = _registerName1("executionBlocks"); - late final _class_NSInvocationOperation1 = - _getClass1("NSInvocationOperation"); - late final _sel_initWithTarget_selector_object_1 = - _registerName1("initWithTarget:selector:object:"); - instancetype _objc_msgSend_530( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer target, - ffi.Pointer sel1, - ffi.Pointer arg, - ) { - return __objc_msgSend_530( - obj, - sel, - target, - sel1, - arg, - ); - } - - late final __objc_msgSend_530Ptr = _lookup< - ffi.NativeFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_530 = __objc_msgSend_530Ptr.asFunction< - instancetype Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_initWithInvocation_1 = _registerName1("initWithInvocation:"); - instancetype _objc_msgSend_531( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer inv, - ) { - return __objc_msgSend_531( - obj, - sel, - inv, - ); - } - - late final __objc_msgSend_531Ptr = _lookup< - ffi.NativeFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_531 = __objc_msgSend_531Ptr.asFunction< - instancetype Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_invocation1 = _registerName1("invocation"); - ffi.Pointer _objc_msgSend_532( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_532( - obj, - sel, - ); - } - - late final __objc_msgSend_532Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_532 = __objc_msgSend_532Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_result1 = _registerName1("result"); - late final ffi.Pointer - _NSInvocationOperationVoidResultException = - _lookup('NSInvocationOperationVoidResultException'); - - NSExceptionName get NSInvocationOperationVoidResultException => - _NSInvocationOperationVoidResultException.value; - - set NSInvocationOperationVoidResultException(NSExceptionName value) => - _NSInvocationOperationVoidResultException.value = value; - - late final ffi.Pointer - _NSInvocationOperationCancelledException = - _lookup('NSInvocationOperationCancelledException'); - - NSExceptionName get NSInvocationOperationCancelledException => - _NSInvocationOperationCancelledException.value; - - set NSInvocationOperationCancelledException(NSExceptionName value) => - _NSInvocationOperationCancelledException.value = value; - - late final ffi.Pointer - _NSOperationQueueDefaultMaxConcurrentOperationCount = - _lookup('NSOperationQueueDefaultMaxConcurrentOperationCount'); - - int get NSOperationQueueDefaultMaxConcurrentOperationCount => - _NSOperationQueueDefaultMaxConcurrentOperationCount.value; - - /// Predefined domain for errors from most AppKit and Foundation APIs. - late final ffi.Pointer _NSCocoaErrorDomain = - _lookup('NSCocoaErrorDomain'); - - NSErrorDomain get NSCocoaErrorDomain => _NSCocoaErrorDomain.value; - - set NSCocoaErrorDomain(NSErrorDomain value) => - _NSCocoaErrorDomain.value = value; - - /// Other predefined domains; value of "code" will correspond to preexisting values in these domains. - late final ffi.Pointer _NSPOSIXErrorDomain = - _lookup('NSPOSIXErrorDomain'); - - NSErrorDomain get NSPOSIXErrorDomain => _NSPOSIXErrorDomain.value; - - set NSPOSIXErrorDomain(NSErrorDomain value) => - _NSPOSIXErrorDomain.value = value; - - late final ffi.Pointer _NSOSStatusErrorDomain = - _lookup('NSOSStatusErrorDomain'); - - NSErrorDomain get NSOSStatusErrorDomain => _NSOSStatusErrorDomain.value; - - set NSOSStatusErrorDomain(NSErrorDomain value) => - _NSOSStatusErrorDomain.value = value; - - late final ffi.Pointer _NSMachErrorDomain = - _lookup('NSMachErrorDomain'); - - NSErrorDomain get NSMachErrorDomain => _NSMachErrorDomain.value; - - set NSMachErrorDomain(NSErrorDomain value) => - _NSMachErrorDomain.value = value; - - /// Key in userInfo. A recommended standard way to embed NSErrors from underlying calls. The value of this key should be an NSError. - late final ffi.Pointer _NSUnderlyingErrorKey = - _lookup('NSUnderlyingErrorKey'); - - NSErrorUserInfoKey get NSUnderlyingErrorKey => _NSUnderlyingErrorKey.value; - - set NSUnderlyingErrorKey(NSErrorUserInfoKey value) => - _NSUnderlyingErrorKey.value = value; - - /// Key in userInfo. A recommended standard way to embed a list of several NSErrors from underlying calls. The value of this key should be an NSArray of NSError. This value is independent from the value of `NSUnderlyingErrorKey` - neither, one, or both may be set. - late final ffi.Pointer _NSMultipleUnderlyingErrorsKey = - _lookup('NSMultipleUnderlyingErrorsKey'); - - NSErrorUserInfoKey get NSMultipleUnderlyingErrorsKey => - _NSMultipleUnderlyingErrorsKey.value; - - set NSMultipleUnderlyingErrorsKey(NSErrorUserInfoKey value) => - _NSMultipleUnderlyingErrorsKey.value = value; - - /// NSString, a complete sentence (or more) describing ideally both what failed and why it failed. - late final ffi.Pointer _NSLocalizedDescriptionKey = - _lookup('NSLocalizedDescriptionKey'); - - NSErrorUserInfoKey get NSLocalizedDescriptionKey => - _NSLocalizedDescriptionKey.value; - - set NSLocalizedDescriptionKey(NSErrorUserInfoKey value) => - _NSLocalizedDescriptionKey.value = value; - - /// NSString, a complete sentence (or more) describing why the operation failed. - late final ffi.Pointer _NSLocalizedFailureReasonErrorKey = - _lookup('NSLocalizedFailureReasonErrorKey'); - - NSErrorUserInfoKey get NSLocalizedFailureReasonErrorKey => - _NSLocalizedFailureReasonErrorKey.value; - - set NSLocalizedFailureReasonErrorKey(NSErrorUserInfoKey value) => - _NSLocalizedFailureReasonErrorKey.value = value; - - /// NSString, a complete sentence (or more) describing what the user can do to fix the problem. - late final ffi.Pointer - _NSLocalizedRecoverySuggestionErrorKey = - _lookup('NSLocalizedRecoverySuggestionErrorKey'); - - NSErrorUserInfoKey get NSLocalizedRecoverySuggestionErrorKey => - _NSLocalizedRecoverySuggestionErrorKey.value; - - set NSLocalizedRecoverySuggestionErrorKey(NSErrorUserInfoKey value) => - _NSLocalizedRecoverySuggestionErrorKey.value = value; - - /// NSArray of NSStrings corresponding to button titles. - late final ffi.Pointer - _NSLocalizedRecoveryOptionsErrorKey = - _lookup('NSLocalizedRecoveryOptionsErrorKey'); - - NSErrorUserInfoKey get NSLocalizedRecoveryOptionsErrorKey => - _NSLocalizedRecoveryOptionsErrorKey.value; - - set NSLocalizedRecoveryOptionsErrorKey(NSErrorUserInfoKey value) => - _NSLocalizedRecoveryOptionsErrorKey.value = value; - - /// Instance of a subclass of NSObject that conforms to the NSErrorRecoveryAttempting informal protocol - late final ffi.Pointer _NSRecoveryAttempterErrorKey = - _lookup('NSRecoveryAttempterErrorKey'); - - NSErrorUserInfoKey get NSRecoveryAttempterErrorKey => - _NSRecoveryAttempterErrorKey.value; - - set NSRecoveryAttempterErrorKey(NSErrorUserInfoKey value) => - _NSRecoveryAttempterErrorKey.value = value; - - /// NSString containing a help anchor - late final ffi.Pointer _NSHelpAnchorErrorKey = - _lookup('NSHelpAnchorErrorKey'); - - NSErrorUserInfoKey get NSHelpAnchorErrorKey => _NSHelpAnchorErrorKey.value; - - set NSHelpAnchorErrorKey(NSErrorUserInfoKey value) => - _NSHelpAnchorErrorKey.value = value; - - /// NSString. This provides a string which will be shown when constructing the debugDescription of the NSError, to be used when debugging or when formatting the error with %@. This string will never be used in localizedDescription, so will not be shown to the user. - late final ffi.Pointer _NSDebugDescriptionErrorKey = - _lookup('NSDebugDescriptionErrorKey'); - - NSErrorUserInfoKey get NSDebugDescriptionErrorKey => - _NSDebugDescriptionErrorKey.value; - - set NSDebugDescriptionErrorKey(NSErrorUserInfoKey value) => - _NSDebugDescriptionErrorKey.value = value; - - /// NSString, a complete sentence (or more) describing what failed. Setting a value for this key in userInfo dictionary of errors received from framework APIs is a good way to customize and fine tune the localizedDescription of an NSError. As an example, for Foundation error code NSFileWriteOutOfSpaceError, setting the value of this key to "The image library could not be saved." will allow the localizedDescription of the error to come out as "The image library could not be saved. The volume Macintosh HD is out of space." rather than the default (say) “You can't save the file ImgDatabaseV2 because the volume Macintosh HD is out of space." - late final ffi.Pointer _NSLocalizedFailureErrorKey = - _lookup('NSLocalizedFailureErrorKey'); - - NSErrorUserInfoKey get NSLocalizedFailureErrorKey => - _NSLocalizedFailureErrorKey.value; - - set NSLocalizedFailureErrorKey(NSErrorUserInfoKey value) => - _NSLocalizedFailureErrorKey.value = value; - - /// NSNumber containing NSStringEncoding - late final ffi.Pointer _NSStringEncodingErrorKey = - _lookup('NSStringEncodingErrorKey'); - - NSErrorUserInfoKey get NSStringEncodingErrorKey => - _NSStringEncodingErrorKey.value; - - set NSStringEncodingErrorKey(NSErrorUserInfoKey value) => - _NSStringEncodingErrorKey.value = value; - - /// NSURL - late final ffi.Pointer _NSURLErrorKey = - _lookup('NSURLErrorKey'); - - NSErrorUserInfoKey get NSURLErrorKey => _NSURLErrorKey.value; - - set NSURLErrorKey(NSErrorUserInfoKey value) => _NSURLErrorKey.value = value; - - /// NSString - late final ffi.Pointer _NSFilePathErrorKey = - _lookup('NSFilePathErrorKey'); - - NSErrorUserInfoKey get NSFilePathErrorKey => _NSFilePathErrorKey.value; - - set NSFilePathErrorKey(NSErrorUserInfoKey value) => - _NSFilePathErrorKey.value = value; - - /// Is this an error handle? - /// - /// Requires there to be a current isolate. - bool Dart_IsError( - Object handle, - ) { - return _Dart_IsError( - handle, - ); - } - - late final _Dart_IsErrorPtr = - _lookup>( - 'Dart_IsError'); - late final _Dart_IsError = - _Dart_IsErrorPtr.asFunction(); - - /// Is this an api error handle? - /// - /// Api error handles are produced when an api function is misused. - /// This happens when a Dart embedding api function is called with - /// invalid arguments or in an invalid context. - /// - /// Requires there to be a current isolate. - bool Dart_IsApiError( - Object handle, - ) { - return _Dart_IsApiError( - handle, - ); - } - - late final _Dart_IsApiErrorPtr = - _lookup>( - 'Dart_IsApiError'); - late final _Dart_IsApiError = - _Dart_IsApiErrorPtr.asFunction(); - - /// Is this an unhandled exception error handle? - /// - /// Unhandled exception error handles are produced when, during the - /// execution of Dart code, an exception is thrown but not caught. - /// This can occur in any function which triggers the execution of Dart - /// code. - /// - /// See Dart_ErrorGetException and Dart_ErrorGetStackTrace. - /// - /// Requires there to be a current isolate. - bool Dart_IsUnhandledExceptionError( - Object handle, - ) { - return _Dart_IsUnhandledExceptionError( - handle, - ); - } - - late final _Dart_IsUnhandledExceptionErrorPtr = - _lookup>( - 'Dart_IsUnhandledExceptionError'); - late final _Dart_IsUnhandledExceptionError = - _Dart_IsUnhandledExceptionErrorPtr.asFunction(); - - /// Is this a compilation error handle? - /// - /// Compilation error handles are produced when, during the execution - /// of Dart code, a compile-time error occurs. This can occur in any - /// function which triggers the execution of Dart code. - /// - /// Requires there to be a current isolate. - bool Dart_IsCompilationError( - Object handle, - ) { - return _Dart_IsCompilationError( - handle, - ); - } - - late final _Dart_IsCompilationErrorPtr = - _lookup>( - 'Dart_IsCompilationError'); - late final _Dart_IsCompilationError = - _Dart_IsCompilationErrorPtr.asFunction(); - - /// Is this a fatal error handle? - /// - /// Fatal error handles are produced when the system wants to shut down - /// the current isolate. - /// - /// Requires there to be a current isolate. - bool Dart_IsFatalError( - Object handle, - ) { - return _Dart_IsFatalError( - handle, - ); - } - - late final _Dart_IsFatalErrorPtr = - _lookup>( - 'Dart_IsFatalError'); - late final _Dart_IsFatalError = - _Dart_IsFatalErrorPtr.asFunction(); - - /// Gets the error message from an error handle. - /// - /// Requires there to be a current isolate. - /// - /// \return A C string containing an error message if the handle is - /// error. An empty C string ("") if the handle is valid. This C - /// String is scope allocated and is only valid until the next call - /// to Dart_ExitScope. - ffi.Pointer Dart_GetError( - Object handle, - ) { - return _Dart_GetError( - handle, - ); - } - - late final _Dart_GetErrorPtr = - _lookup Function(ffi.Handle)>>( - 'Dart_GetError'); - late final _Dart_GetError = - _Dart_GetErrorPtr.asFunction Function(Object)>(); - - /// Is this an error handle for an unhandled exception? - bool Dart_ErrorHasException( - Object handle, - ) { - return _Dart_ErrorHasException( - handle, - ); - } - - late final _Dart_ErrorHasExceptionPtr = - _lookup>( - 'Dart_ErrorHasException'); - late final _Dart_ErrorHasException = - _Dart_ErrorHasExceptionPtr.asFunction(); - - /// Gets the exception Object from an unhandled exception error handle. - Object Dart_ErrorGetException( - Object handle, - ) { - return _Dart_ErrorGetException( - handle, - ); - } - - late final _Dart_ErrorGetExceptionPtr = - _lookup>( - 'Dart_ErrorGetException'); - late final _Dart_ErrorGetException = - _Dart_ErrorGetExceptionPtr.asFunction(); - - /// Gets the stack trace Object from an unhandled exception error handle. - Object Dart_ErrorGetStackTrace( - Object handle, - ) { - return _Dart_ErrorGetStackTrace( - handle, - ); - } - - late final _Dart_ErrorGetStackTracePtr = - _lookup>( - 'Dart_ErrorGetStackTrace'); - late final _Dart_ErrorGetStackTrace = - _Dart_ErrorGetStackTracePtr.asFunction(); - - /// Produces an api error handle with the provided error message. - /// - /// Requires there to be a current isolate. - /// - /// \param error the error message. - Object Dart_NewApiError( - ffi.Pointer error, - ) { - return _Dart_NewApiError( - error, - ); - } - - late final _Dart_NewApiErrorPtr = - _lookup)>>( - 'Dart_NewApiError'); - late final _Dart_NewApiError = - _Dart_NewApiErrorPtr.asFunction)>(); - - Object Dart_NewCompilationError( - ffi.Pointer error, - ) { - return _Dart_NewCompilationError( - error, - ); - } - - late final _Dart_NewCompilationErrorPtr = - _lookup)>>( - 'Dart_NewCompilationError'); - late final _Dart_NewCompilationError = _Dart_NewCompilationErrorPtr - .asFunction)>(); - - /// Produces a new unhandled exception error handle. - /// - /// Requires there to be a current isolate. - /// - /// \param exception An instance of a Dart object to be thrown or - /// an ApiError or CompilationError handle. - /// When an ApiError or CompilationError handle is passed in - /// a string object of the error message is created and it becomes - /// the Dart object to be thrown. - Object Dart_NewUnhandledExceptionError( - Object exception, - ) { - return _Dart_NewUnhandledExceptionError( - exception, - ); - } - - late final _Dart_NewUnhandledExceptionErrorPtr = - _lookup>( - 'Dart_NewUnhandledExceptionError'); - late final _Dart_NewUnhandledExceptionError = - _Dart_NewUnhandledExceptionErrorPtr.asFunction(); - - /// Propagates an error. - /// - /// If the provided handle is an unhandled exception error, this - /// function will cause the unhandled exception to be rethrown. This - /// will proceed in the standard way, walking up Dart frames until an - /// appropriate 'catch' block is found, executing 'finally' blocks, - /// etc. - /// - /// If the error is not an unhandled exception error, we will unwind - /// the stack to the next C frame. Intervening Dart frames will be - /// discarded; specifically, 'finally' blocks will not execute. This - /// is the standard way that compilation errors (and the like) are - /// handled by the Dart runtime. - /// - /// In either case, when an error is propagated any current scopes - /// created by Dart_EnterScope will be exited. - /// - /// See the additional discussion under "Propagating Errors" at the - /// beginning of this file. - /// - /// \param An error handle (See Dart_IsError) - /// - /// \return On success, this function does not return. On failure, the - /// process is terminated. - void Dart_PropagateError( - Object handle, - ) { - return _Dart_PropagateError( - handle, - ); - } - - late final _Dart_PropagateErrorPtr = - _lookup>( - 'Dart_PropagateError'); - late final _Dart_PropagateError = - _Dart_PropagateErrorPtr.asFunction(); - - /// Converts an object to a string. - /// - /// May generate an unhandled exception error. - /// - /// \return The converted string if no error occurs during - /// the conversion. If an error does occur, an error handle is - /// returned. - Object Dart_ToString( - Object object, - ) { - return _Dart_ToString( - object, - ); - } - - late final _Dart_ToStringPtr = - _lookup>( - 'Dart_ToString'); - late final _Dart_ToString = - _Dart_ToStringPtr.asFunction(); - - /// Checks to see if two handles refer to identically equal objects. - /// - /// If both handles refer to instances, this is equivalent to using the top-level - /// function identical() from dart:core. Otherwise, returns whether the two - /// argument handles refer to the same object. - /// - /// \param obj1 An object to be compared. - /// \param obj2 An object to be compared. - /// - /// \return True if the objects are identically equal. False otherwise. - bool Dart_IdentityEquals( - Object obj1, - Object obj2, - ) { - return _Dart_IdentityEquals( - obj1, - obj2, - ); - } - - late final _Dart_IdentityEqualsPtr = - _lookup>( - 'Dart_IdentityEquals'); - late final _Dart_IdentityEquals = - _Dart_IdentityEqualsPtr.asFunction(); - - /// Allocates a handle in the current scope from a persistent handle. - Object Dart_HandleFromPersistent( - Object object, - ) { - return _Dart_HandleFromPersistent( - object, - ); - } - - late final _Dart_HandleFromPersistentPtr = - _lookup>( - 'Dart_HandleFromPersistent'); - late final _Dart_HandleFromPersistent = - _Dart_HandleFromPersistentPtr.asFunction(); - - /// Allocates a handle in the current scope from a weak persistent handle. - /// - /// This will be a handle to Dart_Null if the object has been garbage collected. - Object Dart_HandleFromWeakPersistent( - Dart_WeakPersistentHandle object, - ) { - return _Dart_HandleFromWeakPersistent( - object, - ); - } - - late final _Dart_HandleFromWeakPersistentPtr = _lookup< - ffi.NativeFunction>( - 'Dart_HandleFromWeakPersistent'); - late final _Dart_HandleFromWeakPersistent = _Dart_HandleFromWeakPersistentPtr - .asFunction(); - - /// Allocates a persistent handle for an object. - /// - /// This handle has the lifetime of the current isolate unless it is - /// explicitly deallocated by calling Dart_DeletePersistentHandle. - /// - /// Requires there to be a current isolate. - Object Dart_NewPersistentHandle( - Object object, - ) { - return _Dart_NewPersistentHandle( - object, - ); - } - - late final _Dart_NewPersistentHandlePtr = - _lookup>( - 'Dart_NewPersistentHandle'); - late final _Dart_NewPersistentHandle = - _Dart_NewPersistentHandlePtr.asFunction(); - - /// Assign value of local handle to a persistent handle. - /// - /// Requires there to be a current isolate. - /// - /// \param obj1 A persistent handle whose value needs to be set. - /// \param obj2 An object whose value needs to be set to the persistent handle. - /// - /// \return Success if the persistent handle was set - /// Otherwise, returns an error. - void Dart_SetPersistentHandle( - Object obj1, - Object obj2, - ) { - return _Dart_SetPersistentHandle( - obj1, - obj2, - ); - } - - late final _Dart_SetPersistentHandlePtr = - _lookup>( - 'Dart_SetPersistentHandle'); - late final _Dart_SetPersistentHandle = - _Dart_SetPersistentHandlePtr.asFunction(); - - /// Deallocates a persistent handle. - /// - /// Requires there to be a current isolate group. - void Dart_DeletePersistentHandle( - Object object, - ) { - return _Dart_DeletePersistentHandle( - object, - ); - } - - late final _Dart_DeletePersistentHandlePtr = - _lookup>( - 'Dart_DeletePersistentHandle'); - late final _Dart_DeletePersistentHandle = - _Dart_DeletePersistentHandlePtr.asFunction(); - - /// Allocates a weak persistent handle for an object. - /// - /// This handle has the lifetime of the current isolate. The handle can also be - /// explicitly deallocated by calling Dart_DeleteWeakPersistentHandle. - /// - /// If the object becomes unreachable the callback is invoked with the peer as - /// argument. The callback can be executed on any thread, will have a current - /// isolate group, but will not have a current isolate. The callback can only - /// call Dart_DeletePersistentHandle or Dart_DeleteWeakPersistentHandle. This - /// gives the embedder the ability to cleanup data associated with the object. - /// The handle will point to the Dart_Null object after the finalizer has been - /// run. It is illegal to call into the VM with any other Dart_* functions from - /// the callback. If the handle is deleted before the object becomes - /// unreachable, the callback is never invoked. - /// - /// Requires there to be a current isolate. - /// - /// \param object An object with identity. - /// \param peer A pointer to a native object or NULL. This value is - /// provided to callback when it is invoked. - /// \param external_allocation_size The number of externally allocated - /// bytes for peer. Used to inform the garbage collector. - /// \param callback A function pointer that will be invoked sometime - /// after the object is garbage collected, unless the handle has been deleted. - /// A valid callback needs to be specified it cannot be NULL. - /// - /// \return The weak persistent handle or NULL. NULL is returned in case of bad - /// parameters. - Dart_WeakPersistentHandle Dart_NewWeakPersistentHandle( - Object object, - ffi.Pointer peer, - int external_allocation_size, - Dart_HandleFinalizer callback, - ) { - return _Dart_NewWeakPersistentHandle( - object, - peer, - external_allocation_size, - callback, - ); - } - - late final _Dart_NewWeakPersistentHandlePtr = _lookup< - ffi.NativeFunction< - Dart_WeakPersistentHandle Function( - ffi.Handle, - ffi.Pointer, - ffi.IntPtr, - Dart_HandleFinalizer)>>('Dart_NewWeakPersistentHandle'); - late final _Dart_NewWeakPersistentHandle = - _Dart_NewWeakPersistentHandlePtr.asFunction< - Dart_WeakPersistentHandle Function( - Object, ffi.Pointer, int, Dart_HandleFinalizer)>(); - - /// Deletes the given weak persistent [object] handle. - /// - /// Requires there to be a current isolate group. - void Dart_DeleteWeakPersistentHandle( - Dart_WeakPersistentHandle object, - ) { - return _Dart_DeleteWeakPersistentHandle( - object, - ); - } - - late final _Dart_DeleteWeakPersistentHandlePtr = - _lookup>( - 'Dart_DeleteWeakPersistentHandle'); - late final _Dart_DeleteWeakPersistentHandle = - _Dart_DeleteWeakPersistentHandlePtr.asFunction< - void Function(Dart_WeakPersistentHandle)>(); - - /// Updates the external memory size for the given weak persistent handle. - /// - /// May trigger garbage collection. - void Dart_UpdateExternalSize( - Dart_WeakPersistentHandle object, - int external_allocation_size, - ) { - return _Dart_UpdateExternalSize( - object, - external_allocation_size, - ); - } - - late final _Dart_UpdateExternalSizePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(Dart_WeakPersistentHandle, - ffi.IntPtr)>>('Dart_UpdateExternalSize'); - late final _Dart_UpdateExternalSize = _Dart_UpdateExternalSizePtr.asFunction< - void Function(Dart_WeakPersistentHandle, int)>(); - - /// Allocates a finalizable handle for an object. - /// - /// This handle has the lifetime of the current isolate group unless the object - /// pointed to by the handle is garbage collected, in this case the VM - /// automatically deletes the handle after invoking the callback associated - /// with the handle. The handle can also be explicitly deallocated by - /// calling Dart_DeleteFinalizableHandle. - /// - /// If the object becomes unreachable the callback is invoked with the - /// the peer as argument. The callback can be executed on any thread, will have - /// an isolate group, but will not have a current isolate. The callback can only - /// call Dart_DeletePersistentHandle or Dart_DeleteWeakPersistentHandle. - /// This gives the embedder the ability to cleanup data associated with the - /// object and clear out any cached references to the handle. All references to - /// this handle after the callback will be invalid. It is illegal to call into - /// the VM with any other Dart_* functions from the callback. If the handle is - /// deleted before the object becomes unreachable, the callback is never - /// invoked. - /// - /// Requires there to be a current isolate. - /// - /// \param object An object with identity. - /// \param peer A pointer to a native object or NULL. This value is - /// provided to callback when it is invoked. - /// \param external_allocation_size The number of externally allocated - /// bytes for peer. Used to inform the garbage collector. - /// \param callback A function pointer that will be invoked sometime - /// after the object is garbage collected, unless the handle has been deleted. - /// A valid callback needs to be specified it cannot be NULL. - /// - /// \return The finalizable handle or NULL. NULL is returned in case of bad - /// parameters. - Dart_FinalizableHandle Dart_NewFinalizableHandle( - Object object, - ffi.Pointer peer, - int external_allocation_size, - Dart_HandleFinalizer callback, - ) { - return _Dart_NewFinalizableHandle( - object, - peer, - external_allocation_size, - callback, - ); - } - - late final _Dart_NewFinalizableHandlePtr = _lookup< - ffi.NativeFunction< - Dart_FinalizableHandle Function(ffi.Handle, ffi.Pointer, - ffi.IntPtr, Dart_HandleFinalizer)>>('Dart_NewFinalizableHandle'); - late final _Dart_NewFinalizableHandle = - _Dart_NewFinalizableHandlePtr.asFunction< - Dart_FinalizableHandle Function( - Object, ffi.Pointer, int, Dart_HandleFinalizer)>(); - - /// Deletes the given finalizable [object] handle. - /// - /// The caller has to provide the actual Dart object the handle was created from - /// to prove the object (and therefore the finalizable handle) is still alive. - /// - /// Requires there to be a current isolate. - void Dart_DeleteFinalizableHandle( - Dart_FinalizableHandle object, - Object strong_ref_to_object, - ) { - return _Dart_DeleteFinalizableHandle( - object, - strong_ref_to_object, - ); - } - - late final _Dart_DeleteFinalizableHandlePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(Dart_FinalizableHandle, - ffi.Handle)>>('Dart_DeleteFinalizableHandle'); - late final _Dart_DeleteFinalizableHandle = _Dart_DeleteFinalizableHandlePtr - .asFunction(); - - /// Updates the external memory size for the given finalizable handle. - /// - /// The caller has to provide the actual Dart object the handle was created from - /// to prove the object (and therefore the finalizable handle) is still alive. - /// - /// May trigger garbage collection. - void Dart_UpdateFinalizableExternalSize( - Dart_FinalizableHandle object, - Object strong_ref_to_object, - int external_allocation_size, - ) { - return _Dart_UpdateFinalizableExternalSize( - object, - strong_ref_to_object, - external_allocation_size, - ); - } - - late final _Dart_UpdateFinalizableExternalSizePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(Dart_FinalizableHandle, ffi.Handle, - ffi.IntPtr)>>('Dart_UpdateFinalizableExternalSize'); - late final _Dart_UpdateFinalizableExternalSize = - _Dart_UpdateFinalizableExternalSizePtr.asFunction< - void Function(Dart_FinalizableHandle, Object, int)>(); - - /// Gets the version string for the Dart VM. - /// - /// The version of the Dart VM can be accessed without initializing the VM. - /// - /// \return The version string for the embedded Dart VM. - ffi.Pointer Dart_VersionString() { - return _Dart_VersionString(); - } - - late final _Dart_VersionStringPtr = - _lookup Function()>>( - 'Dart_VersionString'); - late final _Dart_VersionString = - _Dart_VersionStringPtr.asFunction Function()>(); - - /// Initialize Dart_IsolateFlags with correct version and default values. - void Dart_IsolateFlagsInitialize( - ffi.Pointer flags, - ) { - return _Dart_IsolateFlagsInitialize( - flags, - ); - } - - late final _Dart_IsolateFlagsInitializePtr = _lookup< - ffi - .NativeFunction)>>( - 'Dart_IsolateFlagsInitialize'); - late final _Dart_IsolateFlagsInitialize = _Dart_IsolateFlagsInitializePtr - .asFunction)>(); - - /// Initializes the VM. - /// - /// \param params A struct containing initialization information. The version - /// field of the struct must be DART_INITIALIZE_PARAMS_CURRENT_VERSION. - /// - /// \return NULL if initialization is successful. Returns an error message - /// otherwise. The caller is responsible for freeing the error message. - ffi.Pointer Dart_Initialize( - ffi.Pointer params, - ) { - return _Dart_Initialize( - params, - ); - } - - late final _Dart_InitializePtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('Dart_Initialize'); - late final _Dart_Initialize = _Dart_InitializePtr.asFunction< - ffi.Pointer Function(ffi.Pointer)>(); - - /// Cleanup state in the VM before process termination. - /// - /// \return NULL if cleanup is successful. Returns an error message otherwise. - /// The caller is responsible for freeing the error message. - /// - /// NOTE: This function must not be called on a thread that was created by the VM - /// itself. - ffi.Pointer Dart_Cleanup() { - return _Dart_Cleanup(); - } - - late final _Dart_CleanupPtr = - _lookup Function()>>( - 'Dart_Cleanup'); - late final _Dart_Cleanup = - _Dart_CleanupPtr.asFunction Function()>(); - - /// Sets command line flags. Should be called before Dart_Initialize. - /// - /// \param argc The length of the arguments array. - /// \param argv An array of arguments. - /// - /// \return NULL if successful. Returns an error message otherwise. - /// The caller is responsible for freeing the error message. - /// - /// NOTE: This call does not store references to the passed in c-strings. - ffi.Pointer Dart_SetVMFlags( - int argc, - ffi.Pointer> argv, - ) { - return _Dart_SetVMFlags( - argc, - argv, - ); - } - - late final _Dart_SetVMFlagsPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, ffi.Pointer>)>>('Dart_SetVMFlags'); - late final _Dart_SetVMFlags = _Dart_SetVMFlagsPtr.asFunction< - ffi.Pointer Function( - int, ffi.Pointer>)>(); - - /// Returns true if the named VM flag is of boolean type, specified, and set to - /// true. - /// - /// \param flag_name The name of the flag without leading punctuation - /// (example: "enable_asserts"). - bool Dart_IsVMFlagSet( - ffi.Pointer flag_name, - ) { - return _Dart_IsVMFlagSet( - flag_name, - ); - } - - late final _Dart_IsVMFlagSetPtr = - _lookup)>>( - 'Dart_IsVMFlagSet'); - late final _Dart_IsVMFlagSet = - _Dart_IsVMFlagSetPtr.asFunction)>(); - - /// Creates a new isolate. The new isolate becomes the current isolate. - /// - /// A snapshot can be used to restore the VM quickly to a saved state - /// and is useful for fast startup. If snapshot data is provided, the - /// isolate will be started using that snapshot data. Requires a core snapshot or - /// an app snapshot created by Dart_CreateSnapshot or - /// Dart_CreatePrecompiledSnapshot* from a VM with the same version. - /// - /// Requires there to be no current isolate. - /// - /// \param script_uri The main source file or snapshot this isolate will load. - /// The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a child - /// isolate is created by Isolate.spawn. The embedder should use a URI that - /// allows it to load the same program into such a child isolate. - /// \param name A short name for the isolate to improve debugging messages. - /// Typically of the format 'foo.dart:main()'. - /// \param isolate_snapshot_data - /// \param isolate_snapshot_instructions Buffers containing a snapshot of the - /// isolate or NULL if no snapshot is provided. If provided, the buffers must - /// remain valid until the isolate shuts down. - /// \param flags Pointer to VM specific flags or NULL for default flags. - /// \param isolate_group_data Embedder group data. This data can be obtained - /// by calling Dart_IsolateGroupData and will be passed to the - /// Dart_IsolateShutdownCallback, Dart_IsolateCleanupCallback, and - /// Dart_IsolateGroupCleanupCallback. - /// \param isolate_data Embedder data. This data will be passed to - /// the Dart_IsolateGroupCreateCallback when new isolates are spawned from - /// this parent isolate. - /// \param error Returns NULL if creation is successful, an error message - /// otherwise. The caller is responsible for calling free() on the error - /// message. - /// - /// \return The new isolate on success, or NULL if isolate creation failed. - Dart_Isolate Dart_CreateIsolateGroup( - ffi.Pointer script_uri, - ffi.Pointer name, - ffi.Pointer isolate_snapshot_data, - ffi.Pointer isolate_snapshot_instructions, - ffi.Pointer flags, - ffi.Pointer isolate_group_data, - ffi.Pointer isolate_data, - ffi.Pointer> error, - ) { - return _Dart_CreateIsolateGroup( - script_uri, - name, - isolate_snapshot_data, - isolate_snapshot_instructions, - flags, - isolate_group_data, - isolate_data, - error, - ); - } - - late final _Dart_CreateIsolateGroupPtr = _lookup< - ffi.NativeFunction< - Dart_Isolate Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('Dart_CreateIsolateGroup'); - late final _Dart_CreateIsolateGroup = _Dart_CreateIsolateGroupPtr.asFunction< - Dart_Isolate Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - /// Creates a new isolate inside the isolate group of [group_member]. - /// - /// Requires there to be no current isolate. - /// - /// \param group_member An isolate from the same group into which the newly created - /// isolate should be born into. Other threads may not have entered / enter this - /// member isolate. - /// \param name A short name for the isolate for debugging purposes. - /// \param shutdown_callback A callback to be called when the isolate is being - /// shutdown (may be NULL). - /// \param cleanup_callback A callback to be called when the isolate is being - /// cleaned up (may be NULL). - /// \param isolate_data The embedder-specific data associated with this isolate. - /// \param error Set to NULL if creation is successful, set to an error - /// message otherwise. The caller is responsible for calling free() on the - /// error message. - /// - /// \return The newly created isolate on success, or NULL if isolate creation - /// failed. - /// - /// If successful, the newly created isolate will become the current isolate. - Dart_Isolate Dart_CreateIsolateInGroup( - Dart_Isolate group_member, - ffi.Pointer name, - Dart_IsolateShutdownCallback shutdown_callback, - Dart_IsolateCleanupCallback cleanup_callback, - ffi.Pointer child_isolate_data, - ffi.Pointer> error, - ) { - return _Dart_CreateIsolateInGroup( - group_member, - name, - shutdown_callback, - cleanup_callback, - child_isolate_data, - error, - ); - } - - late final _Dart_CreateIsolateInGroupPtr = _lookup< - ffi.NativeFunction< - Dart_Isolate Function( - Dart_Isolate, - ffi.Pointer, - Dart_IsolateShutdownCallback, - Dart_IsolateCleanupCallback, - ffi.Pointer, - ffi.Pointer>)>>( - 'Dart_CreateIsolateInGroup'); - late final _Dart_CreateIsolateInGroup = - _Dart_CreateIsolateInGroupPtr.asFunction< - Dart_Isolate Function( - Dart_Isolate, - ffi.Pointer, - Dart_IsolateShutdownCallback, - Dart_IsolateCleanupCallback, - ffi.Pointer, - ffi.Pointer>)>(); - - /// Creates a new isolate from a Dart Kernel file. The new isolate - /// becomes the current isolate. - /// - /// Requires there to be no current isolate. - /// - /// \param script_uri The main source file or snapshot this isolate will load. - /// The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a child - /// isolate is created by Isolate.spawn. The embedder should use a URI that - /// allows it to load the same program into such a child isolate. - /// \param name A short name for the isolate to improve debugging messages. - /// Typically of the format 'foo.dart:main()'. - /// \param kernel_buffer - /// \param kernel_buffer_size A buffer which contains a kernel/DIL program. Must - /// remain valid until isolate shutdown. - /// \param flags Pointer to VM specific flags or NULL for default flags. - /// \param isolate_group_data Embedder group data. This data can be obtained - /// by calling Dart_IsolateGroupData and will be passed to the - /// Dart_IsolateShutdownCallback, Dart_IsolateCleanupCallback, and - /// Dart_IsolateGroupCleanupCallback. - /// \param isolate_data Embedder data. This data will be passed to - /// the Dart_IsolateGroupCreateCallback when new isolates are spawned from - /// this parent isolate. - /// \param error Returns NULL if creation is successful, an error message - /// otherwise. The caller is responsible for calling free() on the error - /// message. - /// - /// \return The new isolate on success, or NULL if isolate creation failed. - Dart_Isolate Dart_CreateIsolateGroupFromKernel( - ffi.Pointer script_uri, - ffi.Pointer name, - ffi.Pointer kernel_buffer, - int kernel_buffer_size, - ffi.Pointer flags, - ffi.Pointer isolate_group_data, - ffi.Pointer isolate_data, - ffi.Pointer> error, - ) { - return _Dart_CreateIsolateGroupFromKernel( - script_uri, - name, - kernel_buffer, - kernel_buffer_size, - flags, - isolate_group_data, - isolate_data, - error, - ); - } - - late final _Dart_CreateIsolateGroupFromKernelPtr = _lookup< - ffi.NativeFunction< - Dart_Isolate Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.IntPtr, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>( - 'Dart_CreateIsolateGroupFromKernel'); - late final _Dart_CreateIsolateGroupFromKernel = - _Dart_CreateIsolateGroupFromKernelPtr.asFunction< - Dart_Isolate Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>(); - - /// Shuts down the current isolate. After this call, the current isolate is NULL. - /// Any current scopes created by Dart_EnterScope will be exited. Invokes the - /// shutdown callback and any callbacks of remaining weak persistent handles. - /// - /// Requires there to be a current isolate. - void Dart_ShutdownIsolate() { - return _Dart_ShutdownIsolate(); - } - - late final _Dart_ShutdownIsolatePtr = - _lookup>('Dart_ShutdownIsolate'); - late final _Dart_ShutdownIsolate = - _Dart_ShutdownIsolatePtr.asFunction(); - - /// Returns the current isolate. Will return NULL if there is no - /// current isolate. - Dart_Isolate Dart_CurrentIsolate() { - return _Dart_CurrentIsolate(); - } - - late final _Dart_CurrentIsolatePtr = - _lookup>( - 'Dart_CurrentIsolate'); - late final _Dart_CurrentIsolate = - _Dart_CurrentIsolatePtr.asFunction(); - - /// Returns the callback data associated with the current isolate. This - /// data was set when the isolate got created or initialized. - ffi.Pointer Dart_CurrentIsolateData() { - return _Dart_CurrentIsolateData(); - } - - late final _Dart_CurrentIsolateDataPtr = - _lookup Function()>>( - 'Dart_CurrentIsolateData'); - late final _Dart_CurrentIsolateData = _Dart_CurrentIsolateDataPtr.asFunction< - ffi.Pointer Function()>(); - - /// Returns the callback data associated with the given isolate. This - /// data was set when the isolate got created or initialized. - ffi.Pointer Dart_IsolateData( - Dart_Isolate isolate, - ) { - return _Dart_IsolateData( - isolate, - ); - } - - late final _Dart_IsolateDataPtr = - _lookup Function(Dart_Isolate)>>( - 'Dart_IsolateData'); - late final _Dart_IsolateData = _Dart_IsolateDataPtr.asFunction< - ffi.Pointer Function(Dart_Isolate)>(); - - /// Returns the current isolate group. Will return NULL if there is no - /// current isolate group. - Dart_IsolateGroup Dart_CurrentIsolateGroup() { - return _Dart_CurrentIsolateGroup(); - } - - late final _Dart_CurrentIsolateGroupPtr = - _lookup>( - 'Dart_CurrentIsolateGroup'); - late final _Dart_CurrentIsolateGroup = - _Dart_CurrentIsolateGroupPtr.asFunction(); - - /// Returns the callback data associated with the current isolate group. This - /// data was passed to the isolate group when it was created. - ffi.Pointer Dart_CurrentIsolateGroupData() { - return _Dart_CurrentIsolateGroupData(); - } - - late final _Dart_CurrentIsolateGroupDataPtr = - _lookup Function()>>( - 'Dart_CurrentIsolateGroupData'); - late final _Dart_CurrentIsolateGroupData = _Dart_CurrentIsolateGroupDataPtr - .asFunction Function()>(); - - /// Returns the callback data associated with the specified isolate group. This - /// data was passed to the isolate when it was created. - /// The embedder is responsible for ensuring the consistency of this data - /// with respect to the lifecycle of an isolate group. - ffi.Pointer Dart_IsolateGroupData( - Dart_Isolate isolate, - ) { - return _Dart_IsolateGroupData( - isolate, - ); - } - - late final _Dart_IsolateGroupDataPtr = - _lookup Function(Dart_Isolate)>>( - 'Dart_IsolateGroupData'); - late final _Dart_IsolateGroupData = _Dart_IsolateGroupDataPtr.asFunction< - ffi.Pointer Function(Dart_Isolate)>(); - - /// Returns the debugging name for the current isolate. - /// - /// This name is unique to each isolate and should only be used to make - /// debugging messages more comprehensible. - Object Dart_DebugName() { - return _Dart_DebugName(); - } - - late final _Dart_DebugNamePtr = - _lookup>('Dart_DebugName'); - late final _Dart_DebugName = - _Dart_DebugNamePtr.asFunction(); - - /// Returns the ID for an isolate which is used to query the service protocol. - /// - /// It is the responsibility of the caller to free the returned ID. - ffi.Pointer Dart_IsolateServiceId( - Dart_Isolate isolate, - ) { - return _Dart_IsolateServiceId( - isolate, - ); - } - - late final _Dart_IsolateServiceIdPtr = - _lookup Function(Dart_Isolate)>>( - 'Dart_IsolateServiceId'); - late final _Dart_IsolateServiceId = _Dart_IsolateServiceIdPtr.asFunction< - ffi.Pointer Function(Dart_Isolate)>(); - - /// Enters an isolate. After calling this function, - /// the current isolate will be set to the provided isolate. - /// - /// Requires there to be no current isolate. Multiple threads may not be in - /// the same isolate at once. - void Dart_EnterIsolate( - Dart_Isolate isolate, - ) { - return _Dart_EnterIsolate( - isolate, - ); - } - - late final _Dart_EnterIsolatePtr = - _lookup>( - 'Dart_EnterIsolate'); - late final _Dart_EnterIsolate = - _Dart_EnterIsolatePtr.asFunction(); - - /// Kills the given isolate. - /// - /// This function has the same effect as dart:isolate's - /// Isolate.kill(priority:immediate). - /// It can interrupt ordinary Dart code but not native code. If the isolate is - /// in the middle of a long running native function, the isolate will not be - /// killed until control returns to Dart. - /// - /// Does not require a current isolate. It is safe to kill the current isolate if - /// there is one. - void Dart_KillIsolate( - Dart_Isolate isolate, - ) { - return _Dart_KillIsolate( - isolate, - ); - } - - late final _Dart_KillIsolatePtr = - _lookup>( - 'Dart_KillIsolate'); - late final _Dart_KillIsolate = - _Dart_KillIsolatePtr.asFunction(); - - /// Notifies the VM that the embedder expects |size| bytes of memory have become - /// unreachable. The VM may use this hint to adjust the garbage collector's - /// growth policy. - /// - /// Multiple calls are interpreted as increasing, not replacing, the estimate of - /// unreachable memory. - /// - /// Requires there to be a current isolate. - void Dart_HintFreed( - int size, - ) { - return _Dart_HintFreed( - size, - ); - } - - late final _Dart_HintFreedPtr = - _lookup>( - 'Dart_HintFreed'); - late final _Dart_HintFreed = - _Dart_HintFreedPtr.asFunction(); - - /// Notifies the VM that the embedder expects to be idle until |deadline|. The VM - /// may use this time to perform garbage collection or other tasks to avoid - /// delays during execution of Dart code in the future. - /// - /// |deadline| is measured in microseconds against the system's monotonic time. - /// This clock can be accessed via Dart_TimelineGetMicros(). - /// - /// Requires there to be a current isolate. - void Dart_NotifyIdle( - int deadline, - ) { - return _Dart_NotifyIdle( - deadline, - ); - } - - late final _Dart_NotifyIdlePtr = - _lookup>( - 'Dart_NotifyIdle'); - late final _Dart_NotifyIdle = - _Dart_NotifyIdlePtr.asFunction(); - - /// Notifies the VM that the system is running low on memory. - /// - /// Does not require a current isolate. Only valid after calling Dart_Initialize. - void Dart_NotifyLowMemory() { - return _Dart_NotifyLowMemory(); - } - - late final _Dart_NotifyLowMemoryPtr = - _lookup>('Dart_NotifyLowMemory'); - late final _Dart_NotifyLowMemory = - _Dart_NotifyLowMemoryPtr.asFunction(); - - /// Starts the CPU sampling profiler. - void Dart_StartProfiling() { - return _Dart_StartProfiling(); - } - - late final _Dart_StartProfilingPtr = - _lookup>('Dart_StartProfiling'); - late final _Dart_StartProfiling = - _Dart_StartProfilingPtr.asFunction(); - - /// Stops the CPU sampling profiler. - /// - /// Note that some profile samples might still be taken after this fucntion - /// returns due to the asynchronous nature of the implementation on some - /// platforms. - void Dart_StopProfiling() { - return _Dart_StopProfiling(); - } - - late final _Dart_StopProfilingPtr = - _lookup>('Dart_StopProfiling'); - late final _Dart_StopProfiling = - _Dart_StopProfilingPtr.asFunction(); - - /// Notifies the VM that the current thread should not be profiled until a - /// matching call to Dart_ThreadEnableProfiling is made. - /// - /// NOTE: By default, if a thread has entered an isolate it will be profiled. - /// This function should be used when an embedder knows a thread is about - /// to make a blocking call and wants to avoid unnecessary interrupts by - /// the profiler. - void Dart_ThreadDisableProfiling() { - return _Dart_ThreadDisableProfiling(); - } - - late final _Dart_ThreadDisableProfilingPtr = - _lookup>( - 'Dart_ThreadDisableProfiling'); - late final _Dart_ThreadDisableProfiling = - _Dart_ThreadDisableProfilingPtr.asFunction(); - - /// Notifies the VM that the current thread should be profiled. - /// - /// NOTE: It is only legal to call this function *after* calling - /// Dart_ThreadDisableProfiling. - /// - /// NOTE: By default, if a thread has entered an isolate it will be profiled. - void Dart_ThreadEnableProfiling() { - return _Dart_ThreadEnableProfiling(); - } - - late final _Dart_ThreadEnableProfilingPtr = - _lookup>( - 'Dart_ThreadEnableProfiling'); - late final _Dart_ThreadEnableProfiling = - _Dart_ThreadEnableProfilingPtr.asFunction(); - - /// Register symbol information for the Dart VM's profiler and crash dumps. - /// - /// This consumes the output of //topaz/runtime/dart/profiler_symbols, which - /// should be treated as opaque. - void Dart_AddSymbols( - ffi.Pointer dso_name, - ffi.Pointer buffer, - int buffer_size, - ) { - return _Dart_AddSymbols( - dso_name, - buffer, - buffer_size, - ); - } - - late final _Dart_AddSymbolsPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.IntPtr)>>('Dart_AddSymbols'); - late final _Dart_AddSymbols = _Dart_AddSymbolsPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - /// Exits an isolate. After this call, Dart_CurrentIsolate will - /// return NULL. - /// - /// Requires there to be a current isolate. - void Dart_ExitIsolate() { - return _Dart_ExitIsolate(); - } - - late final _Dart_ExitIsolatePtr = - _lookup>('Dart_ExitIsolate'); - late final _Dart_ExitIsolate = - _Dart_ExitIsolatePtr.asFunction(); - - /// Creates a full snapshot of the current isolate heap. - /// - /// A full snapshot is a compact representation of the dart vm isolate heap - /// and dart isolate heap states. These snapshots are used to initialize - /// the vm isolate on startup and fast initialization of an isolate. - /// A Snapshot of the heap is created before any dart code has executed. - /// - /// Requires there to be a current isolate. Not available in the precompiled - /// runtime (check Dart_IsPrecompiledRuntime). - /// - /// \param buffer Returns a pointer to a buffer containing the - /// snapshot. This buffer is scope allocated and is only valid - /// until the next call to Dart_ExitScope. - /// \param size Returns the size of the buffer. - /// \param is_core Create a snapshot containing core libraries. - /// Such snapshot should be agnostic to null safety mode. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_CreateSnapshot( - ffi.Pointer> vm_snapshot_data_buffer, - ffi.Pointer vm_snapshot_data_size, - ffi.Pointer> isolate_snapshot_data_buffer, - ffi.Pointer isolate_snapshot_data_size, - bool is_core, - ) { - return _Dart_CreateSnapshot( - vm_snapshot_data_buffer, - vm_snapshot_data_size, - isolate_snapshot_data_buffer, - isolate_snapshot_data_size, - is_core, - ); - } - - late final _Dart_CreateSnapshotPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Bool)>>('Dart_CreateSnapshot'); - late final _Dart_CreateSnapshot = _Dart_CreateSnapshotPtr.asFunction< - Object Function( - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - bool)>(); - - /// Returns whether the buffer contains a kernel file. - /// - /// \param buffer Pointer to a buffer that might contain a kernel binary. - /// \param buffer_size Size of the buffer. - /// - /// \return Whether the buffer contains a kernel binary (full or partial). - bool Dart_IsKernel( - ffi.Pointer buffer, - int buffer_size, - ) { - return _Dart_IsKernel( - buffer, - buffer_size, - ); - } - - late final _Dart_IsKernelPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, ffi.IntPtr)>>('Dart_IsKernel'); - late final _Dart_IsKernel = _Dart_IsKernelPtr.asFunction< - bool Function(ffi.Pointer, int)>(); - - /// Make isolate runnable. - /// - /// When isolates are spawned, this function is used to indicate that - /// the creation and initialization (including script loading) of the - /// isolate is complete and the isolate can start. - /// This function expects there to be no current isolate. - /// - /// \param isolate The isolate to be made runnable. - /// - /// \return NULL if successful. Returns an error message otherwise. The caller - /// is responsible for freeing the error message. - ffi.Pointer Dart_IsolateMakeRunnable( - Dart_Isolate isolate, - ) { - return _Dart_IsolateMakeRunnable( - isolate, - ); - } - - late final _Dart_IsolateMakeRunnablePtr = - _lookup Function(Dart_Isolate)>>( - 'Dart_IsolateMakeRunnable'); - late final _Dart_IsolateMakeRunnable = _Dart_IsolateMakeRunnablePtr - .asFunction Function(Dart_Isolate)>(); - - /// Allows embedders to provide an alternative wakeup mechanism for the - /// delivery of inter-isolate messages. This setting only applies to - /// the current isolate. - /// - /// Most embedders will only call this function once, before isolate - /// execution begins. If this function is called after isolate - /// execution begins, the embedder is responsible for threading issues. - void Dart_SetMessageNotifyCallback( - Dart_MessageNotifyCallback message_notify_callback, - ) { - return _Dart_SetMessageNotifyCallback( - message_notify_callback, - ); - } - - late final _Dart_SetMessageNotifyCallbackPtr = _lookup< - ffi.NativeFunction>( - 'Dart_SetMessageNotifyCallback'); - late final _Dart_SetMessageNotifyCallback = _Dart_SetMessageNotifyCallbackPtr - .asFunction(); - - /// Query the current message notify callback for the isolate. - /// - /// \return The current message notify callback for the isolate. - Dart_MessageNotifyCallback Dart_GetMessageNotifyCallback() { - return _Dart_GetMessageNotifyCallback(); - } - - late final _Dart_GetMessageNotifyCallbackPtr = - _lookup>( - 'Dart_GetMessageNotifyCallback'); - late final _Dart_GetMessageNotifyCallback = _Dart_GetMessageNotifyCallbackPtr - .asFunction(); - - /// If the VM flag `--pause-isolates-on-start` was passed this will be true. - /// - /// \return A boolean value indicating if pause on start was requested. - bool Dart_ShouldPauseOnStart() { - return _Dart_ShouldPauseOnStart(); - } - - late final _Dart_ShouldPauseOnStartPtr = - _lookup>( - 'Dart_ShouldPauseOnStart'); - late final _Dart_ShouldPauseOnStart = - _Dart_ShouldPauseOnStartPtr.asFunction(); - - /// Override the VM flag `--pause-isolates-on-start` for the current isolate. - /// - /// \param should_pause Should the isolate be paused on start? - /// - /// NOTE: This must be called before Dart_IsolateMakeRunnable. - void Dart_SetShouldPauseOnStart( - bool should_pause, - ) { - return _Dart_SetShouldPauseOnStart( - should_pause, - ); - } - - late final _Dart_SetShouldPauseOnStartPtr = - _lookup>( - 'Dart_SetShouldPauseOnStart'); - late final _Dart_SetShouldPauseOnStart = - _Dart_SetShouldPauseOnStartPtr.asFunction(); - - /// Is the current isolate paused on start? - /// - /// \return A boolean value indicating if the isolate is paused on start. - bool Dart_IsPausedOnStart() { - return _Dart_IsPausedOnStart(); - } - - late final _Dart_IsPausedOnStartPtr = - _lookup>('Dart_IsPausedOnStart'); - late final _Dart_IsPausedOnStart = - _Dart_IsPausedOnStartPtr.asFunction(); - - /// Called when the embedder has paused the current isolate on start and when - /// the embedder has resumed the isolate. - /// - /// \param paused Is the isolate paused on start? - void Dart_SetPausedOnStart( - bool paused, - ) { - return _Dart_SetPausedOnStart( - paused, - ); - } - - late final _Dart_SetPausedOnStartPtr = - _lookup>( - 'Dart_SetPausedOnStart'); - late final _Dart_SetPausedOnStart = - _Dart_SetPausedOnStartPtr.asFunction(); - - /// If the VM flag `--pause-isolates-on-exit` was passed this will be true. - /// - /// \return A boolean value indicating if pause on exit was requested. - bool Dart_ShouldPauseOnExit() { - return _Dart_ShouldPauseOnExit(); - } - - late final _Dart_ShouldPauseOnExitPtr = - _lookup>( - 'Dart_ShouldPauseOnExit'); - late final _Dart_ShouldPauseOnExit = - _Dart_ShouldPauseOnExitPtr.asFunction(); - - /// Override the VM flag `--pause-isolates-on-exit` for the current isolate. - /// - /// \param should_pause Should the isolate be paused on exit? - void Dart_SetShouldPauseOnExit( - bool should_pause, - ) { - return _Dart_SetShouldPauseOnExit( - should_pause, - ); - } - - late final _Dart_SetShouldPauseOnExitPtr = - _lookup>( - 'Dart_SetShouldPauseOnExit'); - late final _Dart_SetShouldPauseOnExit = - _Dart_SetShouldPauseOnExitPtr.asFunction(); - - /// Is the current isolate paused on exit? - /// - /// \return A boolean value indicating if the isolate is paused on exit. - bool Dart_IsPausedOnExit() { - return _Dart_IsPausedOnExit(); - } - - late final _Dart_IsPausedOnExitPtr = - _lookup>('Dart_IsPausedOnExit'); - late final _Dart_IsPausedOnExit = - _Dart_IsPausedOnExitPtr.asFunction(); - - /// Called when the embedder has paused the current isolate on exit and when - /// the embedder has resumed the isolate. - /// - /// \param paused Is the isolate paused on exit? - void Dart_SetPausedOnExit( - bool paused, - ) { - return _Dart_SetPausedOnExit( - paused, - ); - } - - late final _Dart_SetPausedOnExitPtr = - _lookup>( - 'Dart_SetPausedOnExit'); - late final _Dart_SetPausedOnExit = - _Dart_SetPausedOnExitPtr.asFunction(); - - /// Called when the embedder has caught a top level unhandled exception error - /// in the current isolate. - /// - /// NOTE: It is illegal to call this twice on the same isolate without first - /// clearing the sticky error to null. - /// - /// \param error The unhandled exception error. - void Dart_SetStickyError( - Object error, - ) { - return _Dart_SetStickyError( - error, - ); - } - - late final _Dart_SetStickyErrorPtr = - _lookup>( - 'Dart_SetStickyError'); - late final _Dart_SetStickyError = - _Dart_SetStickyErrorPtr.asFunction(); - - /// Does the current isolate have a sticky error? - bool Dart_HasStickyError() { - return _Dart_HasStickyError(); - } - - late final _Dart_HasStickyErrorPtr = - _lookup>('Dart_HasStickyError'); - late final _Dart_HasStickyError = - _Dart_HasStickyErrorPtr.asFunction(); - - /// Gets the sticky error for the current isolate. - /// - /// \return A handle to the sticky error object or null. - Object Dart_GetStickyError() { - return _Dart_GetStickyError(); - } - - late final _Dart_GetStickyErrorPtr = - _lookup>('Dart_GetStickyError'); - late final _Dart_GetStickyError = - _Dart_GetStickyErrorPtr.asFunction(); - - /// Handles the next pending message for the current isolate. - /// - /// May generate an unhandled exception error. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_HandleMessage() { - return _Dart_HandleMessage(); - } - - late final _Dart_HandleMessagePtr = - _lookup>('Dart_HandleMessage'); - late final _Dart_HandleMessage = - _Dart_HandleMessagePtr.asFunction(); - - /// Drains the microtask queue, then blocks the calling thread until the current - /// isolate recieves a message, then handles all messages. - /// - /// \param timeout_millis When non-zero, the call returns after the indicated - /// number of milliseconds even if no message was received. - /// \return A valid handle if no error occurs, otherwise an error handle. - Object Dart_WaitForEvent( - int timeout_millis, - ) { - return _Dart_WaitForEvent( - timeout_millis, - ); - } - - late final _Dart_WaitForEventPtr = - _lookup>( - 'Dart_WaitForEvent'); - late final _Dart_WaitForEvent = - _Dart_WaitForEventPtr.asFunction(); - - /// Handles any pending messages for the vm service for the current - /// isolate. - /// - /// This function may be used by an embedder at a breakpoint to avoid - /// pausing the vm service. - /// - /// This function can indirectly cause the message notify callback to - /// be called. - /// - /// \return true if the vm service requests the program resume - /// execution, false otherwise - bool Dart_HandleServiceMessages() { - return _Dart_HandleServiceMessages(); - } - - late final _Dart_HandleServiceMessagesPtr = - _lookup>( - 'Dart_HandleServiceMessages'); - late final _Dart_HandleServiceMessages = - _Dart_HandleServiceMessagesPtr.asFunction(); - - /// Does the current isolate have pending service messages? - /// - /// \return true if the isolate has pending service messages, false otherwise. - bool Dart_HasServiceMessages() { - return _Dart_HasServiceMessages(); - } - - late final _Dart_HasServiceMessagesPtr = - _lookup>( - 'Dart_HasServiceMessages'); - late final _Dart_HasServiceMessages = - _Dart_HasServiceMessagesPtr.asFunction(); - - /// Processes any incoming messages for the current isolate. - /// - /// This function may only be used when the embedder has not provided - /// an alternate message delivery mechanism with - /// Dart_SetMessageCallbacks. It is provided for convenience. - /// - /// This function waits for incoming messages for the current - /// isolate. As new messages arrive, they are handled using - /// Dart_HandleMessage. The routine exits when all ports to the - /// current isolate are closed. - /// - /// \return A valid handle if the run loop exited successfully. If an - /// exception or other error occurs while processing messages, an - /// error handle is returned. - Object Dart_RunLoop() { - return _Dart_RunLoop(); - } - - late final _Dart_RunLoopPtr = - _lookup>('Dart_RunLoop'); - late final _Dart_RunLoop = _Dart_RunLoopPtr.asFunction(); - - /// Lets the VM run message processing for the isolate. - /// - /// This function expects there to a current isolate and the current isolate - /// must not have an active api scope. The VM will take care of making the - /// isolate runnable (if not already), handles its message loop and will take - /// care of shutting the isolate down once it's done. - /// - /// \param errors_are_fatal Whether uncaught errors should be fatal. - /// \param on_error_port A port to notify on uncaught errors (or ILLEGAL_PORT). - /// \param on_exit_port A port to notify on exit (or ILLEGAL_PORT). - /// \param error A non-NULL pointer which will hold an error message if the call - /// fails. The error has to be free()ed by the caller. - /// - /// \return If successfull the VM takes owernship of the isolate and takes care - /// of its message loop. If not successful the caller retains owernship of the - /// isolate. - bool Dart_RunLoopAsync( - bool errors_are_fatal, - int on_error_port, - int on_exit_port, - ffi.Pointer> error, - ) { - return _Dart_RunLoopAsync( - errors_are_fatal, - on_error_port, - on_exit_port, - error, - ); - } - - late final _Dart_RunLoopAsyncPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function(ffi.Bool, Dart_Port, Dart_Port, - ffi.Pointer>)>>('Dart_RunLoopAsync'); - late final _Dart_RunLoopAsync = _Dart_RunLoopAsyncPtr.asFunction< - bool Function(bool, int, int, ffi.Pointer>)>(); - - /// Gets the main port id for the current isolate. - int Dart_GetMainPortId() { - return _Dart_GetMainPortId(); - } - - late final _Dart_GetMainPortIdPtr = - _lookup>('Dart_GetMainPortId'); - late final _Dart_GetMainPortId = - _Dart_GetMainPortIdPtr.asFunction(); - - /// Does the current isolate have live ReceivePorts? - /// - /// A ReceivePort is live when it has not been closed. - bool Dart_HasLivePorts() { - return _Dart_HasLivePorts(); - } - - late final _Dart_HasLivePortsPtr = - _lookup>('Dart_HasLivePorts'); - late final _Dart_HasLivePorts = - _Dart_HasLivePortsPtr.asFunction(); - - /// Posts a message for some isolate. The message is a serialized - /// object. - /// - /// Requires there to be a current isolate. - /// - /// \param port The destination port. - /// \param object An object from the current isolate. - /// - /// \return True if the message was posted. - bool Dart_Post( - int port_id, - Object object, - ) { - return _Dart_Post( - port_id, - object, - ); - } - - late final _Dart_PostPtr = - _lookup>( - 'Dart_Post'); - late final _Dart_Post = - _Dart_PostPtr.asFunction(); - - /// Returns a new SendPort with the provided port id. - /// - /// \param port_id The destination port. - /// - /// \return A new SendPort if no errors occurs. Otherwise returns - /// an error handle. - Object Dart_NewSendPort( - int port_id, - ) { - return _Dart_NewSendPort( - port_id, - ); - } - - late final _Dart_NewSendPortPtr = - _lookup>( - 'Dart_NewSendPort'); - late final _Dart_NewSendPort = - _Dart_NewSendPortPtr.asFunction(); - - /// Gets the SendPort id for the provided SendPort. - /// \param port A SendPort object whose id is desired. - /// \param port_id Returns the id of the SendPort. - /// \return Success if no error occurs. Otherwise returns - /// an error handle. - Object Dart_SendPortGetId( - Object port, - ffi.Pointer port_id, - ) { - return _Dart_SendPortGetId( - port, - port_id, - ); - } - - late final _Dart_SendPortGetIdPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_SendPortGetId'); - late final _Dart_SendPortGetId = _Dart_SendPortGetIdPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Enters a new scope. - /// - /// All new local handles will be created in this scope. Additionally, - /// some functions may return "scope allocated" memory which is only - /// valid within this scope. - /// - /// Requires there to be a current isolate. - void Dart_EnterScope() { - return _Dart_EnterScope(); - } - - late final _Dart_EnterScopePtr = - _lookup>('Dart_EnterScope'); - late final _Dart_EnterScope = - _Dart_EnterScopePtr.asFunction(); - - /// Exits a scope. - /// - /// The previous scope (if any) becomes the current scope. - /// - /// Requires there to be a current isolate. - void Dart_ExitScope() { - return _Dart_ExitScope(); - } - - late final _Dart_ExitScopePtr = - _lookup>('Dart_ExitScope'); - late final _Dart_ExitScope = _Dart_ExitScopePtr.asFunction(); - - /// The Dart VM uses "zone allocation" for temporary structures. Zones - /// support very fast allocation of small chunks of memory. The chunks - /// cannot be deallocated individually, but instead zones support - /// deallocating all chunks in one fast operation. - /// - /// This function makes it possible for the embedder to allocate - /// temporary data in the VMs zone allocator. - /// - /// Zone allocation is possible: - /// 1. when inside a scope where local handles can be allocated - /// 2. when processing a message from a native port in a native port - /// handler - /// - /// All the memory allocated this way will be reclaimed either on the - /// next call to Dart_ExitScope or when the native port handler exits. - /// - /// \param size Size of the memory to allocate. - /// - /// \return A pointer to the allocated memory. NULL if allocation - /// failed. Failure might due to is no current VM zone. - ffi.Pointer Dart_ScopeAllocate( - int size, - ) { - return _Dart_ScopeAllocate( - size, - ); - } - - late final _Dart_ScopeAllocatePtr = - _lookup Function(ffi.IntPtr)>>( - 'Dart_ScopeAllocate'); - late final _Dart_ScopeAllocate = - _Dart_ScopeAllocatePtr.asFunction Function(int)>(); - - /// Returns the null object. - /// - /// \return A handle to the null object. - Object Dart_Null() { - return _Dart_Null(); - } - - late final _Dart_NullPtr = - _lookup>('Dart_Null'); - late final _Dart_Null = _Dart_NullPtr.asFunction(); - - /// Is this object null? - bool Dart_IsNull( - Object object, - ) { - return _Dart_IsNull( - object, - ); - } - - late final _Dart_IsNullPtr = - _lookup>('Dart_IsNull'); - late final _Dart_IsNull = _Dart_IsNullPtr.asFunction(); - - /// Returns the empty string object. - /// - /// \return A handle to the empty string object. - Object Dart_EmptyString() { - return _Dart_EmptyString(); - } - - late final _Dart_EmptyStringPtr = - _lookup>('Dart_EmptyString'); - late final _Dart_EmptyString = - _Dart_EmptyStringPtr.asFunction(); - - /// Returns types that are not classes, and which therefore cannot be looked up - /// as library members by Dart_GetType. - /// - /// \return A handle to the dynamic, void or Never type. - Object Dart_TypeDynamic() { - return _Dart_TypeDynamic(); - } - - late final _Dart_TypeDynamicPtr = - _lookup>('Dart_TypeDynamic'); - late final _Dart_TypeDynamic = - _Dart_TypeDynamicPtr.asFunction(); - - Object Dart_TypeVoid() { - return _Dart_TypeVoid(); - } - - late final _Dart_TypeVoidPtr = - _lookup>('Dart_TypeVoid'); - late final _Dart_TypeVoid = _Dart_TypeVoidPtr.asFunction(); - - Object Dart_TypeNever() { - return _Dart_TypeNever(); - } - - late final _Dart_TypeNeverPtr = - _lookup>('Dart_TypeNever'); - late final _Dart_TypeNever = - _Dart_TypeNeverPtr.asFunction(); - - /// Checks if the two objects are equal. - /// - /// The result of the comparison is returned through the 'equal' - /// parameter. The return value itself is used to indicate success or - /// failure, not equality. - /// - /// May generate an unhandled exception error. - /// - /// \param obj1 An object to be compared. - /// \param obj2 An object to be compared. - /// \param equal Returns the result of the equality comparison. - /// - /// \return A valid handle if no error occurs during the comparison. - Object Dart_ObjectEquals( - Object obj1, - Object obj2, - ffi.Pointer equal, - ) { - return _Dart_ObjectEquals( - obj1, - obj2, - equal, - ); - } - - late final _Dart_ObjectEqualsPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, - ffi.Pointer)>>('Dart_ObjectEquals'); - late final _Dart_ObjectEquals = _Dart_ObjectEqualsPtr.asFunction< - Object Function(Object, Object, ffi.Pointer)>(); - - /// Is this object an instance of some type? - /// - /// The result of the test is returned through the 'instanceof' parameter. - /// The return value itself is used to indicate success or failure. - /// - /// \param object An object. - /// \param type A type. - /// \param instanceof Return true if 'object' is an instance of type 'type'. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_ObjectIsType( - Object object, - Object type, - ffi.Pointer instanceof, - ) { - return _Dart_ObjectIsType( - object, - type, - instanceof, - ); - } - - late final _Dart_ObjectIsTypePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, - ffi.Pointer)>>('Dart_ObjectIsType'); - late final _Dart_ObjectIsType = _Dart_ObjectIsTypePtr.asFunction< - Object Function(Object, Object, ffi.Pointer)>(); - - /// Query object type. - /// - /// \param object Some Object. - /// - /// \return true if Object is of the specified type. - bool Dart_IsInstance( - Object object, - ) { - return _Dart_IsInstance( - object, - ); - } - - late final _Dart_IsInstancePtr = - _lookup>( - 'Dart_IsInstance'); - late final _Dart_IsInstance = - _Dart_IsInstancePtr.asFunction(); - - bool Dart_IsNumber( - Object object, - ) { - return _Dart_IsNumber( - object, - ); - } - - late final _Dart_IsNumberPtr = - _lookup>( - 'Dart_IsNumber'); - late final _Dart_IsNumber = - _Dart_IsNumberPtr.asFunction(); - - bool Dart_IsInteger( - Object object, - ) { - return _Dart_IsInteger( - object, - ); - } - - late final _Dart_IsIntegerPtr = - _lookup>( - 'Dart_IsInteger'); - late final _Dart_IsInteger = - _Dart_IsIntegerPtr.asFunction(); - - bool Dart_IsDouble( - Object object, - ) { - return _Dart_IsDouble( - object, - ); - } - - late final _Dart_IsDoublePtr = - _lookup>( - 'Dart_IsDouble'); - late final _Dart_IsDouble = - _Dart_IsDoublePtr.asFunction(); - - bool Dart_IsBoolean( - Object object, - ) { - return _Dart_IsBoolean( - object, - ); - } - - late final _Dart_IsBooleanPtr = - _lookup>( - 'Dart_IsBoolean'); - late final _Dart_IsBoolean = - _Dart_IsBooleanPtr.asFunction(); - - bool Dart_IsString( - Object object, - ) { - return _Dart_IsString( - object, - ); - } - - late final _Dart_IsStringPtr = - _lookup>( - 'Dart_IsString'); - late final _Dart_IsString = - _Dart_IsStringPtr.asFunction(); - - bool Dart_IsStringLatin1( - Object object, - ) { - return _Dart_IsStringLatin1( - object, - ); - } - - late final _Dart_IsStringLatin1Ptr = - _lookup>( - 'Dart_IsStringLatin1'); - late final _Dart_IsStringLatin1 = - _Dart_IsStringLatin1Ptr.asFunction(); - - bool Dart_IsExternalString( - Object object, - ) { - return _Dart_IsExternalString( - object, - ); - } - - late final _Dart_IsExternalStringPtr = - _lookup>( - 'Dart_IsExternalString'); - late final _Dart_IsExternalString = - _Dart_IsExternalStringPtr.asFunction(); - - bool Dart_IsList( - Object object, - ) { - return _Dart_IsList( - object, - ); - } - - late final _Dart_IsListPtr = - _lookup>('Dart_IsList'); - late final _Dart_IsList = _Dart_IsListPtr.asFunction(); - - bool Dart_IsMap( - Object object, - ) { - return _Dart_IsMap( - object, - ); - } - - late final _Dart_IsMapPtr = - _lookup>('Dart_IsMap'); - late final _Dart_IsMap = _Dart_IsMapPtr.asFunction(); - - bool Dart_IsLibrary( - Object object, - ) { - return _Dart_IsLibrary( - object, - ); - } - - late final _Dart_IsLibraryPtr = - _lookup>( - 'Dart_IsLibrary'); - late final _Dart_IsLibrary = - _Dart_IsLibraryPtr.asFunction(); - - bool Dart_IsType( - Object handle, - ) { - return _Dart_IsType( - handle, - ); - } - - late final _Dart_IsTypePtr = - _lookup>('Dart_IsType'); - late final _Dart_IsType = _Dart_IsTypePtr.asFunction(); - - bool Dart_IsFunction( - Object handle, - ) { - return _Dart_IsFunction( - handle, - ); - } - - late final _Dart_IsFunctionPtr = - _lookup>( - 'Dart_IsFunction'); - late final _Dart_IsFunction = - _Dart_IsFunctionPtr.asFunction(); - - bool Dart_IsVariable( - Object handle, - ) { - return _Dart_IsVariable( - handle, - ); - } - - late final _Dart_IsVariablePtr = - _lookup>( - 'Dart_IsVariable'); - late final _Dart_IsVariable = - _Dart_IsVariablePtr.asFunction(); - - bool Dart_IsTypeVariable( - Object handle, - ) { - return _Dart_IsTypeVariable( - handle, - ); - } - - late final _Dart_IsTypeVariablePtr = - _lookup>( - 'Dart_IsTypeVariable'); - late final _Dart_IsTypeVariable = - _Dart_IsTypeVariablePtr.asFunction(); - - bool Dart_IsClosure( - Object object, - ) { - return _Dart_IsClosure( - object, - ); - } - - late final _Dart_IsClosurePtr = - _lookup>( - 'Dart_IsClosure'); - late final _Dart_IsClosure = - _Dart_IsClosurePtr.asFunction(); - - bool Dart_IsTypedData( - Object object, - ) { - return _Dart_IsTypedData( - object, - ); - } - - late final _Dart_IsTypedDataPtr = - _lookup>( - 'Dart_IsTypedData'); - late final _Dart_IsTypedData = - _Dart_IsTypedDataPtr.asFunction(); - - bool Dart_IsByteBuffer( - Object object, - ) { - return _Dart_IsByteBuffer( - object, - ); - } - - late final _Dart_IsByteBufferPtr = - _lookup>( - 'Dart_IsByteBuffer'); - late final _Dart_IsByteBuffer = - _Dart_IsByteBufferPtr.asFunction(); - - bool Dart_IsFuture( - Object object, - ) { - return _Dart_IsFuture( - object, - ); - } - - late final _Dart_IsFuturePtr = - _lookup>( - 'Dart_IsFuture'); - late final _Dart_IsFuture = - _Dart_IsFuturePtr.asFunction(); - - /// Gets the type of a Dart language object. - /// - /// \param instance Some Dart object. - /// - /// \return If no error occurs, the type is returned. Otherwise an - /// error handle is returned. - Object Dart_InstanceGetType( - Object instance, - ) { - return _Dart_InstanceGetType( - instance, - ); - } - - late final _Dart_InstanceGetTypePtr = - _lookup>( - 'Dart_InstanceGetType'); - late final _Dart_InstanceGetType = - _Dart_InstanceGetTypePtr.asFunction(); - - /// Returns the name for the provided class type. - /// - /// \return A valid string handle if no error occurs during the - /// operation. - Object Dart_ClassName( - Object cls_type, - ) { - return _Dart_ClassName( - cls_type, - ); - } - - late final _Dart_ClassNamePtr = - _lookup>( - 'Dart_ClassName'); - late final _Dart_ClassName = - _Dart_ClassNamePtr.asFunction(); - - /// Returns the name for the provided function or method. - /// - /// \return A valid string handle if no error occurs during the - /// operation. - Object Dart_FunctionName( - Object function, - ) { - return _Dart_FunctionName( - function, - ); - } - - late final _Dart_FunctionNamePtr = - _lookup>( - 'Dart_FunctionName'); - late final _Dart_FunctionName = - _Dart_FunctionNamePtr.asFunction(); - - /// Returns a handle to the owner of a function. - /// - /// The owner of an instance method or a static method is its defining - /// class. The owner of a top-level function is its defining - /// library. The owner of the function of a non-implicit closure is the - /// function of the method or closure that defines the non-implicit - /// closure. - /// - /// \return A valid handle to the owner of the function, or an error - /// handle if the argument is not a valid handle to a function. - Object Dart_FunctionOwner( - Object function, - ) { - return _Dart_FunctionOwner( - function, - ); - } - - late final _Dart_FunctionOwnerPtr = - _lookup>( - 'Dart_FunctionOwner'); - late final _Dart_FunctionOwner = - _Dart_FunctionOwnerPtr.asFunction(); - - /// Determines whether a function handle referes to a static function - /// of method. - /// - /// For the purposes of the embedding API, a top-level function is - /// implicitly declared static. - /// - /// \param function A handle to a function or method declaration. - /// \param is_static Returns whether the function or method is declared static. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_FunctionIsStatic( - Object function, - ffi.Pointer is_static, - ) { - return _Dart_FunctionIsStatic( - function, - is_static, - ); - } - - late final _Dart_FunctionIsStaticPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_FunctionIsStatic'); - late final _Dart_FunctionIsStatic = _Dart_FunctionIsStaticPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Is this object a closure resulting from a tear-off (closurized method)? - /// - /// Returns true for closures produced when an ordinary method is accessed - /// through a getter call. Returns false otherwise, in particular for closures - /// produced from local function declarations. - /// - /// \param object Some Object. - /// - /// \return true if Object is a tear-off. - bool Dart_IsTearOff( - Object object, - ) { - return _Dart_IsTearOff( - object, - ); - } - - late final _Dart_IsTearOffPtr = - _lookup>( - 'Dart_IsTearOff'); - late final _Dart_IsTearOff = - _Dart_IsTearOffPtr.asFunction(); - - /// Retrieves the function of a closure. - /// - /// \return A handle to the function of the closure, or an error handle if the - /// argument is not a closure. - Object Dart_ClosureFunction( - Object closure, - ) { - return _Dart_ClosureFunction( - closure, - ); - } - - late final _Dart_ClosureFunctionPtr = - _lookup>( - 'Dart_ClosureFunction'); - late final _Dart_ClosureFunction = - _Dart_ClosureFunctionPtr.asFunction(); - - /// Returns a handle to the library which contains class. - /// - /// \return A valid handle to the library with owns class, null if the class - /// has no library or an error handle if the argument is not a valid handle - /// to a class type. - Object Dart_ClassLibrary( - Object cls_type, - ) { - return _Dart_ClassLibrary( - cls_type, - ); - } - - late final _Dart_ClassLibraryPtr = - _lookup>( - 'Dart_ClassLibrary'); - late final _Dart_ClassLibrary = - _Dart_ClassLibraryPtr.asFunction(); - - /// Does this Integer fit into a 64-bit signed integer? - /// - /// \param integer An integer. - /// \param fits Returns true if the integer fits into a 64-bit signed integer. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_IntegerFitsIntoInt64( - Object integer, - ffi.Pointer fits, - ) { - return _Dart_IntegerFitsIntoInt64( - integer, - fits, - ); - } - - late final _Dart_IntegerFitsIntoInt64Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_IntegerFitsIntoInt64'); - late final _Dart_IntegerFitsIntoInt64 = _Dart_IntegerFitsIntoInt64Ptr - .asFunction)>(); - - /// Does this Integer fit into a 64-bit unsigned integer? - /// - /// \param integer An integer. - /// \param fits Returns true if the integer fits into a 64-bit unsigned integer. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_IntegerFitsIntoUint64( - Object integer, - ffi.Pointer fits, - ) { - return _Dart_IntegerFitsIntoUint64( - integer, - fits, - ); - } - - late final _Dart_IntegerFitsIntoUint64Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, - ffi.Pointer)>>('Dart_IntegerFitsIntoUint64'); - late final _Dart_IntegerFitsIntoUint64 = _Dart_IntegerFitsIntoUint64Ptr - .asFunction)>(); - - /// Returns an Integer with the provided value. - /// - /// \param value The value of the integer. - /// - /// \return The Integer object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewInteger( - int value, - ) { - return _Dart_NewInteger( - value, - ); - } - - late final _Dart_NewIntegerPtr = - _lookup>( - 'Dart_NewInteger'); - late final _Dart_NewInteger = - _Dart_NewIntegerPtr.asFunction(); - - /// Returns an Integer with the provided value. - /// - /// \param value The unsigned value of the integer. - /// - /// \return The Integer object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewIntegerFromUint64( - int value, - ) { - return _Dart_NewIntegerFromUint64( - value, - ); - } - - late final _Dart_NewIntegerFromUint64Ptr = - _lookup>( - 'Dart_NewIntegerFromUint64'); - late final _Dart_NewIntegerFromUint64 = - _Dart_NewIntegerFromUint64Ptr.asFunction(); - - /// Returns an Integer with the provided value. - /// - /// \param value The value of the integer represented as a C string - /// containing a hexadecimal number. - /// - /// \return The Integer object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewIntegerFromHexCString( - ffi.Pointer value, - ) { - return _Dart_NewIntegerFromHexCString( - value, - ); - } - - late final _Dart_NewIntegerFromHexCStringPtr = - _lookup)>>( - 'Dart_NewIntegerFromHexCString'); - late final _Dart_NewIntegerFromHexCString = _Dart_NewIntegerFromHexCStringPtr - .asFunction)>(); - - /// Gets the value of an Integer. - /// - /// The integer must fit into a 64-bit signed integer, otherwise an error occurs. - /// - /// \param integer An Integer. - /// \param value Returns the value of the Integer. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_IntegerToInt64( - Object integer, - ffi.Pointer value, - ) { - return _Dart_IntegerToInt64( - integer, - value, - ); - } - - late final _Dart_IntegerToInt64Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_IntegerToInt64'); - late final _Dart_IntegerToInt64 = _Dart_IntegerToInt64Ptr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Gets the value of an Integer. - /// - /// The integer must fit into a 64-bit unsigned integer, otherwise an - /// error occurs. - /// - /// \param integer An Integer. - /// \param value Returns the value of the Integer. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_IntegerToUint64( - Object integer, - ffi.Pointer value, - ) { - return _Dart_IntegerToUint64( - integer, - value, - ); - } - - late final _Dart_IntegerToUint64Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_IntegerToUint64'); - late final _Dart_IntegerToUint64 = _Dart_IntegerToUint64Ptr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Gets the value of an integer as a hexadecimal C string. - /// - /// \param integer An Integer. - /// \param value Returns the value of the Integer as a hexadecimal C - /// string. This C string is scope allocated and is only valid until - /// the next call to Dart_ExitScope. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_IntegerToHexCString( - Object integer, - ffi.Pointer> value, - ) { - return _Dart_IntegerToHexCString( - integer, - value, - ); - } - - late final _Dart_IntegerToHexCStringPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, - ffi.Pointer>)>>('Dart_IntegerToHexCString'); - late final _Dart_IntegerToHexCString = - _Dart_IntegerToHexCStringPtr.asFunction< - Object Function(Object, ffi.Pointer>)>(); - - /// Returns a Double with the provided value. - /// - /// \param value A double. - /// - /// \return The Double object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewDouble( - double value, - ) { - return _Dart_NewDouble( - value, - ); - } - - late final _Dart_NewDoublePtr = - _lookup>( - 'Dart_NewDouble'); - late final _Dart_NewDouble = - _Dart_NewDoublePtr.asFunction(); - - /// Gets the value of a Double - /// - /// \param double_obj A Double - /// \param value Returns the value of the Double. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_DoubleValue( - Object double_obj, - ffi.Pointer value, - ) { - return _Dart_DoubleValue( - double_obj, - value, - ); - } - - late final _Dart_DoubleValuePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_DoubleValue'); - late final _Dart_DoubleValue = _Dart_DoubleValuePtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Returns a closure of static function 'function_name' in the class 'class_name' - /// in the exported namespace of specified 'library'. - /// - /// \param library Library object - /// \param cls_type Type object representing a Class - /// \param function_name Name of the static function in the class - /// - /// \return A valid Dart instance if no error occurs during the operation. - Object Dart_GetStaticMethodClosure( - Object library1, - Object cls_type, - Object function_name, - ) { - return _Dart_GetStaticMethodClosure( - library1, - cls_type, - function_name, - ); - } - - late final _Dart_GetStaticMethodClosurePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, - ffi.Handle)>>('Dart_GetStaticMethodClosure'); - late final _Dart_GetStaticMethodClosure = _Dart_GetStaticMethodClosurePtr - .asFunction(); - - /// Returns the True object. - /// - /// Requires there to be a current isolate. - /// - /// \return A handle to the True object. - Object Dart_True() { - return _Dart_True(); - } - - late final _Dart_TruePtr = - _lookup>('Dart_True'); - late final _Dart_True = _Dart_TruePtr.asFunction(); - - /// Returns the False object. - /// - /// Requires there to be a current isolate. - /// - /// \return A handle to the False object. - Object Dart_False() { - return _Dart_False(); - } - - late final _Dart_FalsePtr = - _lookup>('Dart_False'); - late final _Dart_False = _Dart_FalsePtr.asFunction(); - - /// Returns a Boolean with the provided value. - /// - /// \param value true or false. - /// - /// \return The Boolean object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewBoolean( - bool value, - ) { - return _Dart_NewBoolean( - value, - ); - } - - late final _Dart_NewBooleanPtr = - _lookup>( - 'Dart_NewBoolean'); - late final _Dart_NewBoolean = - _Dart_NewBooleanPtr.asFunction(); - - /// Gets the value of a Boolean - /// - /// \param boolean_obj A Boolean - /// \param value Returns the value of the Boolean. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_BooleanValue( - Object boolean_obj, - ffi.Pointer value, - ) { - return _Dart_BooleanValue( - boolean_obj, - value, - ); - } - - late final _Dart_BooleanValuePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_BooleanValue'); - late final _Dart_BooleanValue = _Dart_BooleanValuePtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Gets the length of a String. - /// - /// \param str A String. - /// \param length Returns the length of the String. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_StringLength( - Object str, - ffi.Pointer length, - ) { - return _Dart_StringLength( - str, - length, - ); - } - - late final _Dart_StringLengthPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_StringLength'); - late final _Dart_StringLength = _Dart_StringLengthPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Returns a String built from the provided C string - /// (There is an implicit assumption that the C string passed in contains - /// UTF-8 encoded characters and '\0' is considered as a termination - /// character). - /// - /// \param value A C String - /// - /// \return The String object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewStringFromCString( - ffi.Pointer str, - ) { - return _Dart_NewStringFromCString( - str, - ); - } - - late final _Dart_NewStringFromCStringPtr = - _lookup)>>( - 'Dart_NewStringFromCString'); - late final _Dart_NewStringFromCString = _Dart_NewStringFromCStringPtr - .asFunction)>(); - - /// Returns a String built from an array of UTF-8 encoded characters. - /// - /// \param utf8_array An array of UTF-8 encoded characters. - /// \param length The length of the codepoints array. - /// - /// \return The String object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewStringFromUTF8( - ffi.Pointer utf8_array, - int length, - ) { - return _Dart_NewStringFromUTF8( - utf8_array, - length, - ); - } - - late final _Dart_NewStringFromUTF8Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer, ffi.IntPtr)>>('Dart_NewStringFromUTF8'); - late final _Dart_NewStringFromUTF8 = _Dart_NewStringFromUTF8Ptr.asFunction< - Object Function(ffi.Pointer, int)>(); - - /// Returns a String built from an array of UTF-16 encoded characters. - /// - /// \param utf16_array An array of UTF-16 encoded characters. - /// \param length The length of the codepoints array. - /// - /// \return The String object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewStringFromUTF16( - ffi.Pointer utf16_array, - int length, - ) { - return _Dart_NewStringFromUTF16( - utf16_array, - length, - ); - } - - late final _Dart_NewStringFromUTF16Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer, ffi.IntPtr)>>('Dart_NewStringFromUTF16'); - late final _Dart_NewStringFromUTF16 = _Dart_NewStringFromUTF16Ptr.asFunction< - Object Function(ffi.Pointer, int)>(); - - /// Returns a String built from an array of UTF-32 encoded characters. - /// - /// \param utf32_array An array of UTF-32 encoded characters. - /// \param length The length of the codepoints array. - /// - /// \return The String object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewStringFromUTF32( - ffi.Pointer utf32_array, - int length, - ) { - return _Dart_NewStringFromUTF32( - utf32_array, - length, - ); - } - - late final _Dart_NewStringFromUTF32Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer, ffi.IntPtr)>>('Dart_NewStringFromUTF32'); - late final _Dart_NewStringFromUTF32 = _Dart_NewStringFromUTF32Ptr.asFunction< - Object Function(ffi.Pointer, int)>(); - - /// Returns a String which references an external array of - /// Latin-1 (ISO-8859-1) encoded characters. - /// - /// \param latin1_array Array of Latin-1 encoded characters. This must not move. - /// \param length The length of the characters array. - /// \param peer An external pointer to associate with this string. - /// \param external_allocation_size The number of externally allocated - /// bytes for peer. Used to inform the garbage collector. - /// \param callback A callback to be called when this string is finalized. - /// - /// \return The String object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewExternalLatin1String( - ffi.Pointer latin1_array, - int length, - ffi.Pointer peer, - int external_allocation_size, - Dart_HandleFinalizer callback, - ) { - return _Dart_NewExternalLatin1String( - latin1_array, - length, - peer, - external_allocation_size, - callback, - ); - } - - late final _Dart_NewExternalLatin1StringPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer, - ffi.IntPtr, - ffi.Pointer, - ffi.IntPtr, - Dart_HandleFinalizer)>>('Dart_NewExternalLatin1String'); - late final _Dart_NewExternalLatin1String = - _Dart_NewExternalLatin1StringPtr.asFunction< - Object Function(ffi.Pointer, int, ffi.Pointer, - int, Dart_HandleFinalizer)>(); - - /// Returns a String which references an external array of UTF-16 encoded - /// characters. - /// - /// \param utf16_array An array of UTF-16 encoded characters. This must not move. - /// \param length The length of the characters array. - /// \param peer An external pointer to associate with this string. - /// \param external_allocation_size The number of externally allocated - /// bytes for peer. Used to inform the garbage collector. - /// \param callback A callback to be called when this string is finalized. - /// - /// \return The String object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewExternalUTF16String( - ffi.Pointer utf16_array, - int length, - ffi.Pointer peer, - int external_allocation_size, - Dart_HandleFinalizer callback, - ) { - return _Dart_NewExternalUTF16String( - utf16_array, - length, - peer, - external_allocation_size, - callback, - ); - } - - late final _Dart_NewExternalUTF16StringPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer, - ffi.IntPtr, - ffi.Pointer, - ffi.IntPtr, - Dart_HandleFinalizer)>>('Dart_NewExternalUTF16String'); - late final _Dart_NewExternalUTF16String = - _Dart_NewExternalUTF16StringPtr.asFunction< - Object Function(ffi.Pointer, int, ffi.Pointer, - int, Dart_HandleFinalizer)>(); - - /// Gets the C string representation of a String. - /// (It is a sequence of UTF-8 encoded values with a '\0' termination.) - /// - /// \param str A string. - /// \param cstr Returns the String represented as a C string. - /// This C string is scope allocated and is only valid until - /// the next call to Dart_ExitScope. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_StringToCString( - Object str, - ffi.Pointer> cstr, - ) { - return _Dart_StringToCString( - str, - cstr, - ); - } - - late final _Dart_StringToCStringPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, - ffi.Pointer>)>>('Dart_StringToCString'); - late final _Dart_StringToCString = _Dart_StringToCStringPtr.asFunction< - Object Function(Object, ffi.Pointer>)>(); - - /// Gets a UTF-8 encoded representation of a String. - /// - /// Any unpaired surrogate code points in the string will be converted as - /// replacement characters (U+FFFD, 0xEF 0xBF 0xBD in UTF-8). If you need - /// to preserve unpaired surrogates, use the Dart_StringToUTF16 function. - /// - /// \param str A string. - /// \param utf8_array Returns the String represented as UTF-8 code - /// units. This UTF-8 array is scope allocated and is only valid - /// until the next call to Dart_ExitScope. - /// \param length Used to return the length of the array which was - /// actually used. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_StringToUTF8( - Object str, - ffi.Pointer> utf8_array, - ffi.Pointer length, - ) { - return _Dart_StringToUTF8( - str, - utf8_array, - length, - ); - } - - late final _Dart_StringToUTF8Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Pointer>, - ffi.Pointer)>>('Dart_StringToUTF8'); - late final _Dart_StringToUTF8 = _Dart_StringToUTF8Ptr.asFunction< - Object Function(Object, ffi.Pointer>, - ffi.Pointer)>(); - - /// Gets the data corresponding to the string object. This function returns - /// the data only for Latin-1 (ISO-8859-1) string objects. For all other - /// string objects it returns an error. - /// - /// \param str A string. - /// \param latin1_array An array allocated by the caller, used to return - /// the string data. - /// \param length Used to pass in the length of the provided array. - /// Used to return the length of the array which was actually used. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_StringToLatin1( - Object str, - ffi.Pointer latin1_array, - ffi.Pointer length, - ) { - return _Dart_StringToLatin1( - str, - latin1_array, - length, - ); - } - - late final _Dart_StringToLatin1Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Pointer, - ffi.Pointer)>>('Dart_StringToLatin1'); - late final _Dart_StringToLatin1 = _Dart_StringToLatin1Ptr.asFunction< - Object Function( - Object, ffi.Pointer, ffi.Pointer)>(); - - /// Gets the UTF-16 encoded representation of a string. - /// - /// \param str A string. - /// \param utf16_array An array allocated by the caller, used to return - /// the array of UTF-16 encoded characters. - /// \param length Used to pass in the length of the provided array. - /// Used to return the length of the array which was actually used. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_StringToUTF16( - Object str, - ffi.Pointer utf16_array, - ffi.Pointer length, - ) { - return _Dart_StringToUTF16( - str, - utf16_array, - length, - ); - } - - late final _Dart_StringToUTF16Ptr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Pointer, - ffi.Pointer)>>('Dart_StringToUTF16'); - late final _Dart_StringToUTF16 = _Dart_StringToUTF16Ptr.asFunction< - Object Function( - Object, ffi.Pointer, ffi.Pointer)>(); - - /// Gets the storage size in bytes of a String. - /// - /// \param str A String. - /// \param length Returns the storage size in bytes of the String. - /// This is the size in bytes needed to store the String. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_StringStorageSize( - Object str, - ffi.Pointer size, - ) { - return _Dart_StringStorageSize( - str, - size, - ); - } - - late final _Dart_StringStorageSizePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_StringStorageSize'); - late final _Dart_StringStorageSize = _Dart_StringStorageSizePtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Retrieves some properties associated with a String. - /// Properties retrieved are: - /// - character size of the string (one or two byte) - /// - length of the string - /// - peer pointer of string if it is an external string. - /// \param str A String. - /// \param char_size Returns the character size of the String. - /// \param str_len Returns the length of the String. - /// \param peer Returns the peer pointer associated with the String or 0 if - /// there is no peer pointer for it. - /// \return Success if no error occurs. Otherwise returns - /// an error handle. - Object Dart_StringGetProperties( - Object str, - ffi.Pointer char_size, - ffi.Pointer str_len, - ffi.Pointer> peer, - ) { - return _Dart_StringGetProperties( - str, - char_size, - str_len, - peer, - ); - } - - late final _Dart_StringGetPropertiesPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer>)>>('Dart_StringGetProperties'); - late final _Dart_StringGetProperties = - _Dart_StringGetPropertiesPtr.asFunction< - Object Function(Object, ffi.Pointer, - ffi.Pointer, ffi.Pointer>)>(); - - /// Returns a List of the desired length. - /// - /// \param length The length of the list. - /// - /// \return The List object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewList( - int length, - ) { - return _Dart_NewList( - length, - ); - } - - late final _Dart_NewListPtr = - _lookup>( - 'Dart_NewList'); - late final _Dart_NewList = - _Dart_NewListPtr.asFunction(); - - /// TODO(bkonyi): convert this to use nullable types once NNBD is enabled. - /// /** - /// * Returns a List of the desired length with the desired legacy element type. - /// * - /// * \param element_type_id The type of elements of the list. - /// * \param length The length of the list. - /// * - /// * \return The List object if no error occurs. Otherwise returns an error - /// * handle. - /// */ - Object Dart_NewListOf( - int element_type_id, - int length, - ) { - return _Dart_NewListOf( - element_type_id, - length, - ); - } - - late final _Dart_NewListOfPtr = - _lookup>( - 'Dart_NewListOf'); - late final _Dart_NewListOf = - _Dart_NewListOfPtr.asFunction(); - - /// Returns a List of the desired length with the desired element type. - /// - /// \param element_type Handle to a nullable type object. E.g., from - /// Dart_GetType or Dart_GetNullableType. - /// - /// \param length The length of the list. - /// - /// \return The List object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewListOfType( - Object element_type, - int length, - ) { - return _Dart_NewListOfType( - element_type, - length, - ); - } - - late final _Dart_NewListOfTypePtr = - _lookup>( - 'Dart_NewListOfType'); - late final _Dart_NewListOfType = - _Dart_NewListOfTypePtr.asFunction(); - - /// Returns a List of the desired length with the desired element type, filled - /// with the provided object. - /// - /// \param element_type Handle to a type object. E.g., from Dart_GetType. - /// - /// \param fill_object Handle to an object of type 'element_type' that will be - /// used to populate the list. This parameter can only be Dart_Null() if the - /// length of the list is 0 or 'element_type' is a nullable type. - /// - /// \param length The length of the list. - /// - /// \return The List object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewListOfTypeFilled( - Object element_type, - Object fill_object, - int length, - ) { - return _Dart_NewListOfTypeFilled( - element_type, - fill_object, - length, - ); - } - - late final _Dart_NewListOfTypeFilledPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Handle, ffi.IntPtr)>>('Dart_NewListOfTypeFilled'); - late final _Dart_NewListOfTypeFilled = _Dart_NewListOfTypeFilledPtr - .asFunction(); - - /// Gets the length of a List. - /// - /// May generate an unhandled exception error. - /// - /// \param list A List. - /// \param length Returns the length of the List. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_ListLength( - Object list, - ffi.Pointer length, - ) { - return _Dart_ListLength( - list, - length, - ); - } - - late final _Dart_ListLengthPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_ListLength'); - late final _Dart_ListLength = _Dart_ListLengthPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Gets the Object at some index of a List. - /// - /// If the index is out of bounds, an error occurs. - /// - /// May generate an unhandled exception error. - /// - /// \param list A List. - /// \param index A valid index into the List. - /// - /// \return The Object in the List at the specified index if no error - /// occurs. Otherwise returns an error handle. - Object Dart_ListGetAt( - Object list, - int index, - ) { - return _Dart_ListGetAt( - list, - index, - ); - } - - late final _Dart_ListGetAtPtr = - _lookup>( - 'Dart_ListGetAt'); - late final _Dart_ListGetAt = - _Dart_ListGetAtPtr.asFunction(); - - /// Gets a range of Objects from a List. - /// - /// If any of the requested index values are out of bounds, an error occurs. - /// - /// May generate an unhandled exception error. - /// - /// \param list A List. - /// \param offset The offset of the first item to get. - /// \param length The number of items to get. - /// \param result A pointer to fill with the objects. - /// - /// \return Success if no error occurs during the operation. - Object Dart_ListGetRange( - Object list, - int offset, - int length, - ffi.Pointer result, - ) { - return _Dart_ListGetRange( - list, - offset, - length, - result, - ); - } - - late final _Dart_ListGetRangePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.IntPtr, ffi.IntPtr, - ffi.Pointer)>>('Dart_ListGetRange'); - late final _Dart_ListGetRange = _Dart_ListGetRangePtr.asFunction< - Object Function(Object, int, int, ffi.Pointer)>(); - - /// Sets the Object at some index of a List. - /// - /// If the index is out of bounds, an error occurs. - /// - /// May generate an unhandled exception error. - /// - /// \param array A List. - /// \param index A valid index into the List. - /// \param value The Object to put in the List. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_ListSetAt( - Object list, - int index, - Object value, - ) { - return _Dart_ListSetAt( - list, - index, - value, - ); - } - - late final _Dart_ListSetAtPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.IntPtr, ffi.Handle)>>('Dart_ListSetAt'); - late final _Dart_ListSetAt = - _Dart_ListSetAtPtr.asFunction(); - - /// May generate an unhandled exception error. - Object Dart_ListGetAsBytes( - Object list, - int offset, - ffi.Pointer native_array, - int length, - ) { - return _Dart_ListGetAsBytes( - list, - offset, - native_array, - length, - ); - } - - late final _Dart_ListGetAsBytesPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.IntPtr, ffi.Pointer, - ffi.IntPtr)>>('Dart_ListGetAsBytes'); - late final _Dart_ListGetAsBytes = _Dart_ListGetAsBytesPtr.asFunction< - Object Function(Object, int, ffi.Pointer, int)>(); - - /// May generate an unhandled exception error. - Object Dart_ListSetAsBytes( - Object list, - int offset, - ffi.Pointer native_array, - int length, - ) { - return _Dart_ListSetAsBytes( - list, - offset, - native_array, - length, - ); - } - - late final _Dart_ListSetAsBytesPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.IntPtr, ffi.Pointer, - ffi.IntPtr)>>('Dart_ListSetAsBytes'); - late final _Dart_ListSetAsBytes = _Dart_ListSetAsBytesPtr.asFunction< - Object Function(Object, int, ffi.Pointer, int)>(); - - /// Gets the Object at some key of a Map. - /// - /// May generate an unhandled exception error. - /// - /// \param map A Map. - /// \param key An Object. - /// - /// \return The value in the map at the specified key, null if the map does not - /// contain the key, or an error handle. - Object Dart_MapGetAt( - Object map, - Object key, - ) { - return _Dart_MapGetAt( - map, - key, - ); - } - - late final _Dart_MapGetAtPtr = - _lookup>( - 'Dart_MapGetAt'); - late final _Dart_MapGetAt = - _Dart_MapGetAtPtr.asFunction(); - - /// Returns whether the Map contains a given key. - /// - /// May generate an unhandled exception error. - /// - /// \param map A Map. - /// - /// \return A handle on a boolean indicating whether map contains the key. - /// Otherwise returns an error handle. - Object Dart_MapContainsKey( - Object map, - Object key, - ) { - return _Dart_MapContainsKey( - map, - key, - ); - } - - late final _Dart_MapContainsKeyPtr = - _lookup>( - 'Dart_MapContainsKey'); - late final _Dart_MapContainsKey = - _Dart_MapContainsKeyPtr.asFunction(); - - /// Gets the list of keys of a Map. - /// - /// May generate an unhandled exception error. - /// - /// \param map A Map. - /// - /// \return The list of key Objects if no error occurs. Otherwise returns an - /// error handle. - Object Dart_MapKeys( - Object map, - ) { - return _Dart_MapKeys( - map, - ); - } - - late final _Dart_MapKeysPtr = - _lookup>( - 'Dart_MapKeys'); - late final _Dart_MapKeys = - _Dart_MapKeysPtr.asFunction(); - - /// Return type if this object is a TypedData object. - /// - /// \return kInvalid if the object is not a TypedData object or the appropriate - /// Dart_TypedData_Type. - int Dart_GetTypeOfTypedData( - Object object, - ) { - return _Dart_GetTypeOfTypedData( - object, - ); - } - - late final _Dart_GetTypeOfTypedDataPtr = - _lookup>( - 'Dart_GetTypeOfTypedData'); - late final _Dart_GetTypeOfTypedData = - _Dart_GetTypeOfTypedDataPtr.asFunction(); - - /// Return type if this object is an external TypedData object. - /// - /// \return kInvalid if the object is not an external TypedData object or - /// the appropriate Dart_TypedData_Type. - int Dart_GetTypeOfExternalTypedData( - Object object, - ) { - return _Dart_GetTypeOfExternalTypedData( - object, - ); - } - - late final _Dart_GetTypeOfExternalTypedDataPtr = - _lookup>( - 'Dart_GetTypeOfExternalTypedData'); - late final _Dart_GetTypeOfExternalTypedData = - _Dart_GetTypeOfExternalTypedDataPtr.asFunction(); - - /// Returns a TypedData object of the desired length and type. - /// - /// \param type The type of the TypedData object. - /// \param length The length of the TypedData object (length in type units). - /// - /// \return The TypedData object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewTypedData( - int type, - int length, - ) { - return _Dart_NewTypedData( - type, - length, - ); - } - - late final _Dart_NewTypedDataPtr = - _lookup>( - 'Dart_NewTypedData'); - late final _Dart_NewTypedData = - _Dart_NewTypedDataPtr.asFunction(); - - /// Returns a TypedData object which references an external data array. - /// - /// \param type The type of the data array. - /// \param data A data array. This array must not move. - /// \param length The length of the data array (length in type units). - /// - /// \return The TypedData object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewExternalTypedData( - int type, - ffi.Pointer data, - int length, - ) { - return _Dart_NewExternalTypedData( - type, - data, - length, - ); - } - - late final _Dart_NewExternalTypedDataPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Int32, ffi.Pointer, - ffi.IntPtr)>>('Dart_NewExternalTypedData'); - late final _Dart_NewExternalTypedData = _Dart_NewExternalTypedDataPtr - .asFunction, int)>(); - - /// Returns a TypedData object which references an external data array. - /// - /// \param type The type of the data array. - /// \param data A data array. This array must not move. - /// \param length The length of the data array (length in type units). - /// \param peer A pointer to a native object or NULL. This value is - /// provided to callback when it is invoked. - /// \param external_allocation_size The number of externally allocated - /// bytes for peer. Used to inform the garbage collector. - /// \param callback A function pointer that will be invoked sometime - /// after the object is garbage collected, unless the handle has been deleted. - /// A valid callback needs to be specified it cannot be NULL. - /// - /// \return The TypedData object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewExternalTypedDataWithFinalizer( - int type, - ffi.Pointer data, - int length, - ffi.Pointer peer, - int external_allocation_size, - Dart_HandleFinalizer callback, - ) { - return _Dart_NewExternalTypedDataWithFinalizer( - type, - data, - length, - peer, - external_allocation_size, - callback, - ); - } - - late final _Dart_NewExternalTypedDataWithFinalizerPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Int32, - ffi.Pointer, - ffi.IntPtr, - ffi.Pointer, - ffi.IntPtr, - Dart_HandleFinalizer)>>('Dart_NewExternalTypedDataWithFinalizer'); - late final _Dart_NewExternalTypedDataWithFinalizer = - _Dart_NewExternalTypedDataWithFinalizerPtr.asFunction< - Object Function(int, ffi.Pointer, int, - ffi.Pointer, int, Dart_HandleFinalizer)>(); - - /// Returns a ByteBuffer object for the typed data. - /// - /// \param type_data The TypedData object. - /// - /// \return The ByteBuffer object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_NewByteBuffer( - Object typed_data, - ) { - return _Dart_NewByteBuffer( - typed_data, - ); - } - - late final _Dart_NewByteBufferPtr = - _lookup>( - 'Dart_NewByteBuffer'); - late final _Dart_NewByteBuffer = - _Dart_NewByteBufferPtr.asFunction(); - - /// Acquires access to the internal data address of a TypedData object. - /// - /// \param object The typed data object whose internal data address is to - /// be accessed. - /// \param type The type of the object is returned here. - /// \param data The internal data address is returned here. - /// \param len Size of the typed array is returned here. - /// - /// Notes: - /// When the internal address of the object is acquired any calls to a - /// Dart API function that could potentially allocate an object or run - /// any Dart code will return an error. - /// - /// Any Dart API functions for accessing the data should not be called - /// before the corresponding release. In particular, the object should - /// not be acquired again before its release. This leads to undefined - /// behavior. - /// - /// \return Success if the internal data address is acquired successfully. - /// Otherwise, returns an error handle. - Object Dart_TypedDataAcquireData( - Object object, - ffi.Pointer type, - ffi.Pointer> data, - ffi.Pointer len, - ) { - return _Dart_TypedDataAcquireData( - object, - type, - data, - len, - ); - } - - late final _Dart_TypedDataAcquireDataPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('Dart_TypedDataAcquireData'); - late final _Dart_TypedDataAcquireData = - _Dart_TypedDataAcquireDataPtr.asFunction< - Object Function(Object, ffi.Pointer, - ffi.Pointer>, ffi.Pointer)>(); - - /// Releases access to the internal data address that was acquired earlier using - /// Dart_TypedDataAcquireData. - /// - /// \param object The typed data object whose internal data address is to be - /// released. - /// - /// \return Success if the internal data address is released successfully. - /// Otherwise, returns an error handle. - Object Dart_TypedDataReleaseData( - Object object, - ) { - return _Dart_TypedDataReleaseData( - object, - ); - } - - late final _Dart_TypedDataReleaseDataPtr = - _lookup>( - 'Dart_TypedDataReleaseData'); - late final _Dart_TypedDataReleaseData = - _Dart_TypedDataReleaseDataPtr.asFunction(); - - /// Returns the TypedData object associated with the ByteBuffer object. - /// - /// \param byte_buffer The ByteBuffer object. - /// - /// \return The TypedData object if no error occurs. Otherwise returns - /// an error handle. - Object Dart_GetDataFromByteBuffer( - Object byte_buffer, - ) { - return _Dart_GetDataFromByteBuffer( - byte_buffer, - ); - } - - late final _Dart_GetDataFromByteBufferPtr = - _lookup>( - 'Dart_GetDataFromByteBuffer'); - late final _Dart_GetDataFromByteBuffer = - _Dart_GetDataFromByteBufferPtr.asFunction(); - - /// Invokes a constructor, creating a new object. - /// - /// This function allows hidden constructors (constructors with leading - /// underscores) to be called. - /// - /// \param type Type of object to be constructed. - /// \param constructor_name The name of the constructor to invoke. Use - /// Dart_Null() or Dart_EmptyString() to invoke the unnamed constructor. - /// This name should not include the name of the class. - /// \param number_of_arguments Size of the arguments array. - /// \param arguments An array of arguments to the constructor. - /// - /// \return If the constructor is called and completes successfully, - /// then the new object. If an error occurs during execution, then an - /// error handle is returned. - Object Dart_New( - Object type, - Object constructor_name, - int number_of_arguments, - ffi.Pointer arguments, - ) { - return _Dart_New( - type, - constructor_name, - number_of_arguments, - arguments, - ); - } - - late final _Dart_NewPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, ffi.Int, - ffi.Pointer)>>('Dart_New'); - late final _Dart_New = _Dart_NewPtr.asFunction< - Object Function(Object, Object, int, ffi.Pointer)>(); - - /// Allocate a new object without invoking a constructor. - /// - /// \param type The type of an object to be allocated. - /// - /// \return The new object. If an error occurs during execution, then an - /// error handle is returned. - Object Dart_Allocate( - Object type, - ) { - return _Dart_Allocate( - type, - ); - } - - late final _Dart_AllocatePtr = - _lookup>( - 'Dart_Allocate'); - late final _Dart_Allocate = - _Dart_AllocatePtr.asFunction(); - - /// Allocate a new object without invoking a constructor, and sets specified - /// native fields. - /// - /// \param type The type of an object to be allocated. - /// \param num_native_fields The number of native fields to set. - /// \param native_fields An array containing the value of native fields. - /// - /// \return The new object. If an error occurs during execution, then an - /// error handle is returned. - Object Dart_AllocateWithNativeFields( - Object type, - int num_native_fields, - ffi.Pointer native_fields, - ) { - return _Dart_AllocateWithNativeFields( - type, - num_native_fields, - native_fields, - ); - } - - late final _Dart_AllocateWithNativeFieldsPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.IntPtr, - ffi.Pointer)>>('Dart_AllocateWithNativeFields'); - late final _Dart_AllocateWithNativeFields = _Dart_AllocateWithNativeFieldsPtr - .asFunction)>(); - - /// Invokes a method or function. - /// - /// The 'target' parameter may be an object, type, or library. If - /// 'target' is an object, then this function will invoke an instance - /// method. If 'target' is a type, then this function will invoke a - /// static method. If 'target' is a library, then this function will - /// invoke a top-level function from that library. - /// NOTE: This API call cannot be used to invoke methods of a type object. - /// - /// This function ignores visibility (leading underscores in names). - /// - /// May generate an unhandled exception error. - /// - /// \param target An object, type, or library. - /// \param name The name of the function or method to invoke. - /// \param number_of_arguments Size of the arguments array. - /// \param arguments An array of arguments to the function. - /// - /// \return If the function or method is called and completes - /// successfully, then the return value is returned. If an error - /// occurs during execution, then an error handle is returned. - Object Dart_Invoke( - Object target, - Object name, - int number_of_arguments, - ffi.Pointer arguments, - ) { - return _Dart_Invoke( - target, - name, - number_of_arguments, - arguments, - ); - } - - late final _Dart_InvokePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, ffi.Int, - ffi.Pointer)>>('Dart_Invoke'); - late final _Dart_Invoke = _Dart_InvokePtr.asFunction< - Object Function(Object, Object, int, ffi.Pointer)>(); - - /// Invokes a Closure with the given arguments. - /// - /// May generate an unhandled exception error. - /// - /// \return If no error occurs during execution, then the result of - /// invoking the closure is returned. If an error occurs during - /// execution, then an error handle is returned. - Object Dart_InvokeClosure( - Object closure, - int number_of_arguments, - ffi.Pointer arguments, - ) { - return _Dart_InvokeClosure( - closure, - number_of_arguments, - arguments, - ); - } - - late final _Dart_InvokeClosurePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Int, - ffi.Pointer)>>('Dart_InvokeClosure'); - late final _Dart_InvokeClosure = _Dart_InvokeClosurePtr.asFunction< - Object Function(Object, int, ffi.Pointer)>(); - - /// Invokes a Generative Constructor on an object that was previously - /// allocated using Dart_Allocate/Dart_AllocateWithNativeFields. - /// - /// The 'target' parameter must be an object. - /// - /// This function ignores visibility (leading underscores in names). - /// - /// May generate an unhandled exception error. - /// - /// \param target An object. - /// \param name The name of the constructor to invoke. - /// Use Dart_Null() or Dart_EmptyString() to invoke the unnamed constructor. - /// \param number_of_arguments Size of the arguments array. - /// \param arguments An array of arguments to the function. - /// - /// \return If the constructor is called and completes - /// successfully, then the object is returned. If an error - /// occurs during execution, then an error handle is returned. - Object Dart_InvokeConstructor( - Object object, - Object name, - int number_of_arguments, - ffi.Pointer arguments, - ) { - return _Dart_InvokeConstructor( - object, - name, - number_of_arguments, - arguments, - ); - } - - late final _Dart_InvokeConstructorPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, ffi.Int, - ffi.Pointer)>>('Dart_InvokeConstructor'); - late final _Dart_InvokeConstructor = _Dart_InvokeConstructorPtr.asFunction< - Object Function(Object, Object, int, ffi.Pointer)>(); - - /// Gets the value of a field. - /// - /// The 'container' parameter may be an object, type, or library. If - /// 'container' is an object, then this function will access an - /// instance field. If 'container' is a type, then this function will - /// access a static field. If 'container' is a library, then this - /// function will access a top-level variable. - /// NOTE: This API call cannot be used to access fields of a type object. - /// - /// This function ignores field visibility (leading underscores in names). - /// - /// May generate an unhandled exception error. - /// - /// \param container An object, type, or library. - /// \param name A field name. - /// - /// \return If no error occurs, then the value of the field is - /// returned. Otherwise an error handle is returned. - Object Dart_GetField( - Object container, - Object name, - ) { - return _Dart_GetField( - container, - name, - ); - } - - late final _Dart_GetFieldPtr = - _lookup>( - 'Dart_GetField'); - late final _Dart_GetField = - _Dart_GetFieldPtr.asFunction(); - - /// Sets the value of a field. - /// - /// The 'container' parameter may actually be an object, type, or - /// library. If 'container' is an object, then this function will - /// access an instance field. If 'container' is a type, then this - /// function will access a static field. If 'container' is a library, - /// then this function will access a top-level variable. - /// NOTE: This API call cannot be used to access fields of a type object. - /// - /// This function ignores field visibility (leading underscores in names). - /// - /// May generate an unhandled exception error. - /// - /// \param container An object, type, or library. - /// \param name A field name. - /// \param value The new field value. - /// - /// \return A valid handle if no error occurs. - Object Dart_SetField( - Object container, - Object name, - Object value, - ) { - return _Dart_SetField( - container, - name, - value, - ); - } - - late final _Dart_SetFieldPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Handle, ffi.Handle)>>('Dart_SetField'); - late final _Dart_SetField = - _Dart_SetFieldPtr.asFunction(); - - /// Throws an exception. - /// - /// This function causes a Dart language exception to be thrown. This - /// will proceed in the standard way, walking up Dart frames until an - /// appropriate 'catch' block is found, executing 'finally' blocks, - /// etc. - /// - /// If an error handle is passed into this function, the error is - /// propagated immediately. See Dart_PropagateError for a discussion - /// of error propagation. - /// - /// If successful, this function does not return. Note that this means - /// that the destructors of any stack-allocated C++ objects will not be - /// called. If there are no Dart frames on the stack, an error occurs. - /// - /// \return An error handle if the exception was not thrown. - /// Otherwise the function does not return. - Object Dart_ThrowException( - Object exception, - ) { - return _Dart_ThrowException( - exception, - ); - } - - late final _Dart_ThrowExceptionPtr = - _lookup>( - 'Dart_ThrowException'); - late final _Dart_ThrowException = - _Dart_ThrowExceptionPtr.asFunction(); - - /// Rethrows an exception. - /// - /// Rethrows an exception, unwinding all dart frames on the stack. If - /// successful, this function does not return. Note that this means - /// that the destructors of any stack-allocated C++ objects will not be - /// called. If there are no Dart frames on the stack, an error occurs. - /// - /// \return An error handle if the exception was not thrown. - /// Otherwise the function does not return. - Object Dart_ReThrowException( - Object exception, - Object stacktrace, - ) { - return _Dart_ReThrowException( - exception, - stacktrace, - ); - } - - late final _Dart_ReThrowExceptionPtr = - _lookup>( - 'Dart_ReThrowException'); - late final _Dart_ReThrowException = - _Dart_ReThrowExceptionPtr.asFunction(); - - /// Gets the number of native instance fields in an object. - Object Dart_GetNativeInstanceFieldCount( - Object obj, - ffi.Pointer count, - ) { - return _Dart_GetNativeInstanceFieldCount( - obj, - count, - ); - } - - late final _Dart_GetNativeInstanceFieldCountPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, - ffi.Pointer)>>('Dart_GetNativeInstanceFieldCount'); - late final _Dart_GetNativeInstanceFieldCount = - _Dart_GetNativeInstanceFieldCountPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Gets the value of a native field. - /// - /// TODO(turnidge): Document. - Object Dart_GetNativeInstanceField( - Object obj, - int index, - ffi.Pointer value, - ) { - return _Dart_GetNativeInstanceField( - obj, - index, - value, - ); - } - - late final _Dart_GetNativeInstanceFieldPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Int, - ffi.Pointer)>>('Dart_GetNativeInstanceField'); - late final _Dart_GetNativeInstanceField = _Dart_GetNativeInstanceFieldPtr - .asFunction)>(); - - /// Sets the value of a native field. - /// - /// TODO(turnidge): Document. - Object Dart_SetNativeInstanceField( - Object obj, - int index, - int value, - ) { - return _Dart_SetNativeInstanceField( - obj, - index, - value, - ); - } - - late final _Dart_SetNativeInstanceFieldPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Int, ffi.IntPtr)>>('Dart_SetNativeInstanceField'); - late final _Dart_SetNativeInstanceField = _Dart_SetNativeInstanceFieldPtr - .asFunction(); - - /// Extracts current isolate group data from the native arguments structure. - ffi.Pointer Dart_GetNativeIsolateGroupData( - Dart_NativeArguments args, - ) { - return _Dart_GetNativeIsolateGroupData( - args, - ); - } - - late final _Dart_GetNativeIsolateGroupDataPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - Dart_NativeArguments)>>('Dart_GetNativeIsolateGroupData'); - late final _Dart_GetNativeIsolateGroupData = - _Dart_GetNativeIsolateGroupDataPtr.asFunction< - ffi.Pointer Function(Dart_NativeArguments)>(); - - /// Gets the native arguments based on the types passed in and populates - /// the passed arguments buffer with appropriate native values. - /// - /// \param args the Native arguments block passed into the native call. - /// \param num_arguments length of argument descriptor array and argument - /// values array passed in. - /// \param arg_descriptors an array that describes the arguments that - /// need to be retrieved. For each argument to be retrieved the descriptor - /// contains the argument number (0, 1 etc.) and the argument type - /// described using Dart_NativeArgument_Type, e.g: - /// DART_NATIVE_ARG_DESCRIPTOR(Dart_NativeArgument_kBool, 1) indicates - /// that the first argument is to be retrieved and it should be a boolean. - /// \param arg_values array into which the native arguments need to be - /// extracted into, the array is allocated by the caller (it could be - /// stack allocated to avoid the malloc/free performance overhead). - /// - /// \return Success if all the arguments could be extracted correctly, - /// returns an error handle if there were any errors while extracting the - /// arguments (mismatched number of arguments, incorrect types, etc.). - Object Dart_GetNativeArguments( - Dart_NativeArguments args, - int num_arguments, - ffi.Pointer arg_descriptors, - ffi.Pointer arg_values, - ) { - return _Dart_GetNativeArguments( - args, - num_arguments, - arg_descriptors, - arg_values, - ); - } - - late final _Dart_GetNativeArgumentsPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - Dart_NativeArguments, - ffi.Int, - ffi.Pointer, - ffi.Pointer)>>( - 'Dart_GetNativeArguments'); - late final _Dart_GetNativeArguments = _Dart_GetNativeArgumentsPtr.asFunction< - Object Function( - Dart_NativeArguments, - int, - ffi.Pointer, - ffi.Pointer)>(); - - /// Gets the native argument at some index. - Object Dart_GetNativeArgument( - Dart_NativeArguments args, - int index, - ) { - return _Dart_GetNativeArgument( - args, - index, - ); - } - - late final _Dart_GetNativeArgumentPtr = _lookup< - ffi - .NativeFunction>( - 'Dart_GetNativeArgument'); - late final _Dart_GetNativeArgument = _Dart_GetNativeArgumentPtr.asFunction< - Object Function(Dart_NativeArguments, int)>(); - - /// Gets the number of native arguments. - int Dart_GetNativeArgumentCount( - Dart_NativeArguments args, - ) { - return _Dart_GetNativeArgumentCount( - args, - ); - } - - late final _Dart_GetNativeArgumentCountPtr = - _lookup>( - 'Dart_GetNativeArgumentCount'); - late final _Dart_GetNativeArgumentCount = _Dart_GetNativeArgumentCountPtr - .asFunction(); - - /// Gets all the native fields of the native argument at some index. - /// \param args Native arguments structure. - /// \param arg_index Index of the desired argument in the structure above. - /// \param num_fields size of the intptr_t array 'field_values' passed in. - /// \param field_values intptr_t array in which native field values are returned. - /// \return Success if the native fields where copied in successfully. Otherwise - /// returns an error handle. On success the native field values are copied - /// into the 'field_values' array, if the argument at 'arg_index' is a - /// null object then 0 is copied as the native field values into the - /// 'field_values' array. - Object Dart_GetNativeFieldsOfArgument( - Dart_NativeArguments args, - int arg_index, - int num_fields, - ffi.Pointer field_values, - ) { - return _Dart_GetNativeFieldsOfArgument( - args, - arg_index, - num_fields, - field_values, - ); - } - - late final _Dart_GetNativeFieldsOfArgumentPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(Dart_NativeArguments, ffi.Int, ffi.Int, - ffi.Pointer)>>('Dart_GetNativeFieldsOfArgument'); - late final _Dart_GetNativeFieldsOfArgument = - _Dart_GetNativeFieldsOfArgumentPtr.asFunction< - Object Function( - Dart_NativeArguments, int, int, ffi.Pointer)>(); - - /// Gets the native field of the receiver. - Object Dart_GetNativeReceiver( - Dart_NativeArguments args, - ffi.Pointer value, - ) { - return _Dart_GetNativeReceiver( - args, - value, - ); - } - - late final _Dart_GetNativeReceiverPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(Dart_NativeArguments, - ffi.Pointer)>>('Dart_GetNativeReceiver'); - late final _Dart_GetNativeReceiver = _Dart_GetNativeReceiverPtr.asFunction< - Object Function(Dart_NativeArguments, ffi.Pointer)>(); - - /// Gets a string native argument at some index. - /// \param args Native arguments structure. - /// \param arg_index Index of the desired argument in the structure above. - /// \param peer Returns the peer pointer if the string argument has one. - /// \return Success if the string argument has a peer, if it does not - /// have a peer then the String object is returned. Otherwise returns - /// an error handle (argument is not a String object). - Object Dart_GetNativeStringArgument( - Dart_NativeArguments args, - int arg_index, - ffi.Pointer> peer, - ) { - return _Dart_GetNativeStringArgument( - args, - arg_index, - peer, - ); - } - - late final _Dart_GetNativeStringArgumentPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(Dart_NativeArguments, ffi.Int, - ffi.Pointer>)>>( - 'Dart_GetNativeStringArgument'); - late final _Dart_GetNativeStringArgument = - _Dart_GetNativeStringArgumentPtr.asFunction< - Object Function( - Dart_NativeArguments, int, ffi.Pointer>)>(); - - /// Gets an integer native argument at some index. - /// \param args Native arguments structure. - /// \param arg_index Index of the desired argument in the structure above. - /// \param value Returns the integer value if the argument is an Integer. - /// \return Success if no error occurs. Otherwise returns an error handle. - Object Dart_GetNativeIntegerArgument( - Dart_NativeArguments args, - int index, - ffi.Pointer value, - ) { - return _Dart_GetNativeIntegerArgument( - args, - index, - value, - ); - } - - late final _Dart_GetNativeIntegerArgumentPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(Dart_NativeArguments, ffi.Int, - ffi.Pointer)>>('Dart_GetNativeIntegerArgument'); - late final _Dart_GetNativeIntegerArgument = - _Dart_GetNativeIntegerArgumentPtr.asFunction< - Object Function(Dart_NativeArguments, int, ffi.Pointer)>(); - - /// Gets a boolean native argument at some index. - /// \param args Native arguments structure. - /// \param arg_index Index of the desired argument in the structure above. - /// \param value Returns the boolean value if the argument is a Boolean. - /// \return Success if no error occurs. Otherwise returns an error handle. - Object Dart_GetNativeBooleanArgument( - Dart_NativeArguments args, - int index, - ffi.Pointer value, - ) { - return _Dart_GetNativeBooleanArgument( - args, - index, - value, - ); - } - - late final _Dart_GetNativeBooleanArgumentPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(Dart_NativeArguments, ffi.Int, - ffi.Pointer)>>('Dart_GetNativeBooleanArgument'); - late final _Dart_GetNativeBooleanArgument = - _Dart_GetNativeBooleanArgumentPtr.asFunction< - Object Function(Dart_NativeArguments, int, ffi.Pointer)>(); - - /// Gets a double native argument at some index. - /// \param args Native arguments structure. - /// \param arg_index Index of the desired argument in the structure above. - /// \param value Returns the double value if the argument is a double. - /// \return Success if no error occurs. Otherwise returns an error handle. - Object Dart_GetNativeDoubleArgument( - Dart_NativeArguments args, - int index, - ffi.Pointer value, - ) { - return _Dart_GetNativeDoubleArgument( - args, - index, - value, - ); - } - - late final _Dart_GetNativeDoubleArgumentPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(Dart_NativeArguments, ffi.Int, - ffi.Pointer)>>('Dart_GetNativeDoubleArgument'); - late final _Dart_GetNativeDoubleArgument = - _Dart_GetNativeDoubleArgumentPtr.asFunction< - Object Function( - Dart_NativeArguments, int, ffi.Pointer)>(); - - /// Sets the return value for a native function. - /// - /// If retval is an Error handle, then error will be propagated once - /// the native functions exits. See Dart_PropagateError for a - /// discussion of how different types of errors are propagated. - void Dart_SetReturnValue( - Dart_NativeArguments args, - Object retval, - ) { - return _Dart_SetReturnValue( - args, - retval, - ); - } - - late final _Dart_SetReturnValuePtr = _lookup< - ffi - .NativeFunction>( - 'Dart_SetReturnValue'); - late final _Dart_SetReturnValue = _Dart_SetReturnValuePtr.asFunction< - void Function(Dart_NativeArguments, Object)>(); - - void Dart_SetWeakHandleReturnValue( - Dart_NativeArguments args, - Dart_WeakPersistentHandle rval, - ) { - return _Dart_SetWeakHandleReturnValue( - args, - rval, - ); - } - - late final _Dart_SetWeakHandleReturnValuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(Dart_NativeArguments, - Dart_WeakPersistentHandle)>>('Dart_SetWeakHandleReturnValue'); - late final _Dart_SetWeakHandleReturnValue = - _Dart_SetWeakHandleReturnValuePtr.asFunction< - void Function(Dart_NativeArguments, Dart_WeakPersistentHandle)>(); - - void Dart_SetBooleanReturnValue( - Dart_NativeArguments args, - bool retval, - ) { - return _Dart_SetBooleanReturnValue( - args, - retval, - ); - } - - late final _Dart_SetBooleanReturnValuePtr = _lookup< - ffi - .NativeFunction>( - 'Dart_SetBooleanReturnValue'); - late final _Dart_SetBooleanReturnValue = _Dart_SetBooleanReturnValuePtr - .asFunction(); - - void Dart_SetIntegerReturnValue( - Dart_NativeArguments args, - int retval, - ) { - return _Dart_SetIntegerReturnValue( - args, - retval, - ); - } - - late final _Dart_SetIntegerReturnValuePtr = _lookup< - ffi - .NativeFunction>( - 'Dart_SetIntegerReturnValue'); - late final _Dart_SetIntegerReturnValue = _Dart_SetIntegerReturnValuePtr - .asFunction(); - - void Dart_SetDoubleReturnValue( - Dart_NativeArguments args, - double retval, - ) { - return _Dart_SetDoubleReturnValue( - args, - retval, - ); - } - - late final _Dart_SetDoubleReturnValuePtr = _lookup< - ffi - .NativeFunction>( - 'Dart_SetDoubleReturnValue'); - late final _Dart_SetDoubleReturnValue = _Dart_SetDoubleReturnValuePtr - .asFunction(); - - /// Sets the environment callback for the current isolate. This - /// callback is used to lookup environment values by name in the - /// current environment. This enables the embedder to supply values for - /// the const constructors bool.fromEnvironment, int.fromEnvironment - /// and String.fromEnvironment. - Object Dart_SetEnvironmentCallback( - Dart_EnvironmentCallback callback, - ) { - return _Dart_SetEnvironmentCallback( - callback, - ); - } - - late final _Dart_SetEnvironmentCallbackPtr = _lookup< - ffi.NativeFunction>( - 'Dart_SetEnvironmentCallback'); - late final _Dart_SetEnvironmentCallback = _Dart_SetEnvironmentCallbackPtr - .asFunction(); - - /// Sets the callback used to resolve native functions for a library. - /// - /// \param library A library. - /// \param resolver A native entry resolver. - /// - /// \return A valid handle if the native resolver was set successfully. - Object Dart_SetNativeResolver( - Object library1, - Dart_NativeEntryResolver resolver, - Dart_NativeEntrySymbol symbol, - ) { - return _Dart_SetNativeResolver( - library1, - resolver, - symbol, - ); - } - - late final _Dart_SetNativeResolverPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, Dart_NativeEntryResolver, - Dart_NativeEntrySymbol)>>('Dart_SetNativeResolver'); - late final _Dart_SetNativeResolver = _Dart_SetNativeResolverPtr.asFunction< - Object Function( - Object, Dart_NativeEntryResolver, Dart_NativeEntrySymbol)>(); - - /// Returns the callback used to resolve native functions for a library. - /// - /// \param library A library. - /// \param resolver a pointer to a Dart_NativeEntryResolver - /// - /// \return A valid handle if the library was found. - Object Dart_GetNativeResolver( - Object library1, - ffi.Pointer resolver, - ) { - return _Dart_GetNativeResolver( - library1, - resolver, - ); - } - - late final _Dart_GetNativeResolverPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>( - 'Dart_GetNativeResolver'); - late final _Dart_GetNativeResolver = _Dart_GetNativeResolverPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Returns the callback used to resolve native function symbols for a library. - /// - /// \param library A library. - /// \param resolver a pointer to a Dart_NativeEntrySymbol. - /// - /// \return A valid handle if the library was found. - Object Dart_GetNativeSymbol( - Object library1, - ffi.Pointer resolver, - ) { - return _Dart_GetNativeSymbol( - library1, - resolver, - ); - } - - late final _Dart_GetNativeSymbolPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, - ffi.Pointer)>>('Dart_GetNativeSymbol'); - late final _Dart_GetNativeSymbol = _Dart_GetNativeSymbolPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Sets the callback used to resolve FFI native functions for a library. - /// The resolved functions are expected to be a C function pointer of the - /// correct signature (as specified in the `@FfiNative()` function - /// annotation in Dart code). - /// - /// NOTE: This is an experimental feature and might change in the future. - /// - /// \param library A library. - /// \param resolver A native function resolver. - /// - /// \return A valid handle if the native resolver was set successfully. - Object Dart_SetFfiNativeResolver( - Object library1, - Dart_FfiNativeResolver resolver, - ) { - return _Dart_SetFfiNativeResolver( - library1, - resolver, - ); - } - - late final _Dart_SetFfiNativeResolverPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, - Dart_FfiNativeResolver)>>('Dart_SetFfiNativeResolver'); - late final _Dart_SetFfiNativeResolver = _Dart_SetFfiNativeResolverPtr - .asFunction(); - - /// Sets library tag handler for the current isolate. This handler is - /// used to handle the various tags encountered while loading libraries - /// or scripts in the isolate. - /// - /// \param handler Handler code to be used for handling the various tags - /// encountered while loading libraries or scripts in the isolate. - /// - /// \return If no error occurs, the handler is set for the isolate. - /// Otherwise an error handle is returned. - /// - /// TODO(turnidge): Document. - Object Dart_SetLibraryTagHandler( - Dart_LibraryTagHandler handler, - ) { - return _Dart_SetLibraryTagHandler( - handler, - ); - } - - late final _Dart_SetLibraryTagHandlerPtr = - _lookup>( - 'Dart_SetLibraryTagHandler'); - late final _Dart_SetLibraryTagHandler = _Dart_SetLibraryTagHandlerPtr - .asFunction(); - - /// Sets the deferred load handler for the current isolate. This handler is - /// used to handle loading deferred imports in an AppJIT or AppAOT program. - Object Dart_SetDeferredLoadHandler( - Dart_DeferredLoadHandler handler, - ) { - return _Dart_SetDeferredLoadHandler( - handler, - ); - } - - late final _Dart_SetDeferredLoadHandlerPtr = _lookup< - ffi.NativeFunction>( - 'Dart_SetDeferredLoadHandler'); - late final _Dart_SetDeferredLoadHandler = _Dart_SetDeferredLoadHandlerPtr - .asFunction(); - - /// Notifies the VM that a deferred load completed successfully. This function - /// will eventually cause the corresponding `prefix.loadLibrary()` futures to - /// complete. - /// - /// Requires the current isolate to be the same current isolate during the - /// invocation of the Dart_DeferredLoadHandler. - Object Dart_DeferredLoadComplete( - int loading_unit_id, - ffi.Pointer snapshot_data, - ffi.Pointer snapshot_instructions, - ) { - return _Dart_DeferredLoadComplete( - loading_unit_id, - snapshot_data, - snapshot_instructions, - ); - } - - late final _Dart_DeferredLoadCompletePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.IntPtr, ffi.Pointer, - ffi.Pointer)>>('Dart_DeferredLoadComplete'); - late final _Dart_DeferredLoadComplete = - _Dart_DeferredLoadCompletePtr.asFunction< - Object Function( - int, ffi.Pointer, ffi.Pointer)>(); - - /// Notifies the VM that a deferred load failed. This function - /// will eventually cause the corresponding `prefix.loadLibrary()` futures to - /// complete with an error. - /// - /// If `transient` is true, future invocations of `prefix.loadLibrary()` will - /// trigger new load requests. If false, futures invocation will complete with - /// the same error. - /// - /// Requires the current isolate to be the same current isolate during the - /// invocation of the Dart_DeferredLoadHandler. - Object Dart_DeferredLoadCompleteError( - int loading_unit_id, - ffi.Pointer error_message, - bool transient, - ) { - return _Dart_DeferredLoadCompleteError( - loading_unit_id, - error_message, - transient, - ); - } - - late final _Dart_DeferredLoadCompleteErrorPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.IntPtr, ffi.Pointer, - ffi.Bool)>>('Dart_DeferredLoadCompleteError'); - late final _Dart_DeferredLoadCompleteError = - _Dart_DeferredLoadCompleteErrorPtr.asFunction< - Object Function(int, ffi.Pointer, bool)>(); - - /// Canonicalizes a url with respect to some library. - /// - /// The url is resolved with respect to the library's url and some url - /// normalizations are performed. - /// - /// This canonicalization function should be sufficient for most - /// embedders to implement the Dart_kCanonicalizeUrl tag. - /// - /// \param base_url The base url relative to which the url is - /// being resolved. - /// \param url The url being resolved and canonicalized. This - /// parameter is a string handle. - /// - /// \return If no error occurs, a String object is returned. Otherwise - /// an error handle is returned. - Object Dart_DefaultCanonicalizeUrl( - Object base_url, - Object url, - ) { - return _Dart_DefaultCanonicalizeUrl( - base_url, - url, - ); - } - - late final _Dart_DefaultCanonicalizeUrlPtr = - _lookup>( - 'Dart_DefaultCanonicalizeUrl'); - late final _Dart_DefaultCanonicalizeUrl = _Dart_DefaultCanonicalizeUrlPtr - .asFunction(); - - /// Loads the root library for the current isolate. - /// - /// Requires there to be no current root library. - /// - /// \param buffer A buffer which contains a kernel binary (see - /// pkg/kernel/binary.md). Must remain valid until isolate group shutdown. - /// \param buffer_size Length of the passed in buffer. - /// - /// \return A handle to the root library, or an error. - Object Dart_LoadScriptFromKernel( - ffi.Pointer kernel_buffer, - int kernel_size, - ) { - return _Dart_LoadScriptFromKernel( - kernel_buffer, - kernel_size, - ); - } - - late final _Dart_LoadScriptFromKernelPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Pointer, - ffi.IntPtr)>>('Dart_LoadScriptFromKernel'); - late final _Dart_LoadScriptFromKernel = _Dart_LoadScriptFromKernelPtr - .asFunction, int)>(); - - /// Gets the library for the root script for the current isolate. - /// - /// If the root script has not yet been set for the current isolate, - /// this function returns Dart_Null(). This function never returns an - /// error handle. - /// - /// \return Returns the root Library for the current isolate or Dart_Null(). - Object Dart_RootLibrary() { - return _Dart_RootLibrary(); - } - - late final _Dart_RootLibraryPtr = - _lookup>('Dart_RootLibrary'); - late final _Dart_RootLibrary = - _Dart_RootLibraryPtr.asFunction(); - - /// Sets the root library for the current isolate. - /// - /// \return Returns an error handle if `library` is not a library handle. - Object Dart_SetRootLibrary( - Object library1, - ) { - return _Dart_SetRootLibrary( - library1, - ); - } - - late final _Dart_SetRootLibraryPtr = - _lookup>( - 'Dart_SetRootLibrary'); - late final _Dart_SetRootLibrary = - _Dart_SetRootLibraryPtr.asFunction(); - - /// Lookup or instantiate a legacy type by name and type arguments from a - /// Library. - /// - /// \param library The library containing the class or interface. - /// \param class_name The class name for the type. - /// \param number_of_type_arguments Number of type arguments. - /// For non parametric types the number of type arguments would be 0. - /// \param type_arguments Pointer to an array of type arguments. - /// For non parameteric types a NULL would be passed in for this argument. - /// - /// \return If no error occurs, the type is returned. - /// Otherwise an error handle is returned. - Object Dart_GetType( - Object library1, - Object class_name, - int number_of_type_arguments, - ffi.Pointer type_arguments, - ) { - return _Dart_GetType( - library1, - class_name, - number_of_type_arguments, - type_arguments, - ); - } - - late final _Dart_GetTypePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, ffi.IntPtr, - ffi.Pointer)>>('Dart_GetType'); - late final _Dart_GetType = _Dart_GetTypePtr.asFunction< - Object Function(Object, Object, int, ffi.Pointer)>(); - - /// Lookup or instantiate a nullable type by name and type arguments from - /// Library. - /// - /// \param library The library containing the class or interface. - /// \param class_name The class name for the type. - /// \param number_of_type_arguments Number of type arguments. - /// For non parametric types the number of type arguments would be 0. - /// \param type_arguments Pointer to an array of type arguments. - /// For non parameteric types a NULL would be passed in for this argument. - /// - /// \return If no error occurs, the type is returned. - /// Otherwise an error handle is returned. - Object Dart_GetNullableType( - Object library1, - Object class_name, - int number_of_type_arguments, - ffi.Pointer type_arguments, - ) { - return _Dart_GetNullableType( - library1, - class_name, - number_of_type_arguments, - type_arguments, - ); - } - - late final _Dart_GetNullableTypePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, ffi.IntPtr, - ffi.Pointer)>>('Dart_GetNullableType'); - late final _Dart_GetNullableType = _Dart_GetNullableTypePtr.asFunction< - Object Function(Object, Object, int, ffi.Pointer)>(); - - /// Lookup or instantiate a non-nullable type by name and type arguments from - /// Library. - /// - /// \param library The library containing the class or interface. - /// \param class_name The class name for the type. - /// \param number_of_type_arguments Number of type arguments. - /// For non parametric types the number of type arguments would be 0. - /// \param type_arguments Pointer to an array of type arguments. - /// For non parameteric types a NULL would be passed in for this argument. - /// - /// \return If no error occurs, the type is returned. - /// Otherwise an error handle is returned. - Object Dart_GetNonNullableType( - Object library1, - Object class_name, - int number_of_type_arguments, - ffi.Pointer type_arguments, - ) { - return _Dart_GetNonNullableType( - library1, - class_name, - number_of_type_arguments, - type_arguments, - ); - } - - late final _Dart_GetNonNullableTypePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Handle, ffi.Handle, ffi.IntPtr, - ffi.Pointer)>>('Dart_GetNonNullableType'); - late final _Dart_GetNonNullableType = _Dart_GetNonNullableTypePtr.asFunction< - Object Function(Object, Object, int, ffi.Pointer)>(); - - /// Creates a nullable version of the provided type. - /// - /// \param type The type to be converted to a nullable type. - /// - /// \return If no error occurs, a nullable type is returned. - /// Otherwise an error handle is returned. - Object Dart_TypeToNullableType( - Object type, - ) { - return _Dart_TypeToNullableType( - type, - ); - } - - late final _Dart_TypeToNullableTypePtr = - _lookup>( - 'Dart_TypeToNullableType'); - late final _Dart_TypeToNullableType = - _Dart_TypeToNullableTypePtr.asFunction(); - - /// Creates a non-nullable version of the provided type. - /// - /// \param type The type to be converted to a non-nullable type. - /// - /// \return If no error occurs, a non-nullable type is returned. - /// Otherwise an error handle is returned. - Object Dart_TypeToNonNullableType( - Object type, - ) { - return _Dart_TypeToNonNullableType( - type, - ); - } - - late final _Dart_TypeToNonNullableTypePtr = - _lookup>( - 'Dart_TypeToNonNullableType'); - late final _Dart_TypeToNonNullableType = - _Dart_TypeToNonNullableTypePtr.asFunction(); - - /// A type's nullability. - /// - /// \param type A Dart type. - /// \param result An out parameter containing the result of the check. True if - /// the type is of the specified nullability, false otherwise. - /// - /// \return Returns an error handle if type is not of type Type. - Object Dart_IsNullableType( - Object type, - ffi.Pointer result, - ) { - return _Dart_IsNullableType( - type, - result, - ); - } - - late final _Dart_IsNullableTypePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_IsNullableType'); - late final _Dart_IsNullableType = _Dart_IsNullableTypePtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - Object Dart_IsNonNullableType( - Object type, - ffi.Pointer result, - ) { - return _Dart_IsNonNullableType( - type, - result, - ); - } - - late final _Dart_IsNonNullableTypePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_IsNonNullableType'); - late final _Dart_IsNonNullableType = _Dart_IsNonNullableTypePtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - Object Dart_IsLegacyType( - Object type, - ffi.Pointer result, - ) { - return _Dart_IsLegacyType( - type, - result, - ); - } - - late final _Dart_IsLegacyTypePtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_IsLegacyType'); - late final _Dart_IsLegacyType = _Dart_IsLegacyTypePtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - /// Lookup a class or interface by name from a Library. - /// - /// \param library The library containing the class or interface. - /// \param class_name The name of the class or interface. - /// - /// \return If no error occurs, the class or interface is - /// returned. Otherwise an error handle is returned. - Object Dart_GetClass( - Object library1, - Object class_name, - ) { - return _Dart_GetClass( - library1, - class_name, - ); - } - - late final _Dart_GetClassPtr = - _lookup>( - 'Dart_GetClass'); - late final _Dart_GetClass = - _Dart_GetClassPtr.asFunction(); - - /// Returns an import path to a Library, such as "file:///test.dart" or - /// "dart:core". - Object Dart_LibraryUrl( - Object library1, - ) { - return _Dart_LibraryUrl( - library1, - ); - } - - late final _Dart_LibraryUrlPtr = - _lookup>( - 'Dart_LibraryUrl'); - late final _Dart_LibraryUrl = - _Dart_LibraryUrlPtr.asFunction(); - - /// Returns a URL from which a Library was loaded. - Object Dart_LibraryResolvedUrl( - Object library1, - ) { - return _Dart_LibraryResolvedUrl( - library1, - ); - } - - late final _Dart_LibraryResolvedUrlPtr = - _lookup>( - 'Dart_LibraryResolvedUrl'); - late final _Dart_LibraryResolvedUrl = - _Dart_LibraryResolvedUrlPtr.asFunction(); - - /// \return An array of libraries. - Object Dart_GetLoadedLibraries() { - return _Dart_GetLoadedLibraries(); - } - - late final _Dart_GetLoadedLibrariesPtr = - _lookup>( - 'Dart_GetLoadedLibraries'); - late final _Dart_GetLoadedLibraries = - _Dart_GetLoadedLibrariesPtr.asFunction(); - - Object Dart_LookupLibrary( - Object url, - ) { - return _Dart_LookupLibrary( - url, - ); - } - - late final _Dart_LookupLibraryPtr = - _lookup>( - 'Dart_LookupLibrary'); - late final _Dart_LookupLibrary = - _Dart_LookupLibraryPtr.asFunction(); - - /// Report an loading error for the library. - /// - /// \param library The library that failed to load. - /// \param error The Dart error instance containing the load error. - /// - /// \return If the VM handles the error, the return value is - /// a null handle. If it doesn't handle the error, the error - /// object is returned. - Object Dart_LibraryHandleError( - Object library1, - Object error, - ) { - return _Dart_LibraryHandleError( - library1, - error, - ); - } - - late final _Dart_LibraryHandleErrorPtr = - _lookup>( - 'Dart_LibraryHandleError'); - late final _Dart_LibraryHandleError = - _Dart_LibraryHandleErrorPtr.asFunction(); - - /// Called by the embedder to load a partial program. Does not set the root - /// library. - /// - /// \param buffer A buffer which contains a kernel binary (see - /// pkg/kernel/binary.md). Must remain valid until isolate shutdown. - /// \param buffer_size Length of the passed in buffer. - /// - /// \return A handle to the main library of the compilation unit, or an error. - Object Dart_LoadLibraryFromKernel( - ffi.Pointer kernel_buffer, - int kernel_buffer_size, - ) { - return _Dart_LoadLibraryFromKernel( - kernel_buffer, - kernel_buffer_size, - ); - } - - late final _Dart_LoadLibraryFromKernelPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Pointer, - ffi.IntPtr)>>('Dart_LoadLibraryFromKernel'); - late final _Dart_LoadLibraryFromKernel = _Dart_LoadLibraryFromKernelPtr - .asFunction, int)>(); - - /// Indicates that all outstanding load requests have been satisfied. - /// This finalizes all the new classes loaded and optionally completes - /// deferred library futures. - /// - /// Requires there to be a current isolate. - /// - /// \param complete_futures Specify true if all deferred library - /// futures should be completed, false otherwise. - /// - /// \return Success if all classes have been finalized and deferred library - /// futures are completed. Otherwise, returns an error. - Object Dart_FinalizeLoading( - bool complete_futures, - ) { - return _Dart_FinalizeLoading( - complete_futures, - ); - } - - late final _Dart_FinalizeLoadingPtr = - _lookup>( - 'Dart_FinalizeLoading'); - late final _Dart_FinalizeLoading = - _Dart_FinalizeLoadingPtr.asFunction(); - - /// Returns the value of peer field of 'object' in 'peer'. - /// - /// \param object An object. - /// \param peer An out parameter that returns the value of the peer - /// field. - /// - /// \return Returns an error if 'object' is a subtype of Null, num, or - /// bool. - Object Dart_GetPeer( - Object object, - ffi.Pointer> peer, - ) { - return _Dart_GetPeer( - object, - peer, - ); - } - - late final _Dart_GetPeerPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer>)>>('Dart_GetPeer'); - late final _Dart_GetPeer = _Dart_GetPeerPtr.asFunction< - Object Function(Object, ffi.Pointer>)>(); - - /// Sets the value of the peer field of 'object' to the value of - /// 'peer'. - /// - /// \param object An object. - /// \param peer A value to store in the peer field. - /// - /// \return Returns an error if 'object' is a subtype of Null, num, or - /// bool. - Object Dart_SetPeer( - Object object, - ffi.Pointer peer, - ) { - return _Dart_SetPeer( - object, - peer, - ); - } - - late final _Dart_SetPeerPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Handle, ffi.Pointer)>>('Dart_SetPeer'); - late final _Dart_SetPeer = _Dart_SetPeerPtr.asFunction< - Object Function(Object, ffi.Pointer)>(); - - bool Dart_IsKernelIsolate( - Dart_Isolate isolate, - ) { - return _Dart_IsKernelIsolate( - isolate, - ); - } - - late final _Dart_IsKernelIsolatePtr = - _lookup>( - 'Dart_IsKernelIsolate'); - late final _Dart_IsKernelIsolate = - _Dart_IsKernelIsolatePtr.asFunction(); - - bool Dart_KernelIsolateIsRunning() { - return _Dart_KernelIsolateIsRunning(); - } - - late final _Dart_KernelIsolateIsRunningPtr = - _lookup>( - 'Dart_KernelIsolateIsRunning'); - late final _Dart_KernelIsolateIsRunning = - _Dart_KernelIsolateIsRunningPtr.asFunction(); - - int Dart_KernelPort() { - return _Dart_KernelPort(); - } - - late final _Dart_KernelPortPtr = - _lookup>('Dart_KernelPort'); - late final _Dart_KernelPort = - _Dart_KernelPortPtr.asFunction(); - - /// Compiles the given `script_uri` to a kernel file. - /// - /// \param platform_kernel A buffer containing the kernel of the platform (e.g. - /// `vm_platform_strong.dill`). The VM does not take ownership of this memory. - /// - /// \param platform_kernel_size The length of the platform_kernel buffer. - /// - /// \param snapshot_compile Set to `true` when the compilation is for a snapshot. - /// This is used by the frontend to determine if compilation related information - /// should be printed to console (e.g., null safety mode). - /// - /// \param verbosity Specifies the logging behavior of the kernel compilation - /// service. - /// - /// \return Returns the result of the compilation. - /// - /// On a successful compilation the returned [Dart_KernelCompilationResult] has - /// a status of [Dart_KernelCompilationStatus_Ok] and the `kernel`/`kernel_size` - /// fields are set. The caller takes ownership of the malloc()ed buffer. - /// - /// On a failed compilation the `error` might be set describing the reason for - /// the failed compilation. The caller takes ownership of the malloc()ed - /// error. - /// - /// Requires there to be a current isolate. - Dart_KernelCompilationResult Dart_CompileToKernel( - ffi.Pointer script_uri, - ffi.Pointer platform_kernel, - int platform_kernel_size, - bool incremental_compile, - bool snapshot_compile, - ffi.Pointer package_config, - int verbosity, - ) { - return _Dart_CompileToKernel( - script_uri, - platform_kernel, - platform_kernel_size, - incremental_compile, - snapshot_compile, - package_config, - verbosity, - ); - } - - late final _Dart_CompileToKernelPtr = _lookup< - ffi.NativeFunction< - Dart_KernelCompilationResult Function( - ffi.Pointer, - ffi.Pointer, - ffi.IntPtr, - ffi.Bool, - ffi.Bool, - ffi.Pointer, - ffi.Int32)>>('Dart_CompileToKernel'); - late final _Dart_CompileToKernel = _Dart_CompileToKernelPtr.asFunction< - Dart_KernelCompilationResult Function( - ffi.Pointer, - ffi.Pointer, - int, - bool, - bool, - ffi.Pointer, - int)>(); - - Dart_KernelCompilationResult Dart_KernelListDependencies() { - return _Dart_KernelListDependencies(); - } - - late final _Dart_KernelListDependenciesPtr = - _lookup>( - 'Dart_KernelListDependencies'); - late final _Dart_KernelListDependencies = _Dart_KernelListDependenciesPtr - .asFunction(); - - /// Sets the kernel buffer which will be used to load Dart SDK sources - /// dynamically at runtime. - /// - /// \param platform_kernel A buffer containing kernel which has sources for the - /// Dart SDK populated. Note: The VM does not take ownership of this memory. - /// - /// \param platform_kernel_size The length of the platform_kernel buffer. - void Dart_SetDartLibrarySourcesKernel( - ffi.Pointer platform_kernel, - int platform_kernel_size, - ) { - return _Dart_SetDartLibrarySourcesKernel( - platform_kernel, - platform_kernel_size, - ); - } - - late final _Dart_SetDartLibrarySourcesKernelPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, - ffi.IntPtr)>>('Dart_SetDartLibrarySourcesKernel'); - late final _Dart_SetDartLibrarySourcesKernel = - _Dart_SetDartLibrarySourcesKernelPtr.asFunction< - void Function(ffi.Pointer, int)>(); - - /// Detect the null safety opt-in status. - /// - /// When running from source, it is based on the opt-in status of `script_uri`. - /// When running from a kernel buffer, it is based on the mode used when - /// generating `kernel_buffer`. - /// When running from an appJIT or AOT snapshot, it is based on the mode used - /// when generating `snapshot_data`. - /// - /// \param script_uri Uri of the script that contains the source code - /// - /// \param package_config Uri of the package configuration file (either in format - /// of .packages or .dart_tool/package_config.json) for the null safety - /// detection to resolve package imports against. If this parameter is not - /// passed the package resolution of the parent isolate should be used. - /// - /// \param original_working_directory current working directory when the VM - /// process was launched, this is used to correctly resolve the path specified - /// for package_config. - /// - /// \param snapshot_data - /// - /// \param snapshot_instructions Buffers containing a snapshot of the - /// isolate or NULL if no snapshot is provided. If provided, the buffers must - /// remain valid until the isolate shuts down. - /// - /// \param kernel_buffer - /// - /// \param kernel_buffer_size A buffer which contains a kernel/DIL program. Must - /// remain valid until isolate shutdown. - /// - /// \return Returns true if the null safety is opted in by the input being - /// run `script_uri`, `snapshot_data` or `kernel_buffer`. - bool Dart_DetectNullSafety( - ffi.Pointer script_uri, - ffi.Pointer package_config, - ffi.Pointer original_working_directory, - ffi.Pointer snapshot_data, - ffi.Pointer snapshot_instructions, - ffi.Pointer kernel_buffer, - int kernel_buffer_size, - ) { - return _Dart_DetectNullSafety( - script_uri, - package_config, - original_working_directory, - snapshot_data, - snapshot_instructions, - kernel_buffer, - kernel_buffer_size, - ); - } - - late final _Dart_DetectNullSafetyPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.IntPtr)>>('Dart_DetectNullSafety'); - late final _Dart_DetectNullSafety = _Dart_DetectNullSafetyPtr.asFunction< - bool Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int)>(); - - /// Returns true if isolate is the service isolate. - /// - /// \param isolate An isolate - /// - /// \return Returns true if 'isolate' is the service isolate. - bool Dart_IsServiceIsolate( - Dart_Isolate isolate, - ) { - return _Dart_IsServiceIsolate( - isolate, - ); - } - - late final _Dart_IsServiceIsolatePtr = - _lookup>( - 'Dart_IsServiceIsolate'); - late final _Dart_IsServiceIsolate = - _Dart_IsServiceIsolatePtr.asFunction(); - - /// Writes the CPU profile to the timeline as a series of 'instant' events. - /// - /// Note that this is an expensive operation. - /// - /// \param main_port The main port of the Isolate whose profile samples to write. - /// \param error An optional error, must be free()ed by caller. - /// - /// \return Returns true if the profile is successfully written and false - /// otherwise. - bool Dart_WriteProfileToTimeline( - int main_port, - ffi.Pointer> error, - ) { - return _Dart_WriteProfileToTimeline( - main_port, - error, - ); - } - - late final _Dart_WriteProfileToTimelinePtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - Dart_Port, ffi.Pointer>)>>( - 'Dart_WriteProfileToTimeline'); - late final _Dart_WriteProfileToTimeline = _Dart_WriteProfileToTimelinePtr - .asFunction>)>(); - - /// Compiles all functions reachable from entry points and marks - /// the isolate to disallow future compilation. - /// - /// Entry points should be specified using `@pragma("vm:entry-point")` - /// annotation. - /// - /// \return An error handle if a compilation error or runtime error running const - /// constructors was encountered. - Object Dart_Precompile() { - return _Dart_Precompile(); - } - - late final _Dart_PrecompilePtr = - _lookup>('Dart_Precompile'); - late final _Dart_Precompile = - _Dart_PrecompilePtr.asFunction(); - - Object Dart_LoadingUnitLibraryUris( - int loading_unit_id, - ) { - return _Dart_LoadingUnitLibraryUris( - loading_unit_id, - ); - } - - late final _Dart_LoadingUnitLibraryUrisPtr = - _lookup>( - 'Dart_LoadingUnitLibraryUris'); - late final _Dart_LoadingUnitLibraryUris = - _Dart_LoadingUnitLibraryUrisPtr.asFunction(); - - /// Creates a precompiled snapshot. - /// - A root library must have been loaded. - /// - Dart_Precompile must have been called. - /// - /// Outputs an assembly file defining the symbols listed in the definitions - /// above. - /// - /// The assembly should be compiled as a static or shared library and linked or - /// loaded by the embedder. Running this snapshot requires a VM compiled with - /// DART_PRECOMPILED_SNAPSHOT. The kDartVmSnapshotData and - /// kDartVmSnapshotInstructions should be passed to Dart_Initialize. The - /// kDartIsolateSnapshotData and kDartIsolateSnapshotInstructions should be - /// passed to Dart_CreateIsolateGroup. - /// - /// The callback will be invoked one or more times to provide the assembly code. - /// - /// If stripped is true, then the assembly code will not include DWARF - /// debugging sections. - /// - /// If debug_callback_data is provided, debug_callback_data will be used with - /// the callback to provide separate debugging information. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_CreateAppAOTSnapshotAsAssembly( - Dart_StreamingWriteCallback callback, - ffi.Pointer callback_data, - bool stripped, - ffi.Pointer debug_callback_data, - ) { - return _Dart_CreateAppAOTSnapshotAsAssembly( - callback, - callback_data, - stripped, - debug_callback_data, - ); - } - - late final _Dart_CreateAppAOTSnapshotAsAssemblyPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - Dart_StreamingWriteCallback, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('Dart_CreateAppAOTSnapshotAsAssembly'); - late final _Dart_CreateAppAOTSnapshotAsAssembly = - _Dart_CreateAppAOTSnapshotAsAssemblyPtr.asFunction< - Object Function(Dart_StreamingWriteCallback, ffi.Pointer, - bool, ffi.Pointer)>(); - - Object Dart_CreateAppAOTSnapshotAsAssemblies( - Dart_CreateLoadingUnitCallback next_callback, - ffi.Pointer next_callback_data, - bool stripped, - Dart_StreamingWriteCallback write_callback, - Dart_StreamingCloseCallback close_callback, - ) { - return _Dart_CreateAppAOTSnapshotAsAssemblies( - next_callback, - next_callback_data, - stripped, - write_callback, - close_callback, - ); - } - - late final _Dart_CreateAppAOTSnapshotAsAssembliesPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - Dart_CreateLoadingUnitCallback, - ffi.Pointer, - ffi.Bool, - Dart_StreamingWriteCallback, - Dart_StreamingCloseCallback)>>( - 'Dart_CreateAppAOTSnapshotAsAssemblies'); - late final _Dart_CreateAppAOTSnapshotAsAssemblies = - _Dart_CreateAppAOTSnapshotAsAssembliesPtr.asFunction< - Object Function( - Dart_CreateLoadingUnitCallback, - ffi.Pointer, - bool, - Dart_StreamingWriteCallback, - Dart_StreamingCloseCallback)>(); - - /// Creates a precompiled snapshot. - /// - A root library must have been loaded. - /// - Dart_Precompile must have been called. - /// - /// Outputs an ELF shared library defining the symbols - /// - _kDartVmSnapshotData - /// - _kDartVmSnapshotInstructions - /// - _kDartIsolateSnapshotData - /// - _kDartIsolateSnapshotInstructions - /// - /// The shared library should be dynamically loaded by the embedder. - /// Running this snapshot requires a VM compiled with DART_PRECOMPILED_SNAPSHOT. - /// The kDartVmSnapshotData and kDartVmSnapshotInstructions should be passed to - /// Dart_Initialize. The kDartIsolateSnapshotData and - /// kDartIsolateSnapshotInstructions should be passed to Dart_CreateIsolate. - /// - /// The callback will be invoked one or more times to provide the binary output. - /// - /// If stripped is true, then the binary output will not include DWARF - /// debugging sections. - /// - /// If debug_callback_data is provided, debug_callback_data will be used with - /// the callback to provide separate debugging information. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_CreateAppAOTSnapshotAsElf( - Dart_StreamingWriteCallback callback, - ffi.Pointer callback_data, - bool stripped, - ffi.Pointer debug_callback_data, - ) { - return _Dart_CreateAppAOTSnapshotAsElf( - callback, - callback_data, - stripped, - debug_callback_data, - ); - } - - late final _Dart_CreateAppAOTSnapshotAsElfPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - Dart_StreamingWriteCallback, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>>('Dart_CreateAppAOTSnapshotAsElf'); - late final _Dart_CreateAppAOTSnapshotAsElf = - _Dart_CreateAppAOTSnapshotAsElfPtr.asFunction< - Object Function(Dart_StreamingWriteCallback, ffi.Pointer, - bool, ffi.Pointer)>(); - - Object Dart_CreateAppAOTSnapshotAsElfs( - Dart_CreateLoadingUnitCallback next_callback, - ffi.Pointer next_callback_data, - bool stripped, - Dart_StreamingWriteCallback write_callback, - Dart_StreamingCloseCallback close_callback, - ) { - return _Dart_CreateAppAOTSnapshotAsElfs( - next_callback, - next_callback_data, - stripped, - write_callback, - close_callback, - ); - } - - late final _Dart_CreateAppAOTSnapshotAsElfsPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - Dart_CreateLoadingUnitCallback, - ffi.Pointer, - ffi.Bool, - Dart_StreamingWriteCallback, - Dart_StreamingCloseCallback)>>('Dart_CreateAppAOTSnapshotAsElfs'); - late final _Dart_CreateAppAOTSnapshotAsElfs = - _Dart_CreateAppAOTSnapshotAsElfsPtr.asFunction< - Object Function( - Dart_CreateLoadingUnitCallback, - ffi.Pointer, - bool, - Dart_StreamingWriteCallback, - Dart_StreamingCloseCallback)>(); - - /// Like Dart_CreateAppAOTSnapshotAsAssembly, but only includes - /// kDartVmSnapshotData and kDartVmSnapshotInstructions. It also does - /// not strip DWARF information from the generated assembly or allow for - /// separate debug information. - Object Dart_CreateVMAOTSnapshotAsAssembly( - Dart_StreamingWriteCallback callback, - ffi.Pointer callback_data, - ) { - return _Dart_CreateVMAOTSnapshotAsAssembly( - callback, - callback_data, - ); - } - - late final _Dart_CreateVMAOTSnapshotAsAssemblyPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(Dart_StreamingWriteCallback, - ffi.Pointer)>>('Dart_CreateVMAOTSnapshotAsAssembly'); - late final _Dart_CreateVMAOTSnapshotAsAssembly = - _Dart_CreateVMAOTSnapshotAsAssemblyPtr.asFunction< - Object Function( - Dart_StreamingWriteCallback, ffi.Pointer)>(); - - /// Sorts the class-ids in depth first traversal order of the inheritance - /// tree. This is a costly operation, but it can make method dispatch - /// more efficient and is done before writing snapshots. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_SortClasses() { - return _Dart_SortClasses(); - } - - late final _Dart_SortClassesPtr = - _lookup>('Dart_SortClasses'); - late final _Dart_SortClasses = - _Dart_SortClassesPtr.asFunction(); - - /// Creates a snapshot that caches compiled code and type feedback for faster - /// startup and quicker warmup in a subsequent process. - /// - /// Outputs a snapshot in two pieces. The pieces should be passed to - /// Dart_CreateIsolateGroup in a VM using the same VM snapshot pieces used in the - /// current VM. The instructions piece must be loaded with read and execute - /// permissions; the data piece may be loaded as read-only. - /// - /// - Requires the VM to have not been started with --precompilation. - /// - Not supported when targeting IA32. - /// - The VM writing the snapshot and the VM reading the snapshot must be the - /// same version, must be built in the same DEBUG/RELEASE/PRODUCT mode, must - /// be targeting the same architecture, and must both be in checked mode or - /// both in unchecked mode. - /// - /// The buffers are scope allocated and are only valid until the next call to - /// Dart_ExitScope. - /// - /// \return A valid handle if no error occurs during the operation. - Object Dart_CreateAppJITSnapshotAsBlobs( - ffi.Pointer> isolate_snapshot_data_buffer, - ffi.Pointer isolate_snapshot_data_size, - ffi.Pointer> isolate_snapshot_instructions_buffer, - ffi.Pointer isolate_snapshot_instructions_size, - ) { - return _Dart_CreateAppJITSnapshotAsBlobs( - isolate_snapshot_data_buffer, - isolate_snapshot_data_size, - isolate_snapshot_instructions_buffer, - isolate_snapshot_instructions_size, - ); - } - - late final _Dart_CreateAppJITSnapshotAsBlobsPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('Dart_CreateAppJITSnapshotAsBlobs'); - late final _Dart_CreateAppJITSnapshotAsBlobs = - _Dart_CreateAppJITSnapshotAsBlobsPtr.asFunction< - Object Function( - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>(); - - /// Like Dart_CreateAppJITSnapshotAsBlobs, but also creates a new VM snapshot. - Object Dart_CreateCoreJITSnapshotAsBlobs( - ffi.Pointer> vm_snapshot_data_buffer, - ffi.Pointer vm_snapshot_data_size, - ffi.Pointer> vm_snapshot_instructions_buffer, - ffi.Pointer vm_snapshot_instructions_size, - ffi.Pointer> isolate_snapshot_data_buffer, - ffi.Pointer isolate_snapshot_data_size, - ffi.Pointer> isolate_snapshot_instructions_buffer, - ffi.Pointer isolate_snapshot_instructions_size, - ) { - return _Dart_CreateCoreJITSnapshotAsBlobs( - vm_snapshot_data_buffer, - vm_snapshot_data_size, - vm_snapshot_instructions_buffer, - vm_snapshot_instructions_size, - isolate_snapshot_data_buffer, - isolate_snapshot_data_size, - isolate_snapshot_instructions_buffer, - isolate_snapshot_instructions_size, - ); - } - - late final _Dart_CreateCoreJITSnapshotAsBlobsPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function( - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>>('Dart_CreateCoreJITSnapshotAsBlobs'); - late final _Dart_CreateCoreJITSnapshotAsBlobs = - _Dart_CreateCoreJITSnapshotAsBlobsPtr.asFunction< - Object Function( - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer, - ffi.Pointer>, - ffi.Pointer)>(); - - /// Get obfuscation map for precompiled code. - /// - /// Obfuscation map is encoded as a JSON array of pairs (original name, - /// obfuscated name). - /// - /// \return Returns an error handler if the VM was built in a mode that does not - /// support obfuscation. - Object Dart_GetObfuscationMap( - ffi.Pointer> buffer, - ffi.Pointer buffer_length, - ) { - return _Dart_GetObfuscationMap( - buffer, - buffer_length, - ); - } - - late final _Dart_GetObfuscationMapPtr = _lookup< - ffi.NativeFunction< - ffi.Handle Function(ffi.Pointer>, - ffi.Pointer)>>('Dart_GetObfuscationMap'); - late final _Dart_GetObfuscationMap = _Dart_GetObfuscationMapPtr.asFunction< - Object Function( - ffi.Pointer>, ffi.Pointer)>(); - - /// Returns whether the VM only supports running from precompiled snapshots and - /// not from any other kind of snapshot or from source (that is, the VM was - /// compiled with DART_PRECOMPILED_RUNTIME). - bool Dart_IsPrecompiledRuntime() { - return _Dart_IsPrecompiledRuntime(); - } - - late final _Dart_IsPrecompiledRuntimePtr = - _lookup>( - 'Dart_IsPrecompiledRuntime'); - late final _Dart_IsPrecompiledRuntime = - _Dart_IsPrecompiledRuntimePtr.asFunction(); - - /// Print a native stack trace. Used for crash handling. - /// - /// If context is NULL, prints the current stack trace. Otherwise, context - /// should be a CONTEXT* (Windows) or ucontext_t* (POSIX) from a signal handler - /// running on the current thread. - void Dart_DumpNativeStackTrace( - ffi.Pointer context, - ) { - return _Dart_DumpNativeStackTrace( - context, - ); - } - - late final _Dart_DumpNativeStackTracePtr = - _lookup)>>( - 'Dart_DumpNativeStackTrace'); - late final _Dart_DumpNativeStackTrace = _Dart_DumpNativeStackTracePtr - .asFunction)>(); - - /// Indicate that the process is about to abort, and the Dart VM should not - /// attempt to cleanup resources. - void Dart_PrepareToAbort() { - return _Dart_PrepareToAbort(); - } - - late final _Dart_PrepareToAbortPtr = - _lookup>('Dart_PrepareToAbort'); - late final _Dart_PrepareToAbort = - _Dart_PrepareToAbortPtr.asFunction(); - - /// Posts a message on some port. The message will contain the Dart_CObject - /// object graph rooted in 'message'. - /// - /// While the message is being sent the state of the graph of Dart_CObject - /// structures rooted in 'message' should not be accessed, as the message - /// generation will make temporary modifications to the data. When the message - /// has been sent the graph will be fully restored. - /// - /// If true is returned, the message was enqueued, and finalizers for external - /// typed data will eventually run, even if the receiving isolate shuts down - /// before processing the message. If false is returned, the message was not - /// enqueued and ownership of external typed data in the message remains with the - /// caller. - /// - /// This function may be called on any thread when the VM is running (that is, - /// after Dart_Initialize has returned and before Dart_Cleanup has been called). - /// - /// \param port_id The destination port. - /// \param message The message to send. - /// - /// \return True if the message was posted. - bool Dart_PostCObject( - int port_id, - ffi.Pointer message, - ) { - return _Dart_PostCObject( - port_id, - message, - ); - } - - late final _Dart_PostCObjectPtr = _lookup< - ffi.NativeFunction< - ffi.Bool Function( - Dart_Port, ffi.Pointer)>>('Dart_PostCObject'); - late final _Dart_PostCObject = _Dart_PostCObjectPtr.asFunction< - bool Function(int, ffi.Pointer)>(); - - /// Posts a message on some port. The message will contain the integer 'message'. - /// - /// \param port_id The destination port. - /// \param message The message to send. - /// - /// \return True if the message was posted. - bool Dart_PostInteger( - int port_id, - int message, - ) { - return _Dart_PostInteger( - port_id, - message, - ); - } - - late final _Dart_PostIntegerPtr = - _lookup>( - 'Dart_PostInteger'); - late final _Dart_PostInteger = - _Dart_PostIntegerPtr.asFunction(); - - /// Creates a new native port. When messages are received on this - /// native port, then they will be dispatched to the provided native - /// message handler. - /// - /// \param name The name of this port in debugging messages. - /// \param handler The C handler to run when messages arrive on the port. - /// \param handle_concurrently Is it okay to process requests on this - /// native port concurrently? - /// - /// \return If successful, returns the port id for the native port. In - /// case of error, returns ILLEGAL_PORT. - int Dart_NewNativePort( - ffi.Pointer name, - Dart_NativeMessageHandler handler, - bool handle_concurrently, - ) { - return _Dart_NewNativePort( - name, - handler, - handle_concurrently, - ); - } - - late final _Dart_NewNativePortPtr = _lookup< - ffi.NativeFunction< - Dart_Port Function(ffi.Pointer, Dart_NativeMessageHandler, - ffi.Bool)>>('Dart_NewNativePort'); - late final _Dart_NewNativePort = _Dart_NewNativePortPtr.asFunction< - int Function(ffi.Pointer, Dart_NativeMessageHandler, bool)>(); - - /// Closes the native port with the given id. - /// - /// The port must have been allocated by a call to Dart_NewNativePort. - /// - /// \param native_port_id The id of the native port to close. - /// - /// \return Returns true if the port was closed successfully. - bool Dart_CloseNativePort( - int native_port_id, - ) { - return _Dart_CloseNativePort( - native_port_id, - ); - } - - late final _Dart_CloseNativePortPtr = - _lookup>( - 'Dart_CloseNativePort'); - late final _Dart_CloseNativePort = - _Dart_CloseNativePortPtr.asFunction(); - - /// Forces all loaded classes and functions to be compiled eagerly in - /// the current isolate.. - /// - /// TODO(turnidge): Document. - Object Dart_CompileAll() { - return _Dart_CompileAll(); - } - - late final _Dart_CompileAllPtr = - _lookup>('Dart_CompileAll'); - late final _Dart_CompileAll = - _Dart_CompileAllPtr.asFunction(); - - /// Finalizes all classes. - Object Dart_FinalizeAllClasses() { - return _Dart_FinalizeAllClasses(); - } - - late final _Dart_FinalizeAllClassesPtr = - _lookup>( - 'Dart_FinalizeAllClasses'); - late final _Dart_FinalizeAllClasses = - _Dart_FinalizeAllClassesPtr.asFunction(); - - /// This function is intentionally undocumented. - /// - /// It should not be used outside internal tests. - ffi.Pointer Dart_ExecuteInternalCommand( - ffi.Pointer command, - ffi.Pointer arg, - ) { - return _Dart_ExecuteInternalCommand( - command, - arg, - ); - } - - late final _Dart_ExecuteInternalCommandPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer)>>('Dart_ExecuteInternalCommand'); - late final _Dart_ExecuteInternalCommand = - _Dart_ExecuteInternalCommandPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - /// \mainpage Dynamically Linked Dart API - /// - /// This exposes a subset of symbols from dart_api.h and dart_native_api.h - /// available in every Dart embedder through dynamic linking. - /// - /// All symbols are postfixed with _DL to indicate that they are dynamically - /// linked and to prevent conflicts with the original symbol. - /// - /// Link `dart_api_dl.c` file into your library and invoke - /// `Dart_InitializeApiDL` with `NativeApi.initializeApiDLData`. - int Dart_InitializeApiDL( - ffi.Pointer data, - ) { - return _Dart_InitializeApiDL( - data, - ); - } - - late final _Dart_InitializeApiDLPtr = - _lookup)>>( - 'Dart_InitializeApiDL'); - late final _Dart_InitializeApiDL = _Dart_InitializeApiDLPtr.asFunction< - int Function(ffi.Pointer)>(); - - late final ffi.Pointer _Dart_PostCObject_DL = - _lookup('Dart_PostCObject_DL'); - - Dart_PostCObject_Type get Dart_PostCObject_DL => _Dart_PostCObject_DL.value; - - set Dart_PostCObject_DL(Dart_PostCObject_Type value) => - _Dart_PostCObject_DL.value = value; - - late final ffi.Pointer _Dart_PostInteger_DL = - _lookup('Dart_PostInteger_DL'); - - Dart_PostInteger_Type get Dart_PostInteger_DL => _Dart_PostInteger_DL.value; - - set Dart_PostInteger_DL(Dart_PostInteger_Type value) => - _Dart_PostInteger_DL.value = value; - - late final ffi.Pointer _Dart_NewNativePort_DL = - _lookup('Dart_NewNativePort_DL'); - - Dart_NewNativePort_Type get Dart_NewNativePort_DL => - _Dart_NewNativePort_DL.value; - - set Dart_NewNativePort_DL(Dart_NewNativePort_Type value) => - _Dart_NewNativePort_DL.value = value; - - late final ffi.Pointer _Dart_CloseNativePort_DL = - _lookup('Dart_CloseNativePort_DL'); - - Dart_CloseNativePort_Type get Dart_CloseNativePort_DL => - _Dart_CloseNativePort_DL.value; - - set Dart_CloseNativePort_DL(Dart_CloseNativePort_Type value) => - _Dart_CloseNativePort_DL.value = value; - - late final ffi.Pointer _Dart_IsError_DL = - _lookup('Dart_IsError_DL'); - - Dart_IsError_Type get Dart_IsError_DL => _Dart_IsError_DL.value; - - set Dart_IsError_DL(Dart_IsError_Type value) => - _Dart_IsError_DL.value = value; - - late final ffi.Pointer _Dart_IsApiError_DL = - _lookup('Dart_IsApiError_DL'); - - Dart_IsApiError_Type get Dart_IsApiError_DL => _Dart_IsApiError_DL.value; - - set Dart_IsApiError_DL(Dart_IsApiError_Type value) => - _Dart_IsApiError_DL.value = value; - - late final ffi.Pointer - _Dart_IsUnhandledExceptionError_DL = - _lookup( - 'Dart_IsUnhandledExceptionError_DL'); - - Dart_IsUnhandledExceptionError_Type get Dart_IsUnhandledExceptionError_DL => - _Dart_IsUnhandledExceptionError_DL.value; - - set Dart_IsUnhandledExceptionError_DL( - Dart_IsUnhandledExceptionError_Type value) => - _Dart_IsUnhandledExceptionError_DL.value = value; - - late final ffi.Pointer - _Dart_IsCompilationError_DL = - _lookup('Dart_IsCompilationError_DL'); - - Dart_IsCompilationError_Type get Dart_IsCompilationError_DL => - _Dart_IsCompilationError_DL.value; - - set Dart_IsCompilationError_DL(Dart_IsCompilationError_Type value) => - _Dart_IsCompilationError_DL.value = value; - - late final ffi.Pointer _Dart_IsFatalError_DL = - _lookup('Dart_IsFatalError_DL'); - - Dart_IsFatalError_Type get Dart_IsFatalError_DL => - _Dart_IsFatalError_DL.value; - - set Dart_IsFatalError_DL(Dart_IsFatalError_Type value) => - _Dart_IsFatalError_DL.value = value; - - late final ffi.Pointer _Dart_GetError_DL = - _lookup('Dart_GetError_DL'); - - Dart_GetError_Type get Dart_GetError_DL => _Dart_GetError_DL.value; - - set Dart_GetError_DL(Dart_GetError_Type value) => - _Dart_GetError_DL.value = value; - - late final ffi.Pointer - _Dart_ErrorHasException_DL = - _lookup('Dart_ErrorHasException_DL'); - - Dart_ErrorHasException_Type get Dart_ErrorHasException_DL => - _Dart_ErrorHasException_DL.value; - - set Dart_ErrorHasException_DL(Dart_ErrorHasException_Type value) => - _Dart_ErrorHasException_DL.value = value; - - late final ffi.Pointer - _Dart_ErrorGetException_DL = - _lookup('Dart_ErrorGetException_DL'); - - Dart_ErrorGetException_Type get Dart_ErrorGetException_DL => - _Dart_ErrorGetException_DL.value; - - set Dart_ErrorGetException_DL(Dart_ErrorGetException_Type value) => - _Dart_ErrorGetException_DL.value = value; - - late final ffi.Pointer - _Dart_ErrorGetStackTrace_DL = - _lookup('Dart_ErrorGetStackTrace_DL'); - - Dart_ErrorGetStackTrace_Type get Dart_ErrorGetStackTrace_DL => - _Dart_ErrorGetStackTrace_DL.value; - - set Dart_ErrorGetStackTrace_DL(Dart_ErrorGetStackTrace_Type value) => - _Dart_ErrorGetStackTrace_DL.value = value; - - late final ffi.Pointer _Dart_NewApiError_DL = - _lookup('Dart_NewApiError_DL'); - - Dart_NewApiError_Type get Dart_NewApiError_DL => _Dart_NewApiError_DL.value; - - set Dart_NewApiError_DL(Dart_NewApiError_Type value) => - _Dart_NewApiError_DL.value = value; - - late final ffi.Pointer - _Dart_NewCompilationError_DL = - _lookup('Dart_NewCompilationError_DL'); - - Dart_NewCompilationError_Type get Dart_NewCompilationError_DL => - _Dart_NewCompilationError_DL.value; - - set Dart_NewCompilationError_DL(Dart_NewCompilationError_Type value) => - _Dart_NewCompilationError_DL.value = value; - - late final ffi.Pointer - _Dart_NewUnhandledExceptionError_DL = - _lookup( - 'Dart_NewUnhandledExceptionError_DL'); - - Dart_NewUnhandledExceptionError_Type get Dart_NewUnhandledExceptionError_DL => - _Dart_NewUnhandledExceptionError_DL.value; - - set Dart_NewUnhandledExceptionError_DL( - Dart_NewUnhandledExceptionError_Type value) => - _Dart_NewUnhandledExceptionError_DL.value = value; - - late final ffi.Pointer _Dart_PropagateError_DL = - _lookup('Dart_PropagateError_DL'); - - Dart_PropagateError_Type get Dart_PropagateError_DL => - _Dart_PropagateError_DL.value; - - set Dart_PropagateError_DL(Dart_PropagateError_Type value) => - _Dart_PropagateError_DL.value = value; - - late final ffi.Pointer - _Dart_HandleFromPersistent_DL = - _lookup('Dart_HandleFromPersistent_DL'); - - Dart_HandleFromPersistent_Type get Dart_HandleFromPersistent_DL => - _Dart_HandleFromPersistent_DL.value; - - set Dart_HandleFromPersistent_DL(Dart_HandleFromPersistent_Type value) => - _Dart_HandleFromPersistent_DL.value = value; - - late final ffi.Pointer - _Dart_HandleFromWeakPersistent_DL = - _lookup( - 'Dart_HandleFromWeakPersistent_DL'); - - Dart_HandleFromWeakPersistent_Type get Dart_HandleFromWeakPersistent_DL => - _Dart_HandleFromWeakPersistent_DL.value; - - set Dart_HandleFromWeakPersistent_DL( - Dart_HandleFromWeakPersistent_Type value) => - _Dart_HandleFromWeakPersistent_DL.value = value; - - late final ffi.Pointer - _Dart_NewPersistentHandle_DL = - _lookup('Dart_NewPersistentHandle_DL'); - - Dart_NewPersistentHandle_Type get Dart_NewPersistentHandle_DL => - _Dart_NewPersistentHandle_DL.value; - - set Dart_NewPersistentHandle_DL(Dart_NewPersistentHandle_Type value) => - _Dart_NewPersistentHandle_DL.value = value; - - late final ffi.Pointer - _Dart_SetPersistentHandle_DL = - _lookup('Dart_SetPersistentHandle_DL'); - - Dart_SetPersistentHandle_Type get Dart_SetPersistentHandle_DL => - _Dart_SetPersistentHandle_DL.value; - - set Dart_SetPersistentHandle_DL(Dart_SetPersistentHandle_Type value) => - _Dart_SetPersistentHandle_DL.value = value; - - late final ffi.Pointer - _Dart_DeletePersistentHandle_DL = - _lookup( - 'Dart_DeletePersistentHandle_DL'); - - Dart_DeletePersistentHandle_Type get Dart_DeletePersistentHandle_DL => - _Dart_DeletePersistentHandle_DL.value; - - set Dart_DeletePersistentHandle_DL(Dart_DeletePersistentHandle_Type value) => - _Dart_DeletePersistentHandle_DL.value = value; - - late final ffi.Pointer - _Dart_NewWeakPersistentHandle_DL = - _lookup( - 'Dart_NewWeakPersistentHandle_DL'); - - Dart_NewWeakPersistentHandle_Type get Dart_NewWeakPersistentHandle_DL => - _Dart_NewWeakPersistentHandle_DL.value; - - set Dart_NewWeakPersistentHandle_DL( - Dart_NewWeakPersistentHandle_Type value) => - _Dart_NewWeakPersistentHandle_DL.value = value; - - late final ffi.Pointer - _Dart_DeleteWeakPersistentHandle_DL = - _lookup( - 'Dart_DeleteWeakPersistentHandle_DL'); - - Dart_DeleteWeakPersistentHandle_Type get Dart_DeleteWeakPersistentHandle_DL => - _Dart_DeleteWeakPersistentHandle_DL.value; - - set Dart_DeleteWeakPersistentHandle_DL( - Dart_DeleteWeakPersistentHandle_Type value) => - _Dart_DeleteWeakPersistentHandle_DL.value = value; - - late final ffi.Pointer - _Dart_UpdateExternalSize_DL = - _lookup('Dart_UpdateExternalSize_DL'); - - Dart_UpdateExternalSize_Type get Dart_UpdateExternalSize_DL => - _Dart_UpdateExternalSize_DL.value; - - set Dart_UpdateExternalSize_DL(Dart_UpdateExternalSize_Type value) => - _Dart_UpdateExternalSize_DL.value = value; - - late final ffi.Pointer - _Dart_NewFinalizableHandle_DL = - _lookup('Dart_NewFinalizableHandle_DL'); - - Dart_NewFinalizableHandle_Type get Dart_NewFinalizableHandle_DL => - _Dart_NewFinalizableHandle_DL.value; - - set Dart_NewFinalizableHandle_DL(Dart_NewFinalizableHandle_Type value) => - _Dart_NewFinalizableHandle_DL.value = value; - - late final ffi.Pointer - _Dart_DeleteFinalizableHandle_DL = - _lookup( - 'Dart_DeleteFinalizableHandle_DL'); - - Dart_DeleteFinalizableHandle_Type get Dart_DeleteFinalizableHandle_DL => - _Dart_DeleteFinalizableHandle_DL.value; - - set Dart_DeleteFinalizableHandle_DL( - Dart_DeleteFinalizableHandle_Type value) => - _Dart_DeleteFinalizableHandle_DL.value = value; - - late final ffi.Pointer - _Dart_UpdateFinalizableExternalSize_DL = - _lookup( - 'Dart_UpdateFinalizableExternalSize_DL'); - - Dart_UpdateFinalizableExternalSize_Type - get Dart_UpdateFinalizableExternalSize_DL => - _Dart_UpdateFinalizableExternalSize_DL.value; - - set Dart_UpdateFinalizableExternalSize_DL( - Dart_UpdateFinalizableExternalSize_Type value) => - _Dart_UpdateFinalizableExternalSize_DL.value = value; - - late final ffi.Pointer _Dart_Post_DL = - _lookup('Dart_Post_DL'); - - Dart_Post_Type get Dart_Post_DL => _Dart_Post_DL.value; - - set Dart_Post_DL(Dart_Post_Type value) => _Dart_Post_DL.value = value; - - late final ffi.Pointer _Dart_NewSendPort_DL = - _lookup('Dart_NewSendPort_DL'); - - Dart_NewSendPort_Type get Dart_NewSendPort_DL => _Dart_NewSendPort_DL.value; - - set Dart_NewSendPort_DL(Dart_NewSendPort_Type value) => - _Dart_NewSendPort_DL.value = value; - - late final ffi.Pointer _Dart_SendPortGetId_DL = - _lookup('Dart_SendPortGetId_DL'); - - Dart_SendPortGetId_Type get Dart_SendPortGetId_DL => - _Dart_SendPortGetId_DL.value; - - set Dart_SendPortGetId_DL(Dart_SendPortGetId_Type value) => - _Dart_SendPortGetId_DL.value = value; - - late final ffi.Pointer _Dart_EnterScope_DL = - _lookup('Dart_EnterScope_DL'); - - Dart_EnterScope_Type get Dart_EnterScope_DL => _Dart_EnterScope_DL.value; - - set Dart_EnterScope_DL(Dart_EnterScope_Type value) => - _Dart_EnterScope_DL.value = value; - - late final ffi.Pointer _Dart_ExitScope_DL = - _lookup('Dart_ExitScope_DL'); - - Dart_ExitScope_Type get Dart_ExitScope_DL => _Dart_ExitScope_DL.value; - - set Dart_ExitScope_DL(Dart_ExitScope_Type value) => - _Dart_ExitScope_DL.value = value; - - late final _class_CUPHTTPTaskConfiguration1 = - _getClass1("CUPHTTPTaskConfiguration"); - late final _sel_initWithPort_1 = _registerName1("initWithPort:"); - ffi.Pointer _objc_msgSend_533( - ffi.Pointer obj, - ffi.Pointer sel, - int sendPort, - ) { - return __objc_msgSend_533( - obj, - sel, - sendPort, - ); - } - - late final __objc_msgSend_533Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, Dart_Port)>>('objc_msgSend'); - late final __objc_msgSend_533 = __objc_msgSend_533Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_sendPort1 = _registerName1("sendPort"); - late final _class_CUPHTTPClientDelegate1 = - _getClass1("CUPHTTPClientDelegate"); - late final _sel_registerTask_withConfiguration_1 = - _registerName1("registerTask:withConfiguration:"); - void _objc_msgSend_534( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer task, - ffi.Pointer config, - ) { - return __objc_msgSend_534( - obj, - sel, - task, - config, - ); - } - - late final __objc_msgSend_534Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_534 = __objc_msgSend_534Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>(); - - late final _class_CUPHTTPForwardedDelegate1 = - _getClass1("CUPHTTPForwardedDelegate"); - late final _sel_initWithSession_task_1 = - _registerName1("initWithSession:task:"); - ffi.Pointer _objc_msgSend_535( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer task, - ) { - return __objc_msgSend_535( - obj, - sel, - session, - task, - ); - } - - late final __objc_msgSend_535Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - 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, - ffi.Pointer)>(); - - late final _sel_finish1 = _registerName1("finish"); - late final _sel_session1 = _registerName1("session"); - late final _sel_task1 = _registerName1("task"); - ffi.Pointer _objc_msgSend_536( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_536( - obj, - sel, - ); - } - - late final __objc_msgSend_536Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_536 = __objc_msgSend_536Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_NSLock1 = _getClass1("NSLock"); - late final _sel_lock1 = _registerName1("lock"); - ffi.Pointer _objc_msgSend_537( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_537( - obj, - sel, - ); - } - - late final __objc_msgSend_537Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_537 = __objc_msgSend_537Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_CUPHTTPForwardedRedirect1 = - _getClass1("CUPHTTPForwardedRedirect"); - late final _sel_initWithSession_task_response_request_1 = - _registerName1("initWithSession:task:response:request:"); - ffi.Pointer _objc_msgSend_538( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer task, - ffi.Pointer response, - ffi.Pointer request, - ) { - return __objc_msgSend_538( - obj, - sel, - session, - task, - response, - request, - ); - } - - late final __objc_msgSend_538Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_538 = __objc_msgSend_538Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_finishWithRequest_1 = _registerName1("finishWithRequest:"); - void _objc_msgSend_539( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer request, - ) { - return __objc_msgSend_539( - obj, - sel, - request, - ); - } - - late final __objc_msgSend_539Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_539 = __objc_msgSend_539Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _objc_msgSend_540( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_540( - obj, - sel, - ); - } - - late final __objc_msgSend_540Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_540 = __objc_msgSend_540Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _sel_redirectRequest1 = _registerName1("redirectRequest"); - late final _class_CUPHTTPForwardedResponse1 = - _getClass1("CUPHTTPForwardedResponse"); - late final _sel_initWithSession_task_response_1 = - _registerName1("initWithSession:task:response:"); - ffi.Pointer _objc_msgSend_541( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer task, - ffi.Pointer response, - ) { - return __objc_msgSend_541( - obj, - sel, - session, - task, - response, - ); - } - - late final __objc_msgSend_541Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_541 = __objc_msgSend_541Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_finishWithDisposition_1 = - _registerName1("finishWithDisposition:"); - void _objc_msgSend_542( - ffi.Pointer obj, - ffi.Pointer sel, - int disposition, - ) { - return __objc_msgSend_542( - obj, - sel, - disposition, - ); - } - - late final __objc_msgSend_542Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Int32)>>('objc_msgSend'); - late final __objc_msgSend_542 = __objc_msgSend_542Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - late final _sel_disposition1 = _registerName1("disposition"); - int _objc_msgSend_543( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_543( - obj, - sel, - ); - } - - late final __objc_msgSend_543Ptr = _lookup< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_543 = __objc_msgSend_543Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - late final _class_CUPHTTPForwardedData1 = _getClass1("CUPHTTPForwardedData"); - late final _sel_initWithSession_task_data_1 = - _registerName1("initWithSession:task:data:"); - ffi.Pointer _objc_msgSend_544( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer task, - ffi.Pointer data, - ) { - return __objc_msgSend_544( - obj, - sel, - session, - task, - data, - ); - } - - late final __objc_msgSend_544Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_544 = __objc_msgSend_544Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_CUPHTTPForwardedComplete1 = - _getClass1("CUPHTTPForwardedComplete"); - late final _sel_initWithSession_task_error_1 = - _registerName1("initWithSession:task:error:"); - ffi.Pointer _objc_msgSend_545( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer task, - ffi.Pointer error, - ) { - return __objc_msgSend_545( - obj, - sel, - session, - task, - error, - ); - } - - late final __objc_msgSend_545Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_545 = __objc_msgSend_545Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _class_CUPHTTPForwardedFinishedDownloading1 = - _getClass1("CUPHTTPForwardedFinishedDownloading"); - late final _sel_initWithSession_downloadTask_url_1 = - _registerName1("initWithSession:downloadTask:url:"); - ffi.Pointer _objc_msgSend_546( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer downloadTask, - ffi.Pointer location, - ) { - return __objc_msgSend_546( - obj, - sel, - session, - downloadTask, - location, - ); - } - - late final __objc_msgSend_546Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_546 = __objc_msgSend_546Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_location1 = _registerName1("location"); - ffi.Pointer _objc_msgSend_547( - ffi.Pointer obj, - ffi.Pointer sel, - ) { - return __objc_msgSend_547( - obj, - sel, - ); - } - - late final __objc_msgSend_547Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_547 = __objc_msgSend_547Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer)>(); - - late final _class_CUPHTTPForwardedWebSocketOpened1 = - _getClass1("CUPHTTPForwardedWebSocketOpened"); - late final _sel_initWithSession_webSocketTask_didOpenWithProtocol_1 = - _registerName1("initWithSession:webSocketTask:didOpenWithProtocol:"); - ffi.Pointer _objc_msgSend_548( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer webSocketTask, - ffi.Pointer protocol, - ) { - return __objc_msgSend_548( - obj, - sel, - session, - webSocketTask, - protocol, - ); - } - - late final __objc_msgSend_548Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - 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, - ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_protocol1 = _registerName1("protocol"); - late final _class_CUPHTTPForwardedWebSocketClosed1 = - _getClass1("CUPHTTPForwardedWebSocketClosed"); - late final _sel_initWithSession_webSocketTask_code_reason_1 = - _registerName1("initWithSession:webSocketTask:code:reason:"); - ffi.Pointer _objc_msgSend_549( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer session, - ffi.Pointer webSocketTask, - int closeCode, - ffi.Pointer reason, - ) { - return __objc_msgSend_549( - obj, - sel, - session, - webSocketTask, - closeCode, - reason, - ); - } - - late final __objc_msgSend_549Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Int32, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_549 = __objc_msgSend_549Ptr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer)>(); - - /// Creates a `Dart_CObject` containing the given `NSObject` pointer as an int. - Dart_CObject NSObjectToCObject( - NSObject n, - ) { - return _NSObjectToCObject( - n._id, - ); - } - - late final _NSObjectToCObjectPtr = _lookup< - ffi.NativeFunction)>>( - 'NSObjectToCObject'); - late final _NSObjectToCObject = _NSObjectToCObjectPtr.asFunction< - Dart_CObject Function(ffi.Pointer)>(); - - /// Executes [NSURLSessionWebSocketTask sendMessage:completionHandler:] and - /// sends the results of the completion handler to the given `Dart_Port`. - void CUPHTTPSendMessage( - NSURLSessionWebSocketTask task, - NSURLSessionWebSocketMessage message, - DartDart_Port sendPort, - ) { - return _CUPHTTPSendMessage( - task._id, - message._id, - sendPort, - ); - } - - late final _CUPHTTPSendMessagePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - Dart_Port)>>('CUPHTTPSendMessage'); - late final _CUPHTTPSendMessage = _CUPHTTPSendMessagePtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - /// Executes [NSURLSessionWebSocketTask receiveMessageWithCompletionHandler:] - /// and sends the results of the completion handler to the given `Dart_Port`. - void CUPHTTPReceiveMessage( - NSURLSessionWebSocketTask task, - DartDart_Port sendPort, - ) { - return _CUPHTTPReceiveMessage( - task._id, - sendPort, - ); - } - - late final _CUPHTTPReceiveMessagePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, Dart_Port)>>('CUPHTTPReceiveMessage'); - late final _CUPHTTPReceiveMessage = _CUPHTTPReceiveMessagePtr.asFunction< - void Function(ffi.Pointer, int)>(); - - late final ffi.Pointer _NSStreamSocketSecurityLevelKey = - _lookup('NSStreamSocketSecurityLevelKey'); - - NSStreamPropertyKey get NSStreamSocketSecurityLevelKey => - _NSStreamSocketSecurityLevelKey.value; - - set NSStreamSocketSecurityLevelKey(NSStreamPropertyKey value) => - _NSStreamSocketSecurityLevelKey.value = value; - - late final ffi.Pointer - _NSStreamSocketSecurityLevelNone = - _lookup('NSStreamSocketSecurityLevelNone'); - - NSStreamSocketSecurityLevel get NSStreamSocketSecurityLevelNone => - _NSStreamSocketSecurityLevelNone.value; - - set NSStreamSocketSecurityLevelNone(NSStreamSocketSecurityLevel value) => - _NSStreamSocketSecurityLevelNone.value = value; - - late final ffi.Pointer - _NSStreamSocketSecurityLevelSSLv2 = - _lookup('NSStreamSocketSecurityLevelSSLv2'); - - NSStreamSocketSecurityLevel get NSStreamSocketSecurityLevelSSLv2 => - _NSStreamSocketSecurityLevelSSLv2.value; - - set NSStreamSocketSecurityLevelSSLv2(NSStreamSocketSecurityLevel value) => - _NSStreamSocketSecurityLevelSSLv2.value = value; - - late final ffi.Pointer - _NSStreamSocketSecurityLevelSSLv3 = - _lookup('NSStreamSocketSecurityLevelSSLv3'); - - NSStreamSocketSecurityLevel get NSStreamSocketSecurityLevelSSLv3 => - _NSStreamSocketSecurityLevelSSLv3.value; - - set NSStreamSocketSecurityLevelSSLv3(NSStreamSocketSecurityLevel value) => - _NSStreamSocketSecurityLevelSSLv3.value = value; - - late final ffi.Pointer - _NSStreamSocketSecurityLevelTLSv1 = - _lookup('NSStreamSocketSecurityLevelTLSv1'); - - NSStreamSocketSecurityLevel get NSStreamSocketSecurityLevelTLSv1 => - _NSStreamSocketSecurityLevelTLSv1.value; - - set NSStreamSocketSecurityLevelTLSv1(NSStreamSocketSecurityLevel value) => - _NSStreamSocketSecurityLevelTLSv1.value = value; - - late final ffi.Pointer - _NSStreamSocketSecurityLevelNegotiatedSSL = - _lookup( - 'NSStreamSocketSecurityLevelNegotiatedSSL'); - - NSStreamSocketSecurityLevel get NSStreamSocketSecurityLevelNegotiatedSSL => - _NSStreamSocketSecurityLevelNegotiatedSSL.value; - - set NSStreamSocketSecurityLevelNegotiatedSSL( - NSStreamSocketSecurityLevel value) => - _NSStreamSocketSecurityLevelNegotiatedSSL.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyConfigurationKey = - _lookup('NSStreamSOCKSProxyConfigurationKey'); - - NSStreamPropertyKey get NSStreamSOCKSProxyConfigurationKey => - _NSStreamSOCKSProxyConfigurationKey.value; - - set NSStreamSOCKSProxyConfigurationKey(NSStreamPropertyKey value) => - _NSStreamSOCKSProxyConfigurationKey.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyHostKey = - _lookup('NSStreamSOCKSProxyHostKey'); - - NSStreamSOCKSProxyConfiguration get NSStreamSOCKSProxyHostKey => - _NSStreamSOCKSProxyHostKey.value; - - set NSStreamSOCKSProxyHostKey(NSStreamSOCKSProxyConfiguration value) => - _NSStreamSOCKSProxyHostKey.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyPortKey = - _lookup('NSStreamSOCKSProxyPortKey'); - - NSStreamSOCKSProxyConfiguration get NSStreamSOCKSProxyPortKey => - _NSStreamSOCKSProxyPortKey.value; - - set NSStreamSOCKSProxyPortKey(NSStreamSOCKSProxyConfiguration value) => - _NSStreamSOCKSProxyPortKey.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyVersionKey = - _lookup('NSStreamSOCKSProxyVersionKey'); - - NSStreamSOCKSProxyConfiguration get NSStreamSOCKSProxyVersionKey => - _NSStreamSOCKSProxyVersionKey.value; - - set NSStreamSOCKSProxyVersionKey(NSStreamSOCKSProxyConfiguration value) => - _NSStreamSOCKSProxyVersionKey.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyUserKey = - _lookup('NSStreamSOCKSProxyUserKey'); - - NSStreamSOCKSProxyConfiguration get NSStreamSOCKSProxyUserKey => - _NSStreamSOCKSProxyUserKey.value; - - set NSStreamSOCKSProxyUserKey(NSStreamSOCKSProxyConfiguration value) => - _NSStreamSOCKSProxyUserKey.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyPasswordKey = - _lookup('NSStreamSOCKSProxyPasswordKey'); - - NSStreamSOCKSProxyConfiguration get NSStreamSOCKSProxyPasswordKey => - _NSStreamSOCKSProxyPasswordKey.value; - - set NSStreamSOCKSProxyPasswordKey(NSStreamSOCKSProxyConfiguration value) => - _NSStreamSOCKSProxyPasswordKey.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyVersion4 = - _lookup('NSStreamSOCKSProxyVersion4'); - - NSStreamSOCKSProxyVersion get NSStreamSOCKSProxyVersion4 => - _NSStreamSOCKSProxyVersion4.value; - - set NSStreamSOCKSProxyVersion4(NSStreamSOCKSProxyVersion value) => - _NSStreamSOCKSProxyVersion4.value = value; - - late final ffi.Pointer - _NSStreamSOCKSProxyVersion5 = - _lookup('NSStreamSOCKSProxyVersion5'); - - NSStreamSOCKSProxyVersion get NSStreamSOCKSProxyVersion5 => - _NSStreamSOCKSProxyVersion5.value; - - set NSStreamSOCKSProxyVersion5(NSStreamSOCKSProxyVersion value) => - _NSStreamSOCKSProxyVersion5.value = value; - - late final ffi.Pointer - _NSStreamDataWrittenToMemoryStreamKey = - _lookup('NSStreamDataWrittenToMemoryStreamKey'); - - NSStreamPropertyKey get NSStreamDataWrittenToMemoryStreamKey => - _NSStreamDataWrittenToMemoryStreamKey.value; - - set NSStreamDataWrittenToMemoryStreamKey(NSStreamPropertyKey value) => - _NSStreamDataWrittenToMemoryStreamKey.value = value; - - late final ffi.Pointer _NSStreamFileCurrentOffsetKey = - _lookup('NSStreamFileCurrentOffsetKey'); - - NSStreamPropertyKey get NSStreamFileCurrentOffsetKey => - _NSStreamFileCurrentOffsetKey.value; - - set NSStreamFileCurrentOffsetKey(NSStreamPropertyKey value) => - _NSStreamFileCurrentOffsetKey.value = value; - - late final ffi.Pointer _NSStreamSocketSSLErrorDomain = - _lookup('NSStreamSocketSSLErrorDomain'); - - NSErrorDomain1 get NSStreamSocketSSLErrorDomain => - _NSStreamSocketSSLErrorDomain.value; - - set NSStreamSocketSSLErrorDomain(NSErrorDomain1 value) => - _NSStreamSocketSSLErrorDomain.value = value; - - late final ffi.Pointer _NSStreamSOCKSErrorDomain = - _lookup('NSStreamSOCKSErrorDomain'); - - NSErrorDomain1 get NSStreamSOCKSErrorDomain => - _NSStreamSOCKSErrorDomain.value; - - set NSStreamSOCKSErrorDomain(NSErrorDomain1 value) => - _NSStreamSOCKSErrorDomain.value = value; - - late final ffi.Pointer _NSStreamNetworkServiceType = - _lookup('NSStreamNetworkServiceType'); - - NSStreamPropertyKey get NSStreamNetworkServiceType => - _NSStreamNetworkServiceType.value; - - set NSStreamNetworkServiceType(NSStreamPropertyKey value) => - _NSStreamNetworkServiceType.value = value; - - late final ffi.Pointer - _NSStreamNetworkServiceTypeVoIP = - _lookup( - 'NSStreamNetworkServiceTypeVoIP'); - - NSStreamNetworkServiceTypeValue get NSStreamNetworkServiceTypeVoIP => - _NSStreamNetworkServiceTypeVoIP.value; - - set NSStreamNetworkServiceTypeVoIP(NSStreamNetworkServiceTypeValue value) => - _NSStreamNetworkServiceTypeVoIP.value = value; - - late final ffi.Pointer - _NSStreamNetworkServiceTypeVideo = - _lookup( - 'NSStreamNetworkServiceTypeVideo'); - - NSStreamNetworkServiceTypeValue get NSStreamNetworkServiceTypeVideo => - _NSStreamNetworkServiceTypeVideo.value; - - set NSStreamNetworkServiceTypeVideo(NSStreamNetworkServiceTypeValue value) => - _NSStreamNetworkServiceTypeVideo.value = value; - - late final ffi.Pointer - _NSStreamNetworkServiceTypeBackground = - _lookup( - 'NSStreamNetworkServiceTypeBackground'); - - NSStreamNetworkServiceTypeValue get NSStreamNetworkServiceTypeBackground => - _NSStreamNetworkServiceTypeBackground.value; - - set NSStreamNetworkServiceTypeBackground( - NSStreamNetworkServiceTypeValue value) => - _NSStreamNetworkServiceTypeBackground.value = value; - - late final ffi.Pointer - _NSStreamNetworkServiceTypeVoice = - _lookup( - 'NSStreamNetworkServiceTypeVoice'); - - NSStreamNetworkServiceTypeValue get NSStreamNetworkServiceTypeVoice => - _NSStreamNetworkServiceTypeVoice.value; - - set NSStreamNetworkServiceTypeVoice(NSStreamNetworkServiceTypeValue value) => - _NSStreamNetworkServiceTypeVoice.value = value; - - late final ffi.Pointer - _NSStreamNetworkServiceTypeCallSignaling = - _lookup( - 'NSStreamNetworkServiceTypeCallSignaling'); - - NSStreamNetworkServiceTypeValue get NSStreamNetworkServiceTypeCallSignaling => - _NSStreamNetworkServiceTypeCallSignaling.value; - - set NSStreamNetworkServiceTypeCallSignaling( - NSStreamNetworkServiceTypeValue value) => - _NSStreamNetworkServiceTypeCallSignaling.value = value; - - late final _class_CUPHTTPStreamToNSInputStreamAdapter1 = - _getClass1("CUPHTTPStreamToNSInputStreamAdapter"); - late final _sel_addData_1 = _registerName1("addData:"); - int _objc_msgSend_550( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer data, - ) { - return __objc_msgSend_550( - obj, - sel, - data, - ); - } - - late final __objc_msgSend_550Ptr = _lookup< - ffi.NativeFunction< - NSUInteger Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_550 = __objc_msgSend_550Ptr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - late final _sel_setDone1 = _registerName1("setDone"); - late final _sel_setError_1 = _registerName1("setError:"); - void _objc_msgSend_551( - ffi.Pointer obj, - ffi.Pointer sel, - ffi.Pointer error, - ) { - return __objc_msgSend_551( - obj, - sel, - error, - ); - } - - late final __objc_msgSend_551Ptr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('objc_msgSend'); - late final __objc_msgSend_551 = __objc_msgSend_551Ptr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); -} - -final class __mbstate_t extends ffi.Union { - @ffi.Array.multi([128]) - external ffi.Array __mbstate8; - - @ffi.LongLong() - external int _mbstateL; -} - -final class __darwin_pthread_handler_rec extends ffi.Struct { - external ffi - .Pointer)>> - __routine; - - external ffi.Pointer __arg; - - external ffi.Pointer<__darwin_pthread_handler_rec> __next; -} - -final class _opaque_pthread_attr_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([56]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_cond_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([40]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_condattr_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([8]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_mutex_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([56]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_mutexattr_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([8]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_once_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([8]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_rwlock_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([192]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_rwlockattr_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - @ffi.Array.multi([16]) - external ffi.Array __opaque; -} - -final class _opaque_pthread_t extends ffi.Struct { - @ffi.Long() - external int __sig; - - external ffi.Pointer<__darwin_pthread_handler_rec> __cleanup_stack; - - @ffi.Array.multi([8176]) - external ffi.Array __opaque; -} - -abstract class idtype_t { - static const int P_ALL = 0; - static const int P_PID = 1; - static const int P_PGID = 2; -} - -final class __darwin_arm_exception_state extends ffi.Struct { - @__uint32_t() - external int __exception; - - @__uint32_t() - external int __fsr; - - @__uint32_t() - external int __far; -} - -typedef __uint32_t = ffi.UnsignedInt; -typedef Dart__uint32_t = int; - -final class __darwin_arm_exception_state64 extends ffi.Struct { - @__uint64_t() - external int __far; - - @__uint32_t() - external int __esr; - - @__uint32_t() - external int __exception; -} - -typedef __uint64_t = ffi.UnsignedLongLong; -typedef Dart__uint64_t = int; - -final class __darwin_arm_thread_state extends ffi.Struct { - @ffi.Array.multi([13]) - external ffi.Array<__uint32_t> __r; - - @__uint32_t() - external int __sp; - - @__uint32_t() - external int __lr; - - @__uint32_t() - external int __pc; - - @__uint32_t() - external int __cpsr; -} - -final class __darwin_arm_thread_state64 extends ffi.Struct { - @ffi.Array.multi([29]) - external ffi.Array<__uint64_t> __x; - - @__uint64_t() - external int __fp; - - @__uint64_t() - external int __lr; - - @__uint64_t() - external int __sp; - - @__uint64_t() - external int __pc; - - @__uint32_t() - external int __cpsr; - - @__uint32_t() - external int __pad; -} - -final class __darwin_arm_vfp_state extends ffi.Struct { - @ffi.Array.multi([64]) - external ffi.Array<__uint32_t> __r; - - @__uint32_t() - external int __fpscr; -} - -final class __darwin_arm_neon_state64 extends ffi.Opaque {} - -final class __darwin_arm_neon_state extends ffi.Opaque {} - -final class __arm_pagein_state extends ffi.Struct { - @ffi.Int() - external int __pagein_error; -} - -final class __arm_legacy_debug_state extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __bvr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __bcr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __wvr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __wcr; -} - -final class __darwin_arm_debug_state32 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __bvr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __bcr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __wvr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint32_t> __wcr; - - @__uint64_t() - external int __mdscr_el1; -} - -final class __darwin_arm_debug_state64 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array<__uint64_t> __bvr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint64_t> __bcr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint64_t> __wvr; - - @ffi.Array.multi([16]) - external ffi.Array<__uint64_t> __wcr; - - @__uint64_t() - external int __mdscr_el1; -} - -final class __darwin_arm_cpmu_state64 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array<__uint64_t> __ctrs; -} - -final class __darwin_mcontext32 extends ffi.Struct { - external __darwin_arm_exception_state __es; - - external __darwin_arm_thread_state __ss; - - external __darwin_arm_vfp_state __fs; -} - -final class __darwin_mcontext64 extends ffi.Opaque {} - -final class __darwin_sigaltstack extends ffi.Struct { - external ffi.Pointer ss_sp; - - @__darwin_size_t() - external int ss_size; - - @ffi.Int() - external int ss_flags; -} - -typedef __darwin_size_t = ffi.UnsignedLong; -typedef Dart__darwin_size_t = int; - -final class __darwin_ucontext extends ffi.Struct { - @ffi.Int() - external int uc_onstack; - - @__darwin_sigset_t() - external int uc_sigmask; - - external __darwin_sigaltstack uc_stack; - - external ffi.Pointer<__darwin_ucontext> uc_link; - - @__darwin_size_t() - external int uc_mcsize; - - external ffi.Pointer<__darwin_mcontext64> uc_mcontext; -} - -typedef __darwin_sigset_t = __uint32_t; - -final class sigval extends ffi.Union { - @ffi.Int() - external int sival_int; - - external ffi.Pointer sival_ptr; -} - -final class sigevent extends ffi.Struct { - @ffi.Int() - external int sigev_notify; - - @ffi.Int() - external int sigev_signo; - - external sigval sigev_value; - - external ffi.Pointer> - sigev_notify_function; - - external ffi.Pointer sigev_notify_attributes; -} - -typedef pthread_attr_t = __darwin_pthread_attr_t; -typedef __darwin_pthread_attr_t = _opaque_pthread_attr_t; - -final class __siginfo extends ffi.Struct { - @ffi.Int() - external int si_signo; - - @ffi.Int() - external int si_errno; - - @ffi.Int() - external int si_code; - - @pid_t() - external int si_pid; - - @uid_t() - external int si_uid; - - @ffi.Int() - external int si_status; - - external ffi.Pointer si_addr; - - external sigval si_value; - - @ffi.Long() - external int si_band; - - @ffi.Array.multi([7]) - external ffi.Array __pad; -} - -typedef pid_t = __darwin_pid_t; -typedef __darwin_pid_t = __int32_t; -typedef __int32_t = ffi.Int; -typedef Dart__int32_t = int; -typedef uid_t = __darwin_uid_t; -typedef __darwin_uid_t = __uint32_t; - -final class __sigaction_u extends ffi.Union { - external ffi.Pointer> - __sa_handler; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Int, ffi.Pointer<__siginfo>, ffi.Pointer)>> - __sa_sigaction; -} - -final class __sigaction extends ffi.Struct { - external __sigaction_u __sigaction_u1; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Int, - ffi.Pointer, ffi.Pointer)>> sa_tramp; - - @sigset_t() - external int sa_mask; - - @ffi.Int() - external int sa_flags; -} - -typedef siginfo_t = __siginfo; -typedef sigset_t = __darwin_sigset_t; - -final class sigaction extends ffi.Struct { - external __sigaction_u __sigaction_u1; - - @sigset_t() - external int sa_mask; - - @ffi.Int() - external int sa_flags; -} - -final class sigvec extends ffi.Struct { - external ffi.Pointer> - sv_handler; - - @ffi.Int() - external int sv_mask; - - @ffi.Int() - external int sv_flags; -} - -final class sigstack extends ffi.Struct { - external ffi.Pointer ss_sp; - - @ffi.Int() - external int ss_onstack; -} - -final class timeval extends ffi.Struct { - @__darwin_time_t() - external int tv_sec; - - @__darwin_suseconds_t() - external int tv_usec; -} - -typedef __darwin_time_t = ffi.Long; -typedef Dart__darwin_time_t = int; -typedef __darwin_suseconds_t = __int32_t; - -final class rusage extends ffi.Struct { - external timeval ru_utime; - - external timeval ru_stime; - - @ffi.Long() - external int ru_maxrss; - - @ffi.Long() - external int ru_ixrss; - - @ffi.Long() - external int ru_idrss; - - @ffi.Long() - external int ru_isrss; - - @ffi.Long() - external int ru_minflt; - - @ffi.Long() - external int ru_majflt; - - @ffi.Long() - external int ru_nswap; - - @ffi.Long() - external int ru_inblock; - - @ffi.Long() - external int ru_oublock; - - @ffi.Long() - external int ru_msgsnd; - - @ffi.Long() - external int ru_msgrcv; - - @ffi.Long() - external int ru_nsignals; - - @ffi.Long() - external int ru_nvcsw; - - @ffi.Long() - external int ru_nivcsw; -} - -final class rusage_info_v0 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array ri_uuid; - - @ffi.Uint64() - external int ri_user_time; - - @ffi.Uint64() - external int ri_system_time; - - @ffi.Uint64() - external int ri_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_interrupt_wkups; - - @ffi.Uint64() - external int ri_pageins; - - @ffi.Uint64() - external int ri_wired_size; - - @ffi.Uint64() - external int ri_resident_size; - - @ffi.Uint64() - external int ri_phys_footprint; - - @ffi.Uint64() - external int ri_proc_start_abstime; - - @ffi.Uint64() - external int ri_proc_exit_abstime; -} - -final class rusage_info_v1 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array ri_uuid; - - @ffi.Uint64() - external int ri_user_time; - - @ffi.Uint64() - external int ri_system_time; - - @ffi.Uint64() - external int ri_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_interrupt_wkups; - - @ffi.Uint64() - external int ri_pageins; - - @ffi.Uint64() - external int ri_wired_size; - - @ffi.Uint64() - external int ri_resident_size; - - @ffi.Uint64() - external int ri_phys_footprint; - - @ffi.Uint64() - external int ri_proc_start_abstime; - - @ffi.Uint64() - external int ri_proc_exit_abstime; - - @ffi.Uint64() - external int ri_child_user_time; - - @ffi.Uint64() - external int ri_child_system_time; - - @ffi.Uint64() - external int ri_child_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_child_interrupt_wkups; - - @ffi.Uint64() - external int ri_child_pageins; - - @ffi.Uint64() - external int ri_child_elapsed_abstime; -} - -final class rusage_info_v2 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array ri_uuid; - - @ffi.Uint64() - external int ri_user_time; - - @ffi.Uint64() - external int ri_system_time; - - @ffi.Uint64() - external int ri_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_interrupt_wkups; - - @ffi.Uint64() - external int ri_pageins; - - @ffi.Uint64() - external int ri_wired_size; - - @ffi.Uint64() - external int ri_resident_size; - - @ffi.Uint64() - external int ri_phys_footprint; - - @ffi.Uint64() - external int ri_proc_start_abstime; - - @ffi.Uint64() - external int ri_proc_exit_abstime; - - @ffi.Uint64() - external int ri_child_user_time; - - @ffi.Uint64() - external int ri_child_system_time; - - @ffi.Uint64() - external int ri_child_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_child_interrupt_wkups; - - @ffi.Uint64() - external int ri_child_pageins; - - @ffi.Uint64() - external int ri_child_elapsed_abstime; - - @ffi.Uint64() - external int ri_diskio_bytesread; - - @ffi.Uint64() - external int ri_diskio_byteswritten; -} - -final class rusage_info_v3 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array ri_uuid; - - @ffi.Uint64() - external int ri_user_time; - - @ffi.Uint64() - external int ri_system_time; - - @ffi.Uint64() - external int ri_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_interrupt_wkups; - - @ffi.Uint64() - external int ri_pageins; - - @ffi.Uint64() - external int ri_wired_size; - - @ffi.Uint64() - external int ri_resident_size; - - @ffi.Uint64() - external int ri_phys_footprint; - - @ffi.Uint64() - external int ri_proc_start_abstime; - - @ffi.Uint64() - external int ri_proc_exit_abstime; - - @ffi.Uint64() - external int ri_child_user_time; - - @ffi.Uint64() - external int ri_child_system_time; - - @ffi.Uint64() - external int ri_child_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_child_interrupt_wkups; - - @ffi.Uint64() - external int ri_child_pageins; - - @ffi.Uint64() - external int ri_child_elapsed_abstime; - - @ffi.Uint64() - external int ri_diskio_bytesread; - - @ffi.Uint64() - external int ri_diskio_byteswritten; - - @ffi.Uint64() - external int ri_cpu_time_qos_default; - - @ffi.Uint64() - external int ri_cpu_time_qos_maintenance; - - @ffi.Uint64() - external int ri_cpu_time_qos_background; - - @ffi.Uint64() - external int ri_cpu_time_qos_utility; - - @ffi.Uint64() - external int ri_cpu_time_qos_legacy; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_initiated; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_interactive; - - @ffi.Uint64() - external int ri_billed_system_time; - - @ffi.Uint64() - external int ri_serviced_system_time; -} - -final class rusage_info_v4 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array ri_uuid; - - @ffi.Uint64() - external int ri_user_time; - - @ffi.Uint64() - external int ri_system_time; - - @ffi.Uint64() - external int ri_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_interrupt_wkups; - - @ffi.Uint64() - external int ri_pageins; - - @ffi.Uint64() - external int ri_wired_size; - - @ffi.Uint64() - external int ri_resident_size; - - @ffi.Uint64() - external int ri_phys_footprint; - - @ffi.Uint64() - external int ri_proc_start_abstime; - - @ffi.Uint64() - external int ri_proc_exit_abstime; - - @ffi.Uint64() - external int ri_child_user_time; - - @ffi.Uint64() - external int ri_child_system_time; - - @ffi.Uint64() - external int ri_child_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_child_interrupt_wkups; - - @ffi.Uint64() - external int ri_child_pageins; - - @ffi.Uint64() - external int ri_child_elapsed_abstime; - - @ffi.Uint64() - external int ri_diskio_bytesread; - - @ffi.Uint64() - external int ri_diskio_byteswritten; - - @ffi.Uint64() - external int ri_cpu_time_qos_default; - - @ffi.Uint64() - external int ri_cpu_time_qos_maintenance; - - @ffi.Uint64() - external int ri_cpu_time_qos_background; - - @ffi.Uint64() - external int ri_cpu_time_qos_utility; - - @ffi.Uint64() - external int ri_cpu_time_qos_legacy; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_initiated; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_interactive; - - @ffi.Uint64() - external int ri_billed_system_time; - - @ffi.Uint64() - external int ri_serviced_system_time; - - @ffi.Uint64() - external int ri_logical_writes; - - @ffi.Uint64() - external int ri_lifetime_max_phys_footprint; - - @ffi.Uint64() - external int ri_instructions; - - @ffi.Uint64() - external int ri_cycles; - - @ffi.Uint64() - external int ri_billed_energy; - - @ffi.Uint64() - external int ri_serviced_energy; - - @ffi.Uint64() - external int ri_interval_max_phys_footprint; - - @ffi.Uint64() - external int ri_runnable_time; -} - -final class rusage_info_v5 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array ri_uuid; - - @ffi.Uint64() - external int ri_user_time; - - @ffi.Uint64() - external int ri_system_time; - - @ffi.Uint64() - external int ri_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_interrupt_wkups; - - @ffi.Uint64() - external int ri_pageins; - - @ffi.Uint64() - external int ri_wired_size; - - @ffi.Uint64() - external int ri_resident_size; - - @ffi.Uint64() - external int ri_phys_footprint; - - @ffi.Uint64() - external int ri_proc_start_abstime; - - @ffi.Uint64() - external int ri_proc_exit_abstime; - - @ffi.Uint64() - external int ri_child_user_time; - - @ffi.Uint64() - external int ri_child_system_time; - - @ffi.Uint64() - external int ri_child_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_child_interrupt_wkups; - - @ffi.Uint64() - external int ri_child_pageins; - - @ffi.Uint64() - external int ri_child_elapsed_abstime; - - @ffi.Uint64() - external int ri_diskio_bytesread; - - @ffi.Uint64() - external int ri_diskio_byteswritten; - - @ffi.Uint64() - external int ri_cpu_time_qos_default; - - @ffi.Uint64() - external int ri_cpu_time_qos_maintenance; - - @ffi.Uint64() - external int ri_cpu_time_qos_background; - - @ffi.Uint64() - external int ri_cpu_time_qos_utility; - - @ffi.Uint64() - external int ri_cpu_time_qos_legacy; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_initiated; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_interactive; - - @ffi.Uint64() - external int ri_billed_system_time; - - @ffi.Uint64() - external int ri_serviced_system_time; - - @ffi.Uint64() - external int ri_logical_writes; - - @ffi.Uint64() - external int ri_lifetime_max_phys_footprint; - - @ffi.Uint64() - external int ri_instructions; - - @ffi.Uint64() - external int ri_cycles; - - @ffi.Uint64() - external int ri_billed_energy; - - @ffi.Uint64() - external int ri_serviced_energy; - - @ffi.Uint64() - external int ri_interval_max_phys_footprint; - - @ffi.Uint64() - external int ri_runnable_time; - - @ffi.Uint64() - external int ri_flags; -} - -final class rusage_info_v6 extends ffi.Struct { - @ffi.Array.multi([16]) - external ffi.Array ri_uuid; - - @ffi.Uint64() - external int ri_user_time; - - @ffi.Uint64() - external int ri_system_time; - - @ffi.Uint64() - external int ri_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_interrupt_wkups; - - @ffi.Uint64() - external int ri_pageins; - - @ffi.Uint64() - external int ri_wired_size; - - @ffi.Uint64() - external int ri_resident_size; - - @ffi.Uint64() - external int ri_phys_footprint; - - @ffi.Uint64() - external int ri_proc_start_abstime; - - @ffi.Uint64() - external int ri_proc_exit_abstime; - - @ffi.Uint64() - external int ri_child_user_time; - - @ffi.Uint64() - external int ri_child_system_time; - - @ffi.Uint64() - external int ri_child_pkg_idle_wkups; - - @ffi.Uint64() - external int ri_child_interrupt_wkups; - - @ffi.Uint64() - external int ri_child_pageins; - - @ffi.Uint64() - external int ri_child_elapsed_abstime; - - @ffi.Uint64() - external int ri_diskio_bytesread; - - @ffi.Uint64() - external int ri_diskio_byteswritten; - - @ffi.Uint64() - external int ri_cpu_time_qos_default; - - @ffi.Uint64() - external int ri_cpu_time_qos_maintenance; - - @ffi.Uint64() - external int ri_cpu_time_qos_background; - - @ffi.Uint64() - external int ri_cpu_time_qos_utility; - - @ffi.Uint64() - external int ri_cpu_time_qos_legacy; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_initiated; - - @ffi.Uint64() - external int ri_cpu_time_qos_user_interactive; - - @ffi.Uint64() - external int ri_billed_system_time; - - @ffi.Uint64() - external int ri_serviced_system_time; - - @ffi.Uint64() - external int ri_logical_writes; - - @ffi.Uint64() - external int ri_lifetime_max_phys_footprint; - - @ffi.Uint64() - external int ri_instructions; - - @ffi.Uint64() - external int ri_cycles; - - @ffi.Uint64() - external int ri_billed_energy; - - @ffi.Uint64() - external int ri_serviced_energy; - - @ffi.Uint64() - external int ri_interval_max_phys_footprint; - - @ffi.Uint64() - external int ri_runnable_time; - - @ffi.Uint64() - external int ri_flags; - - @ffi.Uint64() - external int ri_user_ptime; - - @ffi.Uint64() - external int ri_system_ptime; - - @ffi.Uint64() - external int ri_pinstructions; - - @ffi.Uint64() - external int ri_pcycles; - - @ffi.Uint64() - external int ri_energy_nj; - - @ffi.Uint64() - external int ri_penergy_nj; - - @ffi.Array.multi([14]) - external ffi.Array ri_reserved; -} - -final class rlimit extends ffi.Struct { - @rlim_t() - external int rlim_cur; - - @rlim_t() - external int rlim_max; -} - -typedef rlim_t = __uint64_t; - -final class proc_rlimit_control_wakeupmon extends ffi.Struct { - @ffi.Uint32() - external int wm_flags; - - @ffi.Int32() - external int wm_rate; -} - -typedef id_t = __darwin_id_t; -typedef __darwin_id_t = __uint32_t; - -@ffi.Packed(1) -final class _OSUnalignedU16 extends ffi.Struct { - @ffi.Uint16() - external int __val; -} - -@ffi.Packed(1) -final class _OSUnalignedU32 extends ffi.Struct { - @ffi.Uint32() - external int __val; -} - -@ffi.Packed(1) -final class _OSUnalignedU64 extends ffi.Struct { - @ffi.Uint64() - external int __val; -} - -final class wait extends ffi.Opaque {} - -final class div_t extends ffi.Struct { - @ffi.Int() - external int quot; - - @ffi.Int() - external int rem; -} - -final class ldiv_t extends ffi.Struct { - @ffi.Long() - external int quot; - - @ffi.Long() - external int rem; -} - -final class lldiv_t extends ffi.Struct { - @ffi.LongLong() - external int quot; - - @ffi.LongLong() - external int rem; -} - -typedef malloc_type_id_t = ffi.UnsignedLongLong; -typedef Dartmalloc_type_id_t = int; - -final class _malloc_zone_t extends ffi.Opaque {} - -typedef malloc_zone_t = _malloc_zone_t; - -class _ObjCBlockBase implements ffi.Finalizable { - final ffi.Pointer<_ObjCBlock> _id; - final NativeCupertinoHttp _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_releaseFinalizer2.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_releaseFinalizer2.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; - - /// Return a pointer to this object. - ffi.Pointer<_ObjCBlock> get pointer => _id; - - ffi.Pointer<_ObjCBlock> _retainAndReturnId() { - _lib._Block_copy(_id.cast()); - return _id; - } -} - -void _ObjCBlock_ffiVoid_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, -) => - block.ref.target - .cast>() - .asFunction()(); -final _ObjCBlock_ffiVoid_closureRegistry = {}; -int _ObjCBlock_ffiVoid_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_registerClosure(void Function() fn) { - final id = ++_ObjCBlock_ffiVoid_closureRegistryIndex; - _ObjCBlock_ffiVoid_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, -) => - _ObjCBlock_ffiVoid_closureRegistry[block.ref.target.address]!(); - -class ObjCBlock_ffiVoid extends _ObjCBlockBase { - ObjCBlock_ffiVoid._(ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid.fromFunctionPointer(NativeCupertinoHttp lib, - ffi.Pointer> ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_ffiVoid_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid.fromFunction(NativeCupertinoHttp lib, void Function() fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_ffiVoid_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_registerClosure(() => fn())), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid.listener(NativeCupertinoHttp lib, void Function() fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>)>.listener( - _ObjCBlock_ffiVoid_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_registerClosure(() => fn())), - lib); - static ffi.NativeCallable)>? - _dartFuncListenerTrampoline; - - void call() => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block)>>() - .asFunction)>()( - _id, - ); -} - -final 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; -} - -final 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; -} - -int _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - int Function( - ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiInt_ffiVoid_ffiVoid_registerClosure( - int Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureRegistryIndex; - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -int _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiInt_ffiVoid_ffiVoid extends _ObjCBlockBase { - ObjCBlock_ffiInt_ffiVoid_ffiVoid._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiInt_ffiVoid_ffiVoid.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer arg0, ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Int Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrTrampoline, 0) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiInt_ffiVoid_ffiVoid.fromFunction(NativeCupertinoHttp lib, - int Function(ffi.Pointer, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Int Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureTrampoline, 0) - .cast(), - _ObjCBlock_ffiInt_ffiVoid_ffiVoid_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - int call(ffi.Pointer arg0, ffi.Pointer arg1) => _id - .ref.invoke - .cast< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0, arg1); -} - -typedef dev_t = __darwin_dev_t; -typedef __darwin_dev_t = __int32_t; -typedef mode_t = __darwin_mode_t; -typedef __darwin_mode_t = __uint16_t; -typedef __uint16_t = ffi.UnsignedShort; -typedef Dart__uint16_t = int; - -final class fd_set extends ffi.Struct { - @ffi.Array.multi([32]) - external ffi.Array<__int32_t> fds_bits; -} - -final class objc_class extends ffi.Opaque {} - -final class objc_object extends ffi.Struct { - external ffi.Pointer isa; -} - -final class ObjCObject extends ffi.Opaque {} - -final class objc_selector extends ffi.Opaque {} - -final class ObjCSel extends ffi.Opaque {} - -typedef objc_objectptr_t = ffi.Pointer; - -final class _NSZone extends ffi.Opaque {} - -class _ObjCWrapper implements ffi.Finalizable { - final ffi.Pointer _id; - final NativeCupertinoHttp _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_releaseFinalizer11.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_releaseFinalizer11.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; - - /// Return a pointer to this object. - ffi.Pointer get pointer => _id; - - ffi.Pointer _retainAndReturnId() { - _lib._objc_retain(_id.cast()); - return _id; - } -} - -class NSObject extends _ObjCWrapper { - NSObject._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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(NativeCupertinoHttp _lib) { - _lib._objc_msgSend_1(_lib._class_NSObject1, _lib._sel_load1); - } - - static void initialize(NativeCupertinoHttp _lib) { - _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(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_new1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - static NSObject allocWithZone_( - NativeCupertinoHttp _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(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_alloc1); - return NSObject._(_ret, _lib, retain: false, release: true); - } - - void dealloc() { - _lib._objc_msgSend_1(_id, _lib._sel_dealloc1); - } - - void finalize() { - _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_( - NativeCupertinoHttp _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_( - NativeCupertinoHttp _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_( - NativeCupertinoHttp _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_4(_lib._class_NSObject1, - _lib._sel_instancesRespondToSelector_1, aSelector); - } - - static bool conformsToProtocol_(NativeCupertinoHttp _lib, Protocol protocol) { - return _lib._objc_msgSend_5( - _lib._class_NSObject1, _lib._sel_conformsToProtocol_1, protocol._id); - } - - IMP methodForSelector_(ffi.Pointer aSelector) { - return _lib._objc_msgSend_6(_id, _lib._sel_methodForSelector_1, aSelector); - } - - static IMP instanceMethodForSelector_( - NativeCupertinoHttp _lib, ffi.Pointer aSelector) { - return _lib._objc_msgSend_6(_lib._class_NSObject1, - _lib._sel_instanceMethodForSelector_1, aSelector); - } - - void doesNotRecognizeSelector_(ffi.Pointer aSelector) { - _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) { - _lib._objc_msgSend_9(_id, _lib._sel_forwardInvocation_1, anInvocation._id); - } - - NSMethodSignature methodSignatureForSelector_( - ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_10( - _id, _lib._sel_methodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - static NSMethodSignature instanceMethodSignatureForSelector_( - NativeCupertinoHttp _lib, ffi.Pointer aSelector) { - final _ret = _lib._objc_msgSend_10(_lib._class_NSObject1, - _lib._sel_instanceMethodSignatureForSelector_1, aSelector); - return NSMethodSignature._(_ret, _lib, retain: true, release: true); - } - - bool allowsWeakReference() { - return _lib._objc_msgSend_11(_id, _lib._sel_allowsWeakReference1); - } - - bool retainWeakReference() { - return _lib._objc_msgSend_11(_id, _lib._sel_retainWeakReference1); - } - - static bool isSubclassOfClass_(NativeCupertinoHttp _lib, NSObject aClass) { - return _lib._objc_msgSend_0( - _lib._class_NSObject1, _lib._sel_isSubclassOfClass_1, aClass._id); - } - - static bool resolveClassMethod_( - NativeCupertinoHttp _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_resolveClassMethod_1, sel); - } - - static bool resolveInstanceMethod_( - NativeCupertinoHttp _lib, ffi.Pointer sel) { - return _lib._objc_msgSend_4( - _lib._class_NSObject1, _lib._sel_resolveInstanceMethod_1, sel); - } - - static DartNSUInteger hash(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_12(_lib._class_NSObject1, _lib._sel_hash1); - } - - static NSObject superclass(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_superclass1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject class1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSObject1, _lib._sel_class1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSString description(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_32(_lib._class_NSObject1, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString debugDescription(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_32( - _lib._class_NSObject1, _lib._sel_debugDescription1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static DartNSInteger version(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_86(_lib._class_NSObject1, _lib._sel_version1); - } - - static void setVersion_(NativeCupertinoHttp _lib, DartNSInteger aVersion) { - _lib._objc_msgSend_296( - _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_14( - _id, _lib._sel_replacementObjectForCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? awakeAfterUsingCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_awakeAfterUsingCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: false, release: true); - } - - static void poseAsClass_(NativeCupertinoHttp _lib, NSObject aClass) { - _lib._objc_msgSend_210( - _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 URL_resourceDataDidBecomeAvailable_(NSURL sender, NSData newBytes) { - _lib._objc_msgSend_297(_id, _lib._sel_URL_resourceDataDidBecomeAvailable_1, - sender._id, newBytes._id); - } - - void URLResourceDidFinishLoading_(NSURL sender) { - _lib._objc_msgSend_298( - _id, _lib._sel_URLResourceDidFinishLoading_1, sender._id); - } - - void URLResourceDidCancelLoading_(NSURL sender) { - _lib._objc_msgSend_298( - _id, _lib._sel_URLResourceDidCancelLoading_1, sender._id); - } - - void URL_resourceDidFailLoadingWithReason_(NSURL sender, NSString reason) { - _lib._objc_msgSend_299( - _id, - _lib._sel_URL_resourceDidFailLoadingWithReason_1, - sender._id, - reason._id); - } - - /// Given that an error alert has been presented document-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and send the selected message to the specified delegate. The option index is an index into the error's array of localized recovery options. The method selected by didRecoverSelector must have the same signature as: - /// - /// - (void)didPresentErrorWithRecovery:(BOOL)didRecover contextInfo:(void *)contextInfo; - /// - /// The value passed for didRecover must be YES if error recovery was completely successful, NO otherwise. - void - attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_( - NSError error, - DartNSUInteger recoveryOptionIndex, - NSObject? delegate, - ffi.Pointer didRecoverSelector, - ffi.Pointer contextInfo) { - _lib._objc_msgSend_300( - _id, - _lib._sel_attemptRecoveryFromError_optionIndex_delegate_didRecoverSelector_contextInfo_1, - error._id, - recoveryOptionIndex, - delegate?._id ?? ffi.nullptr, - didRecoverSelector, - contextInfo); - } - - /// Given that an error alert has been presented applicaton-modally to the user, and the user has chosen one of the error's recovery options, attempt recovery from the error, and return YES if error recovery was completely successful, NO otherwise. The recovery option index is an index into the error's array of localized recovery options. - bool attemptRecoveryFromError_optionIndex_( - NSError error, DartNSUInteger recoveryOptionIndex) { - return _lib._objc_msgSend_301( - _id, - _lib._sel_attemptRecoveryFromError_optionIndex_1, - error._id, - recoveryOptionIndex); - } -} - -typedef instancetype = ffi.Pointer; -typedef Dartinstancetype = NSObject; - -class Protocol extends _ObjCWrapper { - Protocol._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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>; -typedef IMPFunction = ffi.Void Function(); -typedef DartIMPFunction = void Function(); - -class NSInvocation extends _ObjCWrapper { - NSInvocation._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } -} - -class NSMethodSignature extends _ObjCWrapper { - NSMethodSignature._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } -} - -typedef NSUInteger = ffi.UnsignedLong; -typedef DartNSUInteger = int; - -class NSString extends NSObject { - NSString._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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(NativeCupertinoHttp _lib, String str) { - final cstr = str.toNativeUtf16(); - final nsstr = stringWithCharacters_length_(_lib, cstr.cast(), str.length); - pkg_ffi.calloc.free(cstr); - return nsstr; - } - - @override - String toString() { - final data = - dataUsingEncoding_(0x94000100 /* NSUTF16LittleEndianStringEncoding */); - return data!.bytes.cast().toDartString(length: length); - } - - DartNSUInteger get length { - return _lib._objc_msgSend_12(_id, _lib._sel_length1); - } - - Dartunichar characterAtIndex_(DartNSUInteger index) { - return _lib._objc_msgSend_13(_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_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString substringFromIndex_(DartNSUInteger from) { - final _ret = - _lib._objc_msgSend_15(_id, _lib._sel_substringFromIndex_1, from); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString substringToIndex_(DartNSUInteger to) { - final _ret = _lib._objc_msgSend_15(_id, _lib._sel_substringToIndex_1, to); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString substringWithRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_16(_id, _lib._sel_substringWithRange_1, range); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void getCharacters_range_(ffi.Pointer buffer, NSRange range) { - _lib._objc_msgSend_17(_id, _lib._sel_getCharacters_range_1, buffer, range); - } - - int compare_(NSString string) { - return _lib._objc_msgSend_18(_id, _lib._sel_compare_1, string._id); - } - - int compare_options_(NSString string, int mask) { - return _lib._objc_msgSend_19( - _id, _lib._sel_compare_options_1, string._id, mask); - } - - int compare_options_range_( - NSString string, int mask, NSRange rangeOfReceiverToCompare) { - return _lib._objc_msgSend_20(_id, _lib._sel_compare_options_range_1, - string._id, mask, rangeOfReceiverToCompare); - } - - int compare_options_range_locale_(NSString string, int mask, - NSRange rangeOfReceiverToCompare, NSObject? locale) { - return _lib._objc_msgSend_21(_id, _lib._sel_compare_options_range_locale_1, - string._id, mask, rangeOfReceiverToCompare, locale?._id ?? ffi.nullptr); - } - - int caseInsensitiveCompare_(NSString string) { - return _lib._objc_msgSend_18( - _id, _lib._sel_caseInsensitiveCompare_1, string._id); - } - - int localizedCompare_(NSString string) { - return _lib._objc_msgSend_18(_id, _lib._sel_localizedCompare_1, string._id); - } - - int localizedCaseInsensitiveCompare_(NSString string) { - return _lib._objc_msgSend_18( - _id, _lib._sel_localizedCaseInsensitiveCompare_1, string._id); - } - - int localizedStandardCompare_(NSString string) { - return _lib._objc_msgSend_18( - _id, _lib._sel_localizedStandardCompare_1, string._id); - } - - bool isEqualToString_(NSString aString) { - return _lib._objc_msgSend_22(_id, _lib._sel_isEqualToString_1, aString._id); - } - - bool hasPrefix_(NSString str) { - return _lib._objc_msgSend_22(_id, _lib._sel_hasPrefix_1, str._id); - } - - bool hasSuffix_(NSString str) { - return _lib._objc_msgSend_22(_id, _lib._sel_hasSuffix_1, str._id); - } - - NSString commonPrefixWithString_options_(NSString str, int mask) { - final _ret = _lib._objc_msgSend_23( - _id, _lib._sel_commonPrefixWithString_options_1, str._id, mask); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool containsString_(NSString str) { - return _lib._objc_msgSend_22(_id, _lib._sel_containsString_1, str._id); - } - - bool localizedCaseInsensitiveContainsString_(NSString str) { - return _lib._objc_msgSend_22( - _id, _lib._sel_localizedCaseInsensitiveContainsString_1, str._id); - } - - bool localizedStandardContainsString_(NSString str) { - return _lib._objc_msgSend_22( - _id, _lib._sel_localizedStandardContainsString_1, str._id); - } - - NSRange localizedStandardRangeOfString_(NSString str) { - return _lib._objc_msgSend_24( - _id, _lib._sel_localizedStandardRangeOfString_1, str._id); - } - - NSRange rangeOfString_(NSString searchString) { - return _lib._objc_msgSend_24( - _id, _lib._sel_rangeOfString_1, searchString._id); - } - - NSRange rangeOfString_options_(NSString searchString, int mask) { - return _lib._objc_msgSend_25( - _id, _lib._sel_rangeOfString_options_1, searchString._id, mask); - } - - NSRange rangeOfString_options_range_( - NSString searchString, int mask, NSRange rangeOfReceiverToSearch) { - return _lib._objc_msgSend_26(_id, _lib._sel_rangeOfString_options_range_1, - searchString._id, mask, rangeOfReceiverToSearch); - } - - NSRange rangeOfString_options_range_locale_(NSString searchString, int mask, - NSRange rangeOfReceiverToSearch, NSLocale? locale) { - return _lib._objc_msgSend_27( - _id, - _lib._sel_rangeOfString_options_range_locale_1, - searchString._id, - mask, - rangeOfReceiverToSearch, - locale?._id ?? ffi.nullptr); - } - - NSRange rangeOfCharacterFromSet_(NSCharacterSet searchSet) { - return _lib._objc_msgSend_241( - _id, _lib._sel_rangeOfCharacterFromSet_1, searchSet._id); - } - - NSRange rangeOfCharacterFromSet_options_(NSCharacterSet searchSet, int mask) { - return _lib._objc_msgSend_242( - _id, _lib._sel_rangeOfCharacterFromSet_options_1, searchSet._id, mask); - } - - NSRange rangeOfCharacterFromSet_options_range_( - NSCharacterSet searchSet, int mask, NSRange rangeOfReceiverToSearch) { - return _lib._objc_msgSend_243( - _id, - _lib._sel_rangeOfCharacterFromSet_options_range_1, - searchSet._id, - mask, - rangeOfReceiverToSearch); - } - - NSRange rangeOfComposedCharacterSequenceAtIndex_(DartNSUInteger index) { - return _lib._objc_msgSend_244( - _id, _lib._sel_rangeOfComposedCharacterSequenceAtIndex_1, index); - } - - NSRange rangeOfComposedCharacterSequencesForRange_(NSRange range) { - return _lib._objc_msgSend_245( - _id, _lib._sel_rangeOfComposedCharacterSequencesForRange_1, range); - } - - NSString stringByAppendingString_(NSString aString) { - final _ret = _lib._objc_msgSend_103( - _id, _lib._sel_stringByAppendingString_1, aString._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByAppendingFormat_(NSString format) { - final _ret = _lib._objc_msgSend_103( - _id, _lib._sel_stringByAppendingFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - double get doubleValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_doubleValue1) - : _lib._objc_msgSend_90(_id, _lib._sel_doubleValue1); - } - - double get floatValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_89_fpret(_id, _lib._sel_floatValue1) - : _lib._objc_msgSend_89(_id, _lib._sel_floatValue1); - } - - int get intValue { - return _lib._objc_msgSend_84(_id, _lib._sel_intValue1); - } - - DartNSInteger get integerValue { - return _lib._objc_msgSend_86(_id, _lib._sel_integerValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_87(_id, _lib._sel_longLongValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_11(_id, _lib._sel_boolValue1); - } - - NSString get uppercaseString { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_uppercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get lowercaseString { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_lowercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get capitalizedString { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_capitalizedString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get localizedUppercaseString { - final _ret = - _lib._objc_msgSend_32(_id, _lib._sel_localizedUppercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get localizedLowercaseString { - final _ret = - _lib._objc_msgSend_32(_id, _lib._sel_localizedLowercaseString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get localizedCapitalizedString { - final _ret = - _lib._objc_msgSend_32(_id, _lib._sel_localizedCapitalizedString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString uppercaseStringWithLocale_(NSLocale? locale) { - final _ret = _lib._objc_msgSend_246( - _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_246( - _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_246(_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) { - _lib._objc_msgSend_247( - _id, - _lib._sel_getLineStart_end_contentsEnd_forRange_1, - startPtr, - lineEndPtr, - contentsEndPtr, - range); - } - - NSRange lineRangeForRange_(NSRange range) { - return _lib._objc_msgSend_245(_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_247( - _id, - _lib._sel_getParagraphStart_end_contentsEnd_forRange_1, - startPtr, - parEndPtr, - contentsEndPtr, - range); - } - - NSRange paragraphRangeForRange_(NSRange range) { - return _lib._objc_msgSend_245( - _id, _lib._sel_paragraphRangeForRange_1, range); - } - - void enumerateSubstringsInRange_options_usingBlock_(NSRange range, int opts, - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool block) { - _lib._objc_msgSend_248( - _id, - _lib._sel_enumerateSubstringsInRange_options_usingBlock_1, - range, - opts, - block._id); - } - - void enumerateLinesUsingBlock_(ObjCBlock_ffiVoid_NSString_bool block) { - _lib._objc_msgSend_249( - _id, _lib._sel_enumerateLinesUsingBlock_1, block._id); - } - - ffi.Pointer get UTF8String { - return _lib._objc_msgSend_57(_id, _lib._sel_UTF8String1); - } - - DartNSUInteger get fastestEncoding { - return _lib._objc_msgSend_12(_id, _lib._sel_fastestEncoding1); - } - - DartNSUInteger get smallestEncoding { - return _lib._objc_msgSend_12(_id, _lib._sel_smallestEncoding1); - } - - NSData? dataUsingEncoding_allowLossyConversion_( - DartNSUInteger encoding, bool lossy) { - final _ret = _lib._objc_msgSend_250(_id, - _lib._sel_dataUsingEncoding_allowLossyConversion_1, encoding, lossy); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? dataUsingEncoding_(DartNSUInteger encoding) { - final _ret = - _lib._objc_msgSend_251(_id, _lib._sel_dataUsingEncoding_1, encoding); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - bool canBeConvertedToEncoding_(DartNSUInteger encoding) { - return _lib._objc_msgSend_122( - _id, _lib._sel_canBeConvertedToEncoding_1, encoding); - } - - ffi.Pointer cStringUsingEncoding_(DartNSUInteger encoding) { - return _lib._objc_msgSend_252( - _id, _lib._sel_cStringUsingEncoding_1, encoding); - } - - bool getCString_maxLength_encoding_(ffi.Pointer buffer, - DartNSUInteger maxBufferCount, DartNSUInteger encoding) { - return _lib._objc_msgSend_253( - _id, - _lib._sel_getCString_maxLength_encoding_1, - buffer, - maxBufferCount, - encoding); - } - - bool getBytes_maxLength_usedLength_encoding_options_range_remainingRange_( - ffi.Pointer buffer, - DartNSUInteger maxBufferCount, - ffi.Pointer usedBufferCount, - DartNSUInteger encoding, - int options, - NSRange range, - NSRangePointer leftover) { - return _lib._objc_msgSend_254( - _id, - _lib._sel_getBytes_maxLength_usedLength_encoding_options_range_remainingRange_1, - buffer, - maxBufferCount, - usedBufferCount, - encoding, - options, - range, - leftover); - } - - DartNSUInteger maximumLengthOfBytesUsingEncoding_(DartNSUInteger enc) { - return _lib._objc_msgSend_119( - _id, _lib._sel_maximumLengthOfBytesUsingEncoding_1, enc); - } - - DartNSUInteger lengthOfBytesUsingEncoding_(DartNSUInteger enc) { - return _lib._objc_msgSend_119( - _id, _lib._sel_lengthOfBytesUsingEncoding_1, enc); - } - - static ffi.Pointer getAvailableStringEncodings( - NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_255( - _lib._class_NSString1, _lib._sel_availableStringEncodings1); - } - - static NSString localizedNameOfStringEncoding_( - NativeCupertinoHttp _lib, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_15(_lib._class_NSString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static DartNSUInteger getDefaultCStringEncoding(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSString1, _lib._sel_defaultCStringEncoding1); - } - - NSString get decomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_32( - _id, _lib._sel_decomposedStringWithCanonicalMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get precomposedStringWithCanonicalMapping { - final _ret = _lib._objc_msgSend_32( - _id, _lib._sel_precomposedStringWithCanonicalMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get decomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_32( - _id, _lib._sel_decomposedStringWithCompatibilityMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get precomposedStringWithCompatibilityMapping { - final _ret = _lib._objc_msgSend_32( - _id, _lib._sel_precomposedStringWithCompatibilityMapping1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSArray componentsSeparatedByString_(NSString separator) { - final _ret = _lib._objc_msgSend_256( - _id, _lib._sel_componentsSeparatedByString_1, separator._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray componentsSeparatedByCharactersInSet_(NSCharacterSet separator) { - final _ret = _lib._objc_msgSend_257( - _id, _lib._sel_componentsSeparatedByCharactersInSet_1, separator._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString stringByTrimmingCharactersInSet_(NSCharacterSet set) { - final _ret = _lib._objc_msgSend_258( - _id, _lib._sel_stringByTrimmingCharactersInSet_1, set._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByPaddingToLength_withString_startingAtIndex_( - DartNSUInteger newLength, NSString padString, DartNSUInteger padIndex) { - final _ret = _lib._objc_msgSend_259( - _id, - _lib._sel_stringByPaddingToLength_withString_startingAtIndex_1, - newLength, - padString._id, - padIndex); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByFoldingWithOptions_locale_(int options, NSLocale? locale) { - final _ret = _lib._objc_msgSend_260( - _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_261( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_options_range_1, - target._id, - replacement._id, - options, - searchRange); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByReplacingOccurrencesOfString_withString_( - NSString target, NSString replacement) { - final _ret = _lib._objc_msgSend_262( - _id, - _lib._sel_stringByReplacingOccurrencesOfString_withString_1, - target._id, - replacement._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString stringByReplacingCharactersInRange_withString_( - NSRange range, NSString replacement) { - final _ret = _lib._objc_msgSend_263( - _id, - _lib._sel_stringByReplacingCharactersInRange_withString_1, - range, - replacement._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? stringByApplyingTransform_reverse_( - DartNSStringTransform transform, bool reverse) { - final _ret = _lib._objc_msgSend_264(_id, - _lib._sel_stringByApplyingTransform_reverse_1, transform._id, reverse); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - bool writeToURL_atomically_encoding_error_(NSURL url, bool useAuxiliaryFile, - DartNSUInteger enc, ffi.Pointer> error) { - return _lib._objc_msgSend_265( - _id, - _lib._sel_writeToURL_atomically_encoding_error_1, - url._id, - useAuxiliaryFile, - enc, - error); - } - - bool writeToFile_atomically_encoding_error_( - NSString path, - bool useAuxiliaryFile, - DartNSUInteger enc, - ffi.Pointer> error) { - return _lib._objc_msgSend_266( - _id, - _lib._sel_writeToFile_atomically_encoding_error_1, - path._id, - useAuxiliaryFile, - enc, - error); - } - - NSString get description { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - DartNSUInteger get hash { - return _lib._objc_msgSend_12(_id, _lib._sel_hash1); - } - - NSString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, DartNSUInteger length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_267( - _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, - DartNSUInteger len, - ObjCBlock_ffiVoid_unichar_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_268( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: false, release: true); - } - - NSString initWithCharacters_length_( - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269( - _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_270( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithString_(NSString aString) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithString_1, aString._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_(NSString format) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_arguments_(NSString format, va_list argList) { - final _ret = _lib._objc_msgSend_271( - _id, _lib._sel_initWithFormat_arguments_1, format._id, argList); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_locale_(NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_272(_id, _lib._sel_initWithFormat_locale_1, - format._id, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString initWithFormat_locale_arguments_( - NSString format, NSObject? locale, va_list argList) { - final _ret = _lib._objc_msgSend_273( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format._id, - locale?._id ?? ffi.nullptr, - argList); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithValidatedFormat_validFormatSpecifiers_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_275( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithValidatedFormat_validFormatSpecifiers_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_276( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, - format._id, - validFormatSpecifiers._id, - argList, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? - initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_277( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - argList, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithData_encoding_(NSData data, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_278( - _id, _lib._sel_initWithData_encoding_1, data._id, encoding); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithBytes_length_encoding_(ffi.Pointer bytes, - DartNSUInteger len, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_279( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - bool freeBuffer) { - final _ret = _lib._objc_msgSend_280( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: false, release: true); - } - - NSString? initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - ObjCBlock_ffiVoid_ffiVoid_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_281( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: false, release: true); - } - - static NSString string(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_string1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString stringWithString_(NativeCupertinoHttp _lib, NSString string) { - final _ret = _lib._objc_msgSend_42( - _lib._class_NSString1, _lib._sel_stringWithString_1, string._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString stringWithCharacters_length_(NativeCupertinoHttp _lib, - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269(_lib._class_NSString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithUTF8String_( - NativeCupertinoHttp _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_270(_lib._class_NSString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString stringWithFormat_(NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42( - _lib._class_NSString1, _lib._sel_stringWithFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString localizedStringWithFormat_( - NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42(_lib._class_NSString1, - _lib._sel_localizedStringWithFormat_1, format._id); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSString1, - _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? - localizedStringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSString1, - _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_282(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithCString_encoding_(NativeCupertinoHttp _lib, - ffi.Pointer cString, DartNSUInteger enc) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfURL_encoding_error_(NSURL url, DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283(_id, - _lib._sel_initWithContentsOfURL_encoding_error_1, url._id, enc, error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfFile_encoding_error_(NSString path, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfURL_encoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfFile_encoding_error_( - NativeCupertinoHttp _lib, - NSString path, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfURL_usedEncoding_error_( - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? initWithContentsOfFile_usedEncoding_error_( - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfURL_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString? stringWithContentsOfFile_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _lib._class_NSString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static DartNSUInteger - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - NativeCupertinoHttp _lib, - NSData data, - NSDictionary? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_287( - _lib._class_NSString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data._id, - 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_288( - _id, _lib._sel_propertyListFromStringsFileFormat1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer cString() { - return _lib._objc_msgSend_57(_id, _lib._sel_cString1); - } - - ffi.Pointer lossyCString() { - return _lib._objc_msgSend_57(_id, _lib._sel_lossyCString1); - } - - DartNSUInteger cStringLength() { - return _lib._objc_msgSend_12(_id, _lib._sel_cStringLength1); - } - - void getCString_(ffi.Pointer bytes) { - _lib._objc_msgSend_289(_id, _lib._sel_getCString_1, bytes); - } - - void getCString_maxLength_( - ffi.Pointer bytes, DartNSUInteger maxLength) { - _lib._objc_msgSend_290( - _id, _lib._sel_getCString_maxLength_1, bytes, maxLength); - } - - void getCString_maxLength_range_remainingRange_(ffi.Pointer bytes, - DartNSUInteger maxLength, NSRange aRange, NSRangePointer leftoverRange) { - _lib._objc_msgSend_291( - _id, - _lib._sel_getCString_maxLength_range_remainingRange_1, - bytes, - maxLength, - aRange, - leftoverRange); - } - - bool writeToFile_atomically_(NSString path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_37( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_168( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - NSObject? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_49( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_226(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49( - _lib._class_NSString1, _lib._sel_stringWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226( - _lib._class_NSString1, _lib._sel_stringWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithCStringNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, DartNSUInteger length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_292( - _id, - _lib._sel_initWithCStringNoCopy_length_freeWhenDone_1, - bytes, - length, - freeBuffer); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: false, release: true); - } - - NSObject? initWithCString_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_282( - _id, _lib._sel_initWithCString_length_1, bytes, length); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithCString_(ffi.Pointer bytes) { - final _ret = - _lib._objc_msgSend_270(_id, _lib._sel_initWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithCString_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSObject? stringWithCString_( - NativeCupertinoHttp _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_270( - _lib._class_NSString1, _lib._sel_stringWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void getCharacters_(ffi.Pointer buffer) { - _lib._objc_msgSend_293(_id, _lib._sel_getCharacters_1, buffer); - } - - /// Returns a new string made from the receiver by replacing all characters not in the allowedCharacters set with percent encoded characters. UTF-8 encoding is used to determine the correct percent encoded characters. Entire URL strings cannot be percent-encoded. This method is intended to percent-encode a URL component or subcomponent string, NOT the entire URL string. Any characters in allowedCharacters outside of the 7-bit ASCII range are ignored. - NSString? stringByAddingPercentEncodingWithAllowedCharacters_( - NSCharacterSet allowedCharacters) { - final _ret = _lib._objc_msgSend_294( - _id, - _lib._sel_stringByAddingPercentEncodingWithAllowedCharacters_1, - allowedCharacters._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// Returns a new string made from the receiver by replacing all percent encoded sequences with the matching UTF-8 characters. - NSString? get stringByRemovingPercentEncoding { - final _ret = - _lib._objc_msgSend_55(_id, _lib._sel_stringByRemovingPercentEncoding1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? stringByAddingPercentEscapesUsingEncoding_(DartNSUInteger enc) { - final _ret = _lib._objc_msgSend_295( - _id, _lib._sel_stringByAddingPercentEscapesUsingEncoding_1, enc); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? stringByReplacingPercentEscapesUsingEncoding_(DartNSUInteger enc) { - final _ret = _lib._objc_msgSend_295( - _id, _lib._sel_stringByReplacingPercentEscapesUsingEncoding_1, enc); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - static NSString new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_new1); - return NSString._(_ret, _lib, retain: false, release: true); - } - - static NSString allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSString1, _lib._sel_allocWithZone_1, zone); - return NSString._(_ret, _lib, retain: false, release: true); - } - - static NSString alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSString1, _lib._sel_alloc1); - return NSString._(_ret, _lib, retain: false, release: true); - } -} - -extension StringToNSString on String { - NSString toNSString(NativeCupertinoHttp lib) => NSString(lib, this); -} - -typedef unichar = ffi.UnsignedShort; -typedef Dartunichar = int; - -class NSCoder extends _ObjCWrapper { - NSCoder._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } -} - -typedef NSRange = _NSRange; - -final class _NSRange extends ffi.Struct { - @NSUInteger() - external int location; - - @NSUInteger() - external int length; -} - -abstract class NSComparisonResult { - static const int NSOrderedAscending = -1; - static const int NSOrderedSame = 0; - static const int NSOrderedDescending = 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; -} - -class NSLocale extends _ObjCWrapper { - NSLocale._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } -} - -class NSCharacterSet extends NSObject { - NSCharacterSet._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_controlCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getWhitespaceCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_whitespaceCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getWhitespaceAndNewlineCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSCharacterSet1, - _lib._sel_whitespaceAndNewlineCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getDecimalDigitCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_decimalDigitCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getLetterCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_letterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getLowercaseLetterCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_lowercaseLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getUppercaseLetterCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_uppercaseLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getNonBaseCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_nonBaseCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getAlphanumericCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_alphanumericCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getDecomposableCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_decomposableCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getIllegalCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_illegalCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getPunctuationCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_punctuationCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getCapitalizedLetterCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_capitalizedLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getSymbolCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_symbolCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet getNewlineCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_newlineCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } - - static NSCharacterSet characterSetWithRange_( - NativeCupertinoHttp _lib, NSRange aRange) { - final _ret = _lib._objc_msgSend_29( - _lib._class_NSCharacterSet1, _lib._sel_characterSetWithRange_1, aRange); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet characterSetWithCharactersInString_( - NativeCupertinoHttp _lib, NSString aString) { - final _ret = _lib._objc_msgSend_30(_lib._class_NSCharacterSet1, - _lib._sel_characterSetWithCharactersInString_1, aString._id); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet characterSetWithBitmapRepresentation_( - NativeCupertinoHttp _lib, NSData data) { - final _ret = _lib._objc_msgSend_234(_lib._class_NSCharacterSet1, - _lib._sel_characterSetWithBitmapRepresentation_1, data._id); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet? characterSetWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString fName) { - final _ret = _lib._objc_msgSend_235(_lib._class_NSCharacterSet1, - _lib._sel_characterSetWithContentsOfFile_1, fName._id); - return _ret.address == 0 - ? null - : NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - NSCharacterSet initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_236(_id, _lib._sel_initWithCoder_1, coder._id); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - bool characterIsMember_(Dartunichar aCharacter) { - return _lib._objc_msgSend_237( - _id, _lib._sel_characterIsMember_1, aCharacter); - } - - NSData get bitmapRepresentation { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_bitmapRepresentation1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSCharacterSet get invertedSet { - final _ret = _lib._objc_msgSend_28(_id, _lib._sel_invertedSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - bool longCharacterIsMember_(DartUInt32 theLongChar) { - return _lib._objc_msgSend_238( - _id, _lib._sel_longCharacterIsMember_1, theLongChar); - } - - bool isSupersetOfSet_(NSCharacterSet theOtherSet) { - return _lib._objc_msgSend_239( - _id, _lib._sel_isSupersetOfSet_1, theOtherSet._id); - } - - bool hasMemberInPlane_(int thePlane) { - return _lib._objc_msgSend_240(_id, _lib._sel_hasMemberInPlane_1, thePlane); - } - - /// Returns a character set containing the characters allowed in a URL's user subcomponent. - static NSCharacterSet getURLUserAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_URLUserAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - /// Returns a character set containing the characters allowed in a URL's password subcomponent. - static NSCharacterSet getURLPasswordAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_URLPasswordAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - /// Returns a character set containing the characters allowed in a URL's host subcomponent. - static NSCharacterSet getURLHostAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_URLHostAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - /// Returns a character set containing the characters allowed in a URL's path component. ';' is a legal path character, but it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet). - static NSCharacterSet getURLPathAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_URLPathAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - /// Returns a character set containing the characters allowed in a URL's query component. - static NSCharacterSet getURLQueryAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_URLQueryAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - /// Returns a character set containing the characters allowed in a URL's fragment component. - static NSCharacterSet getURLFragmentAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSCharacterSet1, _lib._sel_URLFragmentAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSCharacterSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } - - static NSCharacterSet new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_new1); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } - - static NSCharacterSet allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSCharacterSet1, _lib._sel_allocWithZone_1, zone); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } - - static NSCharacterSet alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCharacterSet1, _lib._sel_alloc1); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } -} - -class NSData extends NSObject { - NSData._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - DartNSUInteger get length { - return _lib._objc_msgSend_12(_id, _lib._sel_length1); - } - - /// The -bytes method returns a pointer to a contiguous region of memory managed by the receiver. - /// If the regions of memory represented by the receiver are already contiguous, it does so in O(1) time, otherwise it may take longer - /// Using -enumerateByteRangesUsingBlock: will be efficient for both contiguous and discontiguous data. - ffi.Pointer get bytes { - return _lib._objc_msgSend_31(_id, _lib._sel_bytes1); - } - - NSString get description { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void getBytes_length_(ffi.Pointer buffer, DartNSUInteger length) { - _lib._objc_msgSend_33(_id, _lib._sel_getBytes_length_1, buffer, length); - } - - void getBytes_range_(ffi.Pointer buffer, NSRange range) { - _lib._objc_msgSend_34(_id, _lib._sel_getBytes_range_1, buffer, range); - } - - bool isEqualToData_(NSData other) { - return _lib._objc_msgSend_35(_id, _lib._sel_isEqualToData_1, other._id); - } - - NSData subdataWithRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_36(_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_37( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - /// the atomically flag is ignored if the url is not of a type the supports atomic writes - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_168( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - bool writeToFile_options_error_(NSString path, int writeOptionsMask, - ffi.Pointer> errorPtr) { - return _lib._objc_msgSend_218(_id, _lib._sel_writeToFile_options_error_1, - path._id, writeOptionsMask, errorPtr); - } - - bool writeToURL_options_error_(NSURL url, int writeOptionsMask, - ffi.Pointer> errorPtr) { - return _lib._objc_msgSend_219(_id, _lib._sel_writeToURL_options_error_1, - url._id, writeOptionsMask, errorPtr); - } - - NSRange rangeOfData_options_range_( - NSData dataToFind, int mask, NSRange searchRange) { - return _lib._objc_msgSend_220(_id, _lib._sel_rangeOfData_options_range_1, - dataToFind._id, mask, searchRange); - } - - /// 'block' is called once for each contiguous region of memory in the receiver (once total for contiguous NSDatas), until either all bytes have been enumerated, or the 'stop' parameter is set to YES. - void enumerateByteRangesUsingBlock_( - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_221( - _id, _lib._sel_enumerateByteRangesUsingBlock_1, block._id); - } - - static NSData data(NativeCupertinoHttp _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_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222( - _lib._class_NSData1, _lib._sel_dataWithBytes_length_1, bytes, length); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData dataWithBytesNoCopy_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222(_lib._class_NSData1, - _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static NSData dataWithBytesNoCopy_length_freeWhenDone_( - NativeCupertinoHttp _lib, - ffi.Pointer bytes, - DartNSUInteger length, - bool b) { - final _ret = _lib._objc_msgSend_223(_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_( - NativeCupertinoHttp _lib, - NSString path, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_224( - _lib._class_NSData1, - _lib._sel_dataWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData? dataWithContentsOfURL_options_error_( - NativeCupertinoHttp _lib, - NSURL url, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_225( - _lib._class_NSData1, - _lib._sel_dataWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData? dataWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49( - _lib._class_NSData1, _lib._sel_dataWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData? dataWithContentsOfURL_(NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226( - _lib._class_NSData1, _lib._sel_dataWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData initWithBytes_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222( - _id, _lib._sel_initWithBytes_length_1, bytes, length); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData initWithBytesNoCopy_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222( - _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); - return NSData._(_ret, _lib, retain: false, release: true); - } - - NSData initWithBytesNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, DartNSUInteger length, bool b) { - final _ret = _lib._objc_msgSend_223(_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, - DartNSUInteger length, - ObjCBlock_ffiVoid_ffiVoid_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_227( - _id, - _lib._sel_initWithBytesNoCopy_length_deallocator_1, - bytes, - length, - deallocator?._id ?? ffi.nullptr); - return NSData._(_ret, _lib, retain: false, release: true); - } - - NSData? initWithContentsOfFile_options_error_(NSString path, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_224( - _id, - _lib._sel_initWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithContentsOfURL_options_error_(NSURL url, int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_225( - _id, - _lib._sel_initWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_49( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_226(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_228(_id, _lib._sel_initWithData_1, data._id); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData dataWithData_(NativeCupertinoHttp _lib, NSData data) { - final _ret = _lib._objc_msgSend_228( - _lib._class_NSData1, _lib._sel_dataWithData_1, data._id); - return NSData._(_ret, _lib, retain: true, release: true); - } - - /// Create an NSData from a Base-64 encoded NSString using the given options. By default, returns nil when the input is not recognized as valid Base-64. - NSData? initWithBase64EncodedString_options_( - NSString base64String, int options) { - final _ret = _lib._objc_msgSend_229( - _id, - _lib._sel_initWithBase64EncodedString_options_1, - base64String._id, - options); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - /// Create a Base-64 encoded NSString from the receiver's contents using the given options. - NSString base64EncodedStringWithOptions_(int options) { - final _ret = _lib._objc_msgSend_230( - _id, _lib._sel_base64EncodedStringWithOptions_1, options); - return NSString._(_ret, _lib, retain: true, release: true); - } - - /// Create an NSData from a Base-64, UTF-8 encoded NSData. By default, returns nil when the input is not recognized as valid Base-64. - NSData? initWithBase64EncodedData_options_(NSData base64Data, int options) { - final _ret = _lib._objc_msgSend_231(_id, - _lib._sel_initWithBase64EncodedData_options_1, base64Data._id, options); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - /// Create a Base-64, UTF-8 encoded NSData from the receiver's contents using the given options. - NSData base64EncodedDataWithOptions_(int options) { - final _ret = _lib._objc_msgSend_232( - _id, _lib._sel_base64EncodedDataWithOptions_1, options); - return NSData._(_ret, _lib, retain: true, release: true); - } - - /// These methods return a compressed or decompressed version of the receiver using the specified algorithm. - NSData? decompressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_233(_id, - _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - NSData? compressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_233( - _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - void getBytes_(ffi.Pointer buffer) { - _lib._objc_msgSend_64(_id, _lib._sel_getBytes_1, buffer); - } - - static NSObject? dataWithContentsOfMappedFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSData1, - _lib._sel_dataWithContentsOfMappedFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? initWithContentsOfMappedFile_(NSString path) { - final _ret = _lib._objc_msgSend_49( - _id, _lib._sel_initWithContentsOfMappedFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - /// These methods first appeared in NSData.h on OS X 10.9 and iOS 7.0. They are deprecated in the same releases in favor of the methods in the NSDataBase64Encoding category. However, these methods have existed for several releases, so they may be used for applications targeting releases prior to OS X 10.9 and iOS 7.0. - NSObject? initWithBase64Encoding_(NSString base64String) { - final _ret = _lib._objc_msgSend_49( - _id, _lib._sel_initWithBase64Encoding_1, base64String._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSString base64Encoding() { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_base64Encoding1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSData init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - static NSData new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_new1); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static NSData allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSData1, _lib._sel_allocWithZone_1, zone); - return NSData._(_ret, _lib, retain: false, release: true); - } - - static NSData alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSData1, _lib._sel_alloc1); - return NSData._(_ret, _lib, retain: false, release: true); - } -} - -class NSURL extends NSObject { - NSURL._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - /// this call percent-encodes both the host and path, so this cannot be used to set a username/password or port in the hostname part or with a IPv6 '[...]' type address. NSURLComponents handles IPv6 addresses correctly. - NSURL? initWithScheme_host_path_( - NSString scheme, NSString? host, NSString path) { - final _ret = _lib._objc_msgSend_38( - _id, - _lib._sel_initWithScheme_host_path_1, - scheme._id, - host?._id ?? ffi.nullptr, - path._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes a newly created file NSURL referencing the local file or directory at path, relative to a base URL. - NSURL initFileURLWithPath_isDirectory_relativeToURL_( - NSString path, bool isDir, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_39( - _id, - _lib._sel_initFileURLWithPath_isDirectory_relativeToURL_1, - path._id, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Better to use initFileURLWithPath:isDirectory:relativeToURL: if you know if the path is a directory vs non-directory, as it saves an I/O. - NSURL initFileURLWithPath_relativeToURL_(NSString path, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_40( - _id, - _lib._sel_initFileURLWithPath_relativeToURL_1, - path._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL initFileURLWithPath_isDirectory_(NSString path, bool isDir) { - final _ret = _lib._objc_msgSend_41( - _id, _lib._sel_initFileURLWithPath_isDirectory_1, path._id, isDir); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Better to use initFileURLWithPath:isDirectory: if you know if the path is a directory vs non-directory, as it saves an i/o. - NSURL initFileURLWithPath_(NSString path) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initFileURLWithPath_1, path._id); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes and returns a newly created file NSURL referencing the local file or directory at path, relative to a base URL. - static NSURL fileURLWithPath_isDirectory_relativeToURL_( - NativeCupertinoHttp _lib, NSString path, bool isDir, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_43( - _lib._class_NSURL1, - _lib._sel_fileURLWithPath_isDirectory_relativeToURL_1, - path._id, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Better to use fileURLWithPath:isDirectory:relativeToURL: if you know if the path is a directory vs non-directory, as it saves an I/O. - static NSURL fileURLWithPath_relativeToURL_( - NativeCupertinoHttp _lib, NSString path, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_44( - _lib._class_NSURL1, - _lib._sel_fileURLWithPath_relativeToURL_1, - path._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL fileURLWithPath_isDirectory_( - NativeCupertinoHttp _lib, NSString path, bool isDir) { - final _ret = _lib._objc_msgSend_45(_lib._class_NSURL1, - _lib._sel_fileURLWithPath_isDirectory_1, path._id, isDir); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Better to use fileURLWithPath:isDirectory: if you know if the path is a directory vs non-directory, as it saves an i/o. - static NSURL fileURLWithPath_(NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_46( - _lib._class_NSURL1, _lib._sel_fileURLWithPath_1, path._id); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes a newly created URL referencing the local file or directory at the file system representation of the path. File system representation is a null-terminated C string with canonical UTF-8 encoding. - NSURL initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( - ffi.Pointer path, bool isDir, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_47( - _id, - _lib._sel_initFileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, - path, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes and returns a newly created URL referencing the local file or directory at the file system representation of the path. File system representation is a null-terminated C string with canonical UTF-8 encoding. - static NSURL fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_( - NativeCupertinoHttp _lib, - ffi.Pointer path, - bool isDir, - NSURL? baseURL) { - final _ret = _lib._objc_msgSend_48( - _lib._class_NSURL1, - _lib._sel_fileURLWithFileSystemRepresentation_isDirectory_relativeToURL_1, - path, - isDir, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// These methods expect their string arguments to contain any percent escape codes that are necessary. It is an error for URLString to be nil. - NSURL? initWithString_(NSString URLString) { - final _ret = - _lib._objc_msgSend_49(_id, _lib._sel_initWithString_1, URLString._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? initWithString_relativeToURL_(NSString URLString, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_50( - _id, - _lib._sel_initWithString_relativeToURL_1, - URLString._id, - baseURL?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL? URLWithString_(NativeCupertinoHttp _lib, NSString URLString) { - final _ret = _lib._objc_msgSend_49( - _lib._class_NSURL1, _lib._sel_URLWithString_1, URLString._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL? URLWithString_relativeToURL_( - NativeCupertinoHttp _lib, NSString URLString, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_50( - _lib._class_NSURL1, - _lib._sel_URLWithString_relativeToURL_1, - URLString._id, - baseURL?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes an `NSURL` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters. - /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned. - /// If `encodingInvalidCharacters` is true, `NSURL` will try to encode the string to create a valid URL. - /// If the URL string is still invalid after encoding, `nil` is returned. - /// - /// - Parameter URLString: The URL string. - /// - Parameter encodingInvalidCharacters: True if `NSURL` should try to encode an invalid URL string, false otherwise. - /// - Returns: An `NSURL` instance for a valid URL, or `nil` if the URL is invalid. - NSURL? initWithString_encodingInvalidCharacters_( - NSString URLString, bool encodingInvalidCharacters) { - final _ret = _lib._objc_msgSend_51( - _id, - _lib._sel_initWithString_encodingInvalidCharacters_1, - URLString._id, - encodingInvalidCharacters); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes and returns a newly created `NSURL` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters. - /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned. - /// If `encodingInvalidCharacters` is true, `NSURL` will try to encode the string to create a valid URL. - /// If the URL string is still invalid after encoding, `nil` is returned. - /// - /// - Parameter URLString: The URL string. - /// - Parameter encodingInvalidCharacters: True if `NSURL` should try to encode an invalid URL string, false otherwise. - /// - Returns: An `NSURL` instance for a valid URL, or `nil` if the URL is invalid. - static NSURL? URLWithString_encodingInvalidCharacters_( - NativeCupertinoHttp _lib, - NSString URLString, - bool encodingInvalidCharacters) { - final _ret = _lib._objc_msgSend_51( - _lib._class_NSURL1, - _lib._sel_URLWithString_encodingInvalidCharacters_1, - URLString._id, - encodingInvalidCharacters); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes a newly created NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected. - NSURL initWithDataRepresentation_relativeToURL_(NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_52( - _id, - _lib._sel_initWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes and returns a newly created NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected. - static NSURL URLWithDataRepresentation_relativeToURL_( - NativeCupertinoHttp _lib, NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_53( - _lib._class_NSURL1, - _lib._sel_URLWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes a newly created absolute NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected. - NSURL initAbsoluteURLWithDataRepresentation_relativeToURL_( - NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_52( - _id, - _lib._sel_initAbsoluteURLWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Initializes and returns a newly created absolute NSURL using the contents of the given data, relative to a base URL. If the data representation is not a legal URL string as ASCII bytes, the URL object may not behave as expected. - static NSURL absoluteURLWithDataRepresentation_relativeToURL_( - NativeCupertinoHttp _lib, NSData data, NSURL? baseURL) { - final _ret = _lib._objc_msgSend_53( - _lib._class_NSURL1, - _lib._sel_absoluteURLWithDataRepresentation_relativeToURL_1, - data._id, - baseURL?._id ?? ffi.nullptr); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Returns the data representation of the URL's relativeString. If the URL was initialized with -initWithData:relativeToURL:, the data representation returned are the same bytes as those used at initialization; otherwise, the data representation returned are the bytes of the relativeString encoded with NSUTF8StringEncoding. - NSData get dataRepresentation { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_dataRepresentation1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSString? get absoluteString { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_absoluteString1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// The relative portion of a URL. If baseURL is nil, or if the receiver is itself absolute, this is the same as absoluteString - NSString get relativeString { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_relativeString1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - /// may be nil. - NSURL? get baseURL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_baseURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// if the receiver is itself absolute, this will return self. - NSURL? get absoluteURL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_absoluteURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Any URL is composed of these two basic pieces. The full URL would be the concatenation of [myURL scheme], ':', [myURL resourceSpecifier] - NSString? get scheme { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_scheme1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get resourceSpecifier { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_resourceSpecifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// If the URL conforms to rfc 1808 (the most common form of URL), the following accessors will return the various components; otherwise they return nil. The litmus test for conformance is as recommended in RFC 1808 - whether the first two characters of resourceSpecifier is @"//". In all cases, they return the component's value after resolving the receiver against its base URL. - NSString? get host { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_host1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSNumber? get port { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_port1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSString? get user { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_user1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get password { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_password1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get path { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_path1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get fragment { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_fragment1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get parameterString { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_parameterString1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get query { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_query1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// The same as path if baseURL is nil - NSString? get relativePath { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_relativePath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// Determines if a given URL string's path represents a directory (i.e. the path component in the URL string ends with a '/' character). This does not check the resource the URL refers to. - bool get hasDirectoryPath { - return _lib._objc_msgSend_11(_id, _lib._sel_hasDirectoryPath1); - } - - /// Returns the URL's path in file system representation. File system representation is a null-terminated C string with canonical UTF-8 encoding. - bool getFileSystemRepresentation_maxLength_( - ffi.Pointer buffer, DartNSUInteger maxBufferLength) { - return _lib._objc_msgSend_95( - _id, - _lib._sel_getFileSystemRepresentation_maxLength_1, - buffer, - maxBufferLength); - } - - /// Returns the URL's path in file system representation. File system representation is a null-terminated C string with canonical UTF-8 encoding. The returned C string will be automatically freed just as a returned object would be released; your code should copy the representation or use getFileSystemRepresentation:maxLength: if it needs to store the representation outside of the autorelease context in which the representation is created. - ffi.Pointer get fileSystemRepresentation { - return _lib._objc_msgSend_57(_id, _lib._sel_fileSystemRepresentation1); - } - - /// Whether the scheme is file:; if [myURL isFileURL] is YES, then [myURL path] is suitable for input into NSFileManager or NSPathUtilities. - bool get fileURL { - return _lib._objc_msgSend_11(_id, _lib._sel_isFileURL1); - } - - NSURL? get standardizedURL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_standardizedURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Returns whether the URL is a file reference URL. Symbol is present in iOS 4, but performs no operation. - bool isFileReferenceURL() { - return _lib._objc_msgSend_11(_id, _lib._sel_isFileReferenceURL1); - } - - /// Returns a file reference URL that refers to the same resource as a specified file URL. File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This form of file URL remains valid when the file system path of the URL’s underlying resource changes. An error will occur if the url parameter is not a file URL. File reference URLs cannot be created to file system objects which do not exist or are not reachable. In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL path. A file reference URL's path should never be persistently stored because is not valid across system restarts, and across remounts of volumes -- if you want to create a persistent reference to a file system object, use a bookmark (see -bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error:). Symbol is present in iOS 4, but performs no operation. - NSURL? fileReferenceURL() { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_fileReferenceURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Returns a file path URL that refers to the same resource as a specified URL. File path URLs use a file system style path. An error will occur if the url parameter is not a file URL. A file reference URL's resource must exist and be reachable to be converted to a file path URL. Symbol is present in iOS 4, but performs no operation. - NSURL? get filePathURL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_filePathURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Returns the resource value identified by a given resource key. This method first checks if the URL object already caches the resource value. If so, it returns the cached resource value to the caller. If not, then this method synchronously obtains the resource value from the backing store, adds the resource value to the URL object's cache, and returns the resource value to the caller. The type of the resource value varies by resource property (see resource key definitions). If this method returns YES and value is populated with nil, it means the resource property is not available for the specified resource and no errors occurred when determining the resource property was not available. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation. - bool getResourceValue_forKey_error_( - ffi.Pointer> value, - DartNSURLResourceKey key, - ffi.Pointer> error) { - return _lib._objc_msgSend_191( - _id, _lib._sel_getResourceValue_forKey_error_1, value, key._id, error); - } - - /// Returns the resource values identified by specified array of resource keys. This method first checks if the URL object already caches the resource values. If so, it returns the cached resource values to the caller. If not, then this method synchronously obtains the resource values from the backing store, adds the resource values to the URL object's cache, and returns the resource values to the caller. The type of the resource values vary by property (see resource key definitions). If the result dictionary does not contain a resource value for one or more of the requested resource keys, it means those resource properties are not available for the specified resource and no errors occurred when determining those resource properties were not available. If this method returns NULL, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation. - NSDictionary? resourceValuesForKeys_error_( - NSArray keys, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_192( - _id, _lib._sel_resourceValuesForKeys_error_1, keys._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Sets the resource value identified by a given resource key. This method writes the new resource value out to the backing store. Attempts to set a read-only resource property or to set a resource property not supported by the resource are ignored and are not considered errors. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation. - bool setResourceValue_forKey_error_(NSObject? value, DartNSURLResourceKey key, - ffi.Pointer> error) { - return _lib._objc_msgSend_193( - _id, - _lib._sel_setResourceValue_forKey_error_1, - value?._id ?? ffi.nullptr, - key._id, - error); - } - - /// Sets any number of resource values of a URL's resource. This method writes the new resource values out to the backing store. Attempts to set read-only resource properties or to set resource properties not supported by the resource are ignored and are not considered errors. If an error occurs after some resource properties have been successfully changed, the userInfo dictionary in the returned error contains an array of resource keys that were not set with the key kCFURLKeysOfUnsetValuesKey. The order in which the resource values are set is not defined. If you need to guarantee the order resource values are set, you should make multiple requests to this method or to -setResourceValue:forKey:error: to guarantee the order. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. Symbol is present in iOS 4, but performs no operation. - bool setResourceValues_error_( - NSDictionary keyedValues, ffi.Pointer> error) { - return _lib._objc_msgSend_194( - _id, _lib._sel_setResourceValues_error_1, keyedValues._id, error); - } - - /// Removes the cached resource value identified by a given resource value key from the URL object. Removing a cached resource value may remove other cached resource values because some resource values are cached as a set of values, and because some resource values depend on other resource values (temporary resource values have no dependencies). This method is currently applicable only to URLs for file system resources. - void removeCachedResourceValueForKey_(DartNSURLResourceKey key) { - _lib._objc_msgSend_195( - _id, _lib._sel_removeCachedResourceValueForKey_1, key._id); - } - - /// Removes all cached resource values and all temporary resource values from the URL object. This method is currently applicable only to URLs for file system resources. - void removeAllCachedResourceValues() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResourceValues1); - } - - /// Sets a temporary resource value on the URL object. Temporary resource values are for client use. Temporary resource values exist only in memory and are never written to the resource's backing store. Once set, a temporary resource value can be copied from the URL object with -getResourceValue:forKey:error: or -resourceValuesForKeys:error:. To remove a temporary resource value from the URL object, use -removeCachedResourceValueForKey:. Care should be taken to ensure the key that identifies a temporary resource value is unique and does not conflict with system defined keys (using reverse domain name notation in your temporary resource value keys is recommended). This method is currently applicable only to URLs for file system resources. - void setTemporaryResourceValue_forKey_( - NSObject? value, DartNSURLResourceKey key) { - _lib._objc_msgSend_196(_id, _lib._sel_setTemporaryResourceValue_forKey_1, - value?._id ?? ffi.nullptr, key._id); - } - - /// Returns bookmark data for the URL, created with specified options and resource values. If this method returns nil, the optional error is populated. - NSData? - bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_( - int options, - NSArray? keys, - NSURL? relativeURL, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_197( - _id, - _lib._sel_bookmarkDataWithOptions_includingResourceValuesForKeys_relativeToURL_error_1, - options, - keys?._id ?? ffi.nullptr, - relativeURL?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - /// Initializes a newly created NSURL that refers to a location specified by resolving bookmark data. If this method returns nil, the optional error is populated. - NSURL? - initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_( - NSData bookmarkData, - int options, - NSURL? relativeURL, - ffi.Pointer isStale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_198( - _id, - _lib._sel_initByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1, - bookmarkData._id, - options, - relativeURL?._id ?? ffi.nullptr, - isStale, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Creates and Initializes an NSURL that refers to a location specified by resolving bookmark data. If this method returns nil, the optional error is populated. - static NSURL? - URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_( - NativeCupertinoHttp _lib, - NSData bookmarkData, - int options, - NSURL? relativeURL, - ffi.Pointer isStale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_198( - _lib._class_NSURL1, - _lib._sel_URLByResolvingBookmarkData_options_relativeToURL_bookmarkDataIsStale_error_1, - bookmarkData._id, - options, - relativeURL?._id ?? ffi.nullptr, - isStale, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Returns the resource values for properties identified by a specified array of keys contained in specified bookmark data. If the result dictionary does not contain a resource value for one or more of the requested resource keys, it means those resource properties are not available in the bookmark data. - static NSDictionary? resourceValuesForKeys_fromBookmarkData_( - NativeCupertinoHttp _lib, NSArray keys, NSData bookmarkData) { - final _ret = _lib._objc_msgSend_199( - _lib._class_NSURL1, - _lib._sel_resourceValuesForKeys_fromBookmarkData_1, - keys._id, - bookmarkData._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Creates an alias file on disk at a specified location with specified bookmark data. bookmarkData must have been created with the NSURLBookmarkCreationSuitableForBookmarkFile option. bookmarkFileURL must either refer to an existing file (which will be overwritten), or to location in an existing directory. If this method returns NO, the optional error is populated. - static bool writeBookmarkData_toURL_options_error_( - NativeCupertinoHttp _lib, - NSData bookmarkData, - NSURL bookmarkFileURL, - DartNSUInteger options, - ffi.Pointer> error) { - return _lib._objc_msgSend_200( - _lib._class_NSURL1, - _lib._sel_writeBookmarkData_toURL_options_error_1, - bookmarkData._id, - bookmarkFileURL._id, - options, - error); - } - - /// Initializes and returns bookmark data derived from an alias file pointed to by a specified URL. If bookmarkFileURL refers to an alias file created prior to OS X v10.6 that contains Alias Manager information but no bookmark data, this method synthesizes bookmark data for the file. If this method returns nil, the optional error is populated. - static NSData? bookmarkDataWithContentsOfURL_error_(NativeCupertinoHttp _lib, - NSURL bookmarkFileURL, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_201( - _lib._class_NSURL1, - _lib._sel_bookmarkDataWithContentsOfURL_error_1, - bookmarkFileURL._id, - error); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - /// Creates and initializes a NSURL that refers to the location specified by resolving the alias file at url. If the url argument does not refer to an alias file as defined by the NSURLIsAliasFileKey property, the NSURL returned is the same as url argument. This method fails and returns nil if the url argument is unreachable, or if the original file or directory could not be located or is not reachable, or if the original file or directory is on a volume that could not be located or mounted. If this method fails, the optional error is populated. The NSURLBookmarkResolutionWithSecurityScope option is not supported by this method. - static NSURL? URLByResolvingAliasFileAtURL_options_error_( - NativeCupertinoHttp _lib, - NSURL url, - int options, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_202( - _lib._class_NSURL1, - _lib._sel_URLByResolvingAliasFileAtURL_options_error_1, - url._id, - options, - error); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Given a NSURL created by resolving a bookmark data created with security scope, make the resource referenced by the url accessible to the process. Each call to startAccessingSecurityScopedResource that returns YES must be balanced with a call to stopAccessingSecurityScopedResource when access to this resource is no longer needed by the client. Calls to start and stop accessing the resource are reference counted and may be nested, which allows the pair of calls to be logically scoped. - bool startAccessingSecurityScopedResource() { - return _lib._objc_msgSend_11( - _id, _lib._sel_startAccessingSecurityScopedResource1); - } - - /// Removes one "accessing" reference to the security scope. When all references are removed, it revokes the access granted to the url by the initial prior successful call to startAccessingSecurityScopedResource. - void stopAccessingSecurityScopedResource() { - _lib._objc_msgSend_1(_id, _lib._sel_stopAccessingSecurityScopedResource1); - } - - /// Get resource values from URLs of 'promised' items. A promised item is not guaranteed to have its contents in the file system until you use NSFileCoordinator to perform a coordinated read on its URL, which causes the contents to be downloaded or otherwise generated. Promised item URLs are returned by various APIs, including currently: - /// - NSMetadataQueryUbiquitousDataScope - /// - NSMetadataQueryUbiquitousDocumentsScope - /// - An NSFilePresenter presenting the contents of the directory located by -URLForUbiquitousContainerIdentifier: or a subdirectory thereof - /// - /// The following methods behave identically to their similarly named methods above (-getResourceValue:forKey:error:, etc.), except that they allow you to get resource values and check for presence regardless of whether the promised item's contents currently exist at the URL. You must use these APIs instead of the normal NSURL resource value APIs if and only if any of the following are true: - /// - You are using a URL that you know came directly from one of the above APIs - /// - You are inside the accessor block of a coordinated read or write that used NSFileCoordinatorReadingImmediatelyAvailableMetadataOnly, NSFileCoordinatorWritingForDeleting, NSFileCoordinatorWritingForMoving, or NSFileCoordinatorWritingContentIndependentMetadataOnly - /// - /// Most of the NSURL resource value keys will work with these APIs. However, there are some that are tied to the item's contents that will not work, such as NSURLContentAccessDateKey or NSURLGenerationIdentifierKey. If one of these keys is used, the method will return YES, but the value for the key will be nil. - bool getPromisedItemResourceValue_forKey_error_( - ffi.Pointer> value, - DartNSURLResourceKey key, - ffi.Pointer> error) { - return _lib._objc_msgSend_191( - _id, - _lib._sel_getPromisedItemResourceValue_forKey_error_1, - value, - key._id, - error); - } - - NSDictionary? promisedItemResourceValuesForKeys_error_( - NSArray keys, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_192(_id, - _lib._sel_promisedItemResourceValuesForKeys_error_1, keys._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - bool checkPromisedItemIsReachableAndReturnError_( - ffi.Pointer> error) { - return _lib._objc_msgSend_203( - _id, _lib._sel_checkPromisedItemIsReachableAndReturnError_1, error); - } - - /// The following methods work on the path portion of a URL in the same manner that the NSPathUtilities methods on NSString do. - static NSURL? fileURLWithPathComponents_( - NativeCupertinoHttp _lib, NSArray components) { - final _ret = _lib._objc_msgSend_204(_lib._class_NSURL1, - _lib._sel_fileURLWithPathComponents_1, components._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSArray? get pathComponents { - final _ret = _lib._objc_msgSend_188(_id, _lib._sel_pathComponents1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString? get lastPathComponent { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_lastPathComponent1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - NSString? get pathExtension { - final _ret = _lib._objc_msgSend_55(_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_205( - _id, _lib._sel_URLByAppendingPathComponent_1, pathComponent._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? URLByAppendingPathComponent_isDirectory_( - NSString pathComponent, bool isDirectory) { - final _ret = _lib._objc_msgSend_206( - _id, - _lib._sel_URLByAppendingPathComponent_isDirectory_1, - pathComponent._id, - isDirectory); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URLByDeletingLastPathComponent { - final _ret = - _lib._objc_msgSend_56(_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_205( - _id, _lib._sel_URLByAppendingPathExtension_1, pathExtension._id); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URLByDeletingPathExtension { - final _ret = - _lib._objc_msgSend_56(_id, _lib._sel_URLByDeletingPathExtension1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Returns whether the URL's resource exists and is reachable. This method synchronously checks if the resource's backing store is reachable. Checking reachability is appropriate when making decisions that do not require other immediate operations on the resource, e.g. periodic maintenance of UI state that depends on the existence of a specific document. When performing operations such as opening a file or copying resource properties, it is more efficient to simply try the operation and handle failures. If this method returns NO, the optional error is populated. This method is currently applicable only to URLs for file system resources. For other URL types, NO is returned. Symbol is present in iOS 4, but performs no operation. - bool checkResourceIsReachableAndReturnError_( - ffi.Pointer> error) { - return _lib._objc_msgSend_203( - _id, _lib._sel_checkResourceIsReachableAndReturnError_1, error); - } - - NSURL? get URLByStandardizingPath { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_URLByStandardizingPath1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - NSURL? get URLByResolvingSymlinksInPath { - final _ret = - _lib._objc_msgSend_56(_id, _lib._sel_URLByResolvingSymlinksInPath1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// Blocks to load the data if necessary. If shouldUseCache is YES, then if an equivalent URL has already been loaded and cached, its resource data will be returned immediately. If shouldUseCache is NO, a new load will be started - NSData? resourceDataUsingCache_(bool shouldUseCache) { - final _ret = _lib._objc_msgSend_207( - _id, _lib._sel_resourceDataUsingCache_1, shouldUseCache); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - /// Starts an asynchronous load of the data, registering delegate to receive notification. Only one such background load can proceed at a time. - void loadResourceDataNotifyingClient_usingCache_( - NSObject client, bool shouldUseCache) { - _lib._objc_msgSend_208( - _id, - _lib._sel_loadResourceDataNotifyingClient_usingCache_1, - client._id, - shouldUseCache); - } - - NSObject? propertyForKey_(NSString propertyKey) { - final _ret = - _lib._objc_msgSend_49(_id, _lib._sel_propertyForKey_1, propertyKey._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - /// These attempt to write the given arguments for the resource specified by the URL; they return success or failure - bool setResourceData_(NSData data) { - return _lib._objc_msgSend_35(_id, _lib._sel_setResourceData_1, data._id); - } - - bool setProperty_forKey_(NSObject property, NSString propertyKey) { - return _lib._objc_msgSend_209( - _id, _lib._sel_setProperty_forKey_1, property._id, propertyKey._id); - } - - /// Sophisticated clients will want to ask for this, then message the handle directly. If shouldUseCache is NO, a newly instantiated handle is returned, even if an equivalent URL has been loaded - NSURLHandle? URLHandleUsingCache_(bool shouldUseCache) { - final _ret = _lib._objc_msgSend_217( - _id, _lib._sel_URLHandleUsingCache_1, shouldUseCache); - return _ret.address == 0 - ? null - : NSURLHandle._(_ret, _lib, retain: true, release: true); - } - - @override - NSURL init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURL._(_ret, _lib, retain: true, release: true); - } - - static NSURL new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_new1); - return NSURL._(_ret, _lib, retain: false, release: true); - } - - static NSURL allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURL1, _lib._sel_allocWithZone_1, zone); - return NSURL._(_ret, _lib, retain: false, release: true); - } - - static NSURL alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURL1, _lib._sel_alloc1); - return NSURL._(_ret, _lib, retain: false, release: true); - } -} - -class NSNumber extends NSValue { - NSNumber._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithChar_(int value) { - final _ret = _lib._objc_msgSend_67(_id, _lib._sel_initWithChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedChar_(int value) { - final _ret = - _lib._objc_msgSend_68(_id, _lib._sel_initWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithShort_(int value) { - final _ret = _lib._objc_msgSend_69(_id, _lib._sel_initWithShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedShort_(int value) { - final _ret = - _lib._objc_msgSend_70(_id, _lib._sel_initWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithInt_(int value) { - final _ret = _lib._objc_msgSend_71(_id, _lib._sel_initWithInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedInt_(int value) { - final _ret = - _lib._objc_msgSend_72(_id, _lib._sel_initWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithLong_(int value) { - final _ret = _lib._objc_msgSend_73(_id, _lib._sel_initWithLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedLong_(int value) { - final _ret = - _lib._objc_msgSend_74(_id, _lib._sel_initWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithLongLong_(int value) { - final _ret = - _lib._objc_msgSend_75(_id, _lib._sel_initWithLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedLongLong_(int value) { - final _ret = - _lib._objc_msgSend_76(_id, _lib._sel_initWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithFloat_(double value) { - final _ret = _lib._objc_msgSend_77(_id, _lib._sel_initWithFloat_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithDouble_(double value) { - final _ret = _lib._objc_msgSend_78(_id, _lib._sel_initWithDouble_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithBool_(bool value) { - final _ret = _lib._objc_msgSend_79(_id, _lib._sel_initWithBool_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithInteger_(DartNSInteger value) { - final _ret = _lib._objc_msgSend_73(_id, _lib._sel_initWithInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - NSNumber initWithUnsignedInteger_(DartNSUInteger value) { - final _ret = - _lib._objc_msgSend_74(_id, _lib._sel_initWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - int get charValue { - return _lib._objc_msgSend_80(_id, _lib._sel_charValue1); - } - - int get unsignedCharValue { - return _lib._objc_msgSend_81(_id, _lib._sel_unsignedCharValue1); - } - - int get shortValue { - return _lib._objc_msgSend_82(_id, _lib._sel_shortValue1); - } - - int get unsignedShortValue { - return _lib._objc_msgSend_83(_id, _lib._sel_unsignedShortValue1); - } - - int get intValue { - return _lib._objc_msgSend_84(_id, _lib._sel_intValue1); - } - - int get unsignedIntValue { - return _lib._objc_msgSend_85(_id, _lib._sel_unsignedIntValue1); - } - - int get longValue { - return _lib._objc_msgSend_86(_id, _lib._sel_longValue1); - } - - int get unsignedLongValue { - return _lib._objc_msgSend_12(_id, _lib._sel_unsignedLongValue1); - } - - int get longLongValue { - return _lib._objc_msgSend_87(_id, _lib._sel_longLongValue1); - } - - int get unsignedLongLongValue { - return _lib._objc_msgSend_88(_id, _lib._sel_unsignedLongLongValue1); - } - - double get floatValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_89_fpret(_id, _lib._sel_floatValue1) - : _lib._objc_msgSend_89(_id, _lib._sel_floatValue1); - } - - double get doubleValue { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_doubleValue1) - : _lib._objc_msgSend_90(_id, _lib._sel_doubleValue1); - } - - bool get boolValue { - return _lib._objc_msgSend_11(_id, _lib._sel_boolValue1); - } - - DartNSInteger get integerValue { - return _lib._objc_msgSend_86(_id, _lib._sel_integerValue1); - } - - DartNSUInteger get unsignedIntegerValue { - return _lib._objc_msgSend_12(_id, _lib._sel_unsignedIntegerValue1); - } - - NSString get stringValue { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_stringValue1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - int compare_(NSNumber otherNumber) { - return _lib._objc_msgSend_91(_id, _lib._sel_compare_1, otherNumber._id); - } - - bool isEqualToNumber_(NSNumber number) { - return _lib._objc_msgSend_92(_id, _lib._sel_isEqualToNumber_1, number._id); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_93( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithChar_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_67( - _lib._class_NSNumber1, _lib._sel_numberWithChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedChar_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_68( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedChar_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithShort_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_69( - _lib._class_NSNumber1, _lib._sel_numberWithShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedShort_( - NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_70( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedShort_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithInt_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_71( - _lib._class_NSNumber1, _lib._sel_numberWithInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedInt_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_72( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInt_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithLong_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_73( - _lib._class_NSNumber1, _lib._sel_numberWithLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedLong_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_74( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithLongLong_(NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_75( - _lib._class_NSNumber1, _lib._sel_numberWithLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedLongLong_( - NativeCupertinoHttp _lib, int value) { - final _ret = _lib._objc_msgSend_76( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedLongLong_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithFloat_(NativeCupertinoHttp _lib, double value) { - final _ret = _lib._objc_msgSend_77( - _lib._class_NSNumber1, _lib._sel_numberWithFloat_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithDouble_(NativeCupertinoHttp _lib, double value) { - final _ret = _lib._objc_msgSend_78( - _lib._class_NSNumber1, _lib._sel_numberWithDouble_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithBool_(NativeCupertinoHttp _lib, bool value) { - final _ret = _lib._objc_msgSend_79( - _lib._class_NSNumber1, _lib._sel_numberWithBool_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithInteger_( - NativeCupertinoHttp _lib, DartNSInteger value) { - final _ret = _lib._objc_msgSend_73( - _lib._class_NSNumber1, _lib._sel_numberWithInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber numberWithUnsignedInteger_( - NativeCupertinoHttp _lib, DartNSUInteger value) { - final _ret = _lib._objc_msgSend_74( - _lib._class_NSNumber1, _lib._sel_numberWithUnsignedInteger_1, value); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - @override - NSNumber initWithBytes_objCType_( - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_58( - _id, _lib._sel_initWithBytes_objCType_1, value, type); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithBytes_objCType_(NativeCupertinoHttp _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_59(_lib._class_NSNumber1, - _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue value_withObjCType_(NativeCupertinoHttp _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_59( - _lib._class_NSNumber1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithNonretainedObject_( - NativeCupertinoHttp _lib, NSObject? anObject) { - final _ret = _lib._objc_msgSend_60(_lib._class_NSNumber1, - _lib._sel_valueWithNonretainedObject_1, anObject?._id ?? ffi.nullptr); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithPointer_( - NativeCupertinoHttp _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_62( - _lib._class_NSNumber1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithRange_(NativeCupertinoHttp _lib, NSRange range) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSNumber1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - @override - NSNumber init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSNumber._(_ret, _lib, retain: true, release: true); - } - - static NSNumber new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_new1); - return NSNumber._(_ret, _lib, retain: false, release: true); - } - - static NSNumber allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSNumber1, _lib._sel_allocWithZone_1, zone); - return NSNumber._(_ret, _lib, retain: false, release: true); - } - - static NSNumber alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSNumber1, _lib._sel_alloc1); - return NSNumber._(_ret, _lib, retain: false, release: true); - } -} - -class NSValue extends NSObject { - NSValue._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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, DartNSUInteger size) { - _lib._objc_msgSend_33(_id, _lib._sel_getValue_size_1, value, size); - } - - ffi.Pointer get objCType { - return _lib._objc_msgSend_57(_id, _lib._sel_objCType1); - } - - NSValue initWithBytes_objCType_( - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_58( - _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_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithBytes_objCType_(NativeCupertinoHttp _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_59( - _lib._class_NSValue1, _lib._sel_valueWithBytes_objCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue value_withObjCType_(NativeCupertinoHttp _lib, - ffi.Pointer value, ffi.Pointer type) { - final _ret = _lib._objc_msgSend_59( - _lib._class_NSValue1, _lib._sel_value_withObjCType_1, value, type); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithNonretainedObject_( - NativeCupertinoHttp _lib, NSObject? anObject) { - final _ret = _lib._objc_msgSend_60(_lib._class_NSValue1, - _lib._sel_valueWithNonretainedObject_1, anObject?._id ?? ffi.nullptr); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - NSObject? get nonretainedObjectValue { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_nonretainedObjectValue1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSValue valueWithPointer_( - NativeCupertinoHttp _lib, ffi.Pointer pointer) { - final _ret = _lib._objc_msgSend_62( - _lib._class_NSValue1, _lib._sel_valueWithPointer_1, pointer); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - ffi.Pointer get pointerValue { - return _lib._objc_msgSend_31(_id, _lib._sel_pointerValue1); - } - - bool isEqualToValue_(NSValue value) { - return _lib._objc_msgSend_63(_id, _lib._sel_isEqualToValue_1, value._id); - } - - void getValue_(ffi.Pointer value) { - _lib._objc_msgSend_64(_id, _lib._sel_getValue_1, value); - } - - static NSValue valueWithRange_(NativeCupertinoHttp _lib, NSRange range) { - final _ret = _lib._objc_msgSend_65( - _lib._class_NSValue1, _lib._sel_valueWithRange_1, range); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - NSRange get rangeValue { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeValue1); - } - - @override - NSValue init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSValue._(_ret, _lib, retain: true, release: true); - } - - static NSValue new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_new1); - return NSValue._(_ret, _lib, retain: false, release: true); - } - - static NSValue allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSValue1, _lib._sel_allocWithZone_1, zone); - return NSValue._(_ret, _lib, retain: false, release: true); - } - - static NSValue alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSValue1, _lib._sel_alloc1); - return NSValue._(_ret, _lib, retain: false, release: true); - } -} - -typedef NSInteger = ffi.Long; -typedef DartNSInteger = int; -typedef NSURLResourceKey = ffi.Pointer; -typedef DartNSURLResourceKey = NSString; - -class NSError extends NSObject { - NSError._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - /// Domain cannot be nil; dict may be nil if no userInfo desired. - NSError initWithDomain_code_userInfo_( - DartNSErrorDomain domain, DartNSInteger code, NSDictionary? dict) { - final _ret = _lib._objc_msgSend_186( - _id, - _lib._sel_initWithDomain_code_userInfo_1, - domain._id, - code, - dict?._id ?? ffi.nullptr); - return NSError._(_ret, _lib, retain: true, release: true); - } - - static NSError errorWithDomain_code_userInfo_(NativeCupertinoHttp _lib, - DartNSErrorDomain domain, DartNSInteger code, NSDictionary? dict) { - final _ret = _lib._objc_msgSend_186( - _lib._class_NSError1, - _lib._sel_errorWithDomain_code_userInfo_1, - domain._id, - code, - dict?._id ?? ffi.nullptr); - return NSError._(_ret, _lib, retain: true, release: true); - } - - /// These define the error. Domains are described by names that are arbitrary strings used to differentiate groups of codes; for custom domain using reverse-DNS naming will help avoid conflicts. Codes are domain-specific. - DartNSErrorDomain get domain { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_domain1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - DartNSInteger get code { - return _lib._objc_msgSend_86(_id, _lib._sel_code1); - } - - /// Additional info which may be used to describe the error further. Examples of keys that might be included in here are "Line Number", "Failed URL", etc. Embedding other errors in here can also be used as a way to communicate underlying reasons for failures; for instance "File System Error" embedded in the userInfo of an NSError returned from a higher level document object. If the embedded error information is itself NSError, the standard key NSUnderlyingErrorKey can be used. - NSDictionary get userInfo { - final _ret = _lib._objc_msgSend_187(_id, _lib._sel_userInfo1); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// The primary user-presentable message for the error, for instance for NSFileReadNoPermissionError: "The file "File Name" couldn't be opened because you don't have permission to view it.". This message should ideally indicate what failed and why it failed. This value either comes from NSLocalizedDescriptionKey, or NSLocalizedFailureErrorKey+NSLocalizedFailureReasonErrorKey, or NSLocalizedFailureErrorKey. The steps this takes to construct the description include: - /// 1. Look for NSLocalizedDescriptionKey in userInfo, use value as-is if present. - /// 2. Look for NSLocalizedFailureErrorKey in userInfo. If present, use, combining with value for NSLocalizedFailureReasonErrorKey if available. - /// 3. Fetch NSLocalizedDescriptionKey from userInfoValueProvider, use value as-is if present. - /// 4. Fetch NSLocalizedFailureErrorKey from userInfoValueProvider. If present, use, combining with value for NSLocalizedFailureReasonErrorKey if available. - /// 5. Look for NSLocalizedFailureReasonErrorKey in userInfo or from userInfoValueProvider; combine with generic "Operation failed" message. - /// 6. Last resort localized but barely-presentable string manufactured from domain and code. The result is never nil. - NSString get localizedDescription { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_localizedDescription1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - /// Return a complete sentence which describes why the operation failed. For instance, for NSFileReadNoPermissionError: "You don't have permission.". In many cases this will be just the "because" part of the error message (but as a complete sentence, which makes localization easier). Default implementation of this picks up the value of NSLocalizedFailureReasonErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain, and if that returns nil, this also returns nil. - NSString? get localizedFailureReason { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_localizedFailureReason1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// Return the string that can be displayed as the "informative" (aka "secondary") message on an alert panel. For instance, for NSFileReadNoPermissionError: "To view or change permissions, select the item in the Finder and choose File > Get Info.". Default implementation of this picks up the value of NSLocalizedRecoverySuggestionErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain, and if that returns nil, this also returns nil. - NSString? get localizedRecoverySuggestion { - final _ret = - _lib._objc_msgSend_55(_id, _lib._sel_localizedRecoverySuggestion1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// Return titles of buttons that are appropriate for displaying in an alert. These should match the string provided as a part of localizedRecoverySuggestion. The first string would be the title of the right-most and default button, the second one next to it, and so on. If used in an alert the corresponding default return values are NSAlertFirstButtonReturn + n. Default implementation of this picks up the value of NSLocalizedRecoveryOptionsErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain, and if that returns nil, this also returns nil. nil return usually implies no special suggestion, which would imply a single "OK" button. - NSArray? get localizedRecoveryOptions { - final _ret = - _lib._objc_msgSend_188(_id, _lib._sel_localizedRecoveryOptions1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - /// Return an object that conforms to the NSErrorRecoveryAttempting informal protocol. The recovery attempter must be an object that can correctly interpret an index into the array returned by localizedRecoveryOptions. The default implementation of this picks up the value of NSRecoveryAttempterErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain. If that returns nil, this also returns nil. - NSObject? get recoveryAttempter { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_recoveryAttempter1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - /// Return the help anchor that can be used to create a help button to accompany the error when it's displayed to the user. This is done automatically by +[NSAlert alertWithError:], which the presentError: variants in NSApplication go through. The default implementation of this picks up the value of the NSHelpAnchorErrorKey from the userInfo dictionary. If not present, it consults the userInfoValueProvider for the domain. If that returns nil, this also returns nil. - NSString? get helpAnchor { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_helpAnchor1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// Return a list of underlying errors, if any. It includes the values of both NSUnderlyingErrorKey and NSMultipleUnderlyingErrorsKey. If there are no underlying errors, returns an empty array. - NSArray get underlyingErrors { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_underlyingErrors1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - /// Specify a block which will be called from the implementations of localizedDescription, localizedFailureReason, localizedRecoverySuggestion, localizedRecoveryOptions, recoveryAttempter, helpAnchor, and debugDescription when the underlying value for these is not present in the userInfo dictionary of NSError instances with the specified domain. The provider will be called with the userInfo key corresponding to the queried property: For instance, NSLocalizedDescriptionKey for localizedDescription. The provider should return nil for any keys it is not able to provide and, very importantly, any keys it does not recognize (since we may extend the list of keys in future releases). - /// - /// The specified block will be called synchronously at the time when the above properties are queried. The results are not cached. - /// - /// This provider is optional. It enables localization and formatting of error messages to be done lazily; rather than populating the userInfo at NSError creation time, these keys will be fetched on-demand when asked for. - /// - /// It is expected that only the “owner” of an NSError domain specifies the provider for the domain, and this is done once. This facility is not meant for consumers of errors to customize the userInfo entries. This facility should not be used to customize the behaviors of error domains provided by the system. - /// - /// If an appropriate result for the requested key cannot be provided, return nil rather than choosing to manufacture a generic fallback response such as "Operation could not be completed, error 42." NSError will take care of the fallback cases. - static void setUserInfoValueProviderForDomain_provider_( - NativeCupertinoHttp _lib, - DartNSErrorDomain errorDomain, - ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey? provider) { - _lib._objc_msgSend_189( - _lib._class_NSError1, - _lib._sel_setUserInfoValueProviderForDomain_provider_1, - errorDomain._id, - provider?._id ?? ffi.nullptr); - } - - static ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey? - userInfoValueProviderForDomain_(NativeCupertinoHttp _lib, NSError err, - DartNSErrorUserInfoKey userInfoKey, DartNSErrorDomain errorDomain) { - final _ret = _lib._objc_msgSend_190( - _lib._class_NSError1, - _lib._sel_userInfoValueProviderForDomain_1, - err._id, - userInfoKey._id, - errorDomain._id); - return _ret.address == 0 - ? null - : ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey._(_ret, _lib, - retain: true, release: true); - } - - @override - NSError init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSError._(_ret, _lib, retain: true, release: true); - } - - static NSError new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_new1); - return NSError._(_ret, _lib, retain: false, release: true); - } - - static NSError allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSError1, _lib._sel_allocWithZone_1, zone); - return NSError._(_ret, _lib, retain: false, release: true); - } - - static NSError alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSError1, _lib._sel_alloc1); - return NSError._(_ret, _lib, retain: false, release: true); - } -} - -typedef NSErrorDomain = ffi.Pointer; -typedef DartNSErrorDomain = NSString; - -/// Immutable Dictionary -class NSDictionary extends NSObject { - NSDictionary._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - DartNSUInteger get count { - return _lib._objc_msgSend_12(_id, _lib._sel_count1); - } - - NSObject? objectForKey_(NSObject aKey) { - final _ret = _lib._objc_msgSend_96(_id, _lib._sel_objectForKey_1, aKey._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator keyEnumerator() { - final _ret = _lib._objc_msgSend_97(_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, - DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_98( - _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_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSArray get allKeys { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_allKeys1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray allKeysForObject_(NSObject anObject) { - final _ret = - _lib._objc_msgSend_101(_id, _lib._sel_allKeysForObject_1, anObject._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray get allValues { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_allValues1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString get description { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString get descriptionInStringsFileFormat { - final _ret = - _lib._objc_msgSend_32(_id, _lib._sel_descriptionInStringsFileFormat1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_93( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_indent_( - NSObject? locale, DartNSUInteger level) { - final _ret = _lib._objc_msgSend_104( - _id, - _lib._sel_descriptionWithLocale_indent_1, - locale?._id ?? ffi.nullptr, - level); - return NSString._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToDictionary_(NSDictionary otherDictionary) { - return _lib._objc_msgSend_170( - _id, _lib._sel_isEqualToDictionary_1, otherDictionary._id); - } - - NSEnumerator objectEnumerator() { - final _ret = _lib._objc_msgSend_97(_id, _lib._sel_objectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSArray objectsForKeys_notFoundMarker_(NSArray keys, NSObject marker) { - final _ret = _lib._objc_msgSend_171( - _id, _lib._sel_objectsForKeys_notFoundMarker_1, keys._id, marker._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - /// Serializes this instance to the specified URL in the NSPropertyList format (using NSPropertyListXMLFormat_v1_0). For other formats use NSPropertyListSerialization directly. - bool writeToURL_error_( - NSURL url, ffi.Pointer> error) { - return _lib._objc_msgSend_114( - _id, _lib._sel_writeToURL_error_1, url._id, error); - } - - NSArray keysSortedByValueUsingSelector_(ffi.Pointer comparator) { - final _ret = _lib._objc_msgSend_112( - _id, _lib._sel_keysSortedByValueUsingSelector_1, comparator); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - /// count refers to the number of elements in the dictionary - void getObjects_andKeys_count_(ffi.Pointer> objects, - ffi.Pointer> keys, DartNSUInteger count) { - _lib._objc_msgSend_172( - _id, _lib._sel_getObjects_andKeys_count_1, objects, keys, count); - } - - NSObject? objectForKeyedSubscript_(NSObject key) { - final _ret = _lib._objc_msgSend_96( - _id, _lib._sel_objectForKeyedSubscript_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void enumerateKeysAndObjectsUsingBlock_( - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool block) { - _lib._objc_msgSend_173( - _id, _lib._sel_enumerateKeysAndObjectsUsingBlock_1, block._id); - } - - void enumerateKeysAndObjectsWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool block) { - _lib._objc_msgSend_174( - _id, - _lib._sel_enumerateKeysAndObjectsWithOptions_usingBlock_1, - opts, - block._id); - } - - NSArray keysSortedByValueUsingComparator_(DartNSComparator cmptr) { - final _ret = _lib._objc_msgSend_146( - _id, _lib._sel_keysSortedByValueUsingComparator_1, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray keysSortedByValueWithOptions_usingComparator_( - int opts, DartNSComparator cmptr) { - final _ret = _lib._objc_msgSend_147( - _id, - _lib._sel_keysSortedByValueWithOptions_usingComparator_1, - opts, - cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject keysOfEntriesPassingTest_( - ObjCBlock_bool_ObjCObject_ObjCObject_bool predicate) { - final _ret = _lib._objc_msgSend_175( - _id, _lib._sel_keysOfEntriesPassingTest_1, predicate._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject keysOfEntriesWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_ObjCObject_bool predicate) { - final _ret = _lib._objc_msgSend_176(_id, - _lib._sel_keysOfEntriesWithOptions_passingTest_1, opts, predicate._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - /// This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:andKeys:count: - void getObjects_andKeys_(ffi.Pointer> objects, - ffi.Pointer> keys) { - _lib._objc_msgSend_177(_id, _lib._sel_getObjects_andKeys_1, objects, keys); - } - - /// These methods are deprecated, and will be marked with API_DEPRECATED in a subsequent release. Use the variants that use errors instead. - static NSDictionary? dictionaryWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_178(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary? dictionaryWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_179(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_178( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_179(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - bool writeToFile_atomically_(NSString path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_37( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - /// the atomically flag is ignored if url of a type that cannot be written atomically. - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_168( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - static NSDictionary dictionary(NativeCupertinoHttp _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_( - NativeCupertinoHttp _lib, NSObject object, NSObject key) { - final _ret = _lib._objc_msgSend_180(_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_( - NativeCupertinoHttp _lib, - ffi.Pointer> objects, - ffi.Pointer> keys, - DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_98(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithObjectsAndKeys_( - NativeCupertinoHttp _lib, NSObject firstObject) { - final _ret = _lib._objc_msgSend_149(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithDictionary_( - NativeCupertinoHttp _lib, NSDictionary dict) { - final _ret = _lib._objc_msgSend_181(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithDictionary_1, dict._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSDictionary dictionaryWithObjects_forKeys_( - NativeCupertinoHttp _lib, NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_182(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_1, objects._id, keys._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary initWithObjectsAndKeys_(NSObject firstObject) { - final _ret = _lib._objc_msgSend_149( - _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary initWithDictionary_(NSDictionary otherDictionary) { - final _ret = _lib._objc_msgSend_181( - _id, _lib._sel_initWithDictionary_1, otherDictionary._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - NSDictionary initWithDictionary_copyItems_( - NSDictionary otherDictionary, bool flag) { - final _ret = _lib._objc_msgSend_183(_id, - _lib._sel_initWithDictionary_copyItems_1, otherDictionary._id, flag); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } - - NSDictionary initWithObjects_forKeys_(NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_182( - _id, _lib._sel_initWithObjects_forKeys_1, objects._id, keys._id); - return NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Reads dictionary stored in NSPropertyList format from the specified url. - NSDictionary? initWithContentsOfURL_error_( - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_184( - _id, _lib._sel_initWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Reads dictionary stored in NSPropertyList format from the specified url. - static NSDictionary? dictionaryWithContentsOfURL_error_( - NativeCupertinoHttp _lib, - NSURL url, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_184(_lib._class_NSDictionary1, - _lib._sel_dictionaryWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Use this method to create a key set to pass to +dictionaryWithSharedKeySet:. - /// The keys are copied from the array and must be copyable. - /// If the array parameter is nil or not an NSArray, an exception is thrown. - /// If the array of keys is empty, an empty key set is returned. - /// The array of keys may contain duplicates, which are ignored (it is undefined which object of each duplicate pair is used). - /// As for any usage of hashing, is recommended that the keys have a well-distributed implementation of -hash, and the hash codes must satisfy the hash/isEqual: invariant. - /// Keys with duplicate hash codes are allowed, but will cause lower performance and increase memory usage. - static NSObject sharedKeySetForKeys_(NativeCupertinoHttp _lib, NSArray keys) { - final _ret = _lib._objc_msgSend_150( - _lib._class_NSDictionary1, _lib._sel_sharedKeySetForKeys_1, keys._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - DartNSUInteger countByEnumeratingWithState_objects_count_( - ffi.Pointer state, - ffi.Pointer> buffer, - DartNSUInteger len) { - return _lib._objc_msgSend_185( - _id, - _lib._sel_countByEnumeratingWithState_objects_count_1, - state, - buffer, - len); - } - - static NSDictionary new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_new1); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSDictionary allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSDictionary1, _lib._sel_allocWithZone_1, zone); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSDictionary alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSDictionary1, _lib._sel_alloc1); - return NSDictionary._(_ret, _lib, retain: false, release: true); - } -} - -class NSEnumerator extends NSObject { - NSEnumerator._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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_61(_id, _lib._sel_nextObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject get allObjects { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_allObjects1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSEnumerator init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - static NSEnumerator new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_new1); - return NSEnumerator._(_ret, _lib, retain: false, release: true); - } - - static NSEnumerator allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSEnumerator1, _lib._sel_allocWithZone_1, zone); - return NSEnumerator._(_ret, _lib, retain: false, release: true); - } - - static NSEnumerator alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSEnumerator1, _lib._sel_alloc1); - return NSEnumerator._(_ret, _lib, retain: false, release: true); - } -} - -/// Immutable Array -class NSArray extends NSObject { - NSArray._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - DartNSUInteger get count { - return _lib._objc_msgSend_12(_id, _lib._sel_count1); - } - - NSObject objectAtIndex_(DartNSUInteger index) { - final _ret = _lib._objc_msgSend_99(_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, DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_100( - _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_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray arrayByAddingObject_(NSObject anObject) { - final _ret = _lib._objc_msgSend_101( - _id, _lib._sel_arrayByAddingObject_1, anObject._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray arrayByAddingObjectsFromArray_(NSArray otherArray) { - final _ret = _lib._objc_msgSend_102( - _id, _lib._sel_arrayByAddingObjectsFromArray_1, otherArray._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSString componentsJoinedByString_(NSString separator) { - final _ret = _lib._objc_msgSend_103( - _id, _lib._sel_componentsJoinedByString_1, separator._id); - 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_32(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_93( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSString descriptionWithLocale_indent_( - NSObject? locale, DartNSUInteger level) { - final _ret = _lib._objc_msgSend_104( - _id, - _lib._sel_descriptionWithLocale_indent_1, - locale?._id ?? ffi.nullptr, - level); - return NSString._(_ret, _lib, retain: true, release: true); - } - - NSObject? firstObjectCommonWithArray_(NSArray otherArray) { - final _ret = _lib._objc_msgSend_105( - _id, _lib._sel_firstObjectCommonWithArray_1, otherArray._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - void getObjects_range_( - ffi.Pointer> objects, NSRange range) { - _lib._objc_msgSend_106(_id, _lib._sel_getObjects_range_1, objects, range); - } - - DartNSUInteger indexOfObject_(NSObject anObject) { - return _lib._objc_msgSend_107(_id, _lib._sel_indexOfObject_1, anObject._id); - } - - DartNSUInteger indexOfObject_inRange_(NSObject anObject, NSRange range) { - return _lib._objc_msgSend_108( - _id, _lib._sel_indexOfObject_inRange_1, anObject._id, range); - } - - DartNSUInteger indexOfObjectIdenticalTo_(NSObject anObject) { - return _lib._objc_msgSend_107( - _id, _lib._sel_indexOfObjectIdenticalTo_1, anObject._id); - } - - DartNSUInteger indexOfObjectIdenticalTo_inRange_( - NSObject anObject, NSRange range) { - return _lib._objc_msgSend_108( - _id, _lib._sel_indexOfObjectIdenticalTo_inRange_1, anObject._id, range); - } - - bool isEqualToArray_(NSArray otherArray) { - return _lib._objc_msgSend_109( - _id, _lib._sel_isEqualToArray_1, otherArray._id); - } - - NSObject? get firstObject { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_firstObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject? get lastObject { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_lastObject1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator objectEnumerator() { - final _ret = _lib._objc_msgSend_97(_id, _lib._sel_objectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSEnumerator reverseObjectEnumerator() { - final _ret = _lib._objc_msgSend_97(_id, _lib._sel_reverseObjectEnumerator1); - return NSEnumerator._(_ret, _lib, retain: true, release: true); - } - - NSData get sortedArrayHint { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_sortedArrayHint1); - return 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_110( - _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_111( - _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_112( - _id, _lib._sel_sortedArrayUsingSelector_1, comparator); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray subarrayWithRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_113(_id, _lib._sel_subarrayWithRange_1, range); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - /// Serializes this instance to the specified URL in the NSPropertyList format (using NSPropertyListXMLFormat_v1_0). For other formats use NSPropertyListSerialization directly. - bool writeToURL_error_( - NSURL url, ffi.Pointer> error) { - return _lib._objc_msgSend_114( - _id, _lib._sel_writeToURL_error_1, url._id, error); - } - - void makeObjectsPerformSelector_(ffi.Pointer aSelector) { - _lib._objc_msgSend_7( - _id, _lib._sel_makeObjectsPerformSelector_1, aSelector); - } - - void makeObjectsPerformSelector_withObject_( - ffi.Pointer aSelector, NSObject? argument) { - _lib._objc_msgSend_115( - _id, - _lib._sel_makeObjectsPerformSelector_withObject_1, - aSelector, - argument?._id ?? ffi.nullptr); - } - - NSArray objectsAtIndexes_(NSIndexSet indexes) { - final _ret = - _lib._objc_msgSend_136(_id, _lib._sel_objectsAtIndexes_1, indexes._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSObject objectAtIndexedSubscript_(DartNSUInteger idx) { - final _ret = - _lib._objc_msgSend_99(_id, _lib._sel_objectAtIndexedSubscript_1, idx); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - void enumerateObjectsUsingBlock_( - ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool block) { - _lib._objc_msgSend_137( - _id, _lib._sel_enumerateObjectsUsingBlock_1, block._id); - } - - void enumerateObjectsWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool block) { - _lib._objc_msgSend_138(_id, - _lib._sel_enumerateObjectsWithOptions_usingBlock_1, opts, block._id); - } - - void enumerateObjectsAtIndexes_options_usingBlock_(NSIndexSet s, int opts, - ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool block) { - _lib._objc_msgSend_139( - _id, - _lib._sel_enumerateObjectsAtIndexes_options_usingBlock_1, - s._id, - opts, - block._id); - } - - DartNSUInteger indexOfObjectPassingTest_( - ObjCBlock_bool_ObjCObject_NSUInteger_bool predicate) { - return _lib._objc_msgSend_140( - _id, _lib._sel_indexOfObjectPassingTest_1, predicate._id); - } - - DartNSUInteger indexOfObjectWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_NSUInteger_bool predicate) { - return _lib._objc_msgSend_141(_id, - _lib._sel_indexOfObjectWithOptions_passingTest_1, opts, predicate._id); - } - - DartNSUInteger indexOfObjectAtIndexes_options_passingTest_(NSIndexSet s, - int opts, ObjCBlock_bool_ObjCObject_NSUInteger_bool predicate) { - return _lib._objc_msgSend_142( - _id, - _lib._sel_indexOfObjectAtIndexes_options_passingTest_1, - s._id, - opts, - predicate._id); - } - - NSIndexSet indexesOfObjectsPassingTest_( - ObjCBlock_bool_ObjCObject_NSUInteger_bool predicate) { - final _ret = _lib._objc_msgSend_143( - _id, _lib._sel_indexesOfObjectsPassingTest_1, predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesOfObjectsWithOptions_passingTest_( - int opts, ObjCBlock_bool_ObjCObject_NSUInteger_bool predicate) { - final _ret = _lib._objc_msgSend_144( - _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, ObjCBlock_bool_ObjCObject_NSUInteger_bool predicate) { - final _ret = _lib._objc_msgSend_145( - _id, - _lib._sel_indexesOfObjectsAtIndexes_options_passingTest_1, - s._id, - opts, - predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayUsingComparator_(DartNSComparator cmptr) { - final _ret = _lib._objc_msgSend_146( - _id, _lib._sel_sortedArrayUsingComparator_1, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray sortedArrayWithOptions_usingComparator_( - int opts, DartNSComparator cmptr) { - final _ret = _lib._objc_msgSend_147(_id, - _lib._sel_sortedArrayWithOptions_usingComparator_1, opts, cmptr._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - /// binary search - DartNSUInteger indexOfObject_inSortedRange_options_usingComparator_( - NSObject obj, NSRange r, int opts, DartNSComparator cmp) { - return _lib._objc_msgSend_148( - _id, - _lib._sel_indexOfObject_inSortedRange_options_usingComparator_1, - obj._id, - r, - opts, - cmp._id); - } - - static NSArray array(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_array1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithObject_(NativeCupertinoHttp _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_149( - _lib._class_NSArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithObjects_count_(NativeCupertinoHttp _lib, - ffi.Pointer> objects, DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_100( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithObjects_( - NativeCupertinoHttp _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_149( - _lib._class_NSArray1, _lib._sel_arrayWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray arrayWithArray_(NativeCupertinoHttp _lib, NSArray array) { - final _ret = _lib._objc_msgSend_150( - _lib._class_NSArray1, _lib._sel_arrayWithArray_1, array._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_149(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_150(_id, _lib._sel_initWithArray_1, array._id); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray initWithArray_copyItems_(NSArray array, bool flag) { - final _ret = _lib._objc_msgSend_151( - _id, _lib._sel_initWithArray_copyItems_1, array._id, flag); - return NSArray._(_ret, _lib, retain: false, release: true); - } - - /// Reads array stored in NSPropertyList format from the specified url. - NSArray? initWithContentsOfURL_error_( - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_152( - _id, _lib._sel_initWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - /// Reads array stored in NSPropertyList format from the specified url. - static NSArray? arrayWithContentsOfURL_error_(NativeCupertinoHttp _lib, - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_152(_lib._class_NSArray1, - _lib._sel_arrayWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSOrderedCollectionDifference - differenceFromArray_withOptions_usingEquivalenceTest_(NSArray other, - int options, ObjCBlock_bool_ObjCObject_ObjCObject block) { - final _ret = _lib._objc_msgSend_161( - _id, - _lib._sel_differenceFromArray_withOptions_usingEquivalenceTest_1, - other._id, - options, - block._id); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - NSOrderedCollectionDifference differenceFromArray_withOptions_( - NSArray other, int options) { - final _ret = _lib._objc_msgSend_162( - _id, _lib._sel_differenceFromArray_withOptions_1, other._id, options); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - /// Uses isEqual: to determine the difference between the parameter and the receiver - NSOrderedCollectionDifference differenceFromArray_(NSArray other) { - final _ret = - _lib._objc_msgSend_163(_id, _lib._sel_differenceFromArray_1, other._id); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - NSArray? arrayByApplyingDifference_( - NSOrderedCollectionDifference difference) { - final _ret = _lib._objc_msgSend_164( - _id, _lib._sel_arrayByApplyingDifference_1, difference._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - /// This method is unsafe because it could potentially cause buffer overruns. You should use -getObjects:range: instead. - void getObjects_(ffi.Pointer> objects) { - _lib._objc_msgSend_165(_id, _lib._sel_getObjects_1, objects); - } - - /// These methods are deprecated, and will be marked with API_DEPRECATED in a subsequent release. Use the variants that use errors instead. - static NSArray? arrayWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_166( - _lib._class_NSArray1, _lib._sel_arrayWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSArray? arrayWithContentsOfURL_(NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_167( - _lib._class_NSArray1, _lib._sel_arrayWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_166( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_167(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - bool writeToFile_atomically_(NSString path, bool useAuxiliaryFile) { - return _lib._objc_msgSend_37( - _id, _lib._sel_writeToFile_atomically_1, path._id, useAuxiliaryFile); - } - - bool writeToURL_atomically_(NSURL url, bool atomically) { - return _lib._objc_msgSend_168( - _id, _lib._sel_writeToURL_atomically_1, url._id, atomically); - } - - static NSArray new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_new1); - return NSArray._(_ret, _lib, retain: false, release: true); - } - - static NSArray allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSArray1, _lib._sel_allocWithZone_1, zone); - return NSArray._(_ret, _lib, retain: false, release: true); - } - - static NSArray alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSArray1, _lib._sel_alloc1); - return NSArray._(_ret, _lib, retain: false, release: true); - } -} - -class NSIndexSet extends NSObject { - NSIndexSet._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_indexSet1); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSIndexSet indexSetWithIndex_( - NativeCupertinoHttp _lib, DartNSUInteger value) { - final _ret = _lib._objc_msgSend_99( - _lib._class_NSIndexSet1, _lib._sel_indexSetWithIndex_1, value); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSIndexSet indexSetWithIndexesInRange_( - NativeCupertinoHttp _lib, NSRange range) { - final _ret = _lib._objc_msgSend_116( - _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_116(_id, _lib._sel_initWithIndexesInRange_1, range); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet initWithIndexSet_(NSIndexSet indexSet) { - final _ret = - _lib._objc_msgSend_117(_id, _lib._sel_initWithIndexSet_1, indexSet._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet initWithIndex_(DartNSUInteger value) { - final _ret = _lib._objc_msgSend_99(_id, _lib._sel_initWithIndex_1, value); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - bool isEqualToIndexSet_(NSIndexSet indexSet) { - return _lib._objc_msgSend_118( - _id, _lib._sel_isEqualToIndexSet_1, indexSet._id); - } - - DartNSUInteger get count { - return _lib._objc_msgSend_12(_id, _lib._sel_count1); - } - - DartNSUInteger get firstIndex { - return _lib._objc_msgSend_12(_id, _lib._sel_firstIndex1); - } - - DartNSUInteger get lastIndex { - return _lib._objc_msgSend_12(_id, _lib._sel_lastIndex1); - } - - DartNSUInteger indexGreaterThanIndex_(DartNSUInteger value) { - return _lib._objc_msgSend_119( - _id, _lib._sel_indexGreaterThanIndex_1, value); - } - - DartNSUInteger indexLessThanIndex_(DartNSUInteger value) { - return _lib._objc_msgSend_119(_id, _lib._sel_indexLessThanIndex_1, value); - } - - DartNSUInteger indexGreaterThanOrEqualToIndex_(DartNSUInteger value) { - return _lib._objc_msgSend_119( - _id, _lib._sel_indexGreaterThanOrEqualToIndex_1, value); - } - - DartNSUInteger indexLessThanOrEqualToIndex_(DartNSUInteger value) { - return _lib._objc_msgSend_119( - _id, _lib._sel_indexLessThanOrEqualToIndex_1, value); - } - - DartNSUInteger getIndexes_maxCount_inIndexRange_( - ffi.Pointer indexBuffer, - DartNSUInteger bufferSize, - NSRangePointer range) { - return _lib._objc_msgSend_120( - _id, - _lib._sel_getIndexes_maxCount_inIndexRange_1, - indexBuffer, - bufferSize, - range); - } - - DartNSUInteger countOfIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_121( - _id, _lib._sel_countOfIndexesInRange_1, range); - } - - bool containsIndex_(DartNSUInteger value) { - return _lib._objc_msgSend_122(_id, _lib._sel_containsIndex_1, value); - } - - bool containsIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_123( - _id, _lib._sel_containsIndexesInRange_1, range); - } - - bool containsIndexes_(NSIndexSet indexSet) { - return _lib._objc_msgSend_118( - _id, _lib._sel_containsIndexes_1, indexSet._id); - } - - bool intersectsIndexesInRange_(NSRange range) { - return _lib._objc_msgSend_123( - _id, _lib._sel_intersectsIndexesInRange_1, range); - } - - void enumerateIndexesUsingBlock_(ObjCBlock_ffiVoid_NSUInteger_bool block) { - _lib._objc_msgSend_124( - _id, _lib._sel_enumerateIndexesUsingBlock_1, block._id); - } - - void enumerateIndexesWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_NSUInteger_bool block) { - _lib._objc_msgSend_125(_id, - _lib._sel_enumerateIndexesWithOptions_usingBlock_1, opts, block._id); - } - - void enumerateIndexesInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock_ffiVoid_NSUInteger_bool block) { - _lib._objc_msgSend_126( - _id, - _lib._sel_enumerateIndexesInRange_options_usingBlock_1, - range, - opts, - block._id); - } - - DartNSUInteger indexPassingTest_(ObjCBlock_bool_NSUInteger_bool predicate) { - return _lib._objc_msgSend_127( - _id, _lib._sel_indexPassingTest_1, predicate._id); - } - - DartNSUInteger indexWithOptions_passingTest_( - int opts, ObjCBlock_bool_NSUInteger_bool predicate) { - return _lib._objc_msgSend_128( - _id, _lib._sel_indexWithOptions_passingTest_1, opts, predicate._id); - } - - DartNSUInteger indexInRange_options_passingTest_( - NSRange range, int opts, ObjCBlock_bool_NSUInteger_bool predicate) { - return _lib._objc_msgSend_129( - _id, - _lib._sel_indexInRange_options_passingTest_1, - range, - opts, - predicate._id); - } - - NSIndexSet indexesPassingTest_(ObjCBlock_bool_NSUInteger_bool predicate) { - final _ret = _lib._objc_msgSend_130( - _id, _lib._sel_indexesPassingTest_1, predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - NSIndexSet indexesWithOptions_passingTest_( - int opts, ObjCBlock_bool_NSUInteger_bool predicate) { - final _ret = _lib._objc_msgSend_131( - _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, ObjCBlock_bool_NSUInteger_bool predicate) { - final _ret = _lib._objc_msgSend_132( - _id, - _lib._sel_indexesInRange_options_passingTest_1, - range, - opts, - predicate._id); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - void enumerateRangesUsingBlock_(ObjCBlock_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_133( - _id, _lib._sel_enumerateRangesUsingBlock_1, block._id); - } - - void enumerateRangesWithOptions_usingBlock_( - int opts, ObjCBlock_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_134(_id, - _lib._sel_enumerateRangesWithOptions_usingBlock_1, opts, block._id); - } - - void enumerateRangesInRange_options_usingBlock_( - NSRange range, int opts, ObjCBlock_ffiVoid_NSRange_bool block) { - _lib._objc_msgSend_135( - _id, - _lib._sel_enumerateRangesInRange_options_usingBlock_1, - range, - opts, - block._id); - } - - @override - NSIndexSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSIndexSet new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_new1); - return NSIndexSet._(_ret, _lib, retain: false, release: true); - } - - static NSIndexSet allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSIndexSet1, _lib._sel_allocWithZone_1, zone); - return NSIndexSet._(_ret, _lib, retain: false, release: true); - } - - static NSIndexSet alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSIndexSet1, _lib._sel_alloc1); - return NSIndexSet._(_ret, _lib, retain: false, release: true); - } -} - -typedef NSRangePointer = ffi.Pointer; -void _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - NSUInteger arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSUInteger_bool_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSUInteger_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSUInteger_bool_registerClosure( - void Function(int, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSUInteger_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSUInteger_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSUInteger_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSUInteger_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_NSUInteger_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSUInteger_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_NSUInteger_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - NSUInteger arg0, ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - NSUInteger, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSUInteger_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_NSUInteger_bool.fromFunction(NativeCupertinoHttp lib, - void Function(DartNSUInteger, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - NSUInteger, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSUInteger_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSUInteger_bool_registerClosure( - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_NSUInteger_bool.listener(NativeCupertinoHttp lib, - void Function(DartNSUInteger, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - NSUInteger, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSUInteger_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSUInteger_bool_registerClosure( - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, NSUInteger, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(DartNSUInteger arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, NSUInteger arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, int, - ffi.Pointer)>()(_id, arg0, arg1); -} - -abstract class NSEnumerationOptions { - static const int NSEnumerationConcurrent = 1; - static const int NSEnumerationReverse = 2; -} - -bool _ObjCBlock_bool_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - NSUInteger arg0, ffi.Pointer arg1)>>() - .asFunction)>()(arg0, arg1); -final _ObjCBlock_bool_NSUInteger_bool_closureRegistry = - )>{}; -int _ObjCBlock_bool_NSUInteger_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_bool_NSUInteger_bool_registerClosure( - bool Function(int, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_NSUInteger_bool_closureRegistryIndex; - _ObjCBlock_bool_NSUInteger_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_NSUInteger_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0, ffi.Pointer arg1) => - _ObjCBlock_bool_NSUInteger_bool_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_bool_NSUInteger_bool extends _ObjCBlockBase { - ObjCBlock_bool_NSUInteger_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_bool_NSUInteger_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi - .NativeFunction< - ffi.Bool Function(NSUInteger arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock>, - NSUInteger, ffi.Pointer)>( - _ObjCBlock_bool_NSUInteger_bool_fnPtrTrampoline, false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_bool_NSUInteger_bool.fromFunction(NativeCupertinoHttp lib, - bool Function(DartNSUInteger, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock>, - NSUInteger, ffi.Pointer)>( - _ObjCBlock_bool_NSUInteger_bool_closureTrampoline, - false) - .cast(), - _ObjCBlock_bool_NSUInteger_bool_registerClosure( - (int arg0, ffi.Pointer arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(DartNSUInteger arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer<_ObjCBlock> block, NSUInteger arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, int, - ffi.Pointer)>()(_id, arg0, arg1); -} - -void _ObjCBlock_ffiVoid_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - NSRange arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>>() - .asFunction< - void Function(NSRange, ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSRange_bool_registerClosure( - void Function(NSRange, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - NSRange arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSRange_bool_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_ffiVoid_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_NSRange_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(NSRange arg0, ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_NSRange_bool.fromFunction( - NativeCupertinoHttp lib, void Function(NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSRange_bool_registerClosure( - (NSRange arg0, ffi.Pointer arg1) => - fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_NSRange_bool.listener( - NativeCupertinoHttp lib, void Function(NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSRange_bool_registerClosure( - (NSRange arg0, ffi.Pointer arg1) => - fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, NSRange, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSRange arg0, ffi.Pointer arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, NSRange arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, NSRange, - ffi.Pointer)>()(_id, arg0, arg1); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSUInteger arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, int, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureRegistry = - , int, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_registerClosure( - void Function(ffi.Pointer, int, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool.fromFunction( - NativeCupertinoHttp lib, - void Function(NSObject, DartNSUInteger, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_registerClosure( - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool.listener(NativeCupertinoHttp lib, - void Function(NSObject, DartNSUInteger, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSUInteger_bool_registerClosure( - (ffi.Pointer arg0, int arg1, ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), - arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - NSUInteger, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject arg0, DartNSUInteger arg1, ffi.Pointer arg2) => - _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>, ffi.Pointer, - int, ffi.Pointer)>()(_id, arg0._id, arg1, arg2); -} - -bool _ObjCBlock_bool_ObjCObject_NSUInteger_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, NSUInteger arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function(ffi.Pointer, int, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_bool_ObjCObject_NSUInteger_bool_closureRegistry = - , int, ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_NSUInteger_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_bool_ObjCObject_NSUInteger_bool_registerClosure( - bool Function(ffi.Pointer, int, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_ObjCObject_NSUInteger_bool_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_NSUInteger_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_NSUInteger_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - int arg1, - ffi.Pointer arg2) => - _ObjCBlock_bool_ObjCObject_NSUInteger_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_bool_ObjCObject_NSUInteger_bool extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_NSUInteger_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_bool_ObjCObject_NSUInteger_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - NSUInteger arg1, ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_NSUInteger_bool_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_bool_ObjCObject_NSUInteger_bool.fromFunction( - NativeCupertinoHttp lib, - bool Function(NSObject, DartNSUInteger, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSUInteger, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_NSUInteger_bool_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_ObjCObject_NSUInteger_bool_registerClosure( - (ffi.Pointer arg0, int arg1, - ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject arg0, DartNSUInteger arg1, ffi.Pointer arg2) => - _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>, ffi.Pointer, - int, ffi.Pointer)>()(_id, arg0._id, arg1, arg2); -} - -typedef NSComparator = ffi.Pointer<_ObjCBlock>; -typedef DartNSComparator = ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject; -int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - int Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_registerClosure( - int Function(ffi.Pointer, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistryIndex; - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -int _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject - extends _ObjCBlockBase { - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Int32 Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_fnPtrTrampoline, - 0) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject.fromFunction( - NativeCupertinoHttp lib, int Function(NSObject, NSObject) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Int32 Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_closureTrampoline, 0) - .cast(), - _ObjCBlock_NSComparisonResult_ObjCObject_ObjCObject_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - NSObject._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - int call(NSObject arg0, NSObject arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id); -} - -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; -} - -class NSOrderedCollectionDifference extends NSObject { - NSOrderedCollectionDifference._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSOrderedCollectionDifference] that points to the same underlying object as [other]. - static NSOrderedCollectionDifference castFrom( - T other) { - return NSOrderedCollectionDifference._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSOrderedCollectionDifference] that wraps the given raw object pointer. - static NSOrderedCollectionDifference castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOrderedCollectionDifference._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSOrderedCollectionDifference]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSOrderedCollectionDifference1); - } - - NSOrderedCollectionDifference initWithChanges_(NSObject changes) { - final _ret = - _lib._objc_msgSend_149(_id, _lib._sel_initWithChanges_1, changes._id); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_( - NSIndexSet inserts, - NSObject? insertedObjects, - NSIndexSet removes, - NSObject? removedObjects, - NSObject changes) { - final _ret = _lib._objc_msgSend_153( - _id, - _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_additionalChanges_1, - inserts._id, - insertedObjects?._id ?? ffi.nullptr, - removes._id, - removedObjects?._id ?? ffi.nullptr, - changes._id); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - NSOrderedCollectionDifference - initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_( - NSIndexSet inserts, - NSObject? insertedObjects, - NSIndexSet removes, - NSObject? removedObjects) { - final _ret = _lib._objc_msgSend_154( - _id, - _lib._sel_initWithInsertIndexes_insertedObjects_removeIndexes_removedObjects_1, - inserts._id, - insertedObjects?._id ?? ffi.nullptr, - removes._id, - removedObjects?._id ?? ffi.nullptr); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - NSObject get insertions { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_insertions1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject get removals { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_removals1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - bool get hasChanges { - return _lib._objc_msgSend_11(_id, _lib._sel_hasChanges1); - } - - NSOrderedCollectionDifference differenceByTransformingChangesWithBlock_( - ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange block) { - final _ret = _lib._objc_msgSend_160( - _id, _lib._sel_differenceByTransformingChangesWithBlock_1, block._id); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - NSOrderedCollectionDifference inverseDifference() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_inverseDifference1); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - @override - NSOrderedCollectionDifference init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: true, release: true); - } - - static NSOrderedCollectionDifference new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOrderedCollectionDifference1, _lib._sel_new1); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: false, release: true); - } - - static NSOrderedCollectionDifference allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOrderedCollectionDifference1, - _lib._sel_allocWithZone_1, - zone); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: false, release: true); - } - - static NSOrderedCollectionDifference alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOrderedCollectionDifference1, _lib._sel_alloc1); - return NSOrderedCollectionDifference._(_ret, _lib, - retain: false, release: true); - } -} - -ffi.Pointer - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer)>()(arg0); -final _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_closureRegistry = - Function(ffi.Pointer)>{}; -int _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_registerClosure( - ffi.Pointer Function(ffi.Pointer) fn) { - final id = - ++_ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_closureRegistryIndex; - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange - extends _ObjCBlockBase { - ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange.fromFunction( - NativeCupertinoHttp lib, - NSOrderedCollectionChange Function(NSOrderedCollectionChange) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_closureTrampoline) - .cast(), - _ObjCBlock_NSOrderedCollectionChange_NSOrderedCollectionChange_registerClosure( - (ffi.Pointer arg0) => - fn(NSOrderedCollectionChange._(arg0, lib, retain: true, release: true)) - ._retainAndReturnId())), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSOrderedCollectionChange call(NSOrderedCollectionChange arg0) => - NSOrderedCollectionChange._( - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} - -class NSOrderedCollectionChange extends NSObject { - NSOrderedCollectionChange._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSOrderedCollectionChange] that points to the same underlying object as [other]. - static NSOrderedCollectionChange castFrom(T other) { - return NSOrderedCollectionChange._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSOrderedCollectionChange] that wraps the given raw object pointer. - static NSOrderedCollectionChange castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOrderedCollectionChange._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSOrderedCollectionChange]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSOrderedCollectionChange1); - } - - static NSOrderedCollectionChange changeWithObject_type_index_( - NativeCupertinoHttp _lib, - NSObject? anObject, - int type, - DartNSUInteger index) { - final _ret = _lib._objc_msgSend_155( - _lib._class_NSOrderedCollectionChange1, - _lib._sel_changeWithObject_type_index_1, - anObject?._id ?? ffi.nullptr, - type, - index); - return NSOrderedCollectionChange._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedCollectionChange changeWithObject_type_index_associatedIndex_( - NativeCupertinoHttp _lib, - NSObject? anObject, - int type, - DartNSUInteger index, - DartNSUInteger associatedIndex) { - final _ret = _lib._objc_msgSend_156( - _lib._class_NSOrderedCollectionChange1, - _lib._sel_changeWithObject_type_index_associatedIndex_1, - anObject?._id ?? ffi.nullptr, - type, - index, - associatedIndex); - return NSOrderedCollectionChange._(_ret, _lib, retain: true, release: true); - } - - NSObject? get object { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_object1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - int get changeType { - return _lib._objc_msgSend_157(_id, _lib._sel_changeType1); - } - - DartNSUInteger get index { - return _lib._objc_msgSend_12(_id, _lib._sel_index1); - } - - DartNSUInteger get associatedIndex { - return _lib._objc_msgSend_12(_id, _lib._sel_associatedIndex1); - } - - @override - NSObject init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSOrderedCollectionChange initWithObject_type_index_( - NSObject? anObject, int type, DartNSUInteger index) { - final _ret = _lib._objc_msgSend_158( - _id, - _lib._sel_initWithObject_type_index_1, - anObject?._id ?? ffi.nullptr, - type, - index); - return NSOrderedCollectionChange._(_ret, _lib, retain: true, release: true); - } - - NSOrderedCollectionChange initWithObject_type_index_associatedIndex_( - NSObject? anObject, - int type, - DartNSUInteger index, - DartNSUInteger associatedIndex) { - final _ret = _lib._objc_msgSend_159( - _id, - _lib._sel_initWithObject_type_index_associatedIndex_1, - anObject?._id ?? ffi.nullptr, - type, - index, - associatedIndex); - return NSOrderedCollectionChange._(_ret, _lib, retain: true, release: true); - } - - static NSOrderedCollectionChange new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOrderedCollectionChange1, _lib._sel_new1); - return NSOrderedCollectionChange._(_ret, _lib, - retain: false, release: true); - } - - static NSOrderedCollectionChange allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSOrderedCollectionChange1, - _lib._sel_allocWithZone_1, zone); - return NSOrderedCollectionChange._(_ret, _lib, - retain: false, release: true); - } - - static NSOrderedCollectionChange alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOrderedCollectionChange1, _lib._sel_alloc1); - return NSOrderedCollectionChange._(_ret, _lib, - retain: false, release: true); - } -} - -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; -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - bool Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_bool_ObjCObject_ObjCObject_registerClosure( - bool Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_bool_ObjCObject_ObjCObject_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_bool_ObjCObject_ObjCObject extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_ObjCObject._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_bool_ObjCObject_ObjCObject.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_bool_ObjCObject_ObjCObject.fromFunction( - NativeCupertinoHttp lib, bool Function(NSObject, NSObject) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_closureTrampoline, - false) - .cast(), - _ObjCBlock_bool_ObjCObject_ObjCObject_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(NSObject._(arg0, lib, retain: true, release: true), NSObject._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject arg0, NSObject arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.fromFunction( - NativeCupertinoHttp lib, - void Function(NSObject, NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - NSObject._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool.listener(NativeCupertinoHttp lib, - void Function(NSObject, NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => - fn( - NSObject._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject arg0, NSObject arg1, ffi.Pointer arg2) => - _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>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id, arg2); -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_registerClosure( - bool Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = ++_ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistryIndex; - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -bool _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_bool_ObjCObject_ObjCObject_bool extends _ObjCBlockBase { - ObjCBlock_bool_ObjCObject_ObjCObject_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_bool_ObjCObject_ObjCObject_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_bool_ObjCObject_ObjCObject_bool.fromFunction( - NativeCupertinoHttp lib, - bool Function(NSObject, NSObject, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_ObjCObject_ObjCObject_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn(NSObject._(arg0, lib, retain: true, release: true), NSObject._(arg1, lib, retain: true, release: true), arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(NSObject arg0, NSObject arg1, ffi.Pointer arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - bool Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id, arg2); -} - -final 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; -} - -ffi.Pointer - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSErrorUserInfoKey arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, - NSErrorUserInfoKey arg1)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer, NSErrorUserInfoKey)>()(arg0, arg1); -final _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_closureRegistry = Function( - ffi.Pointer, NSErrorUserInfoKey)>{}; -int _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_registerClosure( - ffi.Pointer Function( - ffi.Pointer, NSErrorUserInfoKey) - fn) { - final id = - ++_ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_closureRegistryIndex; - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSErrorUserInfoKey arg1) => - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey extends _ObjCBlockBase { - ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer arg0, NSErrorUserInfoKey arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSErrorUserInfoKey)>( - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey.fromFunction( - NativeCupertinoHttp lib, - NSObject? Function(NSError, DartNSErrorUserInfoKey) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSErrorUserInfoKey)>( - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_closureTrampoline) - .cast(), - _ObjCBlock_ObjCObject_NSError_NSErrorUserInfoKey_registerClosure( - (ffi.Pointer arg0, NSErrorUserInfoKey arg1) => - fn(NSError._(arg0, lib, retain: true, release: true), NSString._(arg1, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSObject? call(NSError arg0, DartNSErrorUserInfoKey arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSErrorUserInfoKey arg1)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, NSErrorUserInfoKey)>() - (_id, arg0._id, arg1._id) - .address == - 0 - ? null - : NSObject._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, NSErrorUserInfoKey arg1)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, NSErrorUserInfoKey)>()(_id, arg0._id, arg1._id), - _lib, - retain: false, - release: true); -} - -typedef NSErrorUserInfoKey = ffi.Pointer; -typedef DartNSErrorUserInfoKey = NSString; - -/// Working with Bookmarks and alias (bookmark) files -abstract class NSURLBookmarkCreationOptions { - /// This option does nothing and has no effect on bookmark resolution - static const int NSURLBookmarkCreationPreferFileIDResolution = 256; - - /// creates bookmark data with "less" information, which may be smaller but still be able to resolve in certain ways - static const int NSURLBookmarkCreationMinimalBookmark = 512; - - /// include the properties required by writeBookmarkData:toURL:options: in the bookmark data created - static const int NSURLBookmarkCreationSuitableForBookmarkFile = 1024; - - /// include information in the bookmark data which allows the same sandboxed process to access the resource after being relaunched - static const int NSURLBookmarkCreationWithSecurityScope = 2048; - - /// if used with kCFURLBookmarkCreationWithSecurityScope, at resolution time only read access to the resource will be granted - static const int NSURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = 4096; - - /// Disable automatic embedding of an implicit security scope. The resolving process will not be able gain access to the resource by security scope, either implicitly or explicitly, through the returned URL. Not applicable to security-scoped bookmarks. - static const int NSURLBookmarkCreationWithoutImplicitSecurityScope = - 536870912; -} - -abstract class NSURLBookmarkResolutionOptions { - /// don't perform any user interaction during bookmark resolution - static const int NSURLBookmarkResolutionWithoutUI = 256; - - /// don't mount a volume during bookmark resolution - static const int NSURLBookmarkResolutionWithoutMounting = 512; - - /// use the secure information included at creation time to provide the ability to access the resource in a sandboxed process - static const int NSURLBookmarkResolutionWithSecurityScope = 1024; - - /// Disable implicitly starting access of the ephemeral security-scoped resource during resolution. Instead, call `-[NSURL startAccessingSecurityScopedResource]` on the returned URL when ready to use the resource. Not applicable to security-scoped bookmarks. - static const int NSURLBookmarkResolutionWithoutImplicitStartAccessing = 32768; -} - -typedef NSURLBookmarkFileCreationOptions = NSUInteger; - -class NSURLHandle extends NSObject { - NSURLHandle._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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_( - NativeCupertinoHttp _lib, NSObject anURLHandleSubclass) { - _lib._objc_msgSend_210(_lib._class_NSURLHandle1, - _lib._sel_registerURLHandleClass_1, anURLHandleSubclass._id); - } - - static NSObject URLHandleClassForURL_(NativeCupertinoHttp _lib, NSURL anURL) { - final _ret = _lib._objc_msgSend_211( - _lib._class_NSURLHandle1, _lib._sel_URLHandleClassForURL_1, anURL._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - int status() { - return _lib._objc_msgSend_212(_id, _lib._sel_status1); - } - - NSString failureReason() { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_failureReason1); - return NSString._(_ret, _lib, retain: true, release: true); - } - - void addClient_(NSObject client) { - _lib._objc_msgSend_210(_id, _lib._sel_addClient_1, client._id); - } - - void removeClient_(NSObject client) { - _lib._objc_msgSend_210(_id, _lib._sel_removeClient_1, client._id); - } - - void loadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_loadInBackground1); - } - - void cancelLoadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_cancelLoadInBackground1); - } - - NSData resourceData() { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_resourceData1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - NSData availableResourceData() { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_availableResourceData1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - int expectedResourceDataSize() { - return _lib._objc_msgSend_87(_id, _lib._sel_expectedResourceDataSize1); - } - - void flushCachedData() { - _lib._objc_msgSend_1(_id, _lib._sel_flushCachedData1); - } - - void backgroundLoadDidFailWithReason_(NSString reason) { - _lib._objc_msgSend_195( - _id, _lib._sel_backgroundLoadDidFailWithReason_1, reason._id); - } - - void didLoadBytes_loadComplete_(NSData newBytes, bool yorn) { - _lib._objc_msgSend_213( - _id, _lib._sel_didLoadBytes_loadComplete_1, newBytes._id, yorn); - } - - static bool canInitWithURL_(NativeCupertinoHttp _lib, NSURL anURL) { - return _lib._objc_msgSend_214( - _lib._class_NSURLHandle1, _lib._sel_canInitWithURL_1, anURL._id); - } - - static NSURLHandle cachedHandleForURL_( - NativeCupertinoHttp _lib, NSURL anURL) { - final _ret = _lib._objc_msgSend_215( - _lib._class_NSURLHandle1, _lib._sel_cachedHandleForURL_1, anURL._id); - return NSURLHandle._(_ret, _lib, retain: true, release: true); - } - - NSObject initWithURL_cached_(NSURL anURL, bool willCache) { - final _ret = _lib._objc_msgSend_216( - _id, _lib._sel_initWithURL_cached_1, anURL._id, willCache); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject propertyForKey_(NSString propertyKey) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_propertyForKey_1, propertyKey._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSObject propertyForKeyIfAvailable_(NSString propertyKey) { - final _ret = _lib._objc_msgSend_42( - _id, _lib._sel_propertyForKeyIfAvailable_1, propertyKey._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - bool writeProperty_forKey_(NSObject propertyValue, NSString propertyKey) { - return _lib._objc_msgSend_209(_id, _lib._sel_writeProperty_forKey_1, - propertyValue._id, propertyKey._id); - } - - bool writeData_(NSData data) { - return _lib._objc_msgSend_35(_id, _lib._sel_writeData_1, data._id); - } - - NSData loadInForeground() { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_loadInForeground1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - void beginLoadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_beginLoadInBackground1); - } - - void endLoadInBackground() { - _lib._objc_msgSend_1(_id, _lib._sel_endLoadInBackground1); - } - - @override - NSURLHandle init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLHandle._(_ret, _lib, retain: true, release: true); - } - - static NSURLHandle new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_new1); - return NSURLHandle._(_ret, _lib, retain: false, release: true); - } - - static NSURLHandle allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLHandle1, _lib._sel_allocWithZone_1, zone); - return NSURLHandle._(_ret, _lib, retain: false, release: true); - } - - static NSURLHandle alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLHandle1, _lib._sel_alloc1); - return NSURLHandle._(_ret, _lib, retain: false, 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 { - /// Hint to use auxiliary file when saving; equivalent to atomically:YES - static const int NSDataWritingAtomic = 1; - - /// Hint to prevent overwriting an existing file. Cannot be combined with NSDataWritingAtomic. - 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 NSDataWritingFileProtectionCompleteWhenUserInactive = - 1342177280; - static const int NSDataWritingFileProtectionMask = 4026531840; - - /// Deprecated name for NSDataWritingAtomic - static const int NSAtomicWrite = 1; -} - -/// Data Search Options -abstract class NSDataSearchOptions { - static const int NSDataSearchBackwards = 1; - static const int NSDataSearchAnchored = 2; -} - -void _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, NSRange, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry = , NSRange, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure( - void Function(ffi.Pointer, NSRange, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_ffiVoid_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.fromFunction(NativeCupertinoHttp lib, - void Function(ffi.Pointer, NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure( - (ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_ffiVoid_NSRange_bool.listener(NativeCupertinoHttp lib, - void Function(ffi.Pointer, NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_NSRange_bool_registerClosure( - (ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, NSRange, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(ffi.Pointer arg0, NSRange arg1, - ffi.Pointer arg2) => - _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>, ffi.Pointer, - NSRange, ffi.Pointer)>()(_id, arg0, arg1, arg2); -} - -/// Read/Write Options -abstract class NSDataReadingOptions { - /// Hint to map the file in if possible and safe - static const int NSDataReadingMappedIfSafe = 1; - - /// Hint to get the file not to be cached in the kernel - static const int NSDataReadingUncached = 2; - - /// Hint to map the file in if possible. This takes precedence over NSDataReadingMappedIfSafe if both are given. - static const int NSDataReadingMappedAlways = 8; - - /// Deprecated name for NSDataReadingMappedIfSafe - static const int NSDataReadingMapped = 1; - - /// Deprecated name for NSDataReadingMapped - static const int NSMappedRead = 1; - - /// Deprecated name for NSDataReadingUncached - static const int NSUncachedRead = 2; -} - -void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction, int)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureRegistry = - , int)>{}; -int _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_registerClosure( - void Function(ffi.Pointer, int) fn) { - final id = ++_ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) => - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ffiVoid_NSUInteger extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiVoid_NSUInteger._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_ffiVoid_NSUInteger.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_ffiVoid_NSUInteger.fromFunction(NativeCupertinoHttp lib, - void Function(ffi.Pointer, DartNSUInteger) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_registerClosure( - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_ffiVoid_NSUInteger.listener(NativeCupertinoHttp lib, - void Function(ffi.Pointer, DartNSUInteger) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, NSUInteger)>.listener( - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiVoid_NSUInteger_registerClosure( - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer, NSUInteger)>? - _dartFuncListenerTrampoline; - - void call(ffi.Pointer arg0, DartNSUInteger arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - int)>()(_id, arg0, arg1); -} - -abstract class NSDataBase64DecodingOptions { - /// Use the following option to modify the decoding algorithm so that it ignores unknown non-Base64 bytes, including line ending characters. - static const int NSDataBase64DecodingIgnoreUnknownCharacters = 1; -} - -/// Base 64 Options -abstract class NSDataBase64EncodingOptions { - /// Use zero or one of the following to control the maximum line length after which a line ending is inserted. No line endings are inserted by default. - static const int NSDataBase64Encoding64CharacterLineLength = 1; - static const int NSDataBase64Encoding76CharacterLineLength = 2; - - /// Use zero or more of the following to specify which kind of line ending is inserted. The default line ending is CR LF. - static const int NSDataBase64EncodingEndLineWithCarriageReturn = 16; - static const int NSDataBase64EncodingEndLineWithLineFeed = 32; -} - -/// Various algorithms provided for compression APIs. See NSData and NSMutableData. -abstract class NSDataCompressionAlgorithm { - /// LZFSE is the recommended compression algorithm if you don't have a specific reason to use another algorithm. Note that LZFSE is intended for use with Apple devices only. This algorithm generally compresses better than Zlib, but not as well as LZMA. It is generally slower than LZ4. - static const int NSDataCompressionAlgorithmLZFSE = 0; - - /// LZ4 is appropriate if compression speed is critical. LZ4 generally sacrifices compression ratio in order to achieve its greater speed. - /// This implementation of LZ4 makes a small modification to the standard format, which is described in greater detail in . - static const int NSDataCompressionAlgorithmLZ4 = 1; - - /// LZMA is appropriate if compression ratio is critical and memory usage and compression speed are not a factor. LZMA is an order of magnitude slower for both compression and decompression than other algorithms. It can also use a very large amount of memory, so if you need to compress large amounts of data on embedded devices with limited memory you should probably avoid LZMA. - /// Encoding uses LZMA level 6 only, but decompression works with any compression level. - static const int NSDataCompressionAlgorithmLZMA = 2; - - /// Zlib is appropriate if you want a good balance between compression speed and compression ratio, but only if you need interoperability with non-Apple platforms. Otherwise, LZFSE is generally a better choice than Zlib. - /// Encoding uses Zlib level 5 only, but decompression works with any compression level. It uses the raw DEFLATE format as described in IETF RFC 1951. - static const int NSDataCompressionAlgorithmZlib = 3; -} - -typedef UTF32Char = UInt32; -typedef UInt32 = ffi.UnsignedInt; -typedef DartUInt32 = int; - -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_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - NSRange arg2, ffi.Pointer arg3)>>() - .asFunction< - void Function(ffi.Pointer, NSRange, NSRange, - ffi.Pointer)>()(arg0, arg1, arg2, arg3); -final _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry = , NSRange, NSRange, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( - void Function(ffi.Pointer, NSRange, NSRange, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - NSRange arg1, - NSRange arg2, - ffi.Pointer arg3) => - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2, arg3); - -class ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, NSRange arg1, - NSRange arg2, ffi.Pointer arg3)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.fromFunction( - NativeCupertinoHttp lib, - void Function(NSString?, NSRange, NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( - (ffi.Pointer arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - fn(arg0.address == 0 ? null : NSString._(arg0, lib, retain: true, release: true), arg1, arg2, arg3))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool.listener( - NativeCupertinoHttp lib, - void Function(NSString?, NSRange, NSRange, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSString_NSRange_NSRange_bool_registerClosure( - (ffi.Pointer arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - fn(arg0.address == 0 ? null : NSString._(arg0, lib, retain: true, release: true), arg1, arg2, arg3))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSString? arg0, NSRange arg1, NSRange arg2, - ffi.Pointer arg3) => - _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>, - ffi.Pointer, - NSRange, - NSRange, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1, arg2, arg3); -} - -void _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function( - ffi.Pointer, ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSString_bool_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSString_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSString_bool_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSString_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSString_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSString_bool_closureRegistry[block.ref.target.address]!( - arg0, arg1); - -class ObjCBlock_ffiVoid_NSString_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSString_bool._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_NSString_bool.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_NSString_bool.fromFunction(NativeCupertinoHttp lib, - void Function(NSString, ffi.Pointer) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSString_bool_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => - fn(NSString._(arg0, lib, retain: true, release: true), - arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_NSString_bool.listener(NativeCupertinoHttp lib, - void Function(NSString, ffi.Pointer) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSString_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSString_bool_registerClosure( - (ffi.Pointer arg0, - ffi.Pointer arg1) => - fn(NSString._(arg0, lib, retain: true, release: true), - arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSString arg0, ffi.Pointer arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1); -} - -typedef NSStringEncoding = NSUInteger; - -abstract class NSStringEncodingConversionOptions { - static const int NSStringEncodingConversionAllowLossy = 1; - static const int NSStringEncodingConversionExternalRepresentation = 2; -} - -typedef NSStringTransform = ffi.Pointer; -typedef DartNSStringTransform = NSString; -void _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction, int)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_unichar_NSUInteger_closureRegistry = - , int)>{}; -int _ObjCBlock_ffiVoid_unichar_NSUInteger_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_unichar_NSUInteger_registerClosure( - void Function(ffi.Pointer, int) fn) { - final id = ++_ObjCBlock_ffiVoid_unichar_NSUInteger_closureRegistryIndex; - _ObjCBlock_ffiVoid_unichar_NSUInteger_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_unichar_NSUInteger_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0, int arg1) => - _ObjCBlock_ffiVoid_unichar_NSUInteger_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_unichar_NSUInteger extends _ObjCBlockBase { - ObjCBlock_ffiVoid_unichar_NSUInteger._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_unichar_NSUInteger.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, NSUInteger arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_unichar_NSUInteger_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_unichar_NSUInteger.fromFunction(NativeCupertinoHttp lib, - void Function(ffi.Pointer, DartNSUInteger) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, NSUInteger)>( - _ObjCBlock_ffiVoid_unichar_NSUInteger_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_unichar_NSUInteger_registerClosure( - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_unichar_NSUInteger.listener(NativeCupertinoHttp lib, - void Function(ffi.Pointer, DartNSUInteger) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer, NSUInteger)>.listener( - _ObjCBlock_ffiVoid_unichar_NSUInteger_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_unichar_NSUInteger_registerClosure( - (ffi.Pointer arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer, NSUInteger)>? - _dartFuncListenerTrampoline; - - void call(ffi.Pointer arg0, DartNSUInteger arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, NSUInteger arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - int)>()(_id, arg0, arg1); -} - -typedef va_list = __builtin_va_list; -typedef __builtin_va_list = 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; -} - -abstract class ptrauth_key { - static const int ptrauth_key_none = -1; - static const int ptrauth_key_asia = 0; - static const int ptrauth_key_asib = 1; - static const int ptrauth_key_asda = 2; - static const int ptrauth_key_asdb = 3; - static const int ptrauth_key_process_independent_code = 0; - static const int ptrauth_key_process_dependent_code = 1; - static const int ptrauth_key_process_independent_data = 2; - static const int ptrauth_key_process_dependent_data = 3; - static const int ptrauth_key_function_pointer = 0; - static const int ptrauth_key_return_address = 1; - static const int ptrauth_key_frame_pointer = 3; - static const int ptrauth_key_block_function = 0; - static const int ptrauth_key_cxx_vtable_pointer = 2; - static const int ptrauth_key_method_list_pointer = 2; - static const int ptrauth_key_objc_isa_pointer = 2; - static const int ptrauth_key_objc_super_pointer = 2; - static const int ptrauth_key_block_descriptor_pointer = 2; - static const int ptrauth_key_objc_sel_pointer = 3; - static const int ptrauth_key_objc_class_ro_pointer = 2; -} - -@ffi.Packed(2) -final class wide extends ffi.Struct { - @UInt32() - external int lo; - - @SInt32() - external int hi; -} - -typedef SInt32 = ffi.Int; -typedef DartSInt32 = int; - -@ffi.Packed(2) -final class UnsignedWide extends ffi.Struct { - @UInt32() - external int lo; - - @UInt32() - external int hi; -} - -final class Float80 extends ffi.Struct { - @SInt16() - external int exp; - - @ffi.Array.multi([4]) - external ffi.Array man; -} - -typedef SInt16 = ffi.Short; -typedef DartSInt16 = int; -typedef UInt16 = ffi.UnsignedShort; -typedef DartUInt16 = int; - -final class Float96 extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array exp; - - @ffi.Array.multi([4]) - external ffi.Array man; -} - -@ffi.Packed(2) -final class Float32Point extends ffi.Struct { - @Float32() - external double x; - - @Float32() - external double y; -} - -typedef Float32 = ffi.Float; -typedef DartFloat32 = double; - -@ffi.Packed(2) -final class ProcessSerialNumber extends ffi.Struct { - @UInt32() - external int highLongOfPSN; - - @UInt32() - external int lowLongOfPSN; -} - -final class Point extends ffi.Struct { - @ffi.Short() - external int v; - - @ffi.Short() - external int h; -} - -final class Rect extends ffi.Struct { - @ffi.Short() - external int top; - - @ffi.Short() - external int left; - - @ffi.Short() - external int bottom; - - @ffi.Short() - external int right; -} - -@ffi.Packed(2) -final class FixedPoint extends ffi.Struct { - @Fixed() - external int x; - - @Fixed() - external int y; -} - -typedef Fixed = SInt32; - -@ffi.Packed(2) -final class FixedRect extends ffi.Struct { - @Fixed() - external int left; - - @Fixed() - external int top; - - @Fixed() - external int right; - - @Fixed() - external int bottom; -} - -final class TimeBaseRecord extends ffi.Opaque {} - -@ffi.Packed(2) -final class TimeRecord extends ffi.Struct { - external CompTimeValue value; - - @TimeScale() - external int scale; - - external TimeBase base; -} - -typedef CompTimeValue = wide; -typedef TimeScale = SInt32; -typedef TimeBase = ffi.Pointer; - -final class NumVersion extends ffi.Struct { - @UInt8() - external int nonRelRev; - - @UInt8() - external int stage; - - @UInt8() - external int minorAndBugRev; - - @UInt8() - external int majorRev; -} - -typedef UInt8 = ffi.UnsignedChar; -typedef DartUInt8 = int; - -final class NumVersionVariant extends ffi.Union { - external NumVersion parts; - - @UInt32() - external int whole; -} - -final class VersRec extends ffi.Struct { - external NumVersion numericVersion; - - @ffi.Short() - external int countryCode; - - @ffi.Array.multi([256]) - external ffi.Array shortVersion; - - @ffi.Array.multi([256]) - external ffi.Array reserved; -} - -typedef ConstStr255Param = ffi.Pointer; - -final 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 = ffi.Long; -typedef DartCFIndex = int; - -final class CFRange extends ffi.Struct { - @CFIndex() - external int location; - - @CFIndex() - external int length; -} - -final class __CFNull extends ffi.Opaque {} - -typedef CFTypeID = ffi.UnsignedLong; -typedef DartCFTypeID = int; -typedef CFNullRef = ffi.Pointer<__CFNull>; - -final class __CFAllocator extends ffi.Opaque {} - -typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - -final 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>; -typedef CFAllocatorRetainCallBackFunction = ffi.Pointer Function( - ffi.Pointer info); -typedef CFAllocatorReleaseCallBack - = ffi.Pointer>; -typedef CFAllocatorReleaseCallBackFunction = ffi.Void Function( - ffi.Pointer info); -typedef DartCFAllocatorReleaseCallBackFunction = void Function( - ffi.Pointer info); -typedef CFAllocatorCopyDescriptionCallBack = ffi - .Pointer>; -typedef CFAllocatorCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer info); -typedef CFStringRef = ffi.Pointer<__CFString>; -typedef CFAllocatorAllocateCallBack - = ffi.Pointer>; -typedef CFAllocatorAllocateCallBackFunction = ffi.Pointer Function( - CFIndex allocSize, CFOptionFlags hint, ffi.Pointer info); -typedef DartCFAllocatorAllocateCallBackFunction - = ffi.Pointer Function(DartCFIndex allocSize, - DartCFOptionFlags hint, ffi.Pointer info); -typedef CFOptionFlags = ffi.UnsignedLong; -typedef DartCFOptionFlags = int; -typedef CFAllocatorReallocateCallBack - = ffi.Pointer>; -typedef CFAllocatorReallocateCallBackFunction = ffi.Pointer Function( - ffi.Pointer ptr, - CFIndex newsize, - CFOptionFlags hint, - ffi.Pointer info); -typedef DartCFAllocatorReallocateCallBackFunction - = ffi.Pointer Function( - ffi.Pointer ptr, - DartCFIndex newsize, - DartCFOptionFlags hint, - ffi.Pointer info); -typedef CFAllocatorDeallocateCallBack - = ffi.Pointer>; -typedef CFAllocatorDeallocateCallBackFunction = ffi.Void Function( - ffi.Pointer ptr, ffi.Pointer info); -typedef DartCFAllocatorDeallocateCallBackFunction = void Function( - ffi.Pointer ptr, ffi.Pointer info); -typedef CFAllocatorPreferredSizeCallBack - = ffi.Pointer>; -typedef CFAllocatorPreferredSizeCallBackFunction = CFIndex Function( - CFIndex size, CFOptionFlags hint, ffi.Pointer info); -typedef DartCFAllocatorPreferredSizeCallBackFunction = DartCFIndex Function( - DartCFIndex size, DartCFOptionFlags hint, ffi.Pointer info); -typedef CFTypeRef = ffi.Pointer; -typedef Boolean = ffi.UnsignedChar; -typedef DartBoolean = int; -typedef CFHashCode = ffi.UnsignedLong; -typedef DartCFHashCode = int; -typedef NSZone = _NSZone; - -class NSMutableIndexSet extends NSIndexSet { - NSMutableIndexSet._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSMutableIndexSet] that points to the same underlying object as [other]. - static NSMutableIndexSet castFrom(T other) { - return NSMutableIndexSet._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSMutableIndexSet] that wraps the given raw object pointer. - static NSMutableIndexSet castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableIndexSet._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSMutableIndexSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableIndexSet1); - } - - void addIndexes_(NSIndexSet indexSet) { - _lib._objc_msgSend_302(_id, _lib._sel_addIndexes_1, indexSet._id); - } - - void removeIndexes_(NSIndexSet indexSet) { - _lib._objc_msgSend_302(_id, _lib._sel_removeIndexes_1, indexSet._id); - } - - void removeAllIndexes() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllIndexes1); - } - - void addIndex_(DartNSUInteger value) { - _lib._objc_msgSend_303(_id, _lib._sel_addIndex_1, value); - } - - void removeIndex_(DartNSUInteger value) { - _lib._objc_msgSend_303(_id, _lib._sel_removeIndex_1, value); - } - - void addIndexesInRange_(NSRange range) { - _lib._objc_msgSend_304(_id, _lib._sel_addIndexesInRange_1, range); - } - - void removeIndexesInRange_(NSRange range) { - _lib._objc_msgSend_304(_id, _lib._sel_removeIndexesInRange_1, range); - } - - void shiftIndexesStartingAtIndex_by_( - DartNSUInteger index, DartNSInteger delta) { - _lib._objc_msgSend_305( - _id, _lib._sel_shiftIndexesStartingAtIndex_by_1, index, delta); - } - - static NSMutableIndexSet indexSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableIndexSet1, _lib._sel_indexSet1); - return NSMutableIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableIndexSet indexSetWithIndex_( - NativeCupertinoHttp _lib, DartNSUInteger value) { - final _ret = _lib._objc_msgSend_99( - _lib._class_NSMutableIndexSet1, _lib._sel_indexSetWithIndex_1, value); - return NSMutableIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableIndexSet indexSetWithIndexesInRange_( - NativeCupertinoHttp _lib, NSRange range) { - final _ret = _lib._objc_msgSend_116(_lib._class_NSMutableIndexSet1, - _lib._sel_indexSetWithIndexesInRange_1, range); - return NSMutableIndexSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableIndexSet initWithIndexesInRange_(NSRange range) { - final _ret = - _lib._objc_msgSend_116(_id, _lib._sel_initWithIndexesInRange_1, range); - return NSMutableIndexSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableIndexSet initWithIndexSet_(NSIndexSet indexSet) { - final _ret = - _lib._objc_msgSend_117(_id, _lib._sel_initWithIndexSet_1, indexSet._id); - return NSMutableIndexSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableIndexSet initWithIndex_(DartNSUInteger value) { - final _ret = _lib._objc_msgSend_99(_id, _lib._sel_initWithIndex_1, value); - return NSMutableIndexSet._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableIndexSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableIndexSet._(_ret, _lib, retain: true, release: true); - } - - static NSMutableIndexSet new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableIndexSet1, _lib._sel_new1); - return NSMutableIndexSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableIndexSet allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableIndexSet1, _lib._sel_allocWithZone_1, zone); - return NSMutableIndexSet._(_ret, _lib, retain: false, release: true); - } - - static NSMutableIndexSet alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableIndexSet1, _lib._sel_alloc1); - return NSMutableIndexSet._(_ret, _lib, retain: false, release: true); - } -} - -/// Mutable Array -class NSMutableArray extends NSArray { - NSMutableArray._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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) { - _lib._objc_msgSend_210(_id, _lib._sel_addObject_1, anObject._id); - } - - void insertObject_atIndex_(NSObject anObject, DartNSUInteger index) { - _lib._objc_msgSend_306( - _id, _lib._sel_insertObject_atIndex_1, anObject._id, index); - } - - void removeLastObject() { - _lib._objc_msgSend_1(_id, _lib._sel_removeLastObject1); - } - - void removeObjectAtIndex_(DartNSUInteger index) { - _lib._objc_msgSend_303(_id, _lib._sel_removeObjectAtIndex_1, index); - } - - void replaceObjectAtIndex_withObject_( - DartNSUInteger index, NSObject anObject) { - _lib._objc_msgSend_307( - _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_(DartNSUInteger numItems) { - final _ret = - _lib._objc_msgSend_99(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - void addObjectsFromArray_(NSArray otherArray) { - _lib._objc_msgSend_308( - _id, _lib._sel_addObjectsFromArray_1, otherArray._id); - } - - void exchangeObjectAtIndex_withObjectAtIndex_( - DartNSUInteger idx1, DartNSUInteger idx2) { - _lib._objc_msgSend_309( - _id, _lib._sel_exchangeObjectAtIndex_withObjectAtIndex_1, idx1, idx2); - } - - void removeAllObjects() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); - } - - void removeObject_inRange_(NSObject anObject, NSRange range) { - _lib._objc_msgSend_310( - _id, _lib._sel_removeObject_inRange_1, anObject._id, range); - } - - void removeObject_(NSObject anObject) { - _lib._objc_msgSend_210(_id, _lib._sel_removeObject_1, anObject._id); - } - - void removeObjectIdenticalTo_inRange_(NSObject anObject, NSRange range) { - _lib._objc_msgSend_310( - _id, _lib._sel_removeObjectIdenticalTo_inRange_1, anObject._id, range); - } - - void removeObjectIdenticalTo_(NSObject anObject) { - _lib._objc_msgSend_210( - _id, _lib._sel_removeObjectIdenticalTo_1, anObject._id); - } - - void removeObjectsFromIndices_numIndices_( - ffi.Pointer indices, DartNSUInteger cnt) { - _lib._objc_msgSend_311( - _id, _lib._sel_removeObjectsFromIndices_numIndices_1, indices, cnt); - } - - void removeObjectsInArray_(NSArray otherArray) { - _lib._objc_msgSend_308( - _id, _lib._sel_removeObjectsInArray_1, otherArray._id); - } - - void removeObjectsInRange_(NSRange range) { - _lib._objc_msgSend_304(_id, _lib._sel_removeObjectsInRange_1, range); - } - - void replaceObjectsInRange_withObjectsFromArray_range_( - NSRange range, NSArray otherArray, NSRange otherRange) { - _lib._objc_msgSend_312( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_range_1, - range, - otherArray._id, - otherRange); - } - - void replaceObjectsInRange_withObjectsFromArray_( - NSRange range, NSArray otherArray) { - _lib._objc_msgSend_313( - _id, - _lib._sel_replaceObjectsInRange_withObjectsFromArray_1, - range, - otherArray._id); - } - - void setArray_(NSArray otherArray) { - _lib._objc_msgSend_308(_id, _lib._sel_setArray_1, otherArray._id); - } - - void sortUsingFunction_context_( - ffi.Pointer< - ffi.NativeFunction< - NSInteger Function(ffi.Pointer, - ffi.Pointer, ffi.Pointer)>> - compare, - ffi.Pointer context) { - _lib._objc_msgSend_314( - _id, _lib._sel_sortUsingFunction_context_1, compare, context); - } - - void sortUsingSelector_(ffi.Pointer comparator) { - _lib._objc_msgSend_7(_id, _lib._sel_sortUsingSelector_1, comparator); - } - - void insertObjects_atIndexes_(NSArray objects, NSIndexSet indexes) { - _lib._objc_msgSend_315( - _id, _lib._sel_insertObjects_atIndexes_1, objects._id, indexes._id); - } - - void removeObjectsAtIndexes_(NSIndexSet indexes) { - _lib._objc_msgSend_302( - _id, _lib._sel_removeObjectsAtIndexes_1, indexes._id); - } - - void replaceObjectsAtIndexes_withObjects_( - NSIndexSet indexes, NSArray objects) { - _lib._objc_msgSend_316(_id, _lib._sel_replaceObjectsAtIndexes_withObjects_1, - indexes._id, objects._id); - } - - void setObject_atIndexedSubscript_(NSObject obj, DartNSUInteger idx) { - _lib._objc_msgSend_306( - _id, _lib._sel_setObject_atIndexedSubscript_1, obj._id, idx); - } - - void sortUsingComparator_(DartNSComparator cmptr) { - _lib._objc_msgSend_317(_id, _lib._sel_sortUsingComparator_1, cmptr._id); - } - - void sortWithOptions_usingComparator_(int opts, DartNSComparator cmptr) { - _lib._objc_msgSend_318( - _id, _lib._sel_sortWithOptions_usingComparator_1, opts, cmptr._id); - } - - static NSMutableArray arrayWithCapacity_( - NativeCupertinoHttp _lib, DartNSUInteger numItems) { - final _ret = _lib._objc_msgSend_99( - _lib._class_NSMutableArray1, _lib._sel_arrayWithCapacity_1, numItems); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray? arrayWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_319(_lib._class_NSMutableArray1, - _lib._sel_arrayWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray? arrayWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_320(_lib._class_NSMutableArray1, - _lib._sel_arrayWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - NSMutableArray? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_319( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - NSMutableArray? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_320(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - void applyDifference_(NSOrderedCollectionDifference difference) { - _lib._objc_msgSend_321(_id, _lib._sel_applyDifference_1, difference._id); - } - - @override - NSMutableArray initWithObjects_count_( - ffi.Pointer> objects, DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_100( - _id, _lib._sel_initWithObjects_count_1, objects, cnt); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray array(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_array1); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithObject_( - NativeCupertinoHttp _lib, NSObject anObject) { - final _ret = _lib._objc_msgSend_149( - _lib._class_NSMutableArray1, _lib._sel_arrayWithObject_1, anObject._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithObjects_count_(NativeCupertinoHttp _lib, - ffi.Pointer> objects, DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_100(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_count_1, objects, cnt); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithObjects_( - NativeCupertinoHttp _lib, NSObject firstObj) { - final _ret = _lib._objc_msgSend_149(_lib._class_NSMutableArray1, - _lib._sel_arrayWithObjects_1, firstObj._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray arrayWithArray_( - NativeCupertinoHttp _lib, NSArray array) { - final _ret = _lib._objc_msgSend_150( - _lib._class_NSMutableArray1, _lib._sel_arrayWithArray_1, array._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray initWithObjects_(NSObject firstObj) { - final _ret = - _lib._objc_msgSend_149(_id, _lib._sel_initWithObjects_1, firstObj._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray initWithArray_(NSArray array) { - final _ret = - _lib._objc_msgSend_150(_id, _lib._sel_initWithArray_1, array._id); - return NSMutableArray._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableArray initWithArray_copyItems_(NSArray array, bool flag) { - final _ret = _lib._objc_msgSend_151( - _id, _lib._sel_initWithArray_copyItems_1, array._id, flag); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } - - /// Reads array stored in NSPropertyList format from the specified url. - static NSArray? arrayWithContentsOfURL_error_(NativeCupertinoHttp _lib, - NSURL url, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_152(_lib._class_NSMutableArray1, - _lib._sel_arrayWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } - - static NSMutableArray new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_new1); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } - - static NSMutableArray allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableArray1, _lib._sel_allocWithZone_1, zone); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } - - static NSMutableArray alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableArray1, _lib._sel_alloc1); - return NSMutableArray._(_ret, _lib, retain: false, release: true); - } -} - -/// Mutable Data -class NSMutableData extends NSData { - NSMutableData._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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_31(_id, _lib._sel_mutableBytes1); - } - - @override - DartNSUInteger get length { - return _lib._objc_msgSend_12(_id, _lib._sel_length1); - } - - set length(DartNSUInteger value) { - return _lib._objc_msgSend_322(_id, _lib._sel_setLength_1, value); - } - - void appendBytes_length_(ffi.Pointer bytes, DartNSUInteger length) { - _lib._objc_msgSend_33(_id, _lib._sel_appendBytes_length_1, bytes, length); - } - - void appendData_(NSData other) { - _lib._objc_msgSend_323(_id, _lib._sel_appendData_1, other._id); - } - - void increaseLengthBy_(DartNSUInteger extraLength) { - _lib._objc_msgSend_303(_id, _lib._sel_increaseLengthBy_1, extraLength); - } - - void replaceBytesInRange_withBytes_( - NSRange range, ffi.Pointer bytes) { - _lib._objc_msgSend_324( - _id, _lib._sel_replaceBytesInRange_withBytes_1, range, bytes); - } - - void resetBytesInRange_(NSRange range) { - _lib._objc_msgSend_304(_id, _lib._sel_resetBytesInRange_1, range); - } - - void setData_(NSData data) { - _lib._objc_msgSend_323(_id, _lib._sel_setData_1, data._id); - } - - void replaceBytesInRange_withBytes_length_( - NSRange range, - ffi.Pointer replacementBytes, - DartNSUInteger replacementLength) { - _lib._objc_msgSend_325( - _id, - _lib._sel_replaceBytesInRange_withBytes_length_1, - range, - replacementBytes, - replacementLength); - } - - static NSMutableData? dataWithCapacity_( - NativeCupertinoHttp _lib, DartNSUInteger aNumItems) { - final _ret = _lib._objc_msgSend_326( - _lib._class_NSMutableData1, _lib._sel_dataWithCapacity_1, aNumItems); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithLength_( - NativeCupertinoHttp _lib, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_326( - _lib._class_NSMutableData1, _lib._sel_dataWithLength_1, length); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - NSMutableData? initWithCapacity_(DartNSUInteger capacity) { - final _ret = - _lib._objc_msgSend_326(_id, _lib._sel_initWithCapacity_1, capacity); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - NSMutableData? initWithLength_(DartNSUInteger length) { - final _ret = - _lib._objc_msgSend_326(_id, _lib._sel_initWithLength_1, length); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - /// These methods compress or decompress the receiver's contents in-place using the specified algorithm. If the operation is not successful, these methods leave the receiver unchanged.. - bool decompressUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - return _lib._objc_msgSend_327( - _id, _lib._sel_decompressUsingAlgorithm_error_1, algorithm, error); - } - - bool compressUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - return _lib._objc_msgSend_327( - _id, _lib._sel_compressUsingAlgorithm_error_1, algorithm, error); - } - - static NSMutableData data(NativeCupertinoHttp _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_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222(_lib._class_NSMutableData1, - _lib._sel_dataWithBytes_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData dataWithBytesNoCopy_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222(_lib._class_NSMutableData1, - _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static NSMutableData dataWithBytesNoCopy_length_freeWhenDone_( - NativeCupertinoHttp _lib, - ffi.Pointer bytes, - DartNSUInteger length, - bool b) { - final _ret = _lib._objc_msgSend_223(_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_( - NativeCupertinoHttp _lib, - NSString path, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_224( - _lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithContentsOfURL_options_error_( - NativeCupertinoHttp _lib, - NSURL url, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_225( - _lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData? dataWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226( - _lib._class_NSMutableData1, _lib._sel_dataWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData initWithBytes_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222( - _id, _lib._sel_initWithBytes_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData initWithBytesNoCopy_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222( - _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableData initWithBytesNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, DartNSUInteger length, bool b) { - final _ret = _lib._objc_msgSend_223(_id, - _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableData initWithBytesNoCopy_length_deallocator_( - ffi.Pointer bytes, - DartNSUInteger length, - ObjCBlock_ffiVoid_ffiVoid_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_227( - _id, - _lib._sel_initWithBytesNoCopy_length_deallocator_1, - bytes, - length, - deallocator?._id ?? ffi.nullptr); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableData? initWithContentsOfFile_options_error_(NSString path, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_224( - _id, - _lib._sel_initWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithContentsOfURL_options_error_(NSURL url, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_225( - _id, - _lib._sel_initWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_49( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_226(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_228(_id, _lib._sel_initWithData_1, data._id); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData dataWithData_(NativeCupertinoHttp _lib, NSData data) { - final _ret = _lib._objc_msgSend_228( - _lib._class_NSMutableData1, _lib._sel_dataWithData_1, data._id); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - /// Create an NSData from a Base-64 encoded NSString using the given options. By default, returns nil when the input is not recognized as valid Base-64. - @override - NSMutableData? initWithBase64EncodedString_options_( - NSString base64String, int options) { - final _ret = _lib._objc_msgSend_229( - _id, - _lib._sel_initWithBase64EncodedString_options_1, - base64String._id, - options); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - /// Create an NSData from a Base-64, UTF-8 encoded NSData. By default, returns nil when the input is not recognized as valid Base-64. - @override - NSMutableData? initWithBase64EncodedData_options_( - NSData base64Data, int options) { - final _ret = _lib._objc_msgSend_231(_id, - _lib._sel_initWithBase64EncodedData_options_1, base64Data._id, options); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - /// These methods return a compressed or decompressed version of the receiver using the specified algorithm. - @override - NSMutableData? decompressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_233(_id, - _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData? compressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_233( - _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dataWithContentsOfMappedFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSMutableData1, - _lib._sel_dataWithContentsOfMappedFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableData init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableData._(_ret, _lib, retain: true, release: true); - } - - static NSMutableData new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_new1); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static NSMutableData allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableData1, _lib._sel_allocWithZone_1, zone); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } - - static NSMutableData alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableData1, _lib._sel_alloc1); - return NSMutableData._(_ret, _lib, retain: false, release: true); - } -} - -/// Purgeable Data -class NSPurgeableData extends NSMutableData { - NSPurgeableData._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSPurgeableData] that points to the same underlying object as [other]. - static NSPurgeableData castFrom(T other) { - return NSPurgeableData._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSPurgeableData] that wraps the given raw object pointer. - static NSPurgeableData castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSPurgeableData._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSPurgeableData]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSPurgeableData1); - } - - static NSPurgeableData? dataWithCapacity_( - NativeCupertinoHttp _lib, DartNSUInteger aNumItems) { - final _ret = _lib._objc_msgSend_326( - _lib._class_NSPurgeableData1, _lib._sel_dataWithCapacity_1, aNumItems); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData? dataWithLength_( - NativeCupertinoHttp _lib, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_326( - _lib._class_NSPurgeableData1, _lib._sel_dataWithLength_1, length); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData? initWithCapacity_(DartNSUInteger capacity) { - final _ret = - _lib._objc_msgSend_326(_id, _lib._sel_initWithCapacity_1, capacity); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData? initWithLength_(DartNSUInteger length) { - final _ret = - _lib._objc_msgSend_326(_id, _lib._sel_initWithLength_1, length); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData data(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPurgeableData1, _lib._sel_data1); - return NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData dataWithBytes_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222(_lib._class_NSPurgeableData1, - _lib._sel_dataWithBytes_length_1, bytes, length); - return NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData dataWithBytesNoCopy_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222(_lib._class_NSPurgeableData1, - _lib._sel_dataWithBytesNoCopy_length_1, bytes, length); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } - - static NSPurgeableData dataWithBytesNoCopy_length_freeWhenDone_( - NativeCupertinoHttp _lib, - ffi.Pointer bytes, - DartNSUInteger length, - bool b) { - final _ret = _lib._objc_msgSend_223(_lib._class_NSPurgeableData1, - _lib._sel_dataWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } - - static NSPurgeableData? dataWithContentsOfFile_options_error_( - NativeCupertinoHttp _lib, - NSString path, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_224( - _lib._class_NSPurgeableData1, - _lib._sel_dataWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData? dataWithContentsOfURL_options_error_( - NativeCupertinoHttp _lib, - NSURL url, - int readOptionsMask, - ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_225( - _lib._class_NSPurgeableData1, - _lib._sel_dataWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData? dataWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSPurgeableData1, - _lib._sel_dataWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData? dataWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226(_lib._class_NSPurgeableData1, - _lib._sel_dataWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData initWithBytes_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222( - _id, _lib._sel_initWithBytes_length_1, bytes, length); - return NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData initWithBytesNoCopy_length_( - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_222( - _id, _lib._sel_initWithBytesNoCopy_length_1, bytes, length); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSPurgeableData initWithBytesNoCopy_length_freeWhenDone_( - ffi.Pointer bytes, DartNSUInteger length, bool b) { - final _ret = _lib._objc_msgSend_223(_id, - _lib._sel_initWithBytesNoCopy_length_freeWhenDone_1, bytes, length, b); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSPurgeableData initWithBytesNoCopy_length_deallocator_( - ffi.Pointer bytes, - DartNSUInteger length, - ObjCBlock_ffiVoid_ffiVoid_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_227( - _id, - _lib._sel_initWithBytesNoCopy_length_deallocator_1, - bytes, - length, - deallocator?._id ?? ffi.nullptr); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } - - @override - NSPurgeableData? initWithContentsOfFile_options_error_(NSString path, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_224( - _id, - _lib._sel_initWithContentsOfFile_options_error_1, - path._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData? initWithContentsOfURL_options_error_(NSURL url, - int readOptionsMask, ffi.Pointer> errorPtr) { - final _ret = _lib._objc_msgSend_225( - _id, - _lib._sel_initWithContentsOfURL_options_error_1, - url._id, - readOptionsMask, - errorPtr); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_49( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_226(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_228(_id, _lib._sel_initWithData_1, data._id); - return NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData dataWithData_(NativeCupertinoHttp _lib, NSData data) { - final _ret = _lib._objc_msgSend_228( - _lib._class_NSPurgeableData1, _lib._sel_dataWithData_1, data._id); - return NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - /// Create an NSData from a Base-64 encoded NSString using the given options. By default, returns nil when the input is not recognized as valid Base-64. - @override - NSPurgeableData? initWithBase64EncodedString_options_( - NSString base64String, int options) { - final _ret = _lib._objc_msgSend_229( - _id, - _lib._sel_initWithBase64EncodedString_options_1, - base64String._id, - options); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - /// Create an NSData from a Base-64, UTF-8 encoded NSData. By default, returns nil when the input is not recognized as valid Base-64. - @override - NSPurgeableData? initWithBase64EncodedData_options_( - NSData base64Data, int options) { - final _ret = _lib._objc_msgSend_231(_id, - _lib._sel_initWithBase64EncodedData_options_1, base64Data._id, options); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - /// These methods return a compressed or decompressed version of the receiver using the specified algorithm. - @override - NSPurgeableData? decompressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_233(_id, - _lib._sel_decompressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData? compressedDataUsingAlgorithm_error_( - int algorithm, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_233( - _id, _lib._sel_compressedDataUsingAlgorithm_error_1, algorithm, error); - return _ret.address == 0 - ? null - : NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSObject? dataWithContentsOfMappedFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSPurgeableData1, - _lib._sel_dataWithContentsOfMappedFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } - - @override - NSPurgeableData init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSPurgeableData._(_ret, _lib, retain: true, release: true); - } - - static NSPurgeableData new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPurgeableData1, _lib._sel_new1); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } - - static NSPurgeableData allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSPurgeableData1, _lib._sel_allocWithZone_1, zone); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } - - static NSPurgeableData alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSPurgeableData1, _lib._sel_alloc1); - return NSPurgeableData._(_ret, _lib, retain: false, release: true); - } -} - -/// Mutable Dictionary -class NSMutableDictionary extends NSDictionary { - NSMutableDictionary._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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) { - _lib._objc_msgSend_210(_id, _lib._sel_removeObjectForKey_1, aKey._id); - } - - void setObject_forKey_(NSObject anObject, NSObject aKey) { - _lib._objc_msgSend_328( - _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_(DartNSUInteger numItems) { - final _ret = - _lib._objc_msgSend_99(_id, _lib._sel_initWithCapacity_1, numItems); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - void addEntriesFromDictionary_(NSDictionary otherDictionary) { - _lib._objc_msgSend_329( - _id, _lib._sel_addEntriesFromDictionary_1, otherDictionary._id); - } - - void removeAllObjects() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllObjects1); - } - - void removeObjectsForKeys_(NSArray keyArray) { - _lib._objc_msgSend_308(_id, _lib._sel_removeObjectsForKeys_1, keyArray._id); - } - - void setDictionary_(NSDictionary otherDictionary) { - _lib._objc_msgSend_329(_id, _lib._sel_setDictionary_1, otherDictionary._id); - } - - void setObject_forKeyedSubscript_(NSObject? obj, NSObject key) { - _lib._objc_msgSend_330(_id, _lib._sel_setObject_forKeyedSubscript_1, - obj?._id ?? ffi.nullptr, key._id); - } - - static NSMutableDictionary dictionaryWithCapacity_( - NativeCupertinoHttp _lib, DartNSUInteger numItems) { - final _ret = _lib._objc_msgSend_99(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithCapacity_1, numItems); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary? dictionaryWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_331(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary? dictionaryWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_332(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - NSMutableDictionary? initWithContentsOfFile_(NSString path) { - final _ret = _lib._objc_msgSend_331( - _id, _lib._sel_initWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - NSMutableDictionary? initWithContentsOfURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_332(_id, _lib._sel_initWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Create a mutable dictionary which is optimized for dealing with a known set of keys. - /// Keys that are not in the key set can still be set into the dictionary, but that usage is not optimal. - /// As with any dictionary, the keys must be copyable. - /// If keyset is nil, an exception is thrown. - /// If keyset is not an object returned by +sharedKeySetForKeys:, an exception is thrown. - static NSMutableDictionary dictionaryWithSharedKeySet_( - NativeCupertinoHttp _lib, NSObject keyset) { - final _ret = _lib._objc_msgSend_333(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithSharedKeySet_1, keyset._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary initWithObjects_forKeys_count_( - ffi.Pointer> objects, - ffi.Pointer> keys, - DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_98( - _id, _lib._sel_initWithObjects_forKeys_count_1, objects, keys, cnt); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionary(NativeCupertinoHttp _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_( - NativeCupertinoHttp _lib, NSObject object, NSObject key) { - final _ret = _lib._objc_msgSend_180(_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_( - NativeCupertinoHttp _lib, - ffi.Pointer> objects, - ffi.Pointer> keys, - DartNSUInteger cnt) { - final _ret = _lib._objc_msgSend_98(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_count_1, objects, keys, cnt); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithObjectsAndKeys_( - NativeCupertinoHttp _lib, NSObject firstObject) { - final _ret = _lib._objc_msgSend_149(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithObjectsAndKeys_1, firstObject._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithDictionary_( - NativeCupertinoHttp _lib, NSDictionary dict) { - final _ret = _lib._objc_msgSend_181(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithDictionary_1, dict._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary dictionaryWithObjects_forKeys_( - NativeCupertinoHttp _lib, NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_182(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithObjects_forKeys_1, objects._id, keys._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary initWithObjectsAndKeys_(NSObject firstObject) { - final _ret = _lib._objc_msgSend_149( - _id, _lib._sel_initWithObjectsAndKeys_1, firstObject._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary initWithDictionary_(NSDictionary otherDictionary) { - final _ret = _lib._objc_msgSend_181( - _id, _lib._sel_initWithDictionary_1, otherDictionary._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - @override - NSMutableDictionary initWithDictionary_copyItems_( - NSDictionary otherDictionary, bool flag) { - final _ret = _lib._objc_msgSend_183(_id, - _lib._sel_initWithDictionary_copyItems_1, otherDictionary._id, flag); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } - - @override - NSMutableDictionary initWithObjects_forKeys_(NSArray objects, NSArray keys) { - final _ret = _lib._objc_msgSend_182( - _id, _lib._sel_initWithObjects_forKeys_1, objects._id, keys._id); - return NSMutableDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Reads dictionary stored in NSPropertyList format from the specified url. - static NSDictionary? dictionaryWithContentsOfURL_error_( - NativeCupertinoHttp _lib, - NSURL url, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_184(_lib._class_NSMutableDictionary1, - _lib._sel_dictionaryWithContentsOfURL_error_1, url._id, error); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// Use this method to create a key set to pass to +dictionaryWithSharedKeySet:. - /// The keys are copied from the array and must be copyable. - /// If the array parameter is nil or not an NSArray, an exception is thrown. - /// If the array of keys is empty, an empty key set is returned. - /// The array of keys may contain duplicates, which are ignored (it is undefined which object of each duplicate pair is used). - /// As for any usage of hashing, is recommended that the keys have a well-distributed implementation of -hash, and the hash codes must satisfy the hash/isEqual: invariant. - /// Keys with duplicate hash codes are allowed, but will cause lower performance and increase memory usage. - static NSObject sharedKeySetForKeys_(NativeCupertinoHttp _lib, NSArray keys) { - final _ret = _lib._objc_msgSend_150(_lib._class_NSMutableDictionary1, - _lib._sel_sharedKeySetForKeys_1, keys._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - static NSMutableDictionary new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableDictionary1, _lib._sel_new1); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSMutableDictionary allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableDictionary1, _lib._sel_allocWithZone_1, zone); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } - - static NSMutableDictionary alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableDictionary1, _lib._sel_alloc1); - return NSMutableDictionary._(_ret, _lib, retain: false, release: true); - } -} - -/// ! -/// @enum NSURLCacheStoragePolicy -/// -/// @discussion The NSURLCacheStoragePolicy enum defines constants that -/// can be used to specify the type of storage that is allowable for an -/// NSCachedURLResponse object that is to be stored in an NSURLCache. -/// -/// @constant NSURLCacheStorageAllowed Specifies that storage in an -/// NSURLCache is allowed without restriction. -/// -/// @constant NSURLCacheStorageAllowedInMemoryOnly Specifies that -/// storage in an NSURLCache is allowed; however storage should be -/// done in memory only, no disk storage should be done. -/// -/// @constant NSURLCacheStorageNotAllowed Specifies that storage in an -/// NSURLCache is not allowed in any fashion, either in memory or on -/// disk. -abstract class NSURLCacheStoragePolicy { - static const int NSURLCacheStorageAllowed = 0; - static const int NSURLCacheStorageAllowedInMemoryOnly = 1; - static const int NSURLCacheStorageNotAllowed = 2; -} - -/// ! -/// @class NSCachedURLResponse -/// NSCachedURLResponse is a class whose objects functions as a wrapper for -/// objects that are stored in the framework's caching system. -/// It is used to maintain characteristics and attributes of a cached -/// object. -class NSCachedURLResponse extends NSObject { - NSCachedURLResponse._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - /// ! - /// @method initWithResponse:data - /// @abstract Initializes an NSCachedURLResponse with the given - /// response and data. - /// @discussion A default NSURLCacheStoragePolicy is used for - /// NSCachedURLResponse objects initialized with this method: - /// NSURLCacheStorageAllowed. - /// @param response a NSURLResponse object. - /// @param data an NSData object representing the URL content - /// corresponding to the given response. - /// @result an initialized NSCachedURLResponse. - NSCachedURLResponse initWithResponse_data_( - NSURLResponse response, NSData data) { - final _ret = _lib._objc_msgSend_335( - _id, _lib._sel_initWithResponse_data_1, response._id, data._id); - return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @method initWithResponse:data:userInfo:storagePolicy: - /// @abstract Initializes an NSCachedURLResponse with the given - /// response, data, user-info dictionary, and storage policy. - /// @param response a NSURLResponse object. - /// @param data an NSData object representing the URL content - /// corresponding to the given response. - /// @param userInfo a dictionary user-specified information to be - /// stored with the NSCachedURLResponse. - /// @param storagePolicy an NSURLCacheStoragePolicy constant. - /// @result an initialized NSCachedURLResponse. - NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( - NSURLResponse response, - NSData data, - NSDictionary? userInfo, - int storagePolicy) { - final _ret = _lib._objc_msgSend_336( - _id, - _lib._sel_initWithResponse_data_userInfo_storagePolicy_1, - response._id, - data._id, - userInfo?._id ?? ffi.nullptr, - storagePolicy); - return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the response wrapped by this instance. - /// @result The response wrapped by this instance. - NSURLResponse get response { - final _ret = _lib._objc_msgSend_337(_id, _lib._sel_response1); - return NSURLResponse._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the data of the receiver. - /// @result The data of the receiver. - NSData get data { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_data1); - return NSData._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the userInfo dictionary of the receiver. - /// @result The userInfo dictionary of the receiver. - NSDictionary? get userInfo { - final _ret = _lib._objc_msgSend_288(_id, _lib._sel_userInfo1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the NSURLCacheStoragePolicy constant of the receiver. - /// @result The NSURLCacheStoragePolicy constant of the receiver. - int get storagePolicy { - return _lib._objc_msgSend_338(_id, _lib._sel_storagePolicy1); - } - - @override - NSCachedURLResponse init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - static NSCachedURLResponse new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSCachedURLResponse1, _lib._sel_new1); - return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSCachedURLResponse allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSCachedURLResponse1, _lib._sel_allocWithZone_1, zone); - return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSCachedURLResponse alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSCachedURLResponse1, _lib._sel_alloc1); - return NSCachedURLResponse._(_ret, _lib, retain: false, release: true); - } -} - -class NSURLResponse extends NSObject { - NSURLResponse._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - /// ! - /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: - /// @abstract Initialize an NSURLResponse with the provided values. - /// @param URL the URL - /// @param MIMEType the MIME content type of the response - /// @param length the expected content length of the associated data - /// @param name the name of the text encoding for the associated data, if applicable, else nil - /// @result The initialized NSURLResponse. - /// @discussion This is the designated initializer for NSURLResponse. - NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( - NSURL URL, NSString? MIMEType, DartNSInteger length, NSString? name) { - final _ret = _lib._objc_msgSend_334( - _id, - _lib._sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1, - URL._id, - MIMEType?._id ?? ffi.nullptr, - length, - name?._id ?? ffi.nullptr); - return NSURLResponse._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the URL of the receiver. - /// @result The URL of the receiver. - NSURL? get URL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the MIME type of the receiver. - /// @discussion The MIME type is based on the information provided - /// from an origin source. However, that value may be changed or - /// corrected by a protocol implementation if it can be determined - /// that the origin server or source reported the information - /// incorrectly or imprecisely. An attempt to guess the MIME type may - /// be made if the origin source did not report any such information. - /// @result The MIME type of the receiver. - NSString? get MIMEType { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_MIMEType1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the expected content length of the receiver. - /// @discussion Some protocol implementations report a content length - /// as part of delivering load metadata, but not all protocols - /// guarantee the amount of data that will be delivered in actuality. - /// Hence, this method returns an expected amount. Clients should use - /// this value as an advisory, and should be prepared to deal with - /// either more or less data. - /// @result The expected content length of the receiver, or -1 if - /// there is no expectation that can be arrived at regarding expected - /// content length. - int get expectedContentLength { - return _lib._objc_msgSend_87(_id, _lib._sel_expectedContentLength1); - } - - /// ! - /// @abstract Returns the name of the text encoding of the receiver. - /// @discussion This name will be the actual string reported by the - /// origin source during the course of performing a protocol-specific - /// URL load. Clients can inspect this string and convert it to an - /// NSStringEncoding or CFStringEncoding using the methods and - /// functions made available in the appropriate framework. - /// @result The name of the text encoding of the receiver, or nil if no - /// text encoding was specified. - NSString? get textEncodingName { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_textEncodingName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns a suggested filename if the resource were saved to disk. - /// @discussion The method first checks if the server has specified a filename using the - /// content disposition header. If no valid filename is specified using that mechanism, - /// this method checks the last path component of the URL. If no valid filename can be - /// obtained using the last path component, this method uses the URL's host as the filename. - /// If the URL's host can't be converted to a valid filename, the filename "unknown" is used. - /// In most cases, this method appends the proper file extension based on the MIME type. - /// This method always returns a valid filename. - /// @result A suggested filename to use if saving the resource to disk. - NSString? get suggestedFilename { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_suggestedFilename1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - @override - NSURLResponse init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLResponse._(_ret, _lib, retain: true, release: true); - } - - static NSURLResponse new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_new1); - return NSURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSURLResponse allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLResponse1, _lib._sel_allocWithZone_1, zone); - return NSURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSURLResponse alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLResponse1, _lib._sel_alloc1); - return NSURLResponse._(_ret, _lib, retain: false, release: true); - } -} - -class NSURLCache extends NSObject { - NSURLCache._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///
    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static NSURLCache getSharedURLCache(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_339( - _lib._class_NSURLCache1, _lib._sel_sharedURLCache1); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @property sharedURLCache - /// @abstract Returns the shared NSURLCache instance or - /// sets the NSURLCache instance shared by all clients of - /// the current process. This will be the new object returned when - /// calls to the sharedURLCache method are made. - /// @discussion Unless set explicitly through a call to - /// +setSharedURLCache:, this method returns an NSURLCache - /// instance created with the following default values: - ///

    - ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) - ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) - ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) - ///
- ///

Users who do not have special caching requirements or - /// constraints should find the default shared cache instance - /// acceptable. If this default shared cache instance is not - /// acceptable, +setSharedURLCache: can be called to set a - /// different NSURLCache instance to be returned from this method. - /// Callers should take care to ensure that the setter is called - /// at a time when no other caller has a reference to the previously-set - /// shared URL cache. This is to prevent storing cache data from - /// becoming unexpectedly unretrievable. - /// @result the shared NSURLCache instance. - static void setSharedURLCache(NativeCupertinoHttp _lib, NSURLCache value) { - return _lib._objc_msgSend_340( - _lib._class_NSURLCache1, _lib._sel_setSharedURLCache_1, value._id); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:diskPath: - /// @abstract Initializes an NSURLCache with the given capacity and - /// path. - /// @discussion The returned NSURLCache is backed by disk, so - /// developers can be more liberal with space when choosing the - /// capacity for this kind of cache. A disk cache measured in the tens - /// of megabytes should be acceptable in most cases. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. - /// @param path the path on disk where the cache data is stored. - /// @result an initialized NSURLCache, with the given capacity, backed - /// by disk. - NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( - DartNSUInteger memoryCapacity, - DartNSUInteger diskCapacity, - NSString? path) { - final _ret = _lib._objc_msgSend_341( - _id, - _lib._sel_initWithMemoryCapacity_diskCapacity_diskPath_1, - memoryCapacity, - diskCapacity, - path?._id ?? ffi.nullptr); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @method initWithMemoryCapacity:diskCapacity:directoryURL: - /// @abstract Initializes an NSURLCache with the given capacity and directory. - /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. - /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. - /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. - /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. - NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( - DartNSUInteger memoryCapacity, - DartNSUInteger diskCapacity, - NSURL? directoryURL) { - final _ret = _lib._objc_msgSend_342( - _id, - _lib._sel_initWithMemoryCapacity_diskCapacity_directoryURL_1, - memoryCapacity, - diskCapacity, - directoryURL?._id ?? ffi.nullptr); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @method cachedResponseForRequest: - /// @abstract Returns the NSCachedURLResponse stored in the cache with - /// the given request. - /// @discussion The method returns nil if there is no - /// NSCachedURLResponse stored using the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - /// @result The NSCachedURLResponse stored in the cache with the given - /// request, or nil if there is no NSCachedURLResponse stored with the - /// given request. - NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_363( - _id, _lib._sel_cachedResponseForRequest_1, request._id); - return _ret.address == 0 - ? null - : NSCachedURLResponse._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @method storeCachedResponse:forRequest: - /// @abstract Stores the given NSCachedURLResponse in the cache using - /// the given request. - /// @param cachedResponse The cached response to store. - /// @param request the NSURLRequest to use as a key for the storage. - void storeCachedResponse_forRequest_( - NSCachedURLResponse cachedResponse, NSURLRequest request) { - _lib._objc_msgSend_364(_id, _lib._sel_storeCachedResponse_forRequest_1, - cachedResponse._id, request._id); - } - - /// ! - /// @method removeCachedResponseForRequest: - /// @abstract Removes the NSCachedURLResponse from the cache that is - /// stored using the given request. - /// @discussion No action is taken if there is no NSCachedURLResponse - /// stored with the given request. - /// @param request the NSURLRequest to use as a key for the lookup. - void removeCachedResponseForRequest_(NSURLRequest request) { - _lib._objc_msgSend_365( - _id, _lib._sel_removeCachedResponseForRequest_1, request._id); - } - - /// ! - /// @method removeAllCachedResponses - /// @abstract Clears the given cache, removing all NSCachedURLResponse - /// objects that it stores. - void removeAllCachedResponses() { - _lib._objc_msgSend_1(_id, _lib._sel_removeAllCachedResponses1); - } - - /// ! - /// @method removeCachedResponsesSince: - /// @abstract Clears the given cache of any cached responses since the provided date. - void removeCachedResponsesSinceDate_(NSDate date) { - _lib._objc_msgSend_373( - _id, _lib._sel_removeCachedResponsesSinceDate_1, date._id); - } - - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - DartNSUInteger get memoryCapacity { - return _lib._objc_msgSend_12(_id, _lib._sel_memoryCapacity1); - } - - /// ! - /// @abstract In-memory capacity of the receiver. - /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. - /// @result The in-memory capacity, measured in bytes, for the receiver. - set memoryCapacity(DartNSUInteger value) { - return _lib._objc_msgSend_322(_id, _lib._sel_setMemoryCapacity_1, value); - } - - /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - DartNSUInteger get diskCapacity { - return _lib._objc_msgSend_12(_id, _lib._sel_diskCapacity1); - } - - /// ! - /// @abstract The on-disk capacity of the receiver. - /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. - set diskCapacity(DartNSUInteger value) { - return _lib._objc_msgSend_322(_id, _lib._sel_setDiskCapacity_1, value); - } - - /// ! - /// @abstract Returns the current amount of space consumed by the - /// in-memory cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the in-memory cache. - /// @result the current usage of the in-memory cache of the receiver. - DartNSUInteger get currentMemoryUsage { - return _lib._objc_msgSend_12(_id, _lib._sel_currentMemoryUsage1); - } - - /// ! - /// @abstract Returns the current amount of space consumed by the - /// on-disk cache of the receiver. - /// @discussion This size, measured in bytes, indicates the current - /// usage of the on-disk cache. - /// @result the current usage of the on-disk cache of the receiver. - DartNSUInteger get currentDiskUsage { - return _lib._objc_msgSend_12(_id, _lib._sel_currentDiskUsage1); - } - - void storeCachedResponse_forDataTask_( - NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { - _lib._objc_msgSend_398(_id, _lib._sel_storeCachedResponse_forDataTask_1, - cachedResponse._id, dataTask._id); - } - - void getCachedResponseForDataTask_completionHandler_( - NSURLSessionDataTask dataTask, - ObjCBlock_ffiVoid_NSCachedURLResponse completionHandler) { - _lib._objc_msgSend_399( - _id, - _lib._sel_getCachedResponseForDataTask_completionHandler_1, - dataTask._id, - completionHandler._id); - } - - void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { - _lib._objc_msgSend_400( - _id, _lib._sel_removeCachedResponseForDataTask_1, dataTask._id); - } - - @override - NSURLCache init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLCache._(_ret, _lib, retain: true, release: true); - } - - static NSURLCache new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_new1); - return NSURLCache._(_ret, _lib, retain: false, release: true); - } - - static NSURLCache allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLCache1, _lib._sel_allocWithZone_1, zone); - return NSURLCache._(_ret, _lib, retain: false, release: true); - } - - static NSURLCache alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLCache1, _lib._sel_alloc1); - return NSURLCache._(_ret, _lib, retain: false, release: true); - } -} - -class NSURLRequest extends NSObject { - NSURLRequest._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - /// ! - /// @method requestWithURL: - /// @abstract Allocates and initializes an NSURLRequest with the given - /// URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSURLRequest requestWithURL_(NativeCupertinoHttp _lib, NSURL URL) { - final _ret = _lib._objc_msgSend_211( - _lib._class_NSURLRequest1, _lib._sel_requestWithURL_1, URL._id); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @property supportsSecureCoding - /// @abstract Indicates that NSURLRequest implements the NSSecureCoding protocol. - /// @result A BOOL value set to YES. - static bool getSupportsSecureCoding(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSURLRequest1, _lib._sel_supportsSecureCoding1); - } - - /// ! - /// @method requestWithURL:cachePolicy:timeoutInterval: - /// @abstract Allocates and initializes a NSURLRequest with the given - /// URL and cache policy. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( - NativeCupertinoHttp _lib, - NSURL URL, - int cachePolicy, - DartNSTimeInterval timeoutInterval) { - final _ret = _lib._objc_msgSend_343( - _lib._class_NSURLRequest1, - _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result An initialized NSURLRequest. - NSURLRequest initWithURL_(NSURL URL) { - final _ret = _lib._objc_msgSend_211(_id, _lib._sel_initWithURL_1, URL._id); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL and - /// cache policy. - /// @discussion This is the designated initializer for the - /// NSURLRequest class. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result An initialized NSURLRequest. - NSURLRequest initWithURL_cachePolicy_timeoutInterval_( - NSURL URL, int cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _lib._objc_msgSend_343( - _id, - _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the URL of the receiver. - /// @result The URL of the receiver. - NSURL? get URL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the cache policy of the receiver. - /// @result The cache policy of the receiver. - int get cachePolicy { - return _lib._objc_msgSend_344(_id, _lib._sel_cachePolicy1); - } - - /// ! - /// @abstract Returns the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - /// @result The timeout interval of the receiver. - DartNSTimeInterval get timeoutInterval { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_timeoutInterval1) - : _lib._objc_msgSend_90(_id, _lib._sel_timeoutInterval1); - } - - /// ! - /// @abstract The main document URL associated with this load. - /// @discussion This URL is used for the cookie "same domain as main - /// document" policy, and attributing the request as a sub-resource - /// of a user-specified URL. There may also be other future uses. - /// See setMainDocumentURL: - /// @result The main document URL. - NSURL? get mainDocumentURL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_mainDocumentURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the NSURLRequestNetworkServiceType associated with this request. - /// @discussion This will return NSURLNetworkServiceTypeDefault for requests that have - /// not explicitly set a networkServiceType (using the setNetworkServiceType method). - /// @result The NSURLRequestNetworkServiceType associated with this request. - int get networkServiceType { - return _lib._objc_msgSend_345(_id, _lib._sel_networkServiceType1); - } - - /// ! - /// @abstract returns whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @result YES if the receiver is allowed to use the built in cellular radios to - /// satisfy the request, NO otherwise. - bool get allowsCellularAccess { - return _lib._objc_msgSend_11(_id, _lib._sel_allowsCellularAccess1); - } - - /// ! - /// @abstract returns whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @result YES if the receiver is allowed to use an interface marked as expensive to - /// satisfy the request, NO otherwise. - bool get allowsExpensiveNetworkAccess { - return _lib._objc_msgSend_11(_id, _lib._sel_allowsExpensiveNetworkAccess1); - } - - /// ! - /// @abstract returns whether a connection created with this request is allowed to use - /// network interfaces which have been marked as constrained. - /// @result YES if the receiver is allowed to use an interface marked as constrained to - /// satisfy the request, NO otherwise. - bool get allowsConstrainedNetworkAccess { - return _lib._objc_msgSend_11( - _id, _lib._sel_allowsConstrainedNetworkAccess1); - } - - /// ! - /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC - /// racing without HTTP/3 service discovery. - /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. - /// The default may be YES in a future OS update. - bool get assumesHTTP3Capable { - return _lib._objc_msgSend_11(_id, _lib._sel_assumesHTTP3Capable1); - } - - /// ! - /// @abstract Returns the NSURLRequestAttribution associated with this request. - /// @discussion This will return NSURLRequestAttributionDeveloper for requests that - /// have not explicitly set an attribution. - /// @result The NSURLRequestAttribution associated with this request. - int get attribution { - return _lib._objc_msgSend_346(_id, _lib._sel_attribution1); - } - - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - bool get requiresDNSSECValidation { - return _lib._objc_msgSend_11(_id, _lib._sel_requiresDNSSECValidation1); - } - - /// ! - /// @abstract Returns the HTTP request method of the receiver. - /// @result the HTTP request method of the receiver. - NSString? get HTTPMethod { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_HTTPMethod1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns a dictionary containing all the HTTP header fields - /// of the receiver. - /// @result a dictionary containing all the HTTP header fields of the - /// receiver. - NSDictionary? get allHTTPHeaderFields { - final _ret = _lib._objc_msgSend_288(_id, _lib._sel_allHTTPHeaderFields1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @method valueForHTTPHeaderField: - /// @abstract Returns the value which corresponds to the given header - /// field. Note that, in keeping with the HTTP RFC, HTTP header field - /// names are case-insensitive. - /// @param field the header field name to use for the lookup - /// (case-insensitive). - /// @result the value associated with the given header field, or nil if - /// there is no value associated with the given header field. - NSString? valueForHTTPHeaderField_(NSString field) { - final _ret = _lib._objc_msgSend_347( - _id, _lib._sel_valueForHTTPHeaderField_1, field._id); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - /// @result The request body data of the receiver. - NSData? get HTTPBody { - final _ret = _lib._objc_msgSend_348(_id, _lib._sel_HTTPBody1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Returns the request body stream of the receiver - /// if any has been set - /// @discussion The stream is returned for examination only; it is - /// not safe for the caller to manipulate the stream in any way. Also - /// note that the HTTPBodyStream and HTTPBody are mutually exclusive - only - /// one can be set on a given request. Also note that the body stream is - /// preserved across copies, but is LOST when the request is coded via the - /// NSCoding protocol - /// @result The request body stream of the receiver. - NSInputStream? get HTTPBodyStream { - final _ret = _lib._objc_msgSend_362(_id, _lib._sel_HTTPBodyStream1); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract Determine whether default cookie handling will happen for - /// this request. - /// @discussion NOTE: This value is not used prior to 10.3 - /// @result YES if cookies will be sent with and set for this request; - /// otherwise NO. - bool get HTTPShouldHandleCookies { - return _lib._objc_msgSend_11(_id, _lib._sel_HTTPShouldHandleCookies1); - } - - /// ! - /// @abstract Reports whether the receiver is not expected to wait for the - /// previous response before transmitting. - /// @result YES if the receiver should transmit before the previous response - /// is received. NO if the receiver should wait for the previous response - /// before transmitting. - bool get HTTPShouldUsePipelining { - return _lib._objc_msgSend_11(_id, _lib._sel_HTTPShouldUsePipelining1); - } - - @override - NSURLRequest init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } - - static NSURLRequest new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_new1); - return NSURLRequest._(_ret, _lib, retain: false, release: true); - } - - static NSURLRequest allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLRequest1, _lib._sel_allocWithZone_1, zone); - return NSURLRequest._(_ret, _lib, retain: false, release: true); - } +int _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrTrampoline, 0) + .cast(); +int _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as int Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureTrampoline, 0) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_ffiInt_ffiVoid_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>(pointer, + retain: retain, release: release); - static NSURLRequest alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLRequest1, _lib._sel_alloc1); - return NSURLRequest._(_ret, _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. + static objc.ObjCBlock, ffi.Pointer)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_ffiInt_ffiVoid_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -/// ! -/// @enum NSURLRequestCachePolicy -/// -/// @discussion The NSURLRequestCachePolicy enum defines constants that -/// can be used to specify the type of interactions that take place with -/// the caching system when the URL loading system processes a request. -/// Specifically, these constants cover interactions that have to do -/// with whether already-existing cache data is returned to satisfy a -/// URL load request. -/// -/// @constant NSURLRequestUseProtocolCachePolicy Specifies that the -/// caching logic defined in the protocol implementation, if any, is -/// used for a particular URL load request. This is the default policy -/// for URL load requests. -/// -/// @constant NSURLRequestReloadIgnoringLocalCacheData Specifies that the -/// data for the URL load should be loaded from the origin source. No -/// existing local cache data, regardless of its freshness or validity, -/// should be used to satisfy a URL load request. -/// -/// @constant NSURLRequestReloadIgnoringLocalAndRemoteCacheData Specifies that -/// not only should the local cache data be ignored, but that proxies and -/// other intermediates should be instructed to disregard their caches -/// so far as the protocol allows. -/// -/// @constant NSURLRequestReloadIgnoringCacheData Older name for -/// NSURLRequestReloadIgnoringLocalCacheData. -/// -/// @constant NSURLRequestReturnCacheDataElseLoad Specifies that the -/// existing cache data should be used to satisfy a URL load request, -/// regardless of its age or expiration date. However, if there is no -/// existing data in the cache corresponding to a URL load request, -/// the URL is loaded from the origin source. -/// -/// @constant NSURLRequestReturnCacheDataDontLoad Specifies that the -/// existing cache data should be used to satisfy a URL load request, -/// regardless of its age or expiration date. However, if there is no -/// existing data in the cache corresponding to a URL load request, no -/// attempt is made to load the URL from the origin source, and the -/// load is considered to have failed. This constant specifies a -/// behavior that is similar to an "offline" mode. -/// -/// @constant NSURLRequestReloadRevalidatingCacheData Specifies that -/// the existing cache data may be used provided the origin source -/// confirms its validity, otherwise the URL is loaded from the -/// origin source. -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; + /// 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. + static objc + .ObjCBlock, ffi.Pointer)> + fromFunction( + int Function(ffi.Pointer, ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_ffiInt_ffiVoid_ffiVoid_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, arg1)), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_ffiInt_ffiVoid_ffiVoid_CallExtension on objc + .ObjCBlock, ffi.Pointer)> { + int call(ffi.Pointer arg0, ffi.Pointer arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, arg1); } -typedef NSTimeInterval = ffi.Double; -typedef DartNSTimeInterval = double; - -/// ! -/// @enum NSURLRequestNetworkServiceType -/// -/// @discussion The NSURLRequestNetworkServiceType enum defines constants that -/// can be used to specify the service type to associate with this request. The -/// service type is used to provide the networking layers a hint of the purpose -/// of the request. -/// -/// @constant NSURLNetworkServiceTypeDefault Is the default value for an NSURLRequest -/// when created. This value should be left unchanged for the vast majority of requests. -/// -/// @constant NSURLNetworkServiceTypeVoIP Specifies that the request is for voice over IP -/// control traffic. -/// -/// @constant NSURLNetworkServiceTypeVideo Specifies that the request is for video -/// traffic. -/// -/// @constant NSURLNetworkServiceTypeBackground Specifies that the request is for background -/// traffic (such as a file download). -/// -/// @constant NSURLNetworkServiceTypeVoice Specifies that the request is for voice data. -/// -/// @constant NSURLNetworkServiceTypeResponsiveData Specifies that the request is for responsive (time sensitive) data. -/// -/// @constant NSURLNetworkServiceTypeAVStreaming Specifies that the request is streaming audio/video data. -/// -/// @constant NSURLNetworkServiceTypeResponsiveAV Specifies that the request is for responsive (time sensitive) audio/video data. -/// -/// @constant NSURLNetworkServiceTypeCallSignaling Specifies that the request is for call signaling. -abstract class NSURLRequestNetworkServiceType { - /// Standard internet traffic - static const int NSURLNetworkServiceTypeDefault = 0; - - /// Voice over IP control traffic - static const int NSURLNetworkServiceTypeVoIP = 1; - - /// Video traffic - static const int NSURLNetworkServiceTypeVideo = 2; - - /// Background traffic - static const int NSURLNetworkServiceTypeBackground = 3; - - /// Voice data - static const int NSURLNetworkServiceTypeVoice = 4; - - /// Responsive data - static const int NSURLNetworkServiceTypeResponsiveData = 6; - - /// Multimedia Audio/Video Streaming - static const int NSURLNetworkServiceTypeAVStreaming = 8; - - /// Responsive Multimedia Audio/Video - static const int NSURLNetworkServiceTypeResponsiveAV = 9; - - /// Call Signaling - static const int NSURLNetworkServiceTypeCallSignaling = 11; -} +typedef dev_t = __darwin_dev_t; +typedef __darwin_dev_t = __int32_t; +typedef mode_t = __darwin_mode_t; +typedef __darwin_mode_t = __uint16_t; +typedef __uint16_t = ffi.UnsignedShort; +typedef Dart__uint16_t = int; -/// ! -/// @enum NSURLRequestAttribution -/// -/// @discussion The NSURLRequestAttribution enum is used to indicate whether the -/// user or developer specified the URL. -/// -/// @constant NSURLRequestAttributionDeveloper Indicates that the URL was specified -/// by the developer. This is the default value for an NSURLRequest when created. -/// -/// @constant NSURLRequestAttributionUser Indicates that the URL was specified by -/// the user. -abstract class NSURLRequestAttribution { - static const int NSURLRequestAttributionDeveloper = 0; - static const int NSURLRequestAttributionUser = 1; +final class fd_set extends ffi.Struct { + @ffi.Array.multi([32]) + external ffi.Array<__int32_t> fds_bits; } -class NSInputStream extends NSStream { - NSInputStream._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - DartNSInteger read_maxLength_( - ffi.Pointer buffer, DartNSUInteger len) { - return _lib._objc_msgSend_354(_id, _lib._sel_read_maxLength_1, buffer, len); - } - - bool getBuffer_length_( - ffi.Pointer> buffer, ffi.Pointer len) { - return _lib._objc_msgSend_360( - _id, _lib._sel_getBuffer_length_1, buffer, len); - } - - bool get hasBytesAvailable { - return _lib._objc_msgSend_11(_id, _lib._sel_hasBytesAvailable1); - } - - NSInputStream initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_228(_id, _lib._sel_initWithData_1, data._id); - 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); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - NSInputStream? initWithFileAtPath_(NSString path) { - final _ret = - _lib._objc_msgSend_49(_id, _lib._sel_initWithFileAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream? inputStreamWithData_( - NativeCupertinoHttp _lib, NSData data) { - final _ret = _lib._objc_msgSend_361( - _lib._class_NSInputStream1, _lib._sel_inputStreamWithData_1, data._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream? inputStreamWithFileAtPath_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSInputStream1, - _lib._sel_inputStreamWithFileAtPath_1, path._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream? inputStreamWithURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226( - _lib._class_NSInputStream1, _lib._sel_inputStreamWithURL_1, url._id); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static void getStreamsToHostWithName_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSString hostname, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_357( - _lib._class_NSInputStream1, - _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, - hostname._id, - port, - inputStream, - outputStream); - } - - static void getStreamsToHost_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSHost host, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_358( - _lib._class_NSInputStream1, - _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, - host._id, - port, - inputStream, - outputStream); - } - - static void getBoundStreamsWithBufferSize_inputStream_outputStream_( - NativeCupertinoHttp _lib, - DartNSUInteger bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_359( - _lib._class_NSInputStream1, - _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, - bufferSize, - inputStream, - outputStream); - } - - @override - NSInputStream init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSInputStream._(_ret, _lib, retain: true, release: true); - } - - static NSInputStream new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_new1); - return NSInputStream._(_ret, _lib, retain: false, release: true); - } - - static NSInputStream allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSInputStream1, _lib._sel_allocWithZone_1, zone); - return NSInputStream._(_ret, _lib, retain: false, release: true); - } +final class objc_class extends ffi.Opaque {} - static NSInputStream alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSInputStream1, _lib._sel_alloc1); - return NSInputStream._(_ret, _lib, retain: false, release: true); - } +final class objc_object extends ffi.Struct { + external ffi.Pointer isaAsInt; } -class NSStream extends NSObject { - NSStream._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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() { - _lib._objc_msgSend_1(_id, _lib._sel_open1); - } - - void close() { - _lib._objc_msgSend_1(_id, _lib._sel_close1); - } +final class objc_selector extends ffi.Opaque {} - NSObject? get delegate { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } +typedef objc_objectptr_t = ffi.Pointer; - set delegate(NSObject? value) { - return _lib._objc_msgSend_349( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } +/// NSObject +abstract final class NSObject { + /// Builds an object that implements the NSObject protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required bool Function(objc.ObjCObjectBase) isEqual_, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + final builder = objc.ObjCProtocolBuilder(); + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implement(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + return builder.build(); + } + + /// Adds the implementation of the NSObject protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required bool Function(objc.ObjCObjectBase) isEqual_, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implement(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + } + + /// Builds an object that implements the NSObject protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required bool Function(objc.ObjCObjectBase) isEqual_, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + final builder = objc.ObjCProtocolBuilder(); + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implementAsListener(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + return builder.build(); + } + + /// Adds the implementation of the NSObject protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required bool Function(objc.ObjCObjectBase) isEqual_, + required objc.ObjCObjectBase Function() class1, + required objc.ObjCObjectBase Function() self, + required objc.ObjCObjectBase Function(ffi.Pointer) + performSelector_, + required objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + performSelector_withObject_, + required objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + performSelector_withObject_withObject_, + required bool Function() isProxy, + required bool Function(objc.ObjCObjectBase) isKindOfClass_, + required bool Function(objc.ObjCObjectBase) isMemberOfClass_, + required bool Function(objc.Protocol) conformsToProtocol_, + required bool Function(ffi.Pointer) + respondsToSelector_, + required objc.ObjCObjectBase Function() retain, + required void Function() release, + required objc.ObjCObjectBase Function() autorelease, + required DartNSUInteger Function() retainCount, + required ffi.Pointer<_NSZone> Function() zone, + required DartNSUInteger Function() hash, + required objc.ObjCObjectBase Function() superclass, + required objc.NSString Function() description, + objc.NSString Function()? debugDescription}) { + NSObject.isEqual_.implement(builder, isEqual_); + NSObject.class1.implement(builder, class1); + NSObject.self.implement(builder, self); + NSObject.performSelector_.implement(builder, performSelector_); + NSObject.performSelector_withObject_ + .implement(builder, performSelector_withObject_); + NSObject.performSelector_withObject_withObject_ + .implement(builder, performSelector_withObject_withObject_); + NSObject.isProxy.implement(builder, isProxy); + NSObject.isKindOfClass_.implement(builder, isKindOfClass_); + NSObject.isMemberOfClass_.implement(builder, isMemberOfClass_); + NSObject.conformsToProtocol_.implement(builder, conformsToProtocol_); + NSObject.respondsToSelector_.implement(builder, respondsToSelector_); + NSObject.retain.implement(builder, retain); + NSObject.release.implementAsListener(builder, release); + NSObject.autorelease.implement(builder, autorelease); + NSObject.retainCount.implement(builder, retainCount); + NSObject.zone.implement(builder, zone); + NSObject.hash.implement(builder, hash); + NSObject.superclass.implement(builder, superclass); + NSObject.description.implement(builder, description); + NSObject.debugDescription.implement(builder, debugDescription); + } + + /// isEqual: + static final isEqual_ = + objc.ObjCProtocolMethod( + _sel_isEqual_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isEqual_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.ObjCObjectBase) func) => + ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( + (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), + ); + + /// class + static final class1 = objc.ObjCProtocolMethod( + _sel_class, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_class, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// self + static final self = objc.ObjCProtocolMethod( + _sel_self, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_self, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// performSelector: + static final performSelector_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function(ffi.Pointer)>( + _sel_performSelector_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_performSelector_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function(ffi.Pointer) func) => + ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector.fromFunction( + (ffi.Pointer _, ffi.Pointer arg1) => + func(arg1)), + ); + + /// performSelector:withObject: + static final performSelector_withObject_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase)>( + _sel_performSelector_withObject_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_performSelector_withObject_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function( + ffi.Pointer, objc.ObjCObjectBase) + func) => + ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject + .fromFunction((ffi.Pointer _, + ffi.Pointer arg1, + objc.ObjCObjectBase arg2) => + func(arg1, arg2)), + ); + + /// performSelector:withObject:withObject: + static final performSelector_withObject_withObject_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase)>( + _sel_performSelector_withObject_withObject_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_performSelector_withObject_withObject_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function(ffi.Pointer, + objc.ObjCObjectBase, objc.ObjCObjectBase) + func) => + ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject + .fromFunction((ffi.Pointer _, + ffi.Pointer arg1, + objc.ObjCObjectBase arg2, + objc.ObjCObjectBase arg3) => + func(arg1, arg2, arg3)), + ); + + /// isProxy + static final isProxy = objc.ObjCProtocolMethod( + _sel_isProxy, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isProxy, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// isKindOfClass: + static final isKindOfClass_ = + objc.ObjCProtocolMethod( + _sel_isKindOfClass_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isKindOfClass_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.ObjCObjectBase) func) => + ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( + (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), + ); + + /// isMemberOfClass: + static final isMemberOfClass_ = + objc.ObjCProtocolMethod( + _sel_isMemberOfClass_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_isMemberOfClass_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.ObjCObjectBase) func) => + ObjCBlock_bool_ffiVoid_objcObjCObject.fromFunction( + (ffi.Pointer _, objc.ObjCObjectBase arg1) => func(arg1)), + ); + + /// conformsToProtocol: + static final conformsToProtocol_ = + objc.ObjCProtocolMethod( + _sel_conformsToProtocol_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_conformsToProtocol_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(objc.Protocol) func) => + ObjCBlock_bool_ffiVoid_Protocol.fromFunction( + (ffi.Pointer _, objc.Protocol arg1) => func(arg1)), + ); + + /// respondsToSelector: + static final respondsToSelector_ = + objc.ObjCProtocolMethod)>( + _sel_respondsToSelector_, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_respondsToSelector_, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function(ffi.Pointer) func) => + ObjCBlock_bool_ffiVoid_objcObjCSelector.fromFunction( + (ffi.Pointer _, ffi.Pointer arg1) => + func(arg1)), + ); + + /// retain + static final retain = objc.ObjCProtocolMethod( + _sel_retain, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_retain, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// release + static final release = objc.ObjCProtocolListenableMethod( + _sel_release, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_release, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); + + /// autorelease + static final autorelease = + objc.ObjCProtocolMethod( + _sel_autorelease, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_autorelease, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// retainCount + static final retainCount = objc.ObjCProtocolMethod( + _sel_retainCount, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_retainCount, + isRequired: true, + isInstanceMethod: true, + ), + (DartNSUInteger Function() func) => + ObjCBlock_NSUInteger_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// zone + static final zone = objc.ObjCProtocolMethod Function()>( + _sel_zone, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_zone, + isRequired: true, + isInstanceMethod: true, + ), + (ffi.Pointer<_NSZone> Function() func) => + ObjCBlock_NSZone_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// hash + static final hash = objc.ObjCProtocolMethod( + _sel_hash, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_hash, + isRequired: true, + isInstanceMethod: true, + ), + (DartNSUInteger Function() func) => + ObjCBlock_NSUInteger_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// superclass + static final superclass = + objc.ObjCProtocolMethod( + _sel_superclass, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_superclass, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function() func) => + ObjCBlock_objcObjCObject_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// description + static final description = objc.ObjCProtocolMethod( + _sel_description, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_description, + isRequired: true, + isInstanceMethod: true, + ), + (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// debugDescription + static final debugDescription = + objc.ObjCProtocolMethod( + _sel_debugDescription, + objc.getProtocolMethodSignature( + _protocol_NSObject, + _sel_debugDescription, + isRequired: false, + isInstanceMethod: true, + ), + (objc.NSString Function() func) => ObjCBlock_NSString_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); +} + +late final _protocol_NSObject = objc.getProtocol("NSObject"); +late final _sel_isEqual_ = objc.registerName("isEqual:"); +bool _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrTrampoline, false) + .cast(); +bool _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_objcObjCObject_closureTrampoline, false) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_ffiVoid_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + pointer, + retain: retain, + release: release); - NSObject? propertyForKey_(DartNSStreamPropertyKey key) { - final _ret = - _lib._objc_msgSend_49(_id, _lib._sel_propertyForKey_1, key._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock, ffi.Pointer)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - bool setProperty_forKey_(NSObject? property, DartNSStreamPropertyKey key) { - return _lib._objc_msgSend_350(_id, _lib._sel_setProperty_forKey_1, - property?._id ?? ffi.nullptr, key._id); - } + /// 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. + static objc.ObjCBlock, ffi.Pointer)> + fromFunction( + bool Function(ffi.Pointer, objc.ObjCObjectBase) fn) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_bool_ffiVoid_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.ObjCObjectBase(arg1, retain: true, release: true))), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_bool_ffiVoid_objcObjCObject_CallExtension on objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, ffi.Pointer)> { + bool call(ffi.Pointer arg0, objc.ObjCObjectBase arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} - void scheduleInRunLoop_forMode_(NSRunLoop aRunLoop, DartNSRunLoopMode mode) { - _lib._objc_msgSend_351( - _id, _lib._sel_scheduleInRunLoop_forMode_1, aRunLoop._id, mode._id); - } +late final _sel_class = objc.registerName("class"); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock Function(ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + pointer, + retain: retain, + release: release); - void removeFromRunLoop_forMode_(NSRunLoop aRunLoop, DartNSRunLoopMode mode) { - _lib._objc_msgSend_351( - _id, _lib._sel_removeFromRunLoop_forMode_1, aRunLoop._id, mode._id); - } + /// 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. + static objc.ObjCBlock Function(ffi.Pointer)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock Function(ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - int get streamStatus { - return _lib._objc_msgSend_352(_id, _lib._sel_streamStatus1); - } + /// 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. + static objc + .ObjCBlock Function(ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_CallExtension on objc + .ObjCBlock Function(ffi.Pointer)> { + objc.ObjCObjectBase call(ffi.Pointer arg0) => objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); +} + +typedef instancetype = ffi.Pointer; +typedef Dartinstancetype = objc.ObjCObjectBase; +late final _sel_self = objc.registerName("self"); +late final _sel_performSelector_ = objc.registerName("performSelector:"); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + pointer, + retain: retain, + release: release); - NSError? get streamError { - final _ret = _lib._objc_msgSend_353(_id, _lib._sel_streamError1); - return _ret.address == 0 - ? null - : NSError._(_ret, _lib, retain: true, release: true); - } - - static void getStreamsToHostWithName_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSString hostname, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_357( - _lib._class_NSStream1, - _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, - hostname._id, - port, - inputStream, - outputStream); - } - - static void getStreamsToHost_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSHost host, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_358( - _lib._class_NSStream1, - _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, - host._id, - port, - inputStream, - outputStream); - } - - static void getBoundStreamsWithBufferSize_inputStream_outputStream_( - NativeCupertinoHttp _lib, - DartNSUInteger bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_359( - _lib._class_NSStream1, - _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, - bufferSize, - inputStream, - outputStream); - } + /// 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. + static objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => + objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - @override - NSStream init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSStream._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, arg1).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_CallExtension + on objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)> { + objc.ObjCObjectBase call( + ffi.Pointer arg0, ffi.Pointer arg1) => + objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1), + retain: true, + release: true); +} - static NSStream new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_new1); - return NSStream._(_ret, _lib, retain: false, release: true); - } +late final _sel_performSelector_withObject_ = + objc.registerName("performSelector:withObject:"); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); - static NSStream allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSStream1, _lib._sel_allocWithZone_1, zone); - return NSStream._(_ret, _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. + static objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSStream alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSStream1, _lib._sel_alloc1); - return NSStream._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer, objc.ObjCObjectBase) fn) => + objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn(arg0, arg1, objc.ObjCObjectBase(arg2, retain: true, release: true)) + .ref + .retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_CallExtension + on objc.ObjCBlock< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> { + objc.ObjCObjectBase call(ffi.Pointer arg0, + ffi.Pointer arg1, objc.ObjCObjectBase arg2) => + objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1, arg2.ref.pointer), + retain: true, + release: true); } -typedef NSStreamPropertyKey = ffi.Pointer; -typedef DartNSStreamPropertyKey = NSString; +late final _sel_performSelector_withObject_withObject_ = + objc.registerName("performSelector:withObject:withObject:"); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, retain: retain, release: release); -class NSRunLoop extends _ObjCWrapper { - NSRunLoop._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// 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. + static objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// 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); - } + /// 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. + static objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer, objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn(arg0, arg1, objc.ObjCObjectBase(arg2, retain: true, release: true), objc.ObjCObjectBase(arg3, retain: true, release: true)) + .ref + .retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_objcObjCSelector_objcObjCObject_objcObjCObject_CallExtension + on objc.ObjCBlock< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> { + objc.ObjCObjectBase call( + ffi.Pointer arg0, + ffi.Pointer arg1, + objc.ObjCObjectBase arg2, + objc.ObjCObjectBase arg3) => + objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, arg1, arg2.ref.pointer, arg3.ref.pointer), + retain: true, + release: true); +} - /// Returns a [NSRunLoop] that wraps the given raw object pointer. - static NSRunLoop castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSRunLoop._(other, lib, retain: retain, release: release); - } +late final _sel_isProxy = objc.registerName("isProxy"); +bool _ObjCBlock_bool_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_bool_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_fnPtrTrampoline, false) + .cast(); +bool _ObjCBlock_bool_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as bool Function(ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_bool_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_closureTrampoline, false) + .cast(); + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_bool_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + 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); - } -} + /// 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. + static objc.ObjCBlock)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -typedef NSRunLoopMode = ffi.Pointer; -typedef DartNSRunLoopMode = NSString; + /// 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. + static objc.ObjCBlock)> fromFunction( + bool Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock(_ObjCBlock_bool_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0)), + retain: false, + release: true); +} -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; +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_bool_ffiVoid_CallExtension + on objc.ObjCBlock)> { + bool call(ffi.Pointer arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0); } -class NSOutputStream extends NSStream { - NSOutputStream._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +late final _sel_isKindOfClass_ = objc.registerName("isKindOfClass:"); +late final _sel_isMemberOfClass_ = objc.registerName("isMemberOfClass:"); +late final _sel_conformsToProtocol_ = objc.registerName("conformsToProtocol:"); +bool _ObjCBlock_bool_ffiVoid_Protocol_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_Protocol_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_Protocol_fnPtrTrampoline, false) + .cast(); +bool _ObjCBlock_bool_ffiVoid_Protocol_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_Protocol_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_Protocol_closureTrampoline, false) + .cast(); + +/// Construction methods for `objc.ObjCBlock, objc.Protocol)>`. +abstract final class ObjCBlock_bool_ffiVoid_Protocol { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock, objc.Protocol)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function(ffi.Pointer, + objc.Protocol)>(pointer, 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); - } + /// 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. + static objc.ObjCBlock, objc.Protocol)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.Protocol)>( + objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_Protocol_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns a [NSOutputStream] that wraps the given raw object pointer. - static NSOutputStream castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOutputStream._(other, lib, retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock, objc.Protocol)> + fromFunction(bool Function(ffi.Pointer, objc.Protocol) fn) => + objc.ObjCBlock, objc.Protocol)>( + objc.newClosureBlock( + _ObjCBlock_bool_ffiVoid_Protocol_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn( + arg0, + objc.Protocol.castFromPointer(arg1, + retain: true, release: true))), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, objc.Protocol)>`. +extension ObjCBlock_bool_ffiVoid_Protocol_CallExtension + on objc.ObjCBlock, objc.Protocol)> { + bool call(ffi.Pointer arg0, objc.Protocol arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} - /// 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); - } +late final _sel_respondsToSelector_ = objc.registerName("respondsToSelector:"); +bool _ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrTrampoline, false) + .cast(); +bool _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as bool Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureTrampoline, false) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.Pointer)>`. +abstract final class ObjCBlock_bool_ffiVoid_objcObjCSelector { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + pointer, + retain: retain, + release: release); - DartNSInteger write_maxLength_( - ffi.Pointer buffer, DartNSUInteger len) { - return _lib._objc_msgSend_354( - _id, _lib._sel_write_maxLength_1, buffer, len); - } + /// 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. + static objc.ObjCBlock, ffi.Pointer)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_bool_ffiVoid_objcObjCSelector_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - bool get hasSpaceAvailable { - return _lib._objc_msgSend_11(_id, _lib._sel_hasSpaceAvailable1); - } + /// 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. + static objc + .ObjCBlock, ffi.Pointer)> + fromFunction(bool Function(ffi.Pointer, ffi.Pointer) fn) => + objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_bool_ffiVoid_objcObjCSelector_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, arg1)), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, ffi.Pointer)>`. +extension ObjCBlock_bool_ffiVoid_objcObjCSelector_CallExtension + on objc.ObjCBlock< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)> { + bool call(ffi.Pointer arg0, ffi.Pointer arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, arg1); +} - NSOutputStream initToMemory() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_initToMemory1); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } +late final _sel_retain = objc.registerName("retain"); +late final _sel_release = objc.registerName("release"); +void _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - NSOutputStream initToBuffer_capacity_( - ffi.Pointer buffer, DartNSUInteger capacity) { - final _ret = _lib._objc_msgSend_355( - _id, _lib._sel_initToBuffer_capacity_1, buffer, capacity); - return NSOutputStream._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - NSOutputStream? initWithURL_append_(NSURL url, bool shouldAppend) { - final _ret = _lib._objc_msgSend_356( - _id, _lib._sel_initWithURL_append_1, url._id, shouldAppend); - return _ret.address == 0 - ? null - : NSOutputStream._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock)> fromFunction( + void Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0)), + retain: false, + release: true); - NSOutputStream? initToFileAtPath_append_(NSString path, bool shouldAppend) { - final _ret = _lib._objc_msgSend_51( - _id, _lib._sel_initToFileAtPath_append_1, path._id, shouldAppend); - return _ret.address == 0 - ? null - : NSOutputStream._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock)> listener( + void Function(ffi.Pointer) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0)); + final wrapper = _wrapListenerBlock_hepzs(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock)>(wrapper, + retain: false, release: true); } +} - static NSOutputStream outputStreamToMemory(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSOutputStream1, _lib._sel_outputStreamToMemory1); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_CallExtension + on objc.ObjCBlock)> { + void call(ffi.Pointer arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0); +} - static NSOutputStream outputStreamToBuffer_capacity_(NativeCupertinoHttp _lib, - ffi.Pointer buffer, DartNSUInteger capacity) { - final _ret = _lib._objc_msgSend_355(_lib._class_NSOutputStream1, - _lib._sel_outputStreamToBuffer_capacity_1, buffer, capacity); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } +late final _sel_autorelease = objc.registerName("autorelease"); +typedef NSUInteger = ffi.UnsignedLong; +typedef DartNSUInteger = int; +late final _sel_retainCount = objc.registerName("retainCount"); +int _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi + .NativeFunction arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSUInteger_ffiVoid_fnPtrTrampoline, 0) + .cast(); +int _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as int Function(ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSUInteger_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + NSUInteger Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSUInteger_ffiVoid_closureTrampoline, 0) + .cast(); + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSUInteger_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); - static NSOutputStream outputStreamToFileAtPath_append_( - NativeCupertinoHttp _lib, NSString path, bool shouldAppend) { - final _ret = _lib._objc_msgSend_41(_lib._class_NSOutputStream1, - _lib._sel_outputStreamToFileAtPath_append_1, path._id, shouldAppend); - return NSOutputStream._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock< + ffi.UnsignedLong Function(ffi.Pointer)> fromFunctionPointer( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_NSUInteger_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSOutputStream? outputStreamWithURL_append_( - NativeCupertinoHttp _lib, NSURL url, bool shouldAppend) { - final _ret = _lib._objc_msgSend_356(_lib._class_NSOutputStream1, - _lib._sel_outputStreamWithURL_append_1, url._id, shouldAppend); - return _ret.address == 0 - ? null - : NSOutputStream._(_ret, _lib, retain: true, release: true); - } - - static void getStreamsToHostWithName_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSString hostname, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_357( - _lib._class_NSOutputStream1, - _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, - hostname._id, - port, - inputStream, - outputStream); - } - - static void getStreamsToHost_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSHost host, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_358( - _lib._class_NSOutputStream1, - _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, - host._id, - port, - inputStream, - outputStream); - } - - static void getBoundStreamsWithBufferSize_inputStream_outputStream_( - NativeCupertinoHttp _lib, - DartNSUInteger bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_359( - _lib._class_NSOutputStream1, - _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, - bufferSize, - inputStream, - outputStream); - } + /// 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. + static objc.ObjCBlock)> + fromFunction(DartNSUInteger Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSUInteger_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0)), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSUInteger_ffiVoid_CallExtension + on objc.ObjCBlock)> { + DartNSUInteger call(ffi.Pointer arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0); +} - @override - NSOutputStream init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOutputStream._(_ret, _lib, retain: true, release: true); - } +final class _NSZone extends ffi.Opaque {} - static NSOutputStream new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_new1); - return NSOutputStream._(_ret, _lib, retain: false, release: true); - } +late final _sel_zone = objc.registerName("zone"); +ffi.Pointer<_NSZone> _ObjCBlock_NSZone_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer<_NSZone> Function(ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer<_NSZone> Function(ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSZone_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer<_NSZone> Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSZone_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer<_NSZone> _ObjCBlock_NSZone_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer<_NSZone> Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSZone_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer<_NSZone> Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSZone_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(ffi.Pointer)>`. +abstract final class ObjCBlock_NSZone_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock Function(ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock Function(ffi.Pointer)>( + pointer, + retain: retain, + release: release); - static NSOutputStream allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOutputStream1, _lib._sel_allocWithZone_1, zone); - return NSOutputStream._(_ret, _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. + static objc.ObjCBlock Function(ffi.Pointer)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer<_NSZone> Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock Function(ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_NSZone_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSOutputStream alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOutputStream1, _lib._sel_alloc1); - return NSOutputStream._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock Function(ffi.Pointer)> + fromFunction(ffi.Pointer<_NSZone> Function(ffi.Pointer) fn) => + objc.ObjCBlock Function(ffi.Pointer)>( + objc.newClosureBlock(_ObjCBlock_NSZone_ffiVoid_closureCallable, + (ffi.Pointer arg0) => fn(arg0)), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock Function(ffi.Pointer)>`. +extension ObjCBlock_NSZone_ffiVoid_CallExtension + on objc.ObjCBlock Function(ffi.Pointer)> { + ffi.Pointer<_NSZone> call(ffi.Pointer arg0) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer<_NSZone> Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer<_NSZone> Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0); } -class NSHost extends _ObjCWrapper { - NSHost._(ffi.Pointer id, NativeCupertinoHttp 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); - } +late final _sel_hash = objc.registerName("hash"); +late final _sel_superclass = objc.registerName("superclass"); +late final _sel_description = objc.registerName("description"); +ffi.Pointer _ObjCBlock_NSString_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSString_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSString_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer _ObjCBlock_NSString_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSString_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSString_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSString_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - /// Returns a [NSHost] that wraps the given raw object pointer. - static NSHost castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSHost._(other, lib, retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_NSString_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// 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); - } + /// 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. + static objc.ObjCBlock)> + fromFunction(objc.NSString Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSString_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSString_ffiVoid_CallExtension + on objc.ObjCBlock)> { + objc.NSString call(ffi.Pointer arg0) => + objc.NSString.castFromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); } -class NSDate extends NSObject { - NSDate._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +late final _sel_debugDescription = objc.registerName("debugDescription"); +typedef va_list = __builtin_va_list; +typedef __builtin_va_list = ffi.Pointer; +typedef NSInteger = ffi.Long; +typedef DartNSInteger = int; - /// 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); - } +@ffi.Packed(2) +final class wide extends ffi.Struct { + @UInt32() + external int lo; - /// Returns a [NSDate] that wraps the given raw object pointer. - static NSDate castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDate._(other, lib, retain: retain, release: release); - } + @SInt32() + external int hi; +} - /// 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); - } +typedef UInt32 = ffi.UnsignedInt; +typedef DartUInt32 = int; +typedef SInt32 = ffi.Int; +typedef DartSInt32 = int; - DartNSTimeInterval get timeIntervalSinceReferenceDate { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret( - _id, _lib._sel_timeIntervalSinceReferenceDate1) - : _lib._objc_msgSend_90(_id, _lib._sel_timeIntervalSinceReferenceDate1); - } +@ffi.Packed(2) +final class UnsignedWide extends ffi.Struct { + @UInt32() + external int lo; - @override - NSDate init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @UInt32() + external int hi; +} - NSDate initWithTimeIntervalSinceReferenceDate_(DartNSTimeInterval ti) { - final _ret = _lib._objc_msgSend_366( - _id, _lib._sel_initWithTimeIntervalSinceReferenceDate_1, ti); - return NSDate._(_ret, _lib, retain: true, release: true); - } +final class Float80 extends ffi.Struct { + @SInt16() + external int exp; - NSDate? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } + @ffi.Array.multi([4]) + external ffi.Array man; +} - DartNSTimeInterval timeIntervalSinceDate_(NSDate anotherDate) { - return _lib._objc_msgSend_367( - _id, _lib._sel_timeIntervalSinceDate_1, anotherDate._id); - } +typedef SInt16 = ffi.Short; +typedef DartSInt16 = int; +typedef UInt16 = ffi.UnsignedShort; +typedef DartUInt16 = int; - DartNSTimeInterval get timeIntervalSinceNow { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_timeIntervalSinceNow1) - : _lib._objc_msgSend_90(_id, _lib._sel_timeIntervalSinceNow1); - } +final class Float96 extends ffi.Struct { + @ffi.Array.multi([2]) + external ffi.Array exp; - DartNSTimeInterval get timeIntervalSince1970 { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_timeIntervalSince19701) - : _lib._objc_msgSend_90(_id, _lib._sel_timeIntervalSince19701); - } + @ffi.Array.multi([4]) + external ffi.Array man; +} - NSObject addTimeInterval_(DartNSTimeInterval seconds) { - final _ret = - _lib._objc_msgSend_366(_id, _lib._sel_addTimeInterval_1, seconds); - return NSObject._(_ret, _lib, retain: true, release: true); - } +@ffi.Packed(2) +final class Float32Point extends ffi.Struct { + @Float32() + external double x; - NSDate dateByAddingTimeInterval_(DartNSTimeInterval ti) { - final _ret = - _lib._objc_msgSend_366(_id, _lib._sel_dateByAddingTimeInterval_1, ti); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @Float32() + external double y; +} - NSDate earlierDate_(NSDate anotherDate) { - final _ret = - _lib._objc_msgSend_368(_id, _lib._sel_earlierDate_1, anotherDate._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } +typedef Float32 = ffi.Float; +typedef DartFloat32 = double; - NSDate laterDate_(NSDate anotherDate) { - final _ret = - _lib._objc_msgSend_368(_id, _lib._sel_laterDate_1, anotherDate._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } +@ffi.Packed(2) +final class ProcessSerialNumber extends ffi.Struct { + @UInt32() + external int highLongOfPSN; - int compare_(NSDate other) { - return _lib._objc_msgSend_369(_id, _lib._sel_compare_1, other._id); - } + @UInt32() + external int lowLongOfPSN; +} - bool isEqualToDate_(NSDate otherDate) { - return _lib._objc_msgSend_370( - _id, _lib._sel_isEqualToDate_1, otherDate._id); - } +final class Point extends ffi.Struct { + @ffi.Short() + external int v; - NSString get description { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_description1); - return NSString._(_ret, _lib, retain: true, release: true); - } + @ffi.Short() + external int h; +} - NSString descriptionWithLocale_(NSObject? locale) { - final _ret = _lib._objc_msgSend_93( - _id, _lib._sel_descriptionWithLocale_1, locale?._id ?? ffi.nullptr); - return NSString._(_ret, _lib, retain: true, release: true); - } +final class Rect extends ffi.Struct { + @ffi.Short() + external int top; - static NSDate date(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_date1); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @ffi.Short() + external int left; - static NSDate dateWithTimeIntervalSinceNow_( - NativeCupertinoHttp _lib, DartNSTimeInterval secs) { - final _ret = _lib._objc_msgSend_366( - _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSinceNow_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @ffi.Short() + external int bottom; - static NSDate dateWithTimeIntervalSinceReferenceDate_( - NativeCupertinoHttp _lib, DartNSTimeInterval ti) { - final _ret = _lib._objc_msgSend_366(_lib._class_NSDate1, - _lib._sel_dateWithTimeIntervalSinceReferenceDate_1, ti); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @ffi.Short() + external int right; +} - static NSDate dateWithTimeIntervalSince1970_( - NativeCupertinoHttp _lib, DartNSTimeInterval secs) { - final _ret = _lib._objc_msgSend_366( - _lib._class_NSDate1, _lib._sel_dateWithTimeIntervalSince1970_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } +@ffi.Packed(2) +final class FixedPoint extends ffi.Struct { + @Fixed() + external int x; - static NSDate dateWithTimeInterval_sinceDate_( - NativeCupertinoHttp _lib, DartNSTimeInterval secsToBeAdded, NSDate date) { - final _ret = _lib._objc_msgSend_371(_lib._class_NSDate1, - _lib._sel_dateWithTimeInterval_sinceDate_1, secsToBeAdded, date._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @Fixed() + external int y; +} - static NSDate getDistantFuture(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_372(_lib._class_NSDate1, _lib._sel_distantFuture1); - return NSDate._(_ret, _lib, retain: true, release: true); - } +typedef Fixed = SInt32; - static NSDate getDistantPast(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_372(_lib._class_NSDate1, _lib._sel_distantPast1); - return NSDate._(_ret, _lib, retain: true, release: true); - } +@ffi.Packed(2) +final class FixedRect extends ffi.Struct { + @Fixed() + external int left; - static NSDate getNow(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_372(_lib._class_NSDate1, _lib._sel_now1); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @Fixed() + external int top; - NSDate initWithTimeIntervalSinceNow_(DartNSTimeInterval secs) { - final _ret = _lib._objc_msgSend_366( - _id, _lib._sel_initWithTimeIntervalSinceNow_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @Fixed() + external int right; - NSDate initWithTimeIntervalSince1970_(DartNSTimeInterval secs) { - final _ret = _lib._objc_msgSend_366( - _id, _lib._sel_initWithTimeIntervalSince1970_1, secs); - return NSDate._(_ret, _lib, retain: true, release: true); - } + @Fixed() + external int bottom; +} - NSDate initWithTimeInterval_sinceDate_( - DartNSTimeInterval secsToBeAdded, NSDate date) { - final _ret = _lib._objc_msgSend_371(_id, - _lib._sel_initWithTimeInterval_sinceDate_1, secsToBeAdded, date._id); - return NSDate._(_ret, _lib, retain: true, release: true); - } +final class TimeBaseRecord extends ffi.Opaque {} - static NSDate new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_new1); - return NSDate._(_ret, _lib, retain: false, release: true); - } +@ffi.Packed(2) +final class TimeRecord extends ffi.Struct { + external CompTimeValue value; - static NSDate allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSDate1, _lib._sel_allocWithZone_1, zone); - return NSDate._(_ret, _lib, retain: false, release: true); - } + @TimeScale() + external int scale; - static NSDate alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSDate1, _lib._sel_alloc1); - return NSDate._(_ret, _lib, retain: false, release: true); - } + external TimeBase base; } -class NSURLSessionDataTask extends NSURLSessionTask { - NSURLSessionDataTask._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +typedef CompTimeValue = wide; +typedef TimeScale = SInt32; +typedef TimeBase = ffi.Pointer; - /// 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); - } +final class NumVersion extends ffi.Struct { + @UInt8() + external int nonRelRev; - /// Returns a [NSURLSessionDataTask] that wraps the given raw object pointer. - static NSURLSessionDataTask castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionDataTask._(other, lib, retain: retain, release: release); - } + @UInt8() + external int stage; - /// 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); - } + @UInt8() + external int minorAndBugRev; - @override - NSURLSessionDataTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } + @UInt8() + external int majorRev; +} - static NSURLSessionDataTask new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSessionDataTask1, _lib._sel_new1); - return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); - } +typedef UInt8 = ffi.UnsignedChar; +typedef DartUInt8 = int; - static NSURLSessionDataTask allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionDataTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); - } +final class NumVersionVariant extends ffi.Union { + external NumVersion parts; - static NSURLSessionDataTask alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionDataTask1, _lib._sel_alloc1); - return NSURLSessionDataTask._(_ret, _lib, retain: false, release: true); - } + @UInt32() + external int whole; } -/// NSURLSessionTask - a cancelable object that refers to the lifetime -/// of processing a given request. -class NSURLSessionTask extends NSObject { - NSURLSessionTask._(ffi.Pointer id, NativeCupertinoHttp 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); - } +final class VersRec extends ffi.Struct { + external NumVersion numericVersion; - /// Returns a [NSURLSessionTask] that wraps the given raw object pointer. - static NSURLSessionTask castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionTask._(other, lib, retain: retain, release: release); - } + @ffi.Short() + external int countryCode; - /// 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); - } + @ffi.Array.multi([256]) + external ffi.Array shortVersion; - /// an identifier for this task, assigned by and unique to the owning session - DartNSUInteger get taskIdentifier { - return _lib._objc_msgSend_12(_id, _lib._sel_taskIdentifier1); - } + @ffi.Array.multi([256]) + external ffi.Array reserved; +} - /// may be nil if this is a stream task - NSURLRequest? get originalRequest { - final _ret = _lib._objc_msgSend_374(_id, _lib._sel_originalRequest1); - return _ret.address == 0 - ? null - : NSURLRequest._(_ret, _lib, retain: true, release: true); - } +typedef ConstStr255Param = ffi.Pointer; - /// may differ from originalRequest due to http server redirection - NSURLRequest? get currentRequest { - final _ret = _lib._objc_msgSend_374(_id, _lib._sel_currentRequest1); - return _ret.address == 0 - ? null - : NSURLRequest._(_ret, _lib, retain: true, release: true); - } +final class __CFString extends ffi.Opaque {} - /// may be nil if no response has been received - NSURLResponse? get response { - final _ret = _lib._objc_msgSend_375(_id, _lib._sel_response1); - return _ret.address == 0 - ? null - : NSURLResponse._(_ret, _lib, retain: true, release: true); - } +typedef CFIndex = ffi.Long; +typedef DartCFIndex = int; - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - NSObject? get delegate { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } +final class CFRange extends ffi.Struct { + @CFIndex() + external int location; - /// Sets a task-specific delegate. Methods not implemented on this delegate will - /// still be forwarded to the session delegate. - /// - /// Cannot be modified after task resumes. Not supported on background session. - /// - /// Delegate is strongly referenced until the task completes, after which it is - /// reset to `nil`. - set delegate(NSObject? value) { - return _lib._objc_msgSend_349( - _id, _lib._sel_setDelegate_1, value?._id ?? ffi.nullptr); - } + @CFIndex() + external int length; +} - /// NSProgress object which represents the task progress. - /// It can be used for task progress tracking. - NSProgress get progress { - final _ret = _lib._objc_msgSend_392(_id, _lib._sel_progress1); - return NSProgress._(_ret, _lib, retain: true, release: true); - } +final class __CFNull extends ffi.Opaque {} - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - NSDate? get earliestBeginDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_earliestBeginDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } +typedef CFTypeID = ffi.UnsignedLong; +typedef DartCFTypeID = int; +typedef CFNullRef = ffi.Pointer<__CFNull>; - /// Start the network load for this task no earlier than the specified date. If - /// not specified, no start delay is used. - /// - /// Only applies to tasks created from background NSURLSession instances; has no - /// effect for tasks created from other session types. - set earliestBeginDate(NSDate? value) { - return _lib._objc_msgSend_394( - _id, _lib._sel_setEarliestBeginDate_1, value?._id ?? ffi.nullptr); - } +final class __CFAllocator extends ffi.Opaque {} - /// The number of bytes that the client expects (a best-guess upper-bound) will - /// be sent and received by this task. These values are used by system scheduling - /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. - int get countOfBytesClientExpectsToSend { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfBytesClientExpectsToSend1); - } +typedef CFAllocatorRef = ffi.Pointer<__CFAllocator>; - /// The number of bytes that the client expects (a best-guess upper-bound) will - /// be sent and received by this task. These values are used by system scheduling - /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. - set countOfBytesClientExpectsToSend(int value) { - return _lib._objc_msgSend_384( - _id, _lib._sel_setCountOfBytesClientExpectsToSend_1, value); - } +final class CFAllocatorContext extends ffi.Struct { + @CFIndex() + external int version; - int get countOfBytesClientExpectsToReceive { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfBytesClientExpectsToReceive1); - } + external ffi.Pointer info; - set countOfBytesClientExpectsToReceive(int value) { - return _lib._objc_msgSend_384( - _id, _lib._sel_setCountOfBytesClientExpectsToReceive_1, value); - } + external CFAllocatorRetainCallBack retain; - /// number of body bytes already sent - int get countOfBytesSent { - return _lib._objc_msgSend_383(_id, _lib._sel_countOfBytesSent1); - } + external CFAllocatorReleaseCallBack release; - /// number of body bytes already received - int get countOfBytesReceived { - return _lib._objc_msgSend_383(_id, _lib._sel_countOfBytesReceived1); - } + external CFAllocatorCopyDescriptionCallBack copyDescription; - /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request - int get countOfBytesExpectedToSend { - return _lib._objc_msgSend_383(_id, _lib._sel_countOfBytesExpectedToSend1); - } + external CFAllocatorAllocateCallBack allocate; - /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. - int get countOfBytesExpectedToReceive { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfBytesExpectedToReceive1); - } + external CFAllocatorReallocateCallBack reallocate; - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - NSString? get taskDescription { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_taskDescription1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + external CFAllocatorDeallocateCallBack deallocate; - /// The taskDescription property is available for the developer to - /// provide a descriptive label for the task. - set taskDescription(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setTaskDescription_1, value?._id ?? ffi.nullptr); - } + external CFAllocatorPreferredSizeCallBack preferredSize; +} - /// -cancel returns immediately, but marks a task as being canceled. - /// The task will signal -URLSession:task:didCompleteWithError: with an - /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some - /// cases, the task may signal other work before it acknowledges the - /// cancelation. -cancel may be sent to a task that has been suspended. - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); - } +typedef CFAllocatorRetainCallBack + = ffi.Pointer>; +typedef CFAllocatorRetainCallBackFunction = ffi.Pointer Function( + ffi.Pointer info); +typedef CFAllocatorReleaseCallBack + = ffi.Pointer>; +typedef CFAllocatorReleaseCallBackFunction = ffi.Void Function( + ffi.Pointer info); +typedef DartCFAllocatorReleaseCallBackFunction = void Function( + ffi.Pointer info); +typedef CFAllocatorCopyDescriptionCallBack = ffi + .Pointer>; +typedef CFAllocatorCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer info); +typedef CFStringRef = ffi.Pointer<__CFString>; +typedef CFAllocatorAllocateCallBack + = ffi.Pointer>; +typedef CFAllocatorAllocateCallBackFunction = ffi.Pointer Function( + CFIndex allocSize, CFOptionFlags hint, ffi.Pointer info); +typedef DartCFAllocatorAllocateCallBackFunction + = ffi.Pointer Function(DartCFIndex allocSize, + DartCFOptionFlags hint, ffi.Pointer info); +typedef CFOptionFlags = ffi.UnsignedLong; +typedef DartCFOptionFlags = int; +typedef CFAllocatorReallocateCallBack + = ffi.Pointer>; +typedef CFAllocatorReallocateCallBackFunction = ffi.Pointer Function( + ffi.Pointer ptr, + CFIndex newsize, + CFOptionFlags hint, + ffi.Pointer info); +typedef DartCFAllocatorReallocateCallBackFunction + = ffi.Pointer Function( + ffi.Pointer ptr, + DartCFIndex newsize, + DartCFOptionFlags hint, + ffi.Pointer info); +typedef CFAllocatorDeallocateCallBack + = ffi.Pointer>; +typedef CFAllocatorDeallocateCallBackFunction = ffi.Void Function( + ffi.Pointer ptr, ffi.Pointer info); +typedef DartCFAllocatorDeallocateCallBackFunction = void Function( + ffi.Pointer ptr, ffi.Pointer info); +typedef CFAllocatorPreferredSizeCallBack + = ffi.Pointer>; +typedef CFAllocatorPreferredSizeCallBackFunction = CFIndex Function( + CFIndex size, CFOptionFlags hint, ffi.Pointer info); +typedef DartCFAllocatorPreferredSizeCallBackFunction = DartCFIndex Function( + DartCFIndex size, DartCFOptionFlags hint, ffi.Pointer info); +typedef CFTypeRef = ffi.Pointer; +typedef Boolean = ffi.UnsignedChar; +typedef DartBoolean = int; +typedef CFHashCode = ffi.UnsignedLong; +typedef DartCFHashCode = int; +typedef NSZone = _NSZone; - /// The current state of the task within the session. - int get state { - return _lib._objc_msgSend_396(_id, _lib._sel_state1); - } +/// NSCopying +abstract final class NSCopying { + /// Builds an object that implements the NSCopying protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required objc.ObjCObjectBase Function(ffi.Pointer) + copyWithZone_}) { + final builder = objc.ObjCProtocolBuilder(); + NSCopying.copyWithZone_.implement(builder, copyWithZone_); + return builder.build(); + } + + /// Adds the implementation of the NSCopying protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required objc.ObjCObjectBase Function(ffi.Pointer) + copyWithZone_}) { + NSCopying.copyWithZone_.implement(builder, copyWithZone_); + } + + /// copyWithZone: + static final copyWithZone_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function(ffi.Pointer)>( + _sel_copyWithZone_, + objc.getProtocolMethodSignature( + _protocol_NSCopying, + _sel_copyWithZone_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function(ffi.Pointer) func) => + ObjCBlock_objcObjCObject_ffiVoid_NSZone.fromFunction( + (ffi.Pointer _, ffi.Pointer arg1) => func(arg1)), + ); +} + +late final _protocol_NSCopying = objc.getProtocol("NSCopying"); +late final _sel_copyWithZone_ = objc.registerName("copyWithZone:"); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock> Function(ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_objcObjCObject_ffiVoid_NSZone { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + objc.Retained> Function( + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + objc.Retained> Function( + ffi.Pointer, ffi.Pointer)>(pointer, + retain: retain, release: release); - /// The error, if any, delivered via -URLSession:task:didCompleteWithError: - /// This property will be nil in the event that no error occurred. - NSError? get error { - final _ret = _lib._objc_msgSend_353(_id, _lib._sel_error1); - return _ret.address == 0 - ? null - : NSError._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock< + objc.Retained> Function( + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => + objc.ObjCBlock< + objc.Retained> Function( + ffi.Pointer, ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_objcObjCObject_ffiVoid_NSZone_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Suspending a task will prevent the NSURLSession from continuing to - /// load data. There may still be delegate calls made on behalf of - /// this task (for instance, to report data received while suspending) - /// but no further transmissions will be made on behalf of the task - /// until -resume is sent. The timeout timer associated with the task - /// will be disabled while a task is suspended. -suspend and -resume are - /// nestable. - void suspend() { - _lib._objc_msgSend_1(_id, _lib._sel_suspend1); - } + /// 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. + static objc + .ObjCBlock> Function(ffi.Pointer, ffi.Pointer)> + fromFunction(objc.ObjCObjectBase Function(ffi.Pointer, ffi.Pointer) fn) => + objc.ObjCBlock< + objc.Retained> Function( + ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_objcObjCObject_ffiVoid_NSZone_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, arg1).ref.retainAndReturnPointer()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock> Function(ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_objcObjCObject_ffiVoid_NSZone_CallExtension + on objc.ObjCBlock< + objc.Retained> Function( + ffi.Pointer, ffi.Pointer)> { + objc.ObjCObjectBase call( + ffi.Pointer arg0, ffi.Pointer arg1) => + objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, arg1), + retain: false, + release: true); +} - void resume() { - _lib._objc_msgSend_1(_id, _lib._sel_resume1); - } +/// NSMutableCopying +abstract final class NSMutableCopying { + /// Builds an object that implements the NSMutableCopying protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required objc.ObjCObjectBase Function(ffi.Pointer) + mutableCopyWithZone_}) { + final builder = objc.ObjCProtocolBuilder(); + NSMutableCopying.mutableCopyWithZone_ + .implement(builder, mutableCopyWithZone_); + return builder.build(); + } + + /// Adds the implementation of the NSMutableCopying protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required objc.ObjCObjectBase Function(ffi.Pointer) + mutableCopyWithZone_}) { + NSMutableCopying.mutableCopyWithZone_ + .implement(builder, mutableCopyWithZone_); + } + + /// mutableCopyWithZone: + static final mutableCopyWithZone_ = objc.ObjCProtocolMethod< + objc.ObjCObjectBase Function(ffi.Pointer)>( + _sel_mutableCopyWithZone_, + objc.getProtocolMethodSignature( + _protocol_NSMutableCopying, + _sel_mutableCopyWithZone_, + isRequired: true, + isInstanceMethod: true, + ), + (objc.ObjCObjectBase Function(ffi.Pointer) func) => + ObjCBlock_objcObjCObject_ffiVoid_NSZone.fromFunction( + (ffi.Pointer _, ffi.Pointer arg1) => func(arg1)), + ); +} + +late final _protocol_NSMutableCopying = objc.getProtocol("NSMutableCopying"); +late final _sel_mutableCopyWithZone_ = + objc.registerName("mutableCopyWithZone:"); + +/// NSCoding +abstract final class NSCoding { + /// Builds an object that implements the NSCoding protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + final builder = objc.ObjCProtocolBuilder(); + NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + return builder.build(); + } + + /// Adds the implementation of the NSCoding protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + NSCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + } + + /// Builds an object that implements the NSCoding protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + final builder = objc.ObjCProtocolBuilder(); + NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + return builder.build(); + } + + /// Adds the implementation of the NSCoding protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + NSCoding.encodeWithCoder_.implementAsListener(builder, encodeWithCoder_); + NSCoding.initWithCoder_.implement(builder, initWithCoder_); + } + + /// encodeWithCoder: + static final encodeWithCoder_ = + objc.ObjCProtocolListenableMethod( + _sel_encodeWithCoder_, + objc.getProtocolMethodSignature( + _protocol_NSCoding, + _sel_encodeWithCoder_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSCoder) func) => + ObjCBlock_ffiVoid_ffiVoid_NSCoder.fromFunction( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + (void Function(objc.NSCoder) func) => + ObjCBlock_ffiVoid_ffiVoid_NSCoder.listener( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + ); + + /// initWithCoder: + static final initWithCoder_ = + objc.ObjCProtocolMethod( + _sel_initWithCoder_, + objc.getProtocolMethodSignature( + _protocol_NSCoding, + _sel_initWithCoder_, + isRequired: true, + isInstanceMethod: true, + ), + (Dartinstancetype? Function(objc.NSCoder) func) => + ObjCBlock_instancetype_ffiVoid_NSCoder.fromFunction( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + ); +} + +late final _protocol_NSCoding = objc.getProtocol("NSCoding"); +late final _sel_encodeWithCoder_ = objc.registerName("encodeWithCoder:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSCoder)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSCoder { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock, objc.NSCoder)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + objc.NSCoder)>(pointer, retain: retain, release: release); - /// Sets a scaling factor for the priority of the task. The scaling factor is a - /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest - /// priority and 1.0 is considered the highest. + /// Creates a block from a C function pointer. /// - /// The priority is a hint and not a hard requirement of task performance. The - /// priority of a task may be changed using this API at any time, but not all - /// protocols support this; in these cases, the last priority that took effect - /// will be used. + /// 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. + static objc.ObjCBlock, objc.NSCoder)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.NSCoder)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. /// - /// If no priority is specified, the task will operate with the default priority - /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional - /// priority levels are provided: NSURLSessionTaskPriorityLow and - /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. - double get priority { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_89_fpret(_id, _lib._sel_priority1) - : _lib._objc_msgSend_89(_id, _lib._sel_priority1); - } + /// 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. + static objc.ObjCBlock, objc.NSCoder)> + fromFunction(void Function(ffi.Pointer, objc.NSCoder) fn) => + objc.ObjCBlock, objc.NSCoder)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn( + arg0, + objc.NSCoder.castFromPointer(arg1, + retain: true, release: true))), + retain: false, + release: true); - /// Sets a scaling factor for the priority of the task. The scaling factor is a - /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest - /// priority and 1.0 is considered the highest. + /// Creates a listener block from a Dart function. /// - /// The priority is a hint and not a hard requirement of task performance. The - /// priority of a task may be changed using this API at any time, but not all - /// protocols support this; in these cases, the last priority that took effect - /// will be used. + /// 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. /// - /// If no priority is specified, the task will operate with the default priority - /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional - /// priority levels are provided: NSURLSessionTaskPriorityLow and - /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. - set priority(double value) { - return _lib._objc_msgSend_397(_id, _lib._sel_setPriority_1, value); + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock, objc.NSCoder)> + listener(void Function(ffi.Pointer, objc.NSCoder) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSCoder_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + objc.NSCoder.castFromPointer(arg1, retain: false, release: true))); + final wrapper = _wrapListenerBlock_sjfpmz(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSCoder)>(wrapper, + retain: false, release: true); } +} - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. +/// Call operator for `objc.ObjCBlock, objc.NSCoder)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSCoder_CallExtension + on objc.ObjCBlock, objc.NSCoder)> { + void call(ffi.Pointer arg0, objc.NSCoder arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} + +late final _sel_initWithCoder_ = objc.registerName("initWithCoder:"); +instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable = + ffi.Pointer.fromFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrTrampoline) + .cast(); +instancetype _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as instancetype Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable = + ffi.Pointer.fromFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_instancetype_ffiVoid_NSCoder_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. +abstract final class ObjCBlock_instancetype_ffiVoid_NSCoder { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + objc.Retained?> Function( + ffi.Pointer, + objc.NSCoder)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - bool get prefersIncrementalDelivery { - return _lib._objc_msgSend_11(_id, _lib._sel_prefersIncrementalDelivery1); - } + /// 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. + static objc.ObjCBlock< + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1)>> ptr) => + objc.ObjCBlock< + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)>( + objc.newPointerBlock( + _ObjCBlock_instancetype_ffiVoid_NSCoder_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Provides a hint indicating if incremental delivery of a partial response body - /// would be useful for the application, or if it cannot process the response - /// until it is complete. Indicating that incremental delivery is not desired may - /// improve task performance. For example, if a response cannot be decoded until - /// the entire content is received, set this property to false. + /// Creates a block from a Dart function. /// - /// Defaults to true unless this task is created with completion-handler based - /// convenience methods, or if it is a download task. - set prefersIncrementalDelivery(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setPrefersIncrementalDelivery_1, value); - } + /// 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. + static objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)> fromFunction( + Dartinstancetype? Function(ffi.Pointer, objc.NSCoder) fn) => + objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>( + objc.newClosureBlock( + _ObjCBlock_instancetype_ffiVoid_NSCoder_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.NSCoder.castFromPointer(arg1, retain: true, release: true)) + ?.ref + .retainAndReturnPointer() ?? + ffi.nullptr), + retain: false, + release: true); +} - @override - NSURLSessionTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionTask._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock?> Function(ffi.Pointer, objc.NSCoder)>`. +extension ObjCBlock_instancetype_ffiVoid_NSCoder_CallExtension + on objc.ObjCBlock< + objc.Retained?> Function( + ffi.Pointer, objc.NSCoder)> { + Dartinstancetype? call(ffi.Pointer arg0, objc.NSCoder arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction, ffi.Pointer, ffi.Pointer)>() + (ref.pointer, arg0, arg1.ref.pointer) + .address == + 0 + ? null + : objc.ObjCObjectBase( + ref.pointer.ref.invoke + .cast block, ffi.Pointer arg0, ffi.Pointer arg1)>>() + .asFunction, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer), + retain: false, + release: true); +} - static NSURLSessionTask new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_new1); - return NSURLSessionTask._(_ret, _lib, retain: false, release: true); - } +/// NSSecureCoding +abstract final class NSSecureCoding { + /// Builds an object that implements the NSSecureCoding protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required bool Function() supportsSecureCoding, + required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + final builder = objc.ObjCProtocolBuilder(); + NSSecureCoding.supportsSecureCoding + .implement(builder, supportsSecureCoding); + NSSecureCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); + NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); + return builder.build(); + } + + /// Adds the implementation of the NSSecureCoding protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required bool Function() supportsSecureCoding, + required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + NSSecureCoding.supportsSecureCoding + .implement(builder, supportsSecureCoding); + NSSecureCoding.encodeWithCoder_.implement(builder, encodeWithCoder_); + NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); + } + + /// Builds an object that implements the NSSecureCoding protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required bool Function() supportsSecureCoding, + required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + final builder = objc.ObjCProtocolBuilder(); + NSSecureCoding.supportsSecureCoding + .implement(builder, supportsSecureCoding); + NSSecureCoding.encodeWithCoder_ + .implementAsListener(builder, encodeWithCoder_); + NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); + return builder.build(); + } + + /// Adds the implementation of the NSSecureCoding protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required bool Function() supportsSecureCoding, + required void Function(objc.NSCoder) encodeWithCoder_, + required Dartinstancetype? Function(objc.NSCoder) initWithCoder_}) { + NSSecureCoding.supportsSecureCoding + .implement(builder, supportsSecureCoding); + NSSecureCoding.encodeWithCoder_ + .implementAsListener(builder, encodeWithCoder_); + NSSecureCoding.initWithCoder_.implement(builder, initWithCoder_); + } + + /// supportsSecureCoding + static final supportsSecureCoding = objc.ObjCProtocolMethod( + _sel_supportsSecureCoding, + objc.getProtocolMethodSignature( + _protocol_NSSecureCoding, + _sel_supportsSecureCoding, + isRequired: true, + isInstanceMethod: false, + ), + (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// encodeWithCoder: + static final encodeWithCoder_ = + objc.ObjCProtocolListenableMethod( + _sel_encodeWithCoder_, + objc.getProtocolMethodSignature( + _protocol_NSSecureCoding, + _sel_encodeWithCoder_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSCoder) func) => + ObjCBlock_ffiVoid_ffiVoid_NSCoder.fromFunction( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + (void Function(objc.NSCoder) func) => + ObjCBlock_ffiVoid_ffiVoid_NSCoder.listener( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + ); + + /// initWithCoder: + static final initWithCoder_ = + objc.ObjCProtocolMethod( + _sel_initWithCoder_, + objc.getProtocolMethodSignature( + _protocol_NSSecureCoding, + _sel_initWithCoder_, + isRequired: true, + isInstanceMethod: true, + ), + (Dartinstancetype? Function(objc.NSCoder) func) => + ObjCBlock_instancetype_ffiVoid_NSCoder.fromFunction( + (ffi.Pointer _, objc.NSCoder arg1) => func(arg1)), + ); +} + +late final _protocol_NSSecureCoding = objc.getProtocol("NSSecureCoding"); +late final _sel_supportsSecureCoding = + objc.registerName("supportsSecureCoding"); + +/// NSDiscardableContent +abstract final class NSDiscardableContent { + /// Builds an object that implements the NSDiscardableContent protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required bool Function() beginContentAccess, + required void Function() endContentAccess, + required void Function() discardContentIfPossible, + required bool Function() isContentDiscarded}) { + final builder = objc.ObjCProtocolBuilder(); + NSDiscardableContent.beginContentAccess + .implement(builder, beginContentAccess); + NSDiscardableContent.endContentAccess.implement(builder, endContentAccess); + NSDiscardableContent.discardContentIfPossible + .implement(builder, discardContentIfPossible); + NSDiscardableContent.isContentDiscarded + .implement(builder, isContentDiscarded); + return builder.build(); + } + + /// Adds the implementation of the NSDiscardableContent protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required bool Function() beginContentAccess, + required void Function() endContentAccess, + required void Function() discardContentIfPossible, + required bool Function() isContentDiscarded}) { + NSDiscardableContent.beginContentAccess + .implement(builder, beginContentAccess); + NSDiscardableContent.endContentAccess.implement(builder, endContentAccess); + NSDiscardableContent.discardContentIfPossible + .implement(builder, discardContentIfPossible); + NSDiscardableContent.isContentDiscarded + .implement(builder, isContentDiscarded); + } + + /// Builds an object that implements the NSDiscardableContent protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required bool Function() beginContentAccess, + required void Function() endContentAccess, + required void Function() discardContentIfPossible, + required bool Function() isContentDiscarded}) { + final builder = objc.ObjCProtocolBuilder(); + NSDiscardableContent.beginContentAccess + .implement(builder, beginContentAccess); + NSDiscardableContent.endContentAccess + .implementAsListener(builder, endContentAccess); + NSDiscardableContent.discardContentIfPossible + .implementAsListener(builder, discardContentIfPossible); + NSDiscardableContent.isContentDiscarded + .implement(builder, isContentDiscarded); + return builder.build(); + } + + /// Adds the implementation of the NSDiscardableContent protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required bool Function() beginContentAccess, + required void Function() endContentAccess, + required void Function() discardContentIfPossible, + required bool Function() isContentDiscarded}) { + NSDiscardableContent.beginContentAccess + .implement(builder, beginContentAccess); + NSDiscardableContent.endContentAccess + .implementAsListener(builder, endContentAccess); + NSDiscardableContent.discardContentIfPossible + .implementAsListener(builder, discardContentIfPossible); + NSDiscardableContent.isContentDiscarded + .implement(builder, isContentDiscarded); + } + + /// beginContentAccess + static final beginContentAccess = objc.ObjCProtocolMethod( + _sel_beginContentAccess, + objc.getProtocolMethodSignature( + _protocol_NSDiscardableContent, + _sel_beginContentAccess, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); + + /// endContentAccess + static final endContentAccess = + objc.ObjCProtocolListenableMethod( + _sel_endContentAccess, + objc.getProtocolMethodSignature( + _protocol_NSDiscardableContent, + _sel_endContentAccess, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); + + /// discardContentIfPossible + static final discardContentIfPossible = + objc.ObjCProtocolListenableMethod( + _sel_discardContentIfPossible, + objc.getProtocolMethodSignature( + _protocol_NSDiscardableContent, + _sel_discardContentIfPossible, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); + + /// isContentDiscarded + static final isContentDiscarded = objc.ObjCProtocolMethod( + _sel_isContentDiscarded, + objc.getProtocolMethodSignature( + _protocol_NSDiscardableContent, + _sel_isContentDiscarded, + isRequired: true, + isInstanceMethod: true, + ), + (bool Function() func) => ObjCBlock_bool_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); +} + +late final _protocol_NSDiscardableContent = + objc.getProtocol("NSDiscardableContent"); +late final _sel_beginContentAccess = objc.registerName("beginContentAccess"); +late final _sel_endContentAccess = objc.registerName("endContentAccess"); +late final _sel_discardContentIfPossible = + objc.registerName("discardContentIfPossible"); +late final _sel_isContentDiscarded = objc.registerName("isContentDiscarded"); + +/// NSURLCache +class NSURLCache extends objc.NSObject { + NSURLCache._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - static NSURLSessionTask allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionTask._(_ret, _lib, retain: false, release: true); - } + /// Constructs a [NSURLCache] that points to the same underlying object as [other]. + NSURLCache.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - static NSURLSessionTask alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSessionTask1, _lib._sel_alloc1); - return NSURLSessionTask._(_ret, _lib, retain: false, release: true); + /// Constructs a [NSURLCache] that wraps the given raw object pointer. + NSURLCache.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLCache]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCache); } -} -class NSProgress extends NSObject { - NSProgress._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// ! + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///

    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static NSURLCache getSharedURLCache() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLCache, _sel_sharedURLCache); + return NSURLCache.castFromPointer(_ret, retain: true, release: true); + } - /// 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); + /// ! + /// @property sharedURLCache + /// @abstract Returns the shared NSURLCache instance or + /// sets the NSURLCache instance shared by all clients of + /// the current process. This will be the new object returned when + /// calls to the sharedURLCache method are made. + /// @discussion Unless set explicitly through a call to + /// +setSharedURLCache:, this method returns an NSURLCache + /// instance created with the following default values: + ///

    + ///
  • Memory capacity: 4 megabytes (4 * 1024 * 1024 bytes) + ///
  • Disk capacity: 20 megabytes (20 * 1024 * 1024 bytes) + ///
  • Disk path: (user home directory)/Library/Caches/(application bundle id) + ///
+ ///

Users who do not have special caching requirements or + /// constraints should find the default shared cache instance + /// acceptable. If this default shared cache instance is not + /// acceptable, +setSharedURLCache: can be called to set a + /// different NSURLCache instance to be returned from this method. + /// Callers should take care to ensure that the setter is called + /// at a time when no other caller has a reference to the previously-set + /// shared URL cache. This is to prevent storing cache data from + /// becoming unexpectedly unretrievable. + /// @result the shared NSURLCache instance. + static void setSharedURLCache(NSURLCache value) { + return _objc_msgSend_ukcdfq( + _class_NSURLCache, _sel_setSharedURLCache_, value.ref.pointer); } - /// Returns a [NSProgress] that wraps the given raw object pointer. - static NSProgress castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSProgress._(other, lib, retain: retain, release: release); + /// ! + /// @method initWithMemoryCapacity:diskCapacity:diskPath: + /// @abstract Initializes an NSURLCache with the given capacity and + /// path. + /// @discussion The returned NSURLCache is backed by disk, so + /// developers can be more liberal with space when choosing the + /// capacity for this kind of cache. A disk cache measured in the tens + /// of megabytes should be acceptable in most cases. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. + /// @param path the path on disk where the cache data is stored. + /// @result an initialized NSURLCache, with the given capacity, backed + /// by disk. + NSURLCache initWithMemoryCapacity_diskCapacity_diskPath_( + DartNSUInteger memoryCapacity, + DartNSUInteger diskCapacity, + objc.NSString? path) { + final _ret = _objc_msgSend_ebb7er( + this.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_diskPath_, + memoryCapacity, + diskCapacity, + path?.ref.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - /// 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); + /// ! + /// @method initWithMemoryCapacity:diskCapacity:directoryURL: + /// @abstract Initializes an NSURLCache with the given capacity and directory. + /// @param memoryCapacity the capacity, measured in bytes, for the cache in memory. Or 0 to disable memory cache. + /// @param diskCapacity the capacity, measured in bytes, for the cache on disk. Or 0 to disable disk cache. + /// @param directoryURL the path to a directory on disk where the cache data is stored. Or nil for default directory. + /// @result an initialized NSURLCache, with the given capacity, optionally backed by disk. + NSURLCache initWithMemoryCapacity_diskCapacity_directoryURL_( + DartNSUInteger memoryCapacity, + DartNSUInteger diskCapacity, + objc.NSURL? directoryURL) { + final _ret = _objc_msgSend_ebb7er( + this.ref.retainAndReturnPointer(), + _sel_initWithMemoryCapacity_diskCapacity_directoryURL_, + memoryCapacity, + diskCapacity, + directoryURL?.ref.pointer ?? ffi.nullptr); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - static NSProgress? currentProgress(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_376( - _lib._class_NSProgress1, _lib._sel_currentProgress1); + /// ! + /// @method cachedResponseForRequest: + /// @abstract Returns the NSCachedURLResponse stored in the cache with + /// the given request. + /// @discussion The method returns nil if there is no + /// NSCachedURLResponse stored using the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + /// @result The NSCachedURLResponse stored in the cache with the given + /// request, or nil if there is no NSCachedURLResponse stored with the + /// given request. + NSCachedURLResponse? cachedResponseForRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_cachedResponseForRequest_, request.ref.pointer); return _ret.address == 0 ? null - : NSProgress._(_ret, _lib, retain: true, release: true); - } - - static NSProgress progressWithTotalUnitCount_( - NativeCupertinoHttp _lib, int unitCount) { - final _ret = _lib._objc_msgSend_377(_lib._class_NSProgress1, - _lib._sel_progressWithTotalUnitCount_1, unitCount); - return NSProgress._(_ret, _lib, retain: true, release: true); + : NSCachedURLResponse.castFromPointer(_ret, + retain: true, release: true); } - static NSProgress discreteProgressWithTotalUnitCount_( - NativeCupertinoHttp _lib, int unitCount) { - final _ret = _lib._objc_msgSend_377(_lib._class_NSProgress1, - _lib._sel_discreteProgressWithTotalUnitCount_1, unitCount); - return NSProgress._(_ret, _lib, retain: true, release: true); + /// ! + /// @method storeCachedResponse:forRequest: + /// @abstract Stores the given NSCachedURLResponse in the cache using + /// the given request. + /// @param cachedResponse The cached response to store. + /// @param request the NSURLRequest to use as a key for the storage. + void storeCachedResponse_forRequest_( + NSCachedURLResponse cachedResponse, NSURLRequest request) { + _objc_msgSend_1tjlcwl( + this.ref.pointer, + _sel_storeCachedResponse_forRequest_, + cachedResponse.ref.pointer, + request.ref.pointer); } - static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( - NativeCupertinoHttp _lib, - int unitCount, - NSProgress parent, - int portionOfParentTotalUnitCount) { - final _ret = _lib._objc_msgSend_378( - _lib._class_NSProgress1, - _lib._sel_progressWithTotalUnitCount_parent_pendingUnitCount_1, - unitCount, - parent._id, - portionOfParentTotalUnitCount); - return NSProgress._(_ret, _lib, retain: true, release: true); + /// ! + /// @method removeCachedResponseForRequest: + /// @abstract Removes the NSCachedURLResponse from the cache that is + /// stored using the given request. + /// @discussion No action is taken if there is no NSCachedURLResponse + /// stored with the given request. + /// @param request the NSURLRequest to use as a key for the lookup. + void removeCachedResponseForRequest_(NSURLRequest request) { + _objc_msgSend_ukcdfq(this.ref.pointer, _sel_removeCachedResponseForRequest_, + request.ref.pointer); } - NSProgress initWithParent_userInfo_( - NSProgress? parentProgressOrNil, NSDictionary? userInfoOrNil) { - final _ret = _lib._objc_msgSend_379( - _id, - _lib._sel_initWithParent_userInfo_1, - parentProgressOrNil?._id ?? ffi.nullptr, - userInfoOrNil?._id ?? ffi.nullptr); - return NSProgress._(_ret, _lib, retain: true, release: true); + /// ! + /// @method removeAllCachedResponses + /// @abstract Clears the given cache, removing all NSCachedURLResponse + /// objects that it stores. + void removeAllCachedResponses() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_removeAllCachedResponses); } - void becomeCurrentWithPendingUnitCount_(int unitCount) { - _lib._objc_msgSend_380( - _id, _lib._sel_becomeCurrentWithPendingUnitCount_1, unitCount); + /// ! + /// @method removeCachedResponsesSince: + /// @abstract Clears the given cache of any cached responses since the provided date. + void removeCachedResponsesSinceDate_(objc.NSDate date) { + _objc_msgSend_ukcdfq(this.ref.pointer, _sel_removeCachedResponsesSinceDate_, + date.ref.pointer); } - void performAsCurrentWithPendingUnitCount_usingBlock_( - int unitCount, ObjCBlock_ffiVoid work) { - _lib._objc_msgSend_381( - _id, - _lib._sel_performAsCurrentWithPendingUnitCount_usingBlock_1, - unitCount, - work._id); + /// ! + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + DartNSUInteger get memoryCapacity { + return _objc_msgSend_eldhrq(this.ref.pointer, _sel_memoryCapacity); } - void resignCurrent() { - _lib._objc_msgSend_1(_id, _lib._sel_resignCurrent1); + /// ! + /// @abstract In-memory capacity of the receiver. + /// @discussion At the time this call is made, the in-memory cache will truncate its contents to the size given, if necessary. + /// @result The in-memory capacity, measured in bytes, for the receiver. + set memoryCapacity(DartNSUInteger value) { + return _objc_msgSend_1k4zaz5( + this.ref.pointer, _sel_setMemoryCapacity_, value); } - void addChild_withPendingUnitCount_(NSProgress child, int inUnitCount) { - _lib._objc_msgSend_382( - _id, _lib._sel_addChild_withPendingUnitCount_1, child._id, inUnitCount); + /// ! + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + DartNSUInteger get diskCapacity { + return _objc_msgSend_eldhrq(this.ref.pointer, _sel_diskCapacity); } - int get totalUnitCount { - return _lib._objc_msgSend_383(_id, _lib._sel_totalUnitCount1); + /// ! + /// @abstract The on-disk capacity of the receiver. + /// @discussion The on-disk capacity, measured in bytes, for the receiver. On mutation the on-disk cache will truncate its contents to the size given, if necessary. + set diskCapacity(DartNSUInteger value) { + return _objc_msgSend_1k4zaz5( + this.ref.pointer, _sel_setDiskCapacity_, value); } - set totalUnitCount(int value) { - return _lib._objc_msgSend_384(_id, _lib._sel_setTotalUnitCount_1, value); + /// ! + /// @abstract Returns the current amount of space consumed by the + /// in-memory cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the in-memory cache. + /// @result the current usage of the in-memory cache of the receiver. + DartNSUInteger get currentMemoryUsage { + return _objc_msgSend_eldhrq(this.ref.pointer, _sel_currentMemoryUsage); } - int get completedUnitCount { - return _lib._objc_msgSend_383(_id, _lib._sel_completedUnitCount1); + /// ! + /// @abstract Returns the current amount of space consumed by the + /// on-disk cache of the receiver. + /// @discussion This size, measured in bytes, indicates the current + /// usage of the on-disk cache. + /// @result the current usage of the on-disk cache of the receiver. + DartNSUInteger get currentDiskUsage { + return _objc_msgSend_eldhrq(this.ref.pointer, _sel_currentDiskUsage); } - set completedUnitCount(int value) { - return _lib._objc_msgSend_384( - _id, _lib._sel_setCompletedUnitCount_1, value); + /// storeCachedResponse:forDataTask: + void storeCachedResponse_forDataTask_( + NSCachedURLResponse cachedResponse, NSURLSessionDataTask dataTask) { + _objc_msgSend_1tjlcwl( + this.ref.pointer, + _sel_storeCachedResponse_forDataTask_, + cachedResponse.ref.pointer, + dataTask.ref.pointer); } - NSString get localizedDescription { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_localizedDescription1); - return NSString._(_ret, _lib, retain: true, release: true); + /// getCachedResponseForDataTask:completionHandler: + void getCachedResponseForDataTask_completionHandler_( + NSURLSessionDataTask dataTask, + objc.ObjCBlock + completionHandler) { + _objc_msgSend_cmbt6k( + this.ref.pointer, + _sel_getCachedResponseForDataTask_completionHandler_, + dataTask.ref.pointer, + completionHandler.ref.pointer); } - set localizedDescription(NSString value) { - return _lib._objc_msgSend_385( - _id, _lib._sel_setLocalizedDescription_1, value._id); + /// removeCachedResponseForDataTask: + void removeCachedResponseForDataTask_(NSURLSessionDataTask dataTask) { + _objc_msgSend_ukcdfq(this.ref.pointer, + _sel_removeCachedResponseForDataTask_, dataTask.ref.pointer); } - NSString get localizedAdditionalDescription { + /// init + NSURLCache init() { final _ret = - _lib._objc_msgSend_32(_id, _lib._sel_localizedAdditionalDescription1); - return NSString._(_ret, _lib, retain: true, release: true); + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - set localizedAdditionalDescription(NSString value) { - return _lib._objc_msgSend_385( - _id, _lib._sel_setLocalizedAdditionalDescription_1, value._id); + /// new + static NSURLCache new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLCache, _sel_new); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); } - bool get cancellable { - return _lib._objc_msgSend_11(_id, _lib._sel_isCancellable1); - } - - set cancellable(bool value) { - return _lib._objc_msgSend_386(_id, _lib._sel_setCancellable_1, value); - } + /// allocWithZone: + static NSURLCache allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSURLCache, _sel_allocWithZone_, zone); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLCache alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLCache, _sel_alloc); + return NSURLCache.castFromPointer(_ret, retain: false, release: true); + } +} + +late final _class_NSURLCache = objc.getClass("NSURLCache"); +late final _sel_sharedURLCache = objc.registerName("sharedURLCache"); +final _objc_msgSend_1unuoxw = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setSharedURLCache_ = objc.registerName("setSharedURLCache:"); +final _objc_msgSend_ukcdfq = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithMemoryCapacity_diskCapacity_diskPath_ = + objc.registerName("initWithMemoryCapacity:diskCapacity:diskPath:"); +final _objc_msgSend_ebb7er = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer)>(); +late final _sel_initWithMemoryCapacity_diskCapacity_directoryURL_ = + objc.registerName("initWithMemoryCapacity:diskCapacity:directoryURL:"); - bool get pausable { - return _lib._objc_msgSend_11(_id, _lib._sel_isPausable1); - } +/// ! +/// @class NSCachedURLResponse +/// NSCachedURLResponse is a class whose objects functions as a wrapper for +/// objects that are stored in the framework's caching system. +/// It is used to maintain characteristics and attributes of a cached +/// object. +class NSCachedURLResponse extends objc.NSObject { + NSCachedURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - set pausable(bool value) { - return _lib._objc_msgSend_386(_id, _lib._sel_setPausable_1, value); - } + /// Constructs a [NSCachedURLResponse] that points to the same underlying object as [other]. + NSCachedURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - bool get cancelled { - return _lib._objc_msgSend_11(_id, _lib._sel_isCancelled1); - } + /// Constructs a [NSCachedURLResponse] that wraps the given raw object pointer. + NSCachedURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - bool get paused { - return _lib._objc_msgSend_11(_id, _lib._sel_isPaused1); + /// Returns whether [obj] is an instance of [NSCachedURLResponse]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSCachedURLResponse); } - ObjCBlock_ffiVoid? get cancellationHandler { - final _ret = _lib._objc_msgSend_387(_id, _lib._sel_cancellationHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); + /// ! + /// @method initWithResponse:data + /// @abstract Initializes an NSCachedURLResponse with the given + /// response and data. + /// @discussion A default NSURLCacheStoragePolicy is used for + /// NSCachedURLResponse objects initialized with this method: + /// NSURLCacheStorageAllowed. + /// @param response a NSURLResponse object. + /// @param data an NSData object representing the URL content + /// corresponding to the given response. + /// @result an initialized NSCachedURLResponse. + NSCachedURLResponse initWithResponse_data_( + NSURLResponse response, objc.NSData data) { + final _ret = _objc_msgSend_iq11qg(this.ref.retainAndReturnPointer(), + _sel_initWithResponse_data_, response.ref.pointer, data.ref.pointer); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); } - set cancellationHandler(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_388( - _id, _lib._sel_setCancellationHandler_1, value?._id ?? ffi.nullptr); + /// ! + /// @method initWithResponse:data:userInfo:storagePolicy: + /// @abstract Initializes an NSCachedURLResponse with the given + /// response, data, user-info dictionary, and storage policy. + /// @param response a NSURLResponse object. + /// @param data an NSData object representing the URL content + /// corresponding to the given response. + /// @param userInfo a dictionary user-specified information to be + /// stored with the NSCachedURLResponse. + /// @param storagePolicy an NSURLCacheStoragePolicy constant. + /// @result an initialized NSCachedURLResponse. + NSCachedURLResponse initWithResponse_data_userInfo_storagePolicy_( + NSURLResponse response, + objc.NSData data, + objc.NSDictionary? userInfo, + NSURLCacheStoragePolicy storagePolicy) { + final _ret = _objc_msgSend_nhp99d( + this.ref.retainAndReturnPointer(), + _sel_initWithResponse_data_userInfo_storagePolicy_, + response.ref.pointer, + data.ref.pointer, + userInfo?.ref.pointer ?? ffi.nullptr, + storagePolicy.value); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); } - ObjCBlock_ffiVoid? get pausingHandler { - final _ret = _lib._objc_msgSend_387(_id, _lib._sel_pausingHandler1); - return _ret.address == 0 - ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); + /// ! + /// @abstract Returns the response wrapped by this instance. + /// @result The response wrapped by this instance. + NSURLResponse get response { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_response); + return NSURLResponse.castFromPointer(_ret, retain: true, release: true); } - set pausingHandler(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_388( - _id, _lib._sel_setPausingHandler_1, value?._id ?? ffi.nullptr); + /// ! + /// @abstract Returns the data of the receiver. + /// @result The data of the receiver. + objc.NSData get data { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); + return objc.NSData.castFromPointer(_ret, retain: true, release: true); } - ObjCBlock_ffiVoid? get resumingHandler { - final _ret = _lib._objc_msgSend_387(_id, _lib._sel_resumingHandler1); + /// ! + /// @abstract Returns the userInfo dictionary of the receiver. + /// @result The userInfo dictionary of the receiver. + objc.NSDictionary? get userInfo { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); return _ret.address == 0 ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); - } - - set resumingHandler(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_388( - _id, _lib._sel_setResumingHandler_1, value?._id ?? ffi.nullptr); - } - - void setUserInfoObject_forKey_( - NSObject? objectOrNil, DartNSProgressUserInfoKey key) { - _lib._objc_msgSend_196(_id, _lib._sel_setUserInfoObject_forKey_1, - objectOrNil?._id ?? ffi.nullptr, key._id); - } - - bool get indeterminate { - return _lib._objc_msgSend_11(_id, _lib._sel_isIndeterminate1); - } - - double get fractionCompleted { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_fractionCompleted1) - : _lib._objc_msgSend_90(_id, _lib._sel_fractionCompleted1); + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - bool get finished { - return _lib._objc_msgSend_11(_id, _lib._sel_isFinished1); + /// ! + /// @abstract Returns the NSURLCacheStoragePolicy constant of the receiver. + /// @result The NSURLCacheStoragePolicy constant of the receiver. + NSURLCacheStoragePolicy get storagePolicy { + final _ret = _objc_msgSend_1xh4qg4(this.ref.pointer, _sel_storagePolicy); + return NSURLCacheStoragePolicy.fromValue(_ret); } - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + /// init + NSCachedURLResponse init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); } - void pause() { - _lib._objc_msgSend_1(_id, _lib._sel_pause1); + /// new + static NSCachedURLResponse new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSCachedURLResponse, _sel_new); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); } - void resume() { - _lib._objc_msgSend_1(_id, _lib._sel_resume1); + /// allocWithZone: + static NSCachedURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSCachedURLResponse, _sel_allocWithZone_, zone); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); } - NSDictionary get userInfo { - final _ret = _lib._objc_msgSend_187(_id, _lib._sel_userInfo1); - return NSDictionary._(_ret, _lib, retain: true, release: true); + /// alloc + static NSCachedURLResponse alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSCachedURLResponse, _sel_alloc); + return NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); } - DartNSProgressKind get kind { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_kind1); - return NSString._(_ret, _lib, retain: true, release: true); + /// supportsSecureCoding + static bool supportsSecureCoding() { + return _objc_msgSend_olxnu1( + _class_NSCachedURLResponse, _sel_supportsSecureCoding); } - set kind(DartNSProgressKind value) { - return _lib._objc_msgSend_385(_id, _lib._sel_setKind_1, value._id); + /// encodeWithCoder: + void encodeWithCoder_(objc.NSCoder coder) { + _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); } - NSNumber? get estimatedTimeRemaining { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_estimatedTimeRemaining1); + /// initWithCoder: + NSCachedURLResponse? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); return _ret.address == 0 ? null - : NSNumber._(_ret, _lib, retain: true, release: true); + : NSCachedURLResponse.castFromPointer(_ret, + retain: false, release: true); } +} - set estimatedTimeRemaining(NSNumber? value) { - return _lib._objc_msgSend_389( - _id, _lib._sel_setEstimatedTimeRemaining_1, value?._id ?? ffi.nullptr); - } +late final _class_NSCachedURLResponse = objc.getClass("NSCachedURLResponse"); - NSNumber? get throughput { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_throughput1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } +/// NSURLResponse +class NSURLResponse extends objc.NSObject { + NSURLResponse._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - set throughput(NSNumber? value) { - return _lib._objc_msgSend_389( - _id, _lib._sel_setThroughput_1, value?._id ?? ffi.nullptr); - } + /// Constructs a [NSURLResponse] that points to the same underlying object as [other]. + NSURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - DartNSProgressFileOperationKind get fileOperationKind { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_fileOperationKind1); - return NSString._(_ret, _lib, retain: true, release: true); + /// Constructs a [NSURLResponse] that wraps the given raw object pointer. + NSURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLResponse]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLResponse); } - set fileOperationKind(DartNSProgressFileOperationKind value) { - return _lib._objc_msgSend_385( - _id, _lib._sel_setFileOperationKind_1, value._id); + /// ! + /// @method initWithURL:MIMEType:expectedContentLength:textEncodingName: + /// @abstract Initialize an NSURLResponse with the provided values. + /// @param URL the URL + /// @param MIMEType the MIME content type of the response + /// @param length the expected content length of the associated data + /// @param name the name of the text encoding for the associated data, if applicable, else nil + /// @result The initialized NSURLResponse. + /// @discussion This is the designated initializer for NSURLResponse. + NSURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( + objc.NSURL URL, + objc.NSString? MIMEType, + DartNSInteger length, + objc.NSString? name) { + final _ret = _objc_msgSend_eyseqq( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.ref.pointer, + MIMEType?.ref.pointer ?? ffi.nullptr, + length, + name?.ref.pointer ?? ffi.nullptr); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } - NSURL? get fileURL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_fileURL1); + /// ! + /// @abstract Returns the URL of the receiver. + /// @result The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URL); return _ret.address == 0 ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - set fileURL(NSURL? value) { - return _lib._objc_msgSend_390( - _id, _lib._sel_setFileURL_1, value?._id ?? ffi.nullptr); + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } - NSNumber? get fileTotalCount { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_fileTotalCount1); + /// ! + /// @abstract Returns the MIME type of the receiver. + /// @discussion The MIME type is based on the information provided + /// from an origin source. However, that value may be changed or + /// corrected by a protocol implementation if it can be determined + /// that the origin server or source reported the information + /// incorrectly or imprecisely. An attempt to guess the MIME type may + /// be made if the origin source did not report any such information. + /// @result The MIME type of the receiver. + objc.NSString? get MIMEType { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_MIMEType); return _ret.address == 0 ? null - : NSNumber._(_ret, _lib, retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - set fileTotalCount(NSNumber? value) { - return _lib._objc_msgSend_389( - _id, _lib._sel_setFileTotalCount_1, value?._id ?? ffi.nullptr); + /// ! + /// @abstract Returns the expected content length of the receiver. + /// @discussion Some protocol implementations report a content length + /// as part of delivering load metadata, but not all protocols + /// guarantee the amount of data that will be delivered in actuality. + /// Hence, this method returns an expected amount. Clients should use + /// this value as an advisory, and should be prepared to deal with + /// either more or less data. + /// @result The expected content length of the receiver, or -1 if + /// there is no expectation that can be arrived at regarding expected + /// content length. + int get expectedContentLength { + return _objc_msgSend_e94jsr(this.ref.pointer, _sel_expectedContentLength); } - NSNumber? get fileCompletedCount { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_fileCompletedCount1); + /// ! + /// @abstract Returns the name of the text encoding of the receiver. + /// @discussion This name will be the actual string reported by the + /// origin source during the course of performing a protocol-specific + /// URL load. Clients can inspect this string and convert it to an + /// NSStringEncoding or CFStringEncoding using the methods and + /// functions made available in the appropriate framework. + /// @result The name of the text encoding of the receiver, or nil if no + /// text encoding was specified. + objc.NSString? get textEncodingName { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_textEncodingName); return _ret.address == 0 ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - set fileCompletedCount(NSNumber? value) { - return _lib._objc_msgSend_389( - _id, _lib._sel_setFileCompletedCount_1, value?._id ?? ffi.nullptr); - } - - void publish() { - _lib._objc_msgSend_1(_id, _lib._sel_publish1); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - void unpublish() { - _lib._objc_msgSend_1(_id, _lib._sel_unpublish1); - } - - static NSObject addSubscriberForFileURL_withPublishingHandler_( - NativeCupertinoHttp _lib, - NSURL url, - DartNSProgressPublishingHandler publishingHandler) { - final _ret = _lib._objc_msgSend_391( - _lib._class_NSProgress1, - _lib._sel_addSubscriberForFileURL_withPublishingHandler_1, - url._id, - publishingHandler._id); - return NSObject._(_ret, _lib, retain: true, release: true); + /// ! + /// @abstract Returns a suggested filename if the resource were saved to disk. + /// @discussion The method first checks if the server has specified a filename using the + /// content disposition header. If no valid filename is specified using that mechanism, + /// this method checks the last path component of the URL. If no valid filename can be + /// obtained using the last path component, this method uses the URL's host as the filename. + /// If the URL's host can't be converted to a valid filename, the filename "unknown" is used. + /// In most cases, this method appends the proper file extension based on the MIME type. + /// This method always returns a valid filename. + /// @result A suggested filename to use if saving the resource to disk. + objc.NSString? get suggestedFilename { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_suggestedFilename); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - static void removeSubscriber_(NativeCupertinoHttp _lib, NSObject subscriber) { - _lib._objc_msgSend_210( - _lib._class_NSProgress1, _lib._sel_removeSubscriber_1, subscriber._id); + /// init + NSURLResponse init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } - bool get old { - return _lib._objc_msgSend_11(_id, _lib._sel_isOld1); + /// new + static NSURLResponse new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLResponse, _sel_new); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } - @override - NSProgress init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSProgress._(_ret, _lib, retain: true, release: true); + /// allocWithZone: + static NSURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSURLResponse, _sel_allocWithZone_, zone); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } - static NSProgress new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_new1); - return NSProgress._(_ret, _lib, retain: false, release: true); + /// alloc + static NSURLResponse alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLResponse, _sel_alloc); + return NSURLResponse.castFromPointer(_ret, retain: false, release: true); } - static NSProgress allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSProgress1, _lib._sel_allocWithZone_1, zone); - return NSProgress._(_ret, _lib, retain: false, release: true); + /// supportsSecureCoding + static bool supportsSecureCoding() { + return _objc_msgSend_olxnu1( + _class_NSURLResponse, _sel_supportsSecureCoding); } - static NSProgress alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSProgress1, _lib._sel_alloc1); - return NSProgress._(_ret, _lib, retain: false, release: true); + /// encodeWithCoder: + void encodeWithCoder_(objc.NSCoder coder) { + _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); } -} -typedef NSProgressUserInfoKey = ffi.Pointer; -typedef DartNSProgressUserInfoKey = NSString; -typedef NSProgressKind = ffi.Pointer; -typedef DartNSProgressKind = NSString; -typedef NSProgressFileOperationKind = ffi.Pointer; -typedef DartNSProgressFileOperationKind = NSString; -typedef NSProgressPublishingHandler = ffi.Pointer<_ObjCBlock>; -typedef DartNSProgressPublishingHandler - = ObjCBlock_NSProgressUnpublishingHandler_NSProgress; -NSProgressUnpublishingHandler - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer arg0)>>() - .asFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer)>()(arg0); -final _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureRegistry = - )>{}; -int _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_registerClosure( - NSProgressUnpublishingHandler Function(ffi.Pointer) fn) { - final id = - ++_ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureRegistryIndex; - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -NSProgressUnpublishingHandler - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSProgressUnpublishingHandler_NSProgress - extends _ObjCBlockBase { - ObjCBlock_NSProgressUnpublishingHandler_NSProgress._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_NSProgressUnpublishingHandler_NSProgress.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_NSProgressUnpublishingHandler_NSProgress.fromFunction( - NativeCupertinoHttp lib, - DartNSProgressUnpublishingHandler Function(NSProgress) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) - .cast(), - _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_registerClosure( - (ffi.Pointer arg0) => - fn(NSProgress._(arg0, lib, retain: true, release: true)) - ._retainAndReturnId())), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - DartNSProgressUnpublishingHandler call(NSProgress arg0) => - ObjCBlock_ffiVoid._( - _id.ref.invoke - .cast< - ffi.NativeFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - NSProgressUnpublishingHandler Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} - -typedef NSProgressUnpublishingHandler = ffi.Pointer<_ObjCBlock>; -typedef DartNSProgressUnpublishingHandler = ObjCBlock_ffiVoid; - -abstract class NSURLSessionTaskState { - /// The task is currently being serviced by the session - static const int NSURLSessionTaskStateRunning = 0; - static const int NSURLSessionTaskStateSuspended = 1; - - /// The task has been told to cancel. The session will receive a URLSession:task:didCompleteWithError: message. - static const int NSURLSessionTaskStateCanceling = 2; - - /// The task has completed and the session will receive no more delegate notifications - static const int NSURLSessionTaskStateCompleted = 3; -} - -void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSCachedURLResponse extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSCachedURLResponse._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi - .Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + /// initWithCoder: + NSURLResponse? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSURLResponse.castFromPointer(_ret, retain: false, release: true); + } +} + +late final _class_NSURLResponse = objc.getClass("NSURLResponse"); +late final _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_ = + objc.registerName( + "initWithURL:MIMEType:expectedContentLength:textEncodingName:"); +final _objc_msgSend_eyseqq = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_URL = objc.registerName("URL"); +late final _sel_MIMEType = objc.registerName("MIMEType"); +late final _sel_expectedContentLength = + objc.registerName("expectedContentLength"); +final _objc_msgSend_e94jsr = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.LongLong Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_textEncodingName = objc.registerName("textEncodingName"); +late final _sel_suggestedFilename = objc.registerName("suggestedFilename"); +late final _sel_init = objc.registerName("init"); +late final _sel_new = objc.registerName("new"); +late final _sel_allocWithZone_ = objc.registerName("allocWithZone:"); +final _objc_msgSend_1b3ihd0 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer<_NSZone>)>(); +late final _sel_alloc = objc.registerName("alloc"); +final _objc_msgSend_olxnu1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_juohf7 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_initWithResponse_data_ = + objc.registerName("initWithResponse:data:"); +final _objc_msgSend_iq11qg = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); - /// 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. - ObjCBlock_ffiVoid_NSCachedURLResponse.fromFunction( - NativeCupertinoHttp lib, void Function(NSCachedURLResponse?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSCachedURLResponse._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +/// ! +/// @enum NSURLCacheStoragePolicy +/// +/// @discussion The NSURLCacheStoragePolicy enum defines constants that +/// can be used to specify the type of storage that is allowable for an +/// NSCachedURLResponse object that is to be stored in an NSURLCache. +/// +/// @constant NSURLCacheStorageAllowed Specifies that storage in an +/// NSURLCache is allowed without restriction. +/// +/// @constant NSURLCacheStorageAllowedInMemoryOnly Specifies that +/// storage in an NSURLCache is allowed; however storage should be +/// done in memory only, no disk storage should be done. +/// +/// @constant NSURLCacheStorageNotAllowed Specifies that storage in an +/// NSURLCache is not allowed in any fashion, either in memory or on +/// disk. +enum NSURLCacheStoragePolicy { + NSURLCacheStorageAllowed(0), + NSURLCacheStorageAllowedInMemoryOnly(1), + NSURLCacheStorageNotAllowed(2); + + final int value; + const NSURLCacheStoragePolicy(this.value); + + static NSURLCacheStoragePolicy fromValue(int value) => switch (value) { + 0 => NSURLCacheStorageAllowed, + 1 => NSURLCacheStorageAllowedInMemoryOnly, + 2 => NSURLCacheStorageNotAllowed, + _ => throw ArgumentError( + "Unknown value for NSURLCacheStoragePolicy: $value"), + }; +} + +late final _sel_initWithResponse_data_userInfo_storagePolicy_ = + objc.registerName("initWithResponse:data:userInfo:storagePolicy:"); +final _objc_msgSend_nhp99d = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_response = objc.registerName("response"); +late final _sel_data = objc.registerName("data"); +late final _sel_userInfo = objc.registerName("userInfo"); +late final _sel_storagePolicy = objc.registerName("storagePolicy"); +final _objc_msgSend_1xh4qg4 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); + +/// NSURLRequest +class NSURLRequest extends objc.NSObject { + NSURLRequest._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// 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. - ObjCBlock_ffiVoid_NSCachedURLResponse.listener( - NativeCupertinoHttp lib, void Function(NSCachedURLResponse?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSCachedURLResponse_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSCachedURLResponse._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSCachedURLResponse? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} + /// Constructs a [NSURLRequest] that points to the same underlying object as [other]. + NSURLRequest.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -class NSNotification extends NSObject { - NSNotification._(ffi.Pointer id, NativeCupertinoHttp lib, + /// Constructs a [NSURLRequest] that wraps the given raw object pointer. + NSURLRequest.castFromPointer(ffi.Pointer other, {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); - } + : this._(other, retain: retain, release: release); - /// Returns a [NSNotification] that wraps the given raw object pointer. - static NSNotification castFromPointer( - NativeCupertinoHttp 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 [NSURLRequest]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLRequest); } - /// 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); + /// ! + /// @method requestWithURL: + /// @abstract Allocates and initializes an NSURLRequest with the given + /// URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSURLRequest requestWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_juohf7( + _class_NSURLRequest, _sel_requestWithURL_, URL.ref.pointer); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); } - DartNSNotificationName get name { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); + /// ! + /// @property supportsSecureCoding + /// @abstract Indicates that NSURLRequest implements the NSSecureCoding protocol. + /// @result A BOOL value set to YES. + static bool getSupportsSecureCoding() { + return _objc_msgSend_olxnu1(_class_NSURLRequest, _sel_supportsSecureCoding); } - NSObject? get object { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_object1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// ! + /// @method requestWithURL:cachePolicy:timeoutInterval: + /// @abstract Allocates and initializes a NSURLRequest with the given + /// URL and cache policy. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSURLRequest requestWithURL_cachePolicy_timeoutInterval_( + objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, + DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_191svj( + _class_NSURLRequest, + _sel_requestWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSURLRequest.castFromPointer(_ret, retain: true, release: true); } - NSDictionary? get userInfo { - final _ret = _lib._objc_msgSend_288(_id, _lib._sel_userInfo1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result An initialized NSURLRequest. + NSURLRequest initWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_juohf7( + this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } - NSNotification initWithName_object_userInfo_( - DartNSNotificationName name, NSObject? object, NSDictionary? userInfo) { - final _ret = _lib._objc_msgSend_401( - _id, - _lib._sel_initWithName_object_userInfo_1, - name._id, - object?._id ?? ffi.nullptr, - userInfo?._id ?? ffi.nullptr); - return NSNotification._(_ret, _lib, retain: true, release: true); + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL and + /// cache policy. + /// @discussion This is the designated initializer for the + /// NSURLRequest class. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result An initialized NSURLRequest. + NSURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_191svj( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } - NSNotification? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); + /// ! + /// @abstract Returns the URL of the receiver. + /// @result The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URL); return _ret.address == 0 ? null - : NSNotification._(_ret, _lib, retain: true, release: true); + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } - static NSNotification notificationWithName_object_(NativeCupertinoHttp _lib, - DartNSNotificationName aName, NSObject? anObject) { - final _ret = _lib._objc_msgSend_272( - _lib._class_NSNotification1, - _lib._sel_notificationWithName_object_1, - aName._id, - anObject?._id ?? ffi.nullptr); - return NSNotification._(_ret, _lib, retain: true, release: true); + /// ! + /// @abstract Returns the cache policy of the receiver. + /// @result The cache policy of the receiver. + NSURLRequestCachePolicy get cachePolicy { + final _ret = _objc_msgSend_2xak1q(this.ref.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); } - static NSNotification notificationWithName_object_userInfo_( - NativeCupertinoHttp _lib, - DartNSNotificationName aName, - NSObject? anObject, - NSDictionary? aUserInfo) { - final _ret = _lib._objc_msgSend_401( - _lib._class_NSNotification1, - _lib._sel_notificationWithName_object_userInfo_1, - aName._id, - anObject?._id ?? ffi.nullptr, - aUserInfo?._id ?? ffi.nullptr); - return NSNotification._(_ret, _lib, retain: true, release: true); + /// ! + /// @abstract Returns the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + /// @result The timeout interval of the receiver. + DartNSTimeInterval get timeoutInterval { + return _objc_msgSend_10noklm(this.ref.pointer, _sel_timeoutInterval); } - @override - NSNotification init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSNotification._(_ret, _lib, retain: true, release: true); + /// ! + /// @abstract The main document URL associated with this load. + /// @discussion This URL is used for the cookie "same domain as main + /// document" policy, and attributing the request as a sub-resource + /// of a user-specified URL. There may also be other future uses. + /// See setMainDocumentURL: + /// @result The main document URL. + objc.NSURL? get mainDocumentURL { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_mainDocumentURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } - static NSNotification new1(NativeCupertinoHttp _lib) { + /// ! + /// @abstract Returns the NSURLRequestNetworkServiceType associated with this request. + /// @discussion This will return NSURLNetworkServiceTypeDefault for requests that have + /// not explicitly set a networkServiceType (using the setNetworkServiceType method). + /// @result The NSURLRequestNetworkServiceType associated with this request. + NSURLRequestNetworkServiceType get networkServiceType { final _ret = - _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_new1); - return NSNotification._(_ret, _lib, retain: false, release: true); - } - - static NSNotification allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSNotification1, _lib._sel_allocWithZone_1, zone); - return NSNotification._(_ret, _lib, retain: false, release: true); + _objc_msgSend_ttt73t(this.ref.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); } - static NSNotification alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSNotification1, _lib._sel_alloc1); - return NSNotification._(_ret, _lib, retain: false, release: true); + /// ! + /// @abstract returns whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @result YES if the receiver is allowed to use the built in cellular radios to + /// satisfy the request, NO otherwise. + bool get allowsCellularAccess { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_allowsCellularAccess); } -} - -typedef NSNotificationName = ffi.Pointer; -typedef DartNSNotificationName = NSString; -class NSNotificationCenter extends NSObject { - NSNotificationCenter._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSNotificationCenter] that points to the same underlying object as [other]. - static NSNotificationCenter castFrom(T other) { - return NSNotificationCenter._(other._id, other._lib, - retain: true, release: true); + /// ! + /// @abstract returns whether a connection created with this request is allowed to use + /// network interfaces which have been marked as expensive. + /// @result YES if the receiver is allowed to use an interface marked as expensive to + /// satisfy the request, NO otherwise. + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_allowsExpensiveNetworkAccess); } - /// Returns a [NSNotificationCenter] that wraps the given raw object pointer. - static NSNotificationCenter castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSNotificationCenter._(other, lib, retain: retain, release: release); + /// ! + /// @abstract returns whether a connection created with this request is allowed to use + /// network interfaces which have been marked as constrained. + /// @result YES if the receiver is allowed to use an interface marked as constrained to + /// satisfy the request, NO otherwise. + bool get allowsConstrainedNetworkAccess { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } - /// Returns whether [obj] is an instance of [NSNotificationCenter]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSNotificationCenter1); + /// ! + /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC + /// racing without HTTP/3 service discovery. + /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. + /// The default may be YES in a future OS update. + bool get assumesHTTP3Capable { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_assumesHTTP3Capable); } - static NSNotificationCenter getDefaultCenter(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_402( - _lib._class_NSNotificationCenter1, _lib._sel_defaultCenter1); - return NSNotificationCenter._(_ret, _lib, retain: true, release: true); + /// ! + /// @abstract Returns the NSURLRequestAttribution associated with this request. + /// @discussion This will return NSURLRequestAttributionDeveloper for requests that + /// have not explicitly set an attribution. + /// @result The NSURLRequestAttribution associated with this request. + NSURLRequestAttribution get attribution { + final _ret = _objc_msgSend_t5yka9(this.ref.pointer, _sel_attribution); + return NSURLRequestAttribution.fromValue(_ret); } - void addObserver_selector_name_object_( - NSObject observer, - ffi.Pointer aSelector, - DartNSNotificationName aName, - NSObject? anObject) { - _lib._objc_msgSend_403(_id, _lib._sel_addObserver_selector_name_object_1, - observer._id, aSelector, aName._id, anObject?._id ?? ffi.nullptr); + /// ! + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + bool get requiresDNSSECValidation { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_requiresDNSSECValidation); } - void postNotification_(NSNotification notification) { - _lib._objc_msgSend_404(_id, _lib._sel_postNotification_1, notification._id); + /// HTTPMethod + objc.NSString? get HTTPMethod { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPMethod); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - void postNotificationName_object_( - DartNSNotificationName aName, NSObject? anObject) { - _lib._objc_msgSend_405(_id, _lib._sel_postNotificationName_object_1, - aName._id, anObject?._id ?? ffi.nullptr); + /// allHTTPHeaderFields + objc.NSDictionary? get allHTTPHeaderFields { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allHTTPHeaderFields); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - void postNotificationName_object_userInfo_(DartNSNotificationName aName, - NSObject? anObject, NSDictionary? aUserInfo) { - _lib._objc_msgSend_406( - _id, - _lib._sel_postNotificationName_object_userInfo_1, - aName._id, - anObject?._id ?? ffi.nullptr, - aUserInfo?._id ?? ffi.nullptr); + /// valueForHTTPHeaderField: + objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - void removeObserver_(NSObject observer) { - _lib._objc_msgSend_210(_id, _lib._sel_removeObserver_1, observer._id); + /// HTTPBody + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBody); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); } - void removeObserver_name_object_( - NSObject observer, DartNSNotificationName aName, NSObject? anObject) { - _lib._objc_msgSend_407(_id, _lib._sel_removeObserver_name_object_1, - observer._id, aName._id, anObject?._id ?? ffi.nullptr); + /// HTTPBodyStream + objc.NSInputStream? get HTTPBodyStream { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBodyStream); + return _ret.address == 0 + ? null + : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); } - NSObject addObserverForName_object_queue_usingBlock_( - DartNSNotificationName name, - NSObject? obj, - NSOperationQueue? queue, - ObjCBlock_ffiVoid_NSNotification block) { - final _ret = _lib._objc_msgSend_421( - _id, - _lib._sel_addObserverForName_object_queue_usingBlock_1, - name._id, - obj?._id ?? ffi.nullptr, - queue?._id ?? ffi.nullptr, - block._id); - return NSObject._(_ret, _lib, retain: true, release: true); + /// HTTPShouldHandleCookies + bool get HTTPShouldHandleCookies { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldHandleCookies); } - @override - NSNotificationCenter init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSNotificationCenter._(_ret, _lib, retain: true, release: true); + /// HTTPShouldUsePipelining + bool get HTTPShouldUsePipelining { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldUsePipelining); } - static NSNotificationCenter new1(NativeCupertinoHttp _lib) { + /// init + NSURLRequest init() { final _ret = - _lib._objc_msgSend_2(_lib._class_NSNotificationCenter1, _lib._sel_new1); - return NSNotificationCenter._(_ret, _lib, retain: false, release: true); + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } - static NSNotificationCenter allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSNotificationCenter1, _lib._sel_allocWithZone_1, zone); - return NSNotificationCenter._(_ret, _lib, retain: false, release: true); + /// new + static NSURLRequest new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLRequest, _sel_new); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } - static NSNotificationCenter alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSNotificationCenter1, _lib._sel_alloc1); - return NSNotificationCenter._(_ret, _lib, retain: false, release: true); + /// allocWithZone: + static NSURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSURLRequest, _sel_allocWithZone_, zone); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } -} -class NSOperationQueue extends NSObject { - NSOperationQueue._(ffi.Pointer id, NativeCupertinoHttp 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); + /// alloc + static NSURLRequest alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLRequest, _sel_alloc); + return NSURLRequest.castFromPointer(_ret, retain: false, release: true); } - /// Returns a [NSOperationQueue] that wraps the given raw object pointer. - static NSOperationQueue castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOperationQueue._(other, lib, retain: retain, release: release); + /// encodeWithCoder: + void encodeWithCoder_(objc.NSCoder coder) { + _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); } - /// 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); + /// initWithCoder: + NSURLRequest? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: false, release: true); } +} - /// @property progress - /// @discussion The `progress` property represents a total progress of the operations executed in the queue. By default NSOperationQueue - /// does not report progress until the `totalUnitCount` of the progress is set. When the `totalUnitCount` property of the progress is set the - /// queue then opts into participating in progress reporting. When enabled, each operation will contribute 1 unit of completion to the - /// overall progress of the queue for operations that are finished by the end of main (operations that override start and do not invoke super - /// will not contribute to progress). Special attention to race conditions should be made when updating the `totalUnitCount` of the progress - /// as well as care should be taken to avoid 'backwards progress'. For example; when a NSOperationQueue's progress is 5/10, representing 50% - /// completed, and there are 90 more operations about to be added and the `totalUnitCount` that would then make the progress report as 5/100 - /// which represents 5%. In this example it would mean that any progress bar would jump from displaying 50% back to 5%, which might not be - /// desirable. In the cases where the `totalUnitCount` needs to be adjusted it is suggested to do this for thread-safety in a barrier by - /// using the `addBarrierBlock:` API. This ensures that no un-expected execution state occurs adjusting into a potentially backwards moving - /// progress scenario. - /// - /// @example - /// NSOperationQueue *queue = [[NSOperationQueue alloc] init]; - /// queue.progress.totalUnitCount = 10; - NSProgress get progress { - final _ret = _lib._objc_msgSend_392(_id, _lib._sel_progress1); - return NSProgress._(_ret, _lib, retain: true, release: true); - } +late final _class_NSURLRequest = objc.getClass("NSURLRequest"); +late final _sel_requestWithURL_ = objc.registerName("requestWithURL:"); + +/// ! +/// @enum NSURLRequestCachePolicy +/// +/// @discussion The NSURLRequestCachePolicy enum defines constants that +/// can be used to specify the type of interactions that take place with +/// the caching system when the URL loading system processes a request. +/// Specifically, these constants cover interactions that have to do +/// with whether already-existing cache data is returned to satisfy a +/// URL load request. +/// +/// @constant NSURLRequestUseProtocolCachePolicy Specifies that the +/// caching logic defined in the protocol implementation, if any, is +/// used for a particular URL load request. This is the default policy +/// for URL load requests. +/// +/// @constant NSURLRequestReloadIgnoringLocalCacheData Specifies that the +/// data for the URL load should be loaded from the origin source. No +/// existing local cache data, regardless of its freshness or validity, +/// should be used to satisfy a URL load request. +/// +/// @constant NSURLRequestReloadIgnoringLocalAndRemoteCacheData Specifies that +/// not only should the local cache data be ignored, but that proxies and +/// other intermediates should be instructed to disregard their caches +/// so far as the protocol allows. +/// +/// @constant NSURLRequestReloadIgnoringCacheData Older name for +/// NSURLRequestReloadIgnoringLocalCacheData. +/// +/// @constant NSURLRequestReturnCacheDataElseLoad Specifies that the +/// existing cache data should be used to satisfy a URL load request, +/// regardless of its age or expiration date. However, if there is no +/// existing data in the cache corresponding to a URL load request, +/// the URL is loaded from the origin source. +/// +/// @constant NSURLRequestReturnCacheDataDontLoad Specifies that the +/// existing cache data should be used to satisfy a URL load request, +/// regardless of its age or expiration date. However, if there is no +/// existing data in the cache corresponding to a URL load request, no +/// attempt is made to load the URL from the origin source, and the +/// load is considered to have failed. This constant specifies a +/// behavior that is similar to an "offline" mode. +/// +/// @constant NSURLRequestReloadRevalidatingCacheData Specifies that +/// the existing cache data may be used provided the origin source +/// confirms its validity, otherwise the URL is loaded from the +/// origin source. +enum NSURLRequestCachePolicy { + NSURLRequestUseProtocolCachePolicy(0), + NSURLRequestReloadIgnoringLocalCacheData(1), + NSURLRequestReloadIgnoringLocalAndRemoteCacheData(4), + NSURLRequestReturnCacheDataElseLoad(2), + NSURLRequestReturnCacheDataDontLoad(3), + NSURLRequestReloadRevalidatingCacheData(5); + + static const NSURLRequestReloadIgnoringCacheData = + NSURLRequestReloadIgnoringLocalCacheData; + + final int value; + const NSURLRequestCachePolicy(this.value); + + static NSURLRequestCachePolicy fromValue(int value) => switch (value) { + 0 => NSURLRequestUseProtocolCachePolicy, + 1 => NSURLRequestReloadIgnoringLocalCacheData, + 4 => NSURLRequestReloadIgnoringLocalAndRemoteCacheData, + 2 => NSURLRequestReturnCacheDataElseLoad, + 3 => NSURLRequestReturnCacheDataDontLoad, + 5 => NSURLRequestReloadRevalidatingCacheData, + _ => throw ArgumentError( + "Unknown value for NSURLRequestCachePolicy: $value"), + }; - void addOperation_(NSOperation op) { - _lib._objc_msgSend_408(_id, _lib._sel_addOperation_1, op._id); + @override + String toString() { + if (this == NSURLRequestReloadIgnoringLocalCacheData) + return "NSURLRequestCachePolicy.NSURLRequestReloadIgnoringLocalCacheData, NSURLRequestCachePolicy.NSURLRequestReloadIgnoringCacheData"; + return super.toString(); } +} - void addOperations_waitUntilFinished_(NSArray ops, bool wait) { - _lib._objc_msgSend_414( - _id, _lib._sel_addOperations_waitUntilFinished_1, ops._id, wait); - } +typedef NSTimeInterval = ffi.Double; +typedef DartNSTimeInterval = double; +late final _sel_requestWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("requestWithURL:cachePolicy:timeoutInterval:"); +final _objc_msgSend_191svj = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSTimeInterval)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + double)>(); +late final _sel_initWithURL_ = objc.registerName("initWithURL:"); +late final _sel_initWithURL_cachePolicy_timeoutInterval_ = + objc.registerName("initWithURL:cachePolicy:timeoutInterval:"); +late final _sel_cachePolicy = objc.registerName("cachePolicy"); +final _objc_msgSend_2xak1q = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_timeoutInterval = objc.registerName("timeoutInterval"); +final _objc_msgSend_10noklm = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSTimeInterval Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_mainDocumentURL = objc.registerName("mainDocumentURL"); - void addOperationWithBlock_(ObjCBlock_ffiVoid block) { - _lib._objc_msgSend_415(_id, _lib._sel_addOperationWithBlock_1, block._id); - } +/// ! +/// @enum NSURLRequestNetworkServiceType +/// +/// @discussion The NSURLRequestNetworkServiceType enum defines constants that +/// can be used to specify the service type to associate with this request. The +/// service type is used to provide the networking layers a hint of the purpose +/// of the request. +/// +/// @constant NSURLNetworkServiceTypeDefault Is the default value for an NSURLRequest +/// when created. This value should be left unchanged for the vast majority of requests. +/// +/// @constant NSURLNetworkServiceTypeVoIP Specifies that the request is for voice over IP +/// control traffic. +/// +/// @constant NSURLNetworkServiceTypeVideo Specifies that the request is for video +/// traffic. +/// +/// @constant NSURLNetworkServiceTypeBackground Specifies that the request is for background +/// traffic (such as a file download). +/// +/// @constant NSURLNetworkServiceTypeVoice Specifies that the request is for voice data. +/// +/// @constant NSURLNetworkServiceTypeResponsiveData Specifies that the request is for responsive (time sensitive) data. +/// +/// @constant NSURLNetworkServiceTypeAVStreaming Specifies that the request is streaming audio/video data. +/// +/// @constant NSURLNetworkServiceTypeResponsiveAV Specifies that the request is for responsive (time sensitive) audio/video data. +/// +/// @constant NSURLNetworkServiceTypeCallSignaling Specifies that the request is for call signaling. +enum NSURLRequestNetworkServiceType { + /// Standard internet traffic + NSURLNetworkServiceTypeDefault(0), - /// @method addBarrierBlock: - /// @param barrier A block to execute - /// @discussion The `addBarrierBlock:` method executes the block when the NSOperationQueue has finished all enqueued operations and - /// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the - /// `dispatch_barrier_async` function. - void addBarrierBlock_(ObjCBlock_ffiVoid barrier) { - _lib._objc_msgSend_415(_id, _lib._sel_addBarrierBlock_1, barrier._id); - } + /// Voice over IP control traffic + NSURLNetworkServiceTypeVoIP(1), - DartNSInteger get maxConcurrentOperationCount { - return _lib._objc_msgSend_86(_id, _lib._sel_maxConcurrentOperationCount1); - } + /// Video traffic + NSURLNetworkServiceTypeVideo(2), - set maxConcurrentOperationCount(DartNSInteger value) { - return _lib._objc_msgSend_416( - _id, _lib._sel_setMaxConcurrentOperationCount_1, value); - } + /// Background traffic + NSURLNetworkServiceTypeBackground(3), - bool get suspended { - return _lib._objc_msgSend_11(_id, _lib._sel_isSuspended1); - } + /// Voice data + NSURLNetworkServiceTypeVoice(4), - set suspended(bool value) { - return _lib._objc_msgSend_386(_id, _lib._sel_setSuspended_1, value); - } + /// Responsive data + NSURLNetworkServiceTypeResponsiveData(6), - NSString? get name { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_name1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// Multimedia Audio/Video Streaming + NSURLNetworkServiceTypeAVStreaming(8), - set name(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); - } + /// Responsive Multimedia Audio/Video + NSURLNetworkServiceTypeResponsiveAV(9), - int get qualityOfService { - return _lib._objc_msgSend_412(_id, _lib._sel_qualityOfService1); - } + /// Call Signaling + NSURLNetworkServiceTypeCallSignaling(11); + + final int value; + const NSURLRequestNetworkServiceType(this.value); + + static NSURLRequestNetworkServiceType fromValue(int value) => switch (value) { + 0 => NSURLNetworkServiceTypeDefault, + 1 => NSURLNetworkServiceTypeVoIP, + 2 => NSURLNetworkServiceTypeVideo, + 3 => NSURLNetworkServiceTypeBackground, + 4 => NSURLNetworkServiceTypeVoice, + 6 => NSURLNetworkServiceTypeResponsiveData, + 8 => NSURLNetworkServiceTypeAVStreaming, + 9 => NSURLNetworkServiceTypeResponsiveAV, + 11 => NSURLNetworkServiceTypeCallSignaling, + _ => throw ArgumentError( + "Unknown value for NSURLRequestNetworkServiceType: $value"), + }; +} + +late final _sel_networkServiceType = objc.registerName("networkServiceType"); +final _objc_msgSend_ttt73t = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_allowsCellularAccess = + objc.registerName("allowsCellularAccess"); +late final _sel_allowsExpensiveNetworkAccess = + objc.registerName("allowsExpensiveNetworkAccess"); +late final _sel_allowsConstrainedNetworkAccess = + objc.registerName("allowsConstrainedNetworkAccess"); +late final _sel_assumesHTTP3Capable = objc.registerName("assumesHTTP3Capable"); - set qualityOfService(int value) { - return _lib._objc_msgSend_413(_id, _lib._sel_setQualityOfService_1, value); - } +/// ! +/// @enum NSURLRequestAttribution +/// +/// @discussion The NSURLRequestAttribution enum is used to indicate whether the +/// user or developer specified the URL. +/// +/// @constant NSURLRequestAttributionDeveloper Indicates that the URL was specified +/// by the developer. This is the default value for an NSURLRequest when created. +/// +/// @constant NSURLRequestAttributionUser Indicates that the URL was specified by +/// the user. +enum NSURLRequestAttribution { + NSURLRequestAttributionDeveloper(0), + NSURLRequestAttributionUser(1); + + final int value; + const NSURLRequestAttribution(this.value); + + static NSURLRequestAttribution fromValue(int value) => switch (value) { + 0 => NSURLRequestAttributionDeveloper, + 1 => NSURLRequestAttributionUser, + _ => throw ArgumentError( + "Unknown value for NSURLRequestAttribution: $value"), + }; +} + +late final _sel_attribution = objc.registerName("attribution"); +final _objc_msgSend_t5yka9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_requiresDNSSECValidation = + objc.registerName("requiresDNSSECValidation"); +late final _sel_HTTPMethod = objc.registerName("HTTPMethod"); +late final _sel_allHTTPHeaderFields = objc.registerName("allHTTPHeaderFields"); +late final _sel_valueForHTTPHeaderField_ = + objc.registerName("valueForHTTPHeaderField:"); +late final _sel_HTTPBody = objc.registerName("HTTPBody"); +late final _sel_HTTPBodyStream = objc.registerName("HTTPBodyStream"); +late final _sel_HTTPShouldHandleCookies = + objc.registerName("HTTPShouldHandleCookies"); +late final _sel_HTTPShouldUsePipelining = + objc.registerName("HTTPShouldUsePipelining"); +late final _sel_cachedResponseForRequest_ = + objc.registerName("cachedResponseForRequest:"); +late final _sel_storeCachedResponse_forRequest_ = + objc.registerName("storeCachedResponse:forRequest:"); +final _objc_msgSend_1tjlcwl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCachedResponseForRequest_ = + objc.registerName("removeCachedResponseForRequest:"); +late final _sel_removeAllCachedResponses = + objc.registerName("removeAllCachedResponses"); +final _objc_msgSend_ksby9f = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_removeCachedResponsesSinceDate_ = + objc.registerName("removeCachedResponsesSinceDate:"); +late final _sel_memoryCapacity = objc.registerName("memoryCapacity"); +final _objc_msgSend_eldhrq = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setMemoryCapacity_ = objc.registerName("setMemoryCapacity:"); +final _objc_msgSend_1k4zaz5 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_diskCapacity = objc.registerName("diskCapacity"); +late final _sel_setDiskCapacity_ = objc.registerName("setDiskCapacity:"); +late final _sel_currentMemoryUsage = objc.registerName("currentMemoryUsage"); +late final _sel_currentDiskUsage = objc.registerName("currentDiskUsage"); + +/// NSURLSessionDataTask +class NSURLSessionDataTask extends NSURLSessionTask { + NSURLSessionDataTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// actually retain - dispatch_queue_t get underlyingQueue { - return _lib._objc_msgSend_417(_id, _lib._sel_underlyingQueue1); - } + /// Constructs a [NSURLSessionDataTask] that points to the same underlying object as [other]. + NSURLSessionDataTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// actually retain - set underlyingQueue(dispatch_queue_t value) { - return _lib._objc_msgSend_418(_id, _lib._sel_setUnderlyingQueue_1, value); - } + /// Constructs a [NSURLSessionDataTask] that wraps the given raw object pointer. + NSURLSessionDataTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - void cancelAllOperations() { - _lib._objc_msgSend_1(_id, _lib._sel_cancelAllOperations1); + /// Returns whether [obj] is an instance of [NSURLSessionDataTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionDataTask); } - void waitUntilAllOperationsAreFinished() { - _lib._objc_msgSend_1(_id, _lib._sel_waitUntilAllOperationsAreFinished1); + /// init + NSURLSessionDataTask init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: false, release: true); } - static NSOperationQueue? getCurrentQueue(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_419( - _lib._class_NSOperationQueue1, _lib._sel_currentQueue1); - return _ret.address == 0 - ? null - : NSOperationQueue._(_ret, _lib, retain: true, release: true); + /// new + static NSURLSessionDataTask new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionDataTask, _sel_new); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: false, release: true); } - static NSOperationQueue getMainQueue(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_420( - _lib._class_NSOperationQueue1, _lib._sel_mainQueue1); - return NSOperationQueue._(_ret, _lib, retain: true, release: true); + /// allocWithZone: + static NSURLSessionDataTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionDataTask, _sel_allocWithZone_, zone); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: false, release: true); } - /// These two functions are inherently a race condition and should be avoided if possible - NSArray get operations { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_operations1); - return NSArray._(_ret, _lib, retain: true, release: true); + /// alloc + static NSURLSessionDataTask alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionDataTask, _sel_alloc); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: false, release: true); } +} - DartNSUInteger get operationCount { - return _lib._objc_msgSend_12(_id, _lib._sel_operationCount1); - } +late final _class_NSURLSessionDataTask = objc.getClass("NSURLSessionDataTask"); - @override - NSOperationQueue init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOperationQueue._(_ret, _lib, retain: true, release: true); - } +/// NSURLSessionTask - a cancelable object that refers to the lifetime +/// of processing a given request. +class NSURLSessionTask extends objc.NSObject { + NSURLSessionTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - static NSOperationQueue new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_new1); - return NSOperationQueue._(_ret, _lib, retain: false, release: true); - } + /// Constructs a [NSURLSessionTask] that points to the same underlying object as [other]. + NSURLSessionTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - static NSOperationQueue allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOperationQueue1, _lib._sel_allocWithZone_1, zone); - return NSOperationQueue._(_ret, _lib, retain: false, release: true); - } + /// Constructs a [NSURLSessionTask] that wraps the given raw object pointer. + NSURLSessionTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - static NSOperationQueue alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOperationQueue1, _lib._sel_alloc1); - return NSOperationQueue._(_ret, _lib, retain: false, release: true); + /// Returns whether [obj] is an instance of [NSURLSessionTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionTask); } -} - -class NSOperation extends NSObject { - NSOperation._(ffi.Pointer id, NativeCupertinoHttp 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); + /// an identifier for this task, assigned by and unique to the owning session + DartNSUInteger get taskIdentifier { + return _objc_msgSend_eldhrq(this.ref.pointer, _sel_taskIdentifier); } - /// Returns a [NSOperation] that wraps the given raw object pointer. - static NSOperation castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSOperation._(other, lib, retain: retain, release: release); + /// may be nil if this is a stream task + NSURLRequest? get originalRequest { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_originalRequest); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: true, release: true); } - /// 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); + /// may differ from originalRequest due to http server redirection + NSURLRequest? get currentRequest { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_currentRequest); + return _ret.address == 0 + ? null + : NSURLRequest.castFromPointer(_ret, retain: true, release: true); } - void start() { - _lib._objc_msgSend_1(_id, _lib._sel_start1); + /// may be nil if no response has been received + NSURLResponse? get response { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_response); + return _ret.address == 0 + ? null + : NSURLResponse.castFromPointer(_ret, retain: true, release: true); } - void main() { - _lib._objc_msgSend_1(_id, _lib._sel_main1); + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); } - bool get cancelled { - return _lib._objc_msgSend_11(_id, _lib._sel_isCancelled1); + /// Sets a task-specific delegate. Methods not implemented on this delegate will + /// still be forwarded to the session delegate. + /// + /// Cannot be modified after task resumes. Not supported on background session. + /// + /// Delegate is strongly referenced until the task completes, after which it is + /// reset to `nil`. + set delegate(objc.ObjCObjectBase? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setDelegate_, value?.ref.pointer ?? ffi.nullptr); } - void cancel() { - _lib._objc_msgSend_1(_id, _lib._sel_cancel1); + /// NSProgress object which represents the task progress. + /// It can be used for task progress tracking. + NSProgress get progress { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_progress); + return NSProgress.castFromPointer(_ret, retain: true, release: true); } - bool get executing { - return _lib._objc_msgSend_11(_id, _lib._sel_isExecuting1); + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + objc.NSDate? get earliestBeginDate { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_earliestBeginDate); + return _ret.address == 0 + ? null + : objc.NSDate.castFromPointer(_ret, retain: true, release: true); } - bool get finished { - return _lib._objc_msgSend_11(_id, _lib._sel_isFinished1); + /// Start the network load for this task no earlier than the specified date. If + /// not specified, no start delay is used. + /// + /// Only applies to tasks created from background NSURLSession instances; has no + /// effect for tasks created from other session types. + set earliestBeginDate(objc.NSDate? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setEarliestBeginDate_, + value?.ref.pointer ?? ffi.nullptr); } - /// To be deprecated; use and override 'asynchronous' below - bool get concurrent { - return _lib._objc_msgSend_11(_id, _lib._sel_isConcurrent1); + /// The number of bytes that the client expects (a best-guess upper-bound) will + /// be sent and received by this task. These values are used by system scheduling + /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. + int get countOfBytesClientExpectsToSend { + return _objc_msgSend_1voti03( + this.ref.pointer, _sel_countOfBytesClientExpectsToSend); } - bool get asynchronous { - return _lib._objc_msgSend_11(_id, _lib._sel_isAsynchronous1); + /// The number of bytes that the client expects (a best-guess upper-bound) will + /// be sent and received by this task. These values are used by system scheduling + /// policy. If unspecified, NSURLSessionTransferSizeUnknown is used. + set countOfBytesClientExpectsToSend(int value) { + return _objc_msgSend_rrr3q( + this.ref.pointer, _sel_setCountOfBytesClientExpectsToSend_, value); } - bool get ready { - return _lib._objc_msgSend_11(_id, _lib._sel_isReady1); + /// countOfBytesClientExpectsToReceive + int get countOfBytesClientExpectsToReceive { + return _objc_msgSend_1voti03( + this.ref.pointer, _sel_countOfBytesClientExpectsToReceive); } - void addDependency_(NSOperation op) { - _lib._objc_msgSend_408(_id, _lib._sel_addDependency_1, op._id); + /// setCountOfBytesClientExpectsToReceive: + set countOfBytesClientExpectsToReceive(int value) { + return _objc_msgSend_rrr3q( + this.ref.pointer, _sel_setCountOfBytesClientExpectsToReceive_, value); } - void removeDependency_(NSOperation op) { - _lib._objc_msgSend_408(_id, _lib._sel_removeDependency_1, op._id); + /// number of body bytes already sent + int get countOfBytesSent { + return _objc_msgSend_1voti03(this.ref.pointer, _sel_countOfBytesSent); } - NSArray get dependencies { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_dependencies1); - return NSArray._(_ret, _lib, retain: true, release: true); + /// number of body bytes already received + int get countOfBytesReceived { + return _objc_msgSend_1voti03(this.ref.pointer, _sel_countOfBytesReceived); } - int get queuePriority { - return _lib._objc_msgSend_409(_id, _lib._sel_queuePriority1); + /// number of body bytes we expect to send, derived from the Content-Length of the HTTP request + int get countOfBytesExpectedToSend { + return _objc_msgSend_1voti03( + this.ref.pointer, _sel_countOfBytesExpectedToSend); } - set queuePriority(int value) { - return _lib._objc_msgSend_410(_id, _lib._sel_setQueuePriority_1, value); + /// number of byte bytes we expect to receive, usually derived from the Content-Length header of an HTTP response. + int get countOfBytesExpectedToReceive { + return _objc_msgSend_1voti03( + this.ref.pointer, _sel_countOfBytesExpectedToReceive); } - ObjCBlock_ffiVoid? get completionBlock { - final _ret = _lib._objc_msgSend_387(_id, _lib._sel_completionBlock1); + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + objc.NSString? get taskDescription { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_taskDescription); return _ret.address == 0 ? null - : ObjCBlock_ffiVoid._(_ret, _lib, retain: true, release: true); - } - - set completionBlock(ObjCBlock_ffiVoid? value) { - return _lib._objc_msgSend_388( - _id, _lib._sel_setCompletionBlock_1, value?._id ?? ffi.nullptr); - } - - void waitUntilFinished() { - _lib._objc_msgSend_1(_id, _lib._sel_waitUntilFinished1); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - double get threadPriority { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_threadPriority1) - : _lib._objc_msgSend_90(_id, _lib._sel_threadPriority1); - } - - set threadPriority(double value) { - return _lib._objc_msgSend_411(_id, _lib._sel_setThreadPriority_1, value); + /// The taskDescription property is available for the developer to + /// provide a descriptive label for the task. + set taskDescription(objc.NSString? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setTaskDescription_, + value?.ref.pointer ?? ffi.nullptr); } - int get qualityOfService { - return _lib._objc_msgSend_412(_id, _lib._sel_qualityOfService1); + /// -cancel returns immediately, but marks a task as being canceled. + /// The task will signal -URLSession:task:didCompleteWithError: with an + /// error value of { NSURLErrorDomain, NSURLErrorCancelled }. In some + /// cases, the task may signal other work before it acknowledges the + /// cancelation. -cancel may be sent to a task that has been suspended. + void cancel() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); } - set qualityOfService(int value) { - return _lib._objc_msgSend_413(_id, _lib._sel_setQualityOfService_1, value); + /// The current state of the task within the session. + NSURLSessionTaskState get state { + final _ret = _objc_msgSend_8b7yc1(this.ref.pointer, _sel_state); + return NSURLSessionTaskState.fromValue(_ret); } - NSString? get name { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_name1); + /// The error, if any, delivered via -URLSession:task:didCompleteWithError: + /// This property will be nil in the event that no error occurred. + objc.NSError? get error { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_error); return _ret.address == 0 ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set name(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setName_1, value?._id ?? ffi.nullptr); - } - - @override - NSOperation init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSOperation._(_ret, _lib, retain: true, release: true); - } - - static NSOperation new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_new1); - return NSOperation._(_ret, _lib, retain: false, release: true); + : objc.NSError.castFromPointer(_ret, retain: true, release: true); } - static NSOperation allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSOperation1, _lib._sel_allocWithZone_1, zone); - return NSOperation._(_ret, _lib, retain: false, release: true); + /// Suspending a task will prevent the NSURLSession from continuing to + /// load data. There may still be delegate calls made on behalf of + /// this task (for instance, to report data received while suspending) + /// but no further transmissions will be made on behalf of the task + /// until -resume is sent. The timeout timer associated with the task + /// will be disabled while a task is suspended. -suspend and -resume are + /// nestable. + void suspend() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_suspend); } - static NSOperation alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSOperation1, _lib._sel_alloc1); - return NSOperation._(_ret, _lib, retain: false, release: true); + /// resume + void resume() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_resume); } -} - -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; - -final class dispatch_queue_s extends ffi.Opaque {} - -void _ObjCBlock_ffiVoid_NSNotification_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSNotification_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSNotification_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSNotification_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSNotification_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSNotification_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSNotification_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSNotification_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSNotification extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSNotification._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - /// Creates a block from a C function pointer. + /// Sets a scaling factor for the priority of the task. The scaling factor is a + /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest + /// priority and 1.0 is considered the highest. /// - /// 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. - ObjCBlock_ffiVoid_NSNotification.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSNotification_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; - - /// Creates a block from a Dart function. + /// The priority is a hint and not a hard requirement of task performance. The + /// priority of a task may be changed using this API at any time, but not all + /// protocols support this; in these cases, the last priority that took effect + /// will be used. /// - /// 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. - ObjCBlock_ffiVoid_NSNotification.fromFunction( - NativeCupertinoHttp lib, void Function(NSNotification) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSNotification_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSNotification_registerClosure((ffi - .Pointer - arg0) => - fn(NSNotification._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + /// If no priority is specified, the task will operate with the default priority + /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional + /// priority levels are provided: NSURLSessionTaskPriorityLow and + /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. + double get priority { + return objc.useMsgSendVariants + ? _objc_msgSend_fcilgxFpret(this.ref.pointer, _sel_priority) + : _objc_msgSend_fcilgx(this.ref.pointer, _sel_priority); + } - /// Creates a listener block from a Dart function. + /// Sets a scaling factor for the priority of the task. The scaling factor is a + /// value between 0.0 and 1.0 (inclusive), where 0.0 is considered the lowest + /// priority and 1.0 is considered the highest. /// - /// 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. + /// The priority is a hint and not a hard requirement of task performance. The + /// priority of a task may be changed using this API at any time, but not all + /// protocols support this; in these cases, the last priority that took effect + /// will be used. /// - /// Note that unlike the default behavior of NativeCallable.listener, listener - /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSNotification.listener( - NativeCupertinoHttp lib, void Function(NSNotification) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSNotification_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSNotification_registerClosure( - (ffi.Pointer arg0) => fn(NSNotification._( - arg0, lib, - retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSNotification arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id); -} - -/// ! -/// @class NSMutableURLRequest -/// -/// @abstract An NSMutableURLRequest object represents a mutable URL load -/// request in a manner independent of protocol and URL scheme. -/// -/// @discussion This specialization of NSURLRequest is provided to aid -/// developers who may find it more convenient to mutate a single request -/// object for a series of URL loads instead of creating an immutable -/// NSURLRequest for each load. This programming model is supported by -/// the following contract stipulation between NSMutableURLRequest and -/// NSURLConnection: NSURLConnection makes a deep copy of each -/// NSMutableURLRequest object passed to one of its initializers. -///

NSMutableURLRequest is designed to be extended to support -/// protocol-specific data by adding categories to access a property -/// object provided in an interface targeted at protocol implementors. -///

    -///
  • Protocol implementors should direct their attention to the -/// NSMutableURLRequestExtensibility category on -/// NSMutableURLRequest for more information on how to provide -/// extensions on NSMutableURLRequest to support protocol-specific -/// request information. -///
  • Clients of this API who wish to create NSMutableURLRequest -/// objects to load URL content should consult the protocol-specific -/// NSMutableURLRequest categories that are available. The -/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an -/// example. -///
-class NSMutableURLRequest extends NSURLRequest { - NSMutableURLRequest._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp 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); - } - - /// ! - /// @abstract The URL of the receiver. - @override - NSURL? get URL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } - - /// ! - /// @abstract The URL of the receiver. - set URL(NSURL? value) { - return _lib._objc_msgSend_390( - _id, _lib._sel_setURL_1, value?._id ?? ffi.nullptr); - } - - /// ! - /// @abstract The cache policy of the receiver. - @override - int get cachePolicy { - return _lib._objc_msgSend_344(_id, _lib._sel_cachePolicy1); - } - - /// ! - /// @abstract The cache policy of the receiver. - set cachePolicy(int value) { - return _lib._objc_msgSend_422(_id, _lib._sel_setCachePolicy_1, value); + /// If no priority is specified, the task will operate with the default priority + /// as defined by the constant NSURLSessionTaskPriorityDefault. Two additional + /// priority levels are provided: NSURLSessionTaskPriorityLow and + /// NSURLSessionTaskPriorityHigh, but use is not restricted to these. + set priority(double value) { + return _objc_msgSend_s9gjzc(this.ref.pointer, _sel_setPriority_, value); } - /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - @override - DartNSTimeInterval get timeoutInterval { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_timeoutInterval1) - : _lib._objc_msgSend_90(_id, _lib._sel_timeoutInterval1); + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + bool get prefersIncrementalDelivery { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_prefersIncrementalDelivery); } - /// ! - /// @abstract Sets the timeout interval of the receiver. - /// @discussion The timeout interval specifies the limit on the idle - /// interval allotted to a request in the process of loading. The "idle - /// interval" is defined as the period of time that has passed since the - /// last instance of load activity occurred for a request that is in the - /// process of loading. Hence, when an instance of load activity occurs - /// (e.g. bytes are received from the network for a request), the idle - /// interval for a request is reset to 0. If the idle interval ever - /// becomes greater than or equal to the timeout interval, the request - /// is considered to have timed out. This timeout interval is measured - /// in seconds. - set timeoutInterval(DartNSTimeInterval value) { - return _lib._objc_msgSend_411(_id, _lib._sel_setTimeoutInterval_1, value); + /// Provides a hint indicating if incremental delivery of a partial response body + /// would be useful for the application, or if it cannot process the response + /// until it is complete. Indicating that incremental delivery is not desired may + /// improve task performance. For example, if a response cannot be decoded until + /// the entire content is received, set this property to false. + /// + /// Defaults to true unless this task is created with completion-handler based + /// convenience methods, or if it is a download task. + set prefersIncrementalDelivery(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setPrefersIncrementalDelivery_, value); } - /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - @override - NSURL? get mainDocumentURL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_mainDocumentURL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); + /// init + NSURLSessionTask init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract Sets the main document URL - /// @discussion The caller should pass the URL for an appropriate main - /// document, if known. For example, when loading a web page, the URL - /// of the main html document for the top-level frame should be - /// passed. This main document is used to implement the cookie "only - /// from same domain as main document" policy, attributing this request - /// as a sub-resource of a user-specified URL, and possibly other things - /// in the future. - set mainDocumentURL(NSURL? value) { - return _lib._objc_msgSend_390( - _id, _lib._sel_setMainDocumentURL_1, value?._id ?? ffi.nullptr); + /// new + static NSURLSessionTask new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionTask, _sel_new); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - @override - int get networkServiceType { - return _lib._objc_msgSend_345(_id, _lib._sel_networkServiceType1); + /// allocWithZone: + static NSURLSessionTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionTask, _sel_allocWithZone_, zone); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request - /// @discussion This method is used to provide the network layers with a hint as to the purpose - /// of the request. Most clients should not need to use this method. - set networkServiceType(int value) { - return _lib._objc_msgSend_423( - _id, _lib._sel_setNetworkServiceType_1, value); + /// alloc + static NSURLSessionTask alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionTask, _sel_alloc); + return NSURLSessionTask.castFromPointer(_ret, retain: false, release: true); } +} - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - @override - bool get allowsCellularAccess { - return _lib._objc_msgSend_11(_id, _lib._sel_allowsCellularAccess1); - } +late final _class_NSURLSessionTask = objc.getClass("NSURLSessionTask"); +late final _sel_taskIdentifier = objc.registerName("taskIdentifier"); +late final _sel_originalRequest = objc.registerName("originalRequest"); +late final _sel_currentRequest = objc.registerName("currentRequest"); +late final _sel_delegate = objc.registerName("delegate"); +late final _sel_setDelegate_ = objc.registerName("setDelegate:"); - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// the built in cellular radios (if present). - /// @discussion NO if the receiver should not be allowed to use the built in - /// cellular radios to satisfy the request, YES otherwise. The default is YES. - set allowsCellularAccess(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setAllowsCellularAccess_1, value); - } +/// NSProgress +class NSProgress extends objc.NSObject { + NSProgress._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to - /// satisfy the request, YES otherwise. - @override - bool get allowsExpensiveNetworkAccess { - return _lib._objc_msgSend_11(_id, _lib._sel_allowsExpensiveNetworkAccess1); - } + /// Constructs a [NSProgress] that points to the same underlying object as [other]. + NSProgress.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as expensive. - /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to - /// satisfy the request, YES otherwise. - set allowsExpensiveNetworkAccess(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); - } + /// Constructs a [NSProgress] that wraps the given raw object pointer. + NSProgress.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as constrained. - /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to - /// satisfy the request, YES otherwise. - @override - bool get allowsConstrainedNetworkAccess { - return _lib._objc_msgSend_11( - _id, _lib._sel_allowsConstrainedNetworkAccess1); + /// Returns whether [obj] is an instance of [NSProgress]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSProgress); } - /// ! - /// @abstract sets whether a connection created with this request is allowed to use - /// network interfaces which have been marked as constrained. - /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to - /// satisfy the request, YES otherwise. - set allowsConstrainedNetworkAccess(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); + /// currentProgress + static NSProgress? currentProgress() { + final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_currentProgress); + return _ret.address == 0 + ? null + : NSProgress.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC - /// racing without HTTP/3 service discovery. - /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. - /// The default may be YES in a future OS update. - @override - bool get assumesHTTP3Capable { - return _lib._objc_msgSend_11(_id, _lib._sel_assumesHTTP3Capable1); + /// progressWithTotalUnitCount: + static NSProgress progressWithTotalUnitCount_(int unitCount) { + final _ret = _objc_msgSend_n9eq1n( + _class_NSProgress, _sel_progressWithTotalUnitCount_, unitCount); + return NSProgress.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC - /// racing without HTTP/3 service discovery. - /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. - /// The default may be YES in a future OS update. - set assumesHTTP3Capable(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setAssumesHTTP3Capable_1, value); + /// discreteProgressWithTotalUnitCount: + static NSProgress discreteProgressWithTotalUnitCount_(int unitCount) { + final _ret = _objc_msgSend_n9eq1n( + _class_NSProgress, _sel_discreteProgressWithTotalUnitCount_, unitCount); + return NSProgress.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the NSURLRequestAttribution to associate with this request. - /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the - /// user. Defaults to NSURLRequestAttributionDeveloper. - @override - int get attribution { - return _lib._objc_msgSend_346(_id, _lib._sel_attribution1); + /// progressWithTotalUnitCount:parent:pendingUnitCount: + static NSProgress progressWithTotalUnitCount_parent_pendingUnitCount_( + int unitCount, NSProgress parent, int portionOfParentTotalUnitCount) { + final _ret = _objc_msgSend_105mybv( + _class_NSProgress, + _sel_progressWithTotalUnitCount_parent_pendingUnitCount_, + unitCount, + parent.ref.pointer, + portionOfParentTotalUnitCount); + return NSProgress.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the NSURLRequestAttribution to associate with this request. - /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the - /// user. Defaults to NSURLRequestAttributionDeveloper. - set attribution(int value) { - return _lib._objc_msgSend_424(_id, _lib._sel_setAttribution_1, value); + /// initWithParent:userInfo: + NSProgress initWithParent_userInfo_( + NSProgress? parentProgressOrNil, objc.NSDictionary? userInfoOrNil) { + final _ret = _objc_msgSend_iq11qg( + this.ref.retainAndReturnPointer(), + _sel_initWithParent_userInfo_, + parentProgressOrNil?.ref.pointer ?? ffi.nullptr, + userInfoOrNil?.ref.pointer ?? ffi.nullptr); + return NSProgress.castFromPointer(_ret, retain: false, release: true); } - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - @override - bool get requiresDNSSECValidation { - return _lib._objc_msgSend_11(_id, _lib._sel_requiresDNSSECValidation1); + /// becomeCurrentWithPendingUnitCount: + void becomeCurrentWithPendingUnitCount_(int unitCount) { + _objc_msgSend_rrr3q( + this.ref.pointer, _sel_becomeCurrentWithPendingUnitCount_, unitCount); } - /// ! - /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. - /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, - /// No otherwise. Defaults to NO. - set requiresDNSSECValidation(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setRequiresDNSSECValidation_1, value); + /// performAsCurrentWithPendingUnitCount:usingBlock: + void performAsCurrentWithPendingUnitCount_usingBlock_( + int unitCount, objc.ObjCBlock work) { + _objc_msgSend_19q84do( + this.ref.pointer, + _sel_performAsCurrentWithPendingUnitCount_usingBlock_, + unitCount, + work.ref.pointer); } - /// ! - /// @abstract Sets the HTTP request method of the receiver. - NSString get HTTPMethod { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_HTTPMethod1); - return NSString._(_ret, _lib, retain: true, release: true); + /// resignCurrent + void resignCurrent() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_resignCurrent); } - /// ! - /// @abstract Sets the HTTP request method of the receiver. - set HTTPMethod(NSString value) { - return _lib._objc_msgSend_385(_id, _lib._sel_setHTTPMethod_1, value._id); + /// addChild:withPendingUnitCount: + void addChild_withPendingUnitCount_(NSProgress child, int inUnitCount) { + _objc_msgSend_2citz1(this.ref.pointer, _sel_addChild_withPendingUnitCount_, + child.ref.pointer, inUnitCount); } - /// ! - /// @abstract Sets the HTTP header fields of the receiver to the given - /// dictionary. - /// @discussion This method replaces all header fields that may have - /// existed before this method call. - ///

Since HTTP header fields must be string values, each object and - /// key in the dictionary passed to this method must answer YES when - /// sent an -isKindOfClass:[NSString class] message. If either - /// the key or value for a key-value pair answers NO when sent this - /// message, the key-value pair is skipped. - @override - NSDictionary? get allHTTPHeaderFields { - final _ret = _lib._objc_msgSend_288(_id, _lib._sel_allHTTPHeaderFields1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); + /// totalUnitCount + int get totalUnitCount { + return _objc_msgSend_1voti03(this.ref.pointer, _sel_totalUnitCount); } - /// ! - /// @abstract Sets the HTTP header fields of the receiver to the given - /// dictionary. - /// @discussion This method replaces all header fields that may have - /// existed before this method call. - ///

Since HTTP header fields must be string values, each object and - /// key in the dictionary passed to this method must answer YES when - /// sent an -isKindOfClass:[NSString class] message. If either - /// the key or value for a key-value pair answers NO when sent this - /// message, the key-value pair is skipped. - set allHTTPHeaderFields(NSDictionary? value) { - return _lib._objc_msgSend_425( - _id, _lib._sel_setAllHTTPHeaderFields_1, value?._id ?? ffi.nullptr); + /// setTotalUnitCount: + set totalUnitCount(int value) { + return _objc_msgSend_rrr3q( + this.ref.pointer, _sel_setTotalUnitCount_, value); } - /// ! - /// @method setValue:forHTTPHeaderField: - /// @abstract Sets the value of the given HTTP header field. - /// @discussion If a value was previously set for the given header - /// field, that value is replaced with the given value. Note that, in - /// keeping with the HTTP RFC, HTTP header field names are - /// case-insensitive. - /// @param value the header field value. - /// @param field the header field name (case-insensitive). - void setValue_forHTTPHeaderField_(NSString? value, NSString field) { - _lib._objc_msgSend_426(_id, _lib._sel_setValue_forHTTPHeaderField_1, - value?._id ?? ffi.nullptr, field._id); + /// completedUnitCount + int get completedUnitCount { + return _objc_msgSend_1voti03(this.ref.pointer, _sel_completedUnitCount); } - /// ! - /// @method addValue:forHTTPHeaderField: - /// @abstract Adds an HTTP header field in the current header - /// dictionary. - /// @discussion This method provides a way to add values to header - /// fields incrementally. If a value was previously set for the given - /// header field, the given value is appended to the previously-existing - /// value. The appropriate field delimiter, a comma in the case of HTTP, - /// is added by the implementation, and should not be added to the given - /// value by the caller. Note that, in keeping with the HTTP RFC, HTTP - /// header field names are case-insensitive. - /// @param value the header field value. - /// @param field the header field name (case-insensitive). - void addValue_forHTTPHeaderField_(NSString value, NSString field) { - _lib._objc_msgSend_427( - _id, _lib._sel_addValue_forHTTPHeaderField_1, value._id, field._id); + /// setCompletedUnitCount: + set completedUnitCount(int value) { + return _objc_msgSend_rrr3q( + this.ref.pointer, _sel_setCompletedUnitCount_, value); } - /// ! - /// @abstract Sets the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - @override - NSData? get HTTPBody { - final _ret = _lib._objc_msgSend_348(_id, _lib._sel_HTTPBody1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); + /// localizedDescription + objc.NSString get localizedDescription { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_localizedDescription); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the request body data of the receiver. - /// @discussion This data is sent as the message body of the request, as - /// in done in an HTTP POST request. - set HTTPBody(NSData? value) { - return _lib._objc_msgSend_428( - _id, _lib._sel_setHTTPBody_1, value?._id ?? ffi.nullptr); + /// setLocalizedDescription: + set localizedDescription(objc.NSString value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setLocalizedDescription_, value.ref.pointer); } - /// ! - /// @abstract Sets the request body to be the contents of the given stream. - /// @discussion The provided stream should be unopened; the request will take - /// over the stream's delegate. The entire stream's contents will be - /// transmitted as the HTTP body of the request. Note that the body stream - /// and the body data (set by setHTTPBody:, above) are mutually exclusive - /// - setting one will clear the other. - @override - NSInputStream? get HTTPBodyStream { - final _ret = _lib._objc_msgSend_362(_id, _lib._sel_HTTPBodyStream1); - return _ret.address == 0 - ? null - : NSInputStream._(_ret, _lib, retain: true, release: true); + /// localizedAdditionalDescription + objc.NSString get localizedAdditionalDescription { + final _ret = _objc_msgSend_1unuoxw( + this.ref.pointer, _sel_localizedAdditionalDescription); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @abstract Sets the request body to be the contents of the given stream. - /// @discussion The provided stream should be unopened; the request will take - /// over the stream's delegate. The entire stream's contents will be - /// transmitted as the HTTP body of the request. Note that the body stream - /// and the body data (set by setHTTPBody:, above) are mutually exclusive - /// - setting one will clear the other. - set HTTPBodyStream(NSInputStream? value) { - return _lib._objc_msgSend_429( - _id, _lib._sel_setHTTPBodyStream_1, value?._id ?? ffi.nullptr); + /// setLocalizedAdditionalDescription: + set localizedAdditionalDescription(objc.NSString value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, + _sel_setLocalizedAdditionalDescription_, value.ref.pointer); } - /// ! - /// @abstract Decide whether default cookie handling will happen for - /// this request (YES if cookies should be sent with and set for this request; - /// otherwise NO). - /// @discussion The default is YES - in other words, cookies are sent from and - /// stored to the cookie manager by default. - /// NOTE: In releases prior to 10.3, this value is ignored - @override - bool get HTTPShouldHandleCookies { - return _lib._objc_msgSend_11(_id, _lib._sel_HTTPShouldHandleCookies1); + /// isCancellable + bool get cancellable { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancellable); } - /// ! - /// @abstract Decide whether default cookie handling will happen for - /// this request (YES if cookies should be sent with and set for this request; - /// otherwise NO). - /// @discussion The default is YES - in other words, cookies are sent from and - /// stored to the cookie manager by default. - /// NOTE: In releases prior to 10.3, this value is ignored - set HTTPShouldHandleCookies(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setHTTPShouldHandleCookies_1, value); + /// setCancellable: + set cancellable(bool value) { + return _objc_msgSend_117qins(this.ref.pointer, _sel_setCancellable_, value); } - /// ! - /// @abstract Sets whether the request should not wait for the previous response - /// before transmitting (YES if the receiver should transmit before the previous response is - /// received. NO to wait for the previous response before transmitting) - /// @discussion Calling this method with a YES value does not guarantee HTTP - /// pipelining behavior. This method may have no effect if an HTTP proxy is - /// configured, or if the HTTP request uses an unsafe request method (e.g., POST - /// requests will not pipeline). Pipelining behavior also may not begin until - /// the second request on a given TCP connection. There may be other situations - /// where pipelining does not occur even though YES was set. - /// HTTP 1.1 allows the client to send multiple requests to the server without - /// waiting for a response. Though HTTP 1.1 requires support for pipelining, - /// some servers report themselves as being HTTP 1.1 but do not support - /// pipelining (disconnecting, sending resources misordered, omitting part of - /// a resource, etc.). - @override - bool get HTTPShouldUsePipelining { - return _lib._objc_msgSend_11(_id, _lib._sel_HTTPShouldUsePipelining1); + /// isPausable + bool get pausable { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPausable); } - /// ! - /// @abstract Sets whether the request should not wait for the previous response - /// before transmitting (YES if the receiver should transmit before the previous response is - /// received. NO to wait for the previous response before transmitting) - /// @discussion Calling this method with a YES value does not guarantee HTTP - /// pipelining behavior. This method may have no effect if an HTTP proxy is - /// configured, or if the HTTP request uses an unsafe request method (e.g., POST - /// requests will not pipeline). Pipelining behavior also may not begin until - /// the second request on a given TCP connection. There may be other situations - /// where pipelining does not occur even though YES was set. - /// HTTP 1.1 allows the client to send multiple requests to the server without - /// waiting for a response. Though HTTP 1.1 requires support for pipelining, - /// some servers report themselves as being HTTP 1.1 but do not support - /// pipelining (disconnecting, sending resources misordered, omitting part of - /// a resource, etc.). - set HTTPShouldUsePipelining(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setHTTPShouldUsePipelining_1, value); + /// setPausable: + set pausable(bool value) { + return _objc_msgSend_117qins(this.ref.pointer, _sel_setPausable_, value); } - /// ! - /// @method requestWithURL: - /// @abstract Allocates and initializes an NSURLRequest with the given - /// URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSMutableURLRequest requestWithURL_( - NativeCupertinoHttp _lib, NSURL URL) { - final _ret = _lib._objc_msgSend_211( - _lib._class_NSMutableURLRequest1, _lib._sel_requestWithURL_1, URL._id); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + /// isCancelled + bool get cancelled { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); } - /// ! - /// @property supportsSecureCoding - /// @abstract Indicates that NSURLRequest implements the NSSecureCoding protocol. - /// @result A BOOL value set to YES. - static bool getSupportsSecureCoding(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_11( - _lib._class_NSMutableURLRequest1, _lib._sel_supportsSecureCoding1); + /// isPaused + bool get paused { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isPaused); } - /// ! - /// @method requestWithURL:cachePolicy:timeoutInterval: - /// @abstract Allocates and initializes a NSURLRequest with the given - /// URL and cache policy. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result A newly-created and autoreleased NSURLRequest instance. - static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( - NativeCupertinoHttp _lib, - NSURL URL, - int cachePolicy, - DartNSTimeInterval timeoutInterval) { - final _ret = _lib._objc_msgSend_343( - _lib._class_NSMutableURLRequest1, - _lib._sel_requestWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + /// cancellationHandler + objc.ObjCBlock? get cancellationHandler { + final _ret = + _objc_msgSend_2osec1(this.ref.pointer, _sel_cancellationHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); } - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL. - /// @discussion Default values are used for cache policy - /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 - /// seconds). - /// @param URL The URL for the request. - /// @result An initialized NSURLRequest. - @override - NSMutableURLRequest initWithURL_(NSURL URL) { - final _ret = _lib._objc_msgSend_211(_id, _lib._sel_initWithURL_1, URL._id); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + /// setCancellationHandler: + set cancellationHandler(objc.ObjCBlock? value) { + return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setCancellationHandler_, + value?.ref.pointer ?? ffi.nullptr); } - /// ! - /// @method initWithURL: - /// @abstract Initializes an NSURLRequest with the given URL and - /// cache policy. - /// @discussion This is the designated initializer for the - /// NSURLRequest class. - /// @param URL The URL for the request. - /// @param cachePolicy The cache policy for the request. - /// @param timeoutInterval The timeout interval for the request. See the - /// commentary for the timeoutInterval for more information on - /// timeout intervals. - /// @result An initialized NSURLRequest. - @override - NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_( - NSURL URL, int cachePolicy, DartNSTimeInterval timeoutInterval) { - final _ret = _lib._objc_msgSend_343( - _id, - _lib._sel_initWithURL_cachePolicy_timeoutInterval_1, - URL._id, - cachePolicy, - timeoutInterval); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + /// pausingHandler + objc.ObjCBlock? get pausingHandler { + final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_pausingHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); } - @override - NSMutableURLRequest init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableURLRequest._(_ret, _lib, retain: true, release: true); + /// setPausingHandler: + set pausingHandler(objc.ObjCBlock? value) { + return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setPausingHandler_, + value?.ref.pointer ?? ffi.nullptr); } - static NSMutableURLRequest new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableURLRequest1, _lib._sel_new1); - return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + /// resumingHandler + objc.ObjCBlock? get resumingHandler { + final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_resumingHandler); + return _ret.address == 0 + ? null + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); } - static NSMutableURLRequest allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableURLRequest1, _lib._sel_allocWithZone_1, zone); - return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + /// setResumingHandler: + set resumingHandler(objc.ObjCBlock? value) { + return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setResumingHandler_, + value?.ref.pointer ?? ffi.nullptr); } - static NSMutableURLRequest alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableURLRequest1, _lib._sel_alloc1); - return NSMutableURLRequest._(_ret, _lib, retain: false, release: true); + /// setUserInfoObject:forKey: + void setUserInfoObject_forKey_( + objc.ObjCObjectBase? objectOrNil, DartNSProgressUserInfoKey key) { + _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setUserInfoObject_forKey_, + objectOrNil?.ref.pointer ?? ffi.nullptr, key.ref.pointer); } -} -abstract class NSHTTPCookieAcceptPolicy { - static const int NSHTTPCookieAcceptPolicyAlways = 0; - static const int NSHTTPCookieAcceptPolicyNever = 1; - static const int NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain = 2; -} + /// isIndeterminate + bool get indeterminate { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isIndeterminate); + } -class NSHTTPCookieStorage extends NSObject { - NSHTTPCookieStorage._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// fractionCompleted + double get fractionCompleted { + return _objc_msgSend_10noklm(this.ref.pointer, _sel_fractionCompleted); + } - /// 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); + /// isFinished + bool get finished { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); } - /// Returns a [NSHTTPCookieStorage] that wraps the given raw object pointer. - static NSHTTPCookieStorage castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSHTTPCookieStorage._(other, lib, retain: retain, release: release); + /// cancel + void cancel() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); } - /// 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); + /// pause + void pause() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_pause); } - static NSHTTPCookieStorage getSharedHTTPCookieStorage( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_430( - _lib._class_NSHTTPCookieStorage1, _lib._sel_sharedHTTPCookieStorage1); - return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + /// resume + void resume() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_resume); } - static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( - NativeCupertinoHttp _lib, NSString identifier) { - final _ret = _lib._objc_msgSend_431( - _lib._class_NSHTTPCookieStorage1, - _lib._sel_sharedCookieStorageForGroupContainerIdentifier_1, - identifier._id); - return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + /// userInfo + objc.NSDictionary get userInfo { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - NSArray? get cookies { - final _ret = _lib._objc_msgSend_188(_id, _lib._sel_cookies1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); + /// kind + DartNSProgressKind get kind { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_kind); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - void setCookie_(NSHTTPCookie cookie) { - _lib._objc_msgSend_432(_id, _lib._sel_setCookie_1, cookie._id); + /// setKind: + set kind(DartNSProgressKind value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setKind_, value.ref.pointer); } - void deleteCookie_(NSHTTPCookie cookie) { - _lib._objc_msgSend_432(_id, _lib._sel_deleteCookie_1, cookie._id); + /// estimatedTimeRemaining + objc.NSNumber? get estimatedTimeRemaining { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_estimatedTimeRemaining); + return _ret.address == 0 + ? null + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); } - void removeCookiesSinceDate_(NSDate date) { - _lib._objc_msgSend_373(_id, _lib._sel_removeCookiesSinceDate_1, date._id); + /// setEstimatedTimeRemaining: + set estimatedTimeRemaining(objc.NSNumber? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, + _sel_setEstimatedTimeRemaining_, value?.ref.pointer ?? ffi.nullptr); } - NSArray? cookiesForURL_(NSURL URL) { - final _ret = - _lib._objc_msgSend_167(_id, _lib._sel_cookiesForURL_1, URL._id); + /// throughput + objc.NSNumber? get throughput { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_throughput); return _ret.address == 0 ? null - : NSArray._(_ret, _lib, retain: true, release: true); + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); } - void setCookies_forURL_mainDocumentURL_( - NSArray cookies, NSURL? URL, NSURL? mainDocumentURL) { - _lib._objc_msgSend_433( - _id, - _lib._sel_setCookies_forURL_mainDocumentURL_1, - cookies._id, - URL?._id ?? ffi.nullptr, - mainDocumentURL?._id ?? ffi.nullptr); + /// setThroughput: + set throughput(objc.NSNumber? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setThroughput_, + value?.ref.pointer ?? ffi.nullptr); } - int get cookieAcceptPolicy { - return _lib._objc_msgSend_434(_id, _lib._sel_cookieAcceptPolicy1); + /// fileOperationKind + DartNSProgressFileOperationKind get fileOperationKind { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileOperationKind); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - set cookieAcceptPolicy(int value) { - return _lib._objc_msgSend_435( - _id, _lib._sel_setCookieAcceptPolicy_1, value); + /// setFileOperationKind: + set fileOperationKind(DartNSProgressFileOperationKind value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setFileOperationKind_, value.ref.pointer); } - NSArray sortedCookiesUsingDescriptors_(NSArray sortOrder) { - final _ret = _lib._objc_msgSend_102( - _id, _lib._sel_sortedCookiesUsingDescriptors_1, sortOrder._id); - return NSArray._(_ret, _lib, retain: true, release: true); + /// fileURL + objc.NSURL? get fileURL { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); } - void storeCookies_forTask_(NSArray cookies, NSURLSessionTask task) { - _lib._objc_msgSend_436( - _id, _lib._sel_storeCookies_forTask_1, cookies._id, task._id); + /// setFileURL: + set fileURL(objc.NSURL? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setFileURL_, value?.ref.pointer ?? ffi.nullptr); } - void getCookiesForTask_completionHandler_( - NSURLSessionTask task, ObjCBlock_ffiVoid_NSArray completionHandler) { - _lib._objc_msgSend_437(_id, _lib._sel_getCookiesForTask_completionHandler_1, - task._id, completionHandler._id); + /// fileTotalCount + objc.NSNumber? get fileTotalCount { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileTotalCount); + return _ret.address == 0 + ? null + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); } - @override - NSHTTPCookieStorage init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); + /// setFileTotalCount: + set fileTotalCount(objc.NSNumber? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileTotalCount_, + value?.ref.pointer ?? ffi.nullptr); } - static NSHTTPCookieStorage new1(NativeCupertinoHttp _lib) { + /// fileCompletedCount + objc.NSNumber? get fileCompletedCount { final _ret = - _lib._objc_msgSend_2(_lib._class_NSHTTPCookieStorage1, _lib._sel_new1); - return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_fileCompletedCount); + return _ret.address == 0 + ? null + : objc.NSNumber.castFromPointer(_ret, retain: true, release: true); } - static NSHTTPCookieStorage allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSHTTPCookieStorage1, _lib._sel_allocWithZone_1, zone); - return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + /// setFileCompletedCount: + set fileCompletedCount(objc.NSNumber? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setFileCompletedCount_, + value?.ref.pointer ?? ffi.nullptr); } - static NSHTTPCookieStorage alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSHTTPCookieStorage1, _lib._sel_alloc1); - return NSHTTPCookieStorage._(_ret, _lib, retain: false, release: true); + /// publish + void publish() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_publish); } -} -class NSHTTPCookie extends _ObjCWrapper { - NSHTTPCookie._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// unpublish + void unpublish() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_unpublish); + } - /// 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); + /// addSubscriberForFileURL:withPublishingHandler: + static objc.ObjCObjectBase addSubscriberForFileURL_withPublishingHandler_( + objc.NSURL url, DartNSProgressPublishingHandler publishingHandler) { + final _ret = _objc_msgSend_1kkhn3j( + _class_NSProgress, + _sel_addSubscriberForFileURL_withPublishingHandler_, + url.ref.pointer, + publishingHandler.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// Returns a [NSHTTPCookie] that wraps the given raw object pointer. - static NSHTTPCookie castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSHTTPCookie._(other, lib, retain: retain, release: release); + /// removeSubscriber: + static void removeSubscriber_(objc.ObjCObjectBase subscriber) { + _objc_msgSend_ukcdfq( + _class_NSProgress, _sel_removeSubscriber_, subscriber.ref.pointer); } - /// 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); + /// isOld + bool get old { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isOld); } -} -void _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSArray_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSArray_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSArray_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSArray_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSArray_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} + /// init + NSProgress init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSProgress.castFromPointer(_ret, retain: false, release: true); + } -void _ObjCBlock_ffiVoid_NSArray_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSArray_closureRegistry[block.ref.target.address]!(arg0); + /// new + static NSProgress new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_new); + return NSProgress.castFromPointer(_ret, retain: false, release: true); + } -class ObjCBlock_ffiVoid_NSArray extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSArray._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + /// allocWithZone: + static NSProgress allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSProgress, _sel_allocWithZone_, zone); + return NSProgress.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSProgress alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSProgress, _sel_alloc); + return NSProgress.castFromPointer(_ret, retain: false, release: true); + } +} + +late final _class_NSProgress = objc.getClass("NSProgress"); +late final _sel_currentProgress = objc.registerName("currentProgress"); +late final _sel_progressWithTotalUnitCount_ = + objc.registerName("progressWithTotalUnitCount:"); +final _objc_msgSend_n9eq1n = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_discreteProgressWithTotalUnitCount_ = + objc.registerName("discreteProgressWithTotalUnitCount:"); +late final _sel_progressWithTotalUnitCount_parent_pendingUnitCount_ = + objc.registerName("progressWithTotalUnitCount:parent:pendingUnitCount:"); +final _objc_msgSend_105mybv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer, + ffi.Int64)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + int)>(); +late final _sel_initWithParent_userInfo_ = + objc.registerName("initWithParent:userInfo:"); +late final _sel_becomeCurrentWithPendingUnitCount_ = + objc.registerName("becomeCurrentWithPendingUnitCount:"); +final _objc_msgSend_rrr3q = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Int64)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_performAsCurrentWithPendingUnitCount_usingBlock_ = + objc.registerName("performAsCurrentWithPendingUnitCount:usingBlock:"); +final _objc_msgSend_19q84do = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_resignCurrent = objc.registerName("resignCurrent"); +late final _sel_addChild_withPendingUnitCount_ = + objc.registerName("addChild:withPendingUnitCount:"); +final _objc_msgSend_2citz1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); +late final _sel_totalUnitCount = objc.registerName("totalUnitCount"); +final _objc_msgSend_1voti03 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Int64 Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setTotalUnitCount_ = objc.registerName("setTotalUnitCount:"); +late final _sel_completedUnitCount = objc.registerName("completedUnitCount"); +late final _sel_setCompletedUnitCount_ = + objc.registerName("setCompletedUnitCount:"); +late final _sel_localizedDescription = + objc.registerName("localizedDescription"); +late final _sel_setLocalizedDescription_ = + objc.registerName("setLocalizedDescription:"); +late final _sel_localizedAdditionalDescription = + objc.registerName("localizedAdditionalDescription"); +late final _sel_setLocalizedAdditionalDescription_ = + objc.registerName("setLocalizedAdditionalDescription:"); +late final _sel_isCancellable = objc.registerName("isCancellable"); +late final _sel_setCancellable_ = objc.registerName("setCancellable:"); +final _objc_msgSend_117qins = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Bool)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, bool)>(); +late final _sel_isPausable = objc.registerName("isPausable"); +late final _sel_setPausable_ = objc.registerName("setPausable:"); +late final _sel_isCancelled = objc.registerName("isCancelled"); +late final _sel_isPaused = objc.registerName("isPaused"); +late final _sel_cancellationHandler = objc.registerName("cancellationHandler"); +final _objc_msgSend_2osec1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCancellationHandler_ = + objc.registerName("setCancellationHandler:"); +final _objc_msgSend_4daxhl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_pausingHandler = objc.registerName("pausingHandler"); +late final _sel_setPausingHandler_ = objc.registerName("setPausingHandler:"); +late final _sel_resumingHandler = objc.registerName("resumingHandler"); +late final _sel_setResumingHandler_ = objc.registerName("setResumingHandler:"); +typedef NSProgressUserInfoKey = ffi.Pointer; +typedef DartNSProgressUserInfoKey = objc.NSString; +late final _sel_setUserInfoObject_forKey_ = + objc.registerName("setUserInfoObject:forKey:"); +late final _sel_isIndeterminate = objc.registerName("isIndeterminate"); +late final _sel_fractionCompleted = objc.registerName("fractionCompleted"); +late final _sel_isFinished = objc.registerName("isFinished"); +late final _sel_cancel = objc.registerName("cancel"); +late final _sel_pause = objc.registerName("pause"); +late final _sel_resume = objc.registerName("resume"); +typedef NSProgressKind = ffi.Pointer; +typedef DartNSProgressKind = objc.NSString; +late final _sel_kind = objc.registerName("kind"); +late final _sel_setKind_ = objc.registerName("setKind:"); +late final _sel_estimatedTimeRemaining = + objc.registerName("estimatedTimeRemaining"); +late final _sel_setEstimatedTimeRemaining_ = + objc.registerName("setEstimatedTimeRemaining:"); +late final _sel_throughput = objc.registerName("throughput"); +late final _sel_setThroughput_ = objc.registerName("setThroughput:"); +typedef NSProgressFileOperationKind = ffi.Pointer; +typedef DartNSProgressFileOperationKind = objc.NSString; +late final _sel_fileOperationKind = objc.registerName("fileOperationKind"); +late final _sel_setFileOperationKind_ = + objc.registerName("setFileOperationKind:"); +late final _sel_fileURL = objc.registerName("fileURL"); +late final _sel_setFileURL_ = objc.registerName("setFileURL:"); +late final _sel_fileTotalCount = objc.registerName("fileTotalCount"); +late final _sel_setFileTotalCount_ = objc.registerName("setFileTotalCount:"); +late final _sel_fileCompletedCount = objc.registerName("fileCompletedCount"); +late final _sel_setFileCompletedCount_ = + objc.registerName("setFileCompletedCount:"); +late final _sel_publish = objc.registerName("publish"); +late final _sel_unpublish = objc.registerName("unpublish"); +typedef NSProgressPublishingHandler = ffi.Pointer; +typedef DartNSProgressPublishingHandler + = objc.ObjCBlock Function(NSProgress)>; +NSProgressUnpublishingHandler + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer arg0)>>() + .asFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer)>()(arg0); +ffi.Pointer + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable = + ffi.Pointer.fromFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrTrampoline) + .cast(); +NSProgressUnpublishingHandler + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as NSProgressUnpublishingHandler Function( + ffi.Pointer))(arg0); +ffi.Pointer + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable = + ffi.Pointer.fromFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock Function(NSProgress)>`. +abstract final class ObjCBlock_NSProgressUnpublishingHandler_NSProgress { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + objc.ObjCBlock Function(NSProgress)> castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock Function(NSProgress)>( + pointer, + retain: retain, + release: release); /// 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. - ObjCBlock_ffiVoid_NSArray.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc.ObjCBlock Function(NSProgress)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock Function(NSProgress)>( + objc.newPointerBlock( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_NSArray.fromFunction( - NativeCupertinoHttp lib, void Function(NSArray?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSArray_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_NSArray.listener( - NativeCupertinoHttp lib, void Function(NSArray?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSArray_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSArray_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSArray? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); -} - -final class CFArrayCallBacks extends ffi.Struct { - @CFIndex() - external int version; - - external CFArrayRetainCallBack retain; - - external CFArrayReleaseCallBack release; - - external CFArrayCopyDescriptionCallBack copyDescription; - - external CFArrayEqualCallBack equal; -} - -typedef CFArrayRetainCallBack - = ffi.Pointer>; -typedef CFArrayRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFArrayReleaseCallBack - = ffi.Pointer>; -typedef CFArrayReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFArrayReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFArrayCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFArrayCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFArrayEqualCallBack - = ffi.Pointer>; -typedef CFArrayEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFArrayEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); - -final class __CFArray extends ffi.Opaque {} - -typedef CFArrayRef = ffi.Pointer<__CFArray>; -typedef CFMutableArrayRef = ffi.Pointer<__CFArray>; -typedef CFArrayApplierFunction - = ffi.Pointer>; -typedef CFArrayApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFArrayApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); -typedef CFComparatorFunction - = ffi.Pointer>; -typedef CFComparatorFunctionFunction = ffi.Int32 Function( - ffi.Pointer val1, - ffi.Pointer val2, - ffi.Pointer context); -typedef DartCFComparatorFunctionFunction = int Function( - ffi.Pointer val1, - ffi.Pointer val2, - ffi.Pointer context); - -final class sec_object extends ffi.Opaque {} - -final class __SecCertificate extends ffi.Opaque {} - -final class __SecIdentity extends ffi.Opaque {} - -final class __SecKey extends ffi.Opaque {} - -final class __SecPolicy extends ffi.Opaque {} - -final class __SecAccessControl extends ffi.Opaque {} - -final class __SecKeychain extends ffi.Opaque {} - -final class __SecKeychainItem extends ffi.Opaque {} - -final class __SecKeychainSearch extends ffi.Opaque {} - -final class SecKeychainAttribute extends ffi.Struct { - @SecKeychainAttrType() - external int tag; - - @UInt32() - external int length; - - external ffi.Pointer data; -} - -typedef SecKeychainAttrType = OSType; -typedef OSType = FourCharCode; -typedef FourCharCode = UInt32; - -final class SecKeychainAttributeList extends ffi.Struct { - @UInt32() - external int count; - - external ffi.Pointer attr; -} - -final class __SecTrustedApplication extends ffi.Opaque {} - -final class __SecAccess extends ffi.Opaque {} - -final class __SecACL extends ffi.Opaque {} - -final class __SecPassword extends ffi.Opaque {} - -final class SecKeychainAttributeInfo extends ffi.Struct { - @UInt32() - external int count; - - external ffi.Pointer tag; - - external ffi.Pointer format; -} - -typedef OSStatus = SInt32; - -final class _RuneEntry extends ffi.Struct { - @__darwin_rune_t() - external int __min; - - @__darwin_rune_t() - external int __max; - - @__darwin_rune_t() - external int __map; - - external ffi.Pointer<__uint32_t> __types; -} - -typedef __darwin_rune_t = __darwin_wchar_t; -typedef __darwin_wchar_t = ffi.Int; -typedef Dart__darwin_wchar_t = int; - -final class _RuneRange extends ffi.Struct { - @ffi.Int() - external int __nranges; - - external ffi.Pointer<_RuneEntry> __ranges; -} - -final class _RuneCharClass extends ffi.Struct { - @ffi.Array.multi([14]) - external ffi.Array __name; - - @__uint32_t() - external int __mask; -} - -final class _RuneLocale extends ffi.Struct { - @ffi.Array.multi([8]) - external ffi.Array __magic; - - @ffi.Array.multi([32]) - external ffi.Array __encoding; - - external ffi.Pointer< - ffi.NativeFunction< - __darwin_rune_t Function(ffi.Pointer, __darwin_size_t, - ffi.Pointer>)>> __sgetrune; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function(__darwin_rune_t, ffi.Pointer, - __darwin_size_t, ffi.Pointer>)>> __sputrune; - - @__darwin_rune_t() - external int __invalid_rune; - - @ffi.Array.multi([256]) - external ffi.Array<__uint32_t> __runetype; - - @ffi.Array.multi([256]) - external ffi.Array<__darwin_rune_t> __maplower; - - @ffi.Array.multi([256]) - external ffi.Array<__darwin_rune_t> __mapupper; - - external _RuneRange __runetype_ext; - - external _RuneRange __maplower_ext; - - external _RuneRange __mapupper_ext; - - external ffi.Pointer __variable; - - @ffi.Int() - external int __variable_len; - - @ffi.Int() - external int __ncharclasses; - - external ffi.Pointer<_RuneCharClass> __charclasses; -} - -typedef __darwin_ct_rune_t = ffi.Int; -typedef Dart__darwin_ct_rune_t = int; - -final class lconv extends ffi.Struct { - external ffi.Pointer decimal_point; - - external ffi.Pointer thousands_sep; - - external ffi.Pointer grouping; - - external ffi.Pointer int_curr_symbol; - - external ffi.Pointer currency_symbol; - - external ffi.Pointer mon_decimal_point; - - external ffi.Pointer mon_thousands_sep; - - external ffi.Pointer mon_grouping; - - external ffi.Pointer positive_sign; - - external ffi.Pointer negative_sign; - - @ffi.Char() - external int int_frac_digits; - - @ffi.Char() - external int frac_digits; - - @ffi.Char() - external int p_cs_precedes; - - @ffi.Char() - external int p_sep_by_space; - - @ffi.Char() - external int n_cs_precedes; - - @ffi.Char() - external int n_sep_by_space; - - @ffi.Char() - external int p_sign_posn; - - @ffi.Char() - external int n_sign_posn; - - @ffi.Char() - external int int_p_cs_precedes; - - @ffi.Char() - external int int_n_cs_precedes; - - @ffi.Char() - external int int_p_sep_by_space; - - @ffi.Char() - external int int_n_sep_by_space; - - @ffi.Char() - external int int_p_sign_posn; - - @ffi.Char() - external int int_n_sign_posn; -} - -final class exception extends ffi.Struct { - @ffi.Int() - external int type; - - external ffi.Pointer name; - - @ffi.Double() - external double arg1; - - @ffi.Double() - external double arg2; - - @ffi.Double() - external double retval; + static objc.ObjCBlock< + objc.ObjCBlock Function(NSProgress)> fromFunction( + DartNSProgressUnpublishingHandler Function(NSProgress) fn) => + objc.ObjCBlock Function(NSProgress)>( + objc.newClosureBlock( + _ObjCBlock_NSProgressUnpublishingHandler_NSProgress_closureCallable, + (ffi.Pointer arg0) => + fn(NSProgress.castFromPointer(arg0, retain: true, release: true)) + .ref + .retainAndAutorelease()), + retain: false, + release: true); } -typedef pthread_t = __darwin_pthread_t; -typedef __darwin_pthread_t = ffi.Pointer<_opaque_pthread_t>; -typedef stack_t = __darwin_sigaltstack; - -final class __sbuf extends ffi.Struct { - external ffi.Pointer _base; - - @ffi.Int() - external int _size; +/// Call operator for `objc.ObjCBlock Function(NSProgress)>`. +extension ObjCBlock_NSProgressUnpublishingHandler_NSProgress_CallExtension + on objc + .ObjCBlock Function(NSProgress)> { + DartNSProgressUnpublishingHandler call(NSProgress arg0) => + ObjCBlock_ffiVoid.castFromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + NSProgressUnpublishingHandler Function( + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer), + retain: true, + release: true); } -final class __sFILEX extends ffi.Opaque {} +typedef NSProgressUnpublishingHandler = ffi.Pointer; +typedef DartNSProgressUnpublishingHandler = objc.ObjCBlock; +late final _sel_addSubscriberForFileURL_withPublishingHandler_ = + objc.registerName("addSubscriberForFileURL:withPublishingHandler:"); +final _objc_msgSend_1kkhn3j = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSProgressPublishingHandler)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSProgressPublishingHandler)>(); +late final _sel_removeSubscriber_ = objc.registerName("removeSubscriber:"); +late final _sel_isOld = objc.registerName("isOld"); +late final _sel_progress = objc.registerName("progress"); +late final _sel_earliestBeginDate = objc.registerName("earliestBeginDate"); +late final _sel_setEarliestBeginDate_ = + objc.registerName("setEarliestBeginDate:"); +late final _sel_countOfBytesClientExpectsToSend = + objc.registerName("countOfBytesClientExpectsToSend"); +late final _sel_setCountOfBytesClientExpectsToSend_ = + objc.registerName("setCountOfBytesClientExpectsToSend:"); +late final _sel_countOfBytesClientExpectsToReceive = + objc.registerName("countOfBytesClientExpectsToReceive"); +late final _sel_setCountOfBytesClientExpectsToReceive_ = + objc.registerName("setCountOfBytesClientExpectsToReceive:"); +late final _sel_countOfBytesSent = objc.registerName("countOfBytesSent"); +late final _sel_countOfBytesReceived = + objc.registerName("countOfBytesReceived"); +late final _sel_countOfBytesExpectedToSend = + objc.registerName("countOfBytesExpectedToSend"); +late final _sel_countOfBytesExpectedToReceive = + objc.registerName("countOfBytesExpectedToReceive"); +late final _sel_taskDescription = objc.registerName("taskDescription"); +late final _sel_setTaskDescription_ = objc.registerName("setTaskDescription:"); + +enum NSURLSessionTaskState { + /// The task is currently being serviced by the session + NSURLSessionTaskStateRunning(0), + NSURLSessionTaskStateSuspended(1), -final class __sFILE extends ffi.Struct { - external ffi.Pointer _p; + /// The task has been told to cancel. The session will receive a URLSession:task:didCompleteWithError: message. + NSURLSessionTaskStateCanceling(2), - @ffi.Int() - external int _r; + /// The task has completed and the session will receive no more delegate notifications + NSURLSessionTaskStateCompleted(3); + + final int value; + const NSURLSessionTaskState(this.value); + + static NSURLSessionTaskState fromValue(int value) => switch (value) { + 0 => NSURLSessionTaskStateRunning, + 1 => NSURLSessionTaskStateSuspended, + 2 => NSURLSessionTaskStateCanceling, + 3 => NSURLSessionTaskStateCompleted, + _ => throw ArgumentError( + "Unknown value for NSURLSessionTaskState: $value"), + }; +} + +late final _sel_state = objc.registerName("state"); +final _objc_msgSend_8b7yc1 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_error = objc.registerName("error"); +late final _sel_suspend = objc.registerName("suspend"); +late final _sel_priority = objc.registerName("priority"); +final _objc_msgSend_fcilgx = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +final _objc_msgSend_fcilgxFpret = objc.msgSendFpretPointer + .cast< + ffi.NativeFunction< + ffi.Float Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + double Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setPriority_ = objc.registerName("setPriority:"); +final _objc_msgSend_s9gjzc = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Float)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_prefersIncrementalDelivery = + objc.registerName("prefersIncrementalDelivery"); +late final _sel_setPrefersIncrementalDelivery_ = + objc.registerName("setPrefersIncrementalDelivery:"); + +/// NSProgressReporting +abstract final class NSProgressReporting { + /// Builds an object that implements the NSProgressReporting protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required NSProgress Function() progress}) { + final builder = objc.ObjCProtocolBuilder(); + NSProgressReporting.progress.implement(builder, progress); + return builder.build(); + } + + /// Adds the implementation of the NSProgressReporting protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required NSProgress Function() progress}) { + NSProgressReporting.progress.implement(builder, progress); + } + + /// progress + static final progress = objc.ObjCProtocolMethod( + _sel_progress, + objc.getProtocolMethodSignature( + _protocol_NSProgressReporting, + _sel_progress, + isRequired: true, + isInstanceMethod: true, + ), + (NSProgress Function() func) => ObjCBlock_NSProgress_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); +} + +late final _protocol_NSProgressReporting = + objc.getProtocol("NSProgressReporting"); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSProgress_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSProgress_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - @ffi.Int() - external int _w; + /// 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. + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_NSProgress_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - @ffi.Short() - external int _flags; + /// 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. + static objc.ObjCBlock)> + fromFunction(NSProgress Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSProgress_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSProgress_ffiVoid_CallExtension + on objc.ObjCBlock)> { + NSProgress call(ffi.Pointer arg0) => NSProgress.castFromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); +} - @ffi.Short() - external int _file; +late final _sel_storeCachedResponse_forDataTask_ = + objc.registerName("storeCachedResponse:forDataTask:"); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSCachedURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - external __sbuf _bf; + /// 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. + static objc.ObjCBlock + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - @ffi.Int() - external int _lbfsize; + /// 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. + static objc.ObjCBlock fromFunction( + void Function(NSCachedURLResponse?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); - external ffi.Pointer _cookie; + /// 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. + static objc.ObjCBlock listener( + void Function(NSCachedURLResponse?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCachedURLResponse_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSCachedURLResponse.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} - external ffi - .Pointer)>> - _close; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSCachedURLResponse_CallExtension + on objc.ObjCBlock { + void call(NSCachedURLResponse? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_getCachedResponseForDataTask_completionHandler_ = + objc.registerName("getCachedResponseForDataTask:completionHandler:"); +final _objc_msgSend_cmbt6k = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_removeCachedResponseForDataTask_ = + objc.registerName("removeCachedResponseForDataTask:"); +typedef NSNotificationName = ffi.Pointer; +typedef DartNSNotificationName = objc.NSString; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> _read; +/// ! +/// @class NSMutableURLRequest +/// +/// @abstract An NSMutableURLRequest object represents a mutable URL load +/// request in a manner independent of protocol and URL scheme. +/// +/// @discussion This specialization of NSURLRequest is provided to aid +/// developers who may find it more convenient to mutate a single request +/// object for a series of URL loads instead of creating an immutable +/// NSURLRequest for each load. This programming model is supported by +/// the following contract stipulation between NSMutableURLRequest and +/// NSURLConnection: NSURLConnection makes a deep copy of each +/// NSMutableURLRequest object passed to one of its initializers. +///

NSMutableURLRequest is designed to be extended to support +/// protocol-specific data by adding categories to access a property +/// object provided in an interface targeted at protocol implementors. +///

    +///
  • Protocol implementors should direct their attention to the +/// NSMutableURLRequestExtensibility category on +/// NSMutableURLRequest for more information on how to provide +/// extensions on NSMutableURLRequest to support protocol-specific +/// request information. +///
  • Clients of this API who wish to create NSMutableURLRequest +/// objects to load URL content should consult the protocol-specific +/// NSMutableURLRequest categories that are available. The +/// NSMutableHTTPURLRequest category on NSMutableURLRequest is an +/// example. +///
+class NSMutableURLRequest extends NSURLRequest { + NSMutableURLRequest._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - external ffi.Pointer< - ffi.NativeFunction< - fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>> _seek; + /// Constructs a [NSMutableURLRequest] that points to the same underlying object as [other]. + NSMutableURLRequest.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>> _write; + /// Constructs a [NSMutableURLRequest] that wraps the given raw object pointer. + NSMutableURLRequest.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - external __sbuf _ub; + /// Returns whether [obj] is an instance of [NSMutableURLRequest]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSMutableURLRequest); + } - external ffi.Pointer<__sFILEX> _extra; + /// ! + /// @abstract The URL of the receiver. + objc.NSURL? get URL { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } - @ffi.Int() - external int _ur; + /// ! + /// @abstract The URL of the receiver. + set URL(objc.NSURL? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setURL_, value?.ref.pointer ?? ffi.nullptr); + } - @ffi.Array.multi([3]) - external ffi.Array _ubuf; + /// ! + /// @abstract The cache policy of the receiver. + NSURLRequestCachePolicy get cachePolicy { + final _ret = _objc_msgSend_2xak1q(this.ref.pointer, _sel_cachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); + } - @ffi.Array.multi([1]) - external ffi.Array _nbuf; + /// ! + /// @abstract The cache policy of the receiver. + set cachePolicy(NSURLRequestCachePolicy value) { + return _objc_msgSend_12vaadl( + this.ref.pointer, _sel_setCachePolicy_, value.value); + } - external __sbuf _lb; + /// ! + /// @abstract Sets the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + DartNSTimeInterval get timeoutInterval { + return _objc_msgSend_10noklm(this.ref.pointer, _sel_timeoutInterval); + } - @ffi.Int() - external int _blksize; + /// ! + /// @abstract Sets the timeout interval of the receiver. + /// @discussion The timeout interval specifies the limit on the idle + /// interval allotted to a request in the process of loading. The "idle + /// interval" is defined as the period of time that has passed since the + /// last instance of load activity occurred for a request that is in the + /// process of loading. Hence, when an instance of load activity occurs + /// (e.g. bytes are received from the network for a request), the idle + /// interval for a request is reset to 0. If the idle interval ever + /// becomes greater than or equal to the timeout interval, the request + /// is considered to have timed out. This timeout interval is measured + /// in seconds. + set timeoutInterval(DartNSTimeInterval value) { + return _objc_msgSend_suh039( + this.ref.pointer, _sel_setTimeoutInterval_, value); + } - @fpos_t() - external int _offset; -} + /// ! + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. + objc.NSURL? get mainDocumentURL { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_mainDocumentURL); + return _ret.address == 0 + ? null + : objc.NSURL.castFromPointer(_ret, retain: true, release: true); + } -typedef fpos_t = __darwin_off_t; -typedef __darwin_off_t = __int64_t; -typedef __int64_t = ffi.LongLong; -typedef Dart__int64_t = int; -typedef FILE = __sFILE; -typedef off_t = __darwin_off_t; -typedef ssize_t = __darwin_ssize_t; -typedef __darwin_ssize_t = ffi.Long; -typedef Dart__darwin_ssize_t = int; -typedef errno_t = ffi.Int; -typedef Darterrno_t = int; -typedef rsize_t = ffi.UnsignedLong; -typedef Dartrsize_t = int; + /// ! + /// @abstract Sets the main document URL + /// @discussion The caller should pass the URL for an appropriate main + /// document, if known. For example, when loading a web page, the URL + /// of the main html document for the top-level frame should be + /// passed. This main document is used to implement the cookie "only + /// from same domain as main document" policy, attributing this request + /// as a sub-resource of a user-specified URL, and possibly other things + /// in the future. + set mainDocumentURL(objc.NSURL? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setMainDocumentURL_, + value?.ref.pointer ?? ffi.nullptr); + } -final class timespec extends ffi.Struct { - @__darwin_time_t() - external int tv_sec; + /// ! + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. + NSURLRequestNetworkServiceType get networkServiceType { + final _ret = + _objc_msgSend_ttt73t(this.ref.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); + } - @ffi.Long() - external int tv_nsec; -} + /// ! + /// @abstract Sets the NSURLRequestNetworkServiceType to associate with this request + /// @discussion This method is used to provide the network layers with a hint as to the purpose + /// of the request. Most clients should not need to use this method. + set networkServiceType(NSURLRequestNetworkServiceType value) { + return _objc_msgSend_br89tg( + this.ref.pointer, _sel_setNetworkServiceType_, value.value); + } -final class tm extends ffi.Struct { - @ffi.Int() - external int tm_sec; + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. + bool get allowsCellularAccess { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_allowsCellularAccess); + } - @ffi.Int() - external int tm_min; + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// the built in cellular radios (if present). + /// @discussion NO if the receiver should not be allowed to use the built in + /// cellular radios to satisfy the request, YES otherwise. The default is YES. + set allowsCellularAccess(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setAllowsCellularAccess_, value); + } - @ffi.Int() - external int tm_hour; + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as expensive. + /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to + /// satisfy the request, YES otherwise. + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_allowsExpensiveNetworkAccess); + } - @ffi.Int() - external int tm_mday; + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as expensive. + /// @discussion NO if the receiver should not be allowed to use an interface marked as expensive to + /// satisfy the request, YES otherwise. + set allowsExpensiveNetworkAccess(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); + } - @ffi.Int() - external int tm_mon; + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as constrained. + /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to + /// satisfy the request, YES otherwise. + bool get allowsConstrainedNetworkAccess { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_allowsConstrainedNetworkAccess); + } - @ffi.Int() - external int tm_year; + /// ! + /// @abstract sets whether a connection created with this request is allowed to use + /// network interfaces which have been marked as constrained. + /// @discussion NO if the receiver should not be allowed to use an interface marked as constrained to + /// satisfy the request, YES otherwise. + set allowsConstrainedNetworkAccess(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); + } - @ffi.Int() - external int tm_wday; + /// ! + /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC + /// racing without HTTP/3 service discovery. + /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. + /// The default may be YES in a future OS update. + bool get assumesHTTP3Capable { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_assumesHTTP3Capable); + } - @ffi.Int() - external int tm_yday; + /// ! + /// @abstract returns whether we assume that server supports HTTP/3. Enables QUIC + /// racing without HTTP/3 service discovery. + /// @result YES if server endpoint is known to support HTTP/3. Defaults to NO. + /// The default may be YES in a future OS update. + set assumesHTTP3Capable(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setAssumesHTTP3Capable_, value); + } - @ffi.Int() - external int tm_isdst; + /// ! + /// @abstract Sets the NSURLRequestAttribution to associate with this request. + /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the + /// user. Defaults to NSURLRequestAttributionDeveloper. + NSURLRequestAttribution get attribution { + final _ret = _objc_msgSend_t5yka9(this.ref.pointer, _sel_attribution); + return NSURLRequestAttribution.fromValue(_ret); + } - @ffi.Long() - external int tm_gmtoff; + /// ! + /// @abstract Sets the NSURLRequestAttribution to associate with this request. + /// @discussion Set to NSURLRequestAttributionUser if the URL was specified by the + /// user. Defaults to NSURLRequestAttributionDeveloper. + set attribution(NSURLRequestAttribution value) { + return _objc_msgSend_1w8eyjo( + this.ref.pointer, _sel_setAttribution_, value.value); + } - external ffi.Pointer tm_zone; -} + /// ! + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + bool get requiresDNSSECValidation { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_requiresDNSSECValidation); + } -typedef clock_t = __darwin_clock_t; -typedef __darwin_clock_t = ffi.UnsignedLong; -typedef Dart__darwin_clock_t = int; -typedef time_t = __darwin_time_t; + /// ! + /// @abstract sets whether a request is required to do DNSSEC validation during DNS lookup. + /// @discussion YES, if the DNS lookup for this request should require DNSSEC validation, + /// No otherwise. Defaults to NO. + set requiresDNSSECValidation(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); + } -abstract class clockid_t { - static const int _CLOCK_REALTIME = 0; - static const int _CLOCK_MONOTONIC = 6; - static const int _CLOCK_MONOTONIC_RAW = 4; - static const int _CLOCK_MONOTONIC_RAW_APPROX = 5; - static const int _CLOCK_UPTIME_RAW = 8; - static const int _CLOCK_UPTIME_RAW_APPROX = 9; - static const int _CLOCK_PROCESS_CPUTIME_ID = 12; - static const int _CLOCK_THREAD_CPUTIME_ID = 16; -} + /// HTTPMethod + objc.NSString get HTTPMethod { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPMethod); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); + } -typedef intmax_t = ffi.Long; -typedef Dartintmax_t = int; + /// setHTTPMethod: + set HTTPMethod(objc.NSString value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setHTTPMethod_, value.ref.pointer); + } -final class imaxdiv_t extends ffi.Struct { - @intmax_t() - external int quot; + /// allHTTPHeaderFields + objc.NSDictionary? get allHTTPHeaderFields { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allHTTPHeaderFields); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); + } - @intmax_t() - external int rem; -} + /// setAllHTTPHeaderFields: + set allHTTPHeaderFields(objc.NSDictionary? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setAllHTTPHeaderFields_, + value?.ref.pointer ?? ffi.nullptr); + } -typedef uintmax_t = ffi.UnsignedLong; -typedef Dartuintmax_t = int; + /// setValue:forHTTPHeaderField: + void setValue_forHTTPHeaderField_(objc.NSString? value, objc.NSString field) { + _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_setValue_forHTTPHeaderField_, + value?.ref.pointer ?? ffi.nullptr, field.ref.pointer); + } -final class CFBagCallBacks extends ffi.Struct { - @CFIndex() - external int version; + /// addValue:forHTTPHeaderField: + void addValue_forHTTPHeaderField_(objc.NSString value, objc.NSString field) { + _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_addValue_forHTTPHeaderField_, + value.ref.pointer, field.ref.pointer); + } - external CFBagRetainCallBack retain; + /// HTTPBody + objc.NSData? get HTTPBody { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBody); + return _ret.address == 0 + ? null + : objc.NSData.castFromPointer(_ret, retain: true, release: true); + } - external CFBagReleaseCallBack release; + /// setHTTPBody: + set HTTPBody(objc.NSData? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setHTTPBody_, value?.ref.pointer ?? ffi.nullptr); + } - external CFBagCopyDescriptionCallBack copyDescription; + /// HTTPBodyStream + objc.NSInputStream? get HTTPBodyStream { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPBodyStream); + return _ret.address == 0 + ? null + : objc.NSInputStream.castFromPointer(_ret, retain: true, release: true); + } - external CFBagEqualCallBack equal; + /// setHTTPBodyStream: + set HTTPBodyStream(objc.NSInputStream? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setHTTPBodyStream_, + value?.ref.pointer ?? ffi.nullptr); + } - external CFBagHashCallBack hash; -} + /// HTTPShouldHandleCookies + bool get HTTPShouldHandleCookies { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldHandleCookies); + } -typedef CFBagRetainCallBack - = ffi.Pointer>; -typedef CFBagRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFBagReleaseCallBack - = ffi.Pointer>; -typedef CFBagReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFBagReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFBagCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFBagCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFBagEqualCallBack - = ffi.Pointer>; -typedef CFBagEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFBagEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef CFBagHashCallBack - = ffi.Pointer>; -typedef CFBagHashCallBackFunction = CFHashCode Function( - ffi.Pointer value); -typedef DartCFBagHashCallBackFunction = DartCFHashCode Function( - ffi.Pointer value); + /// setHTTPShouldHandleCookies: + set HTTPShouldHandleCookies(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setHTTPShouldHandleCookies_, value); + } -final class __CFBag extends ffi.Opaque {} + /// HTTPShouldUsePipelining + bool get HTTPShouldUsePipelining { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldUsePipelining); + } -typedef CFBagRef = ffi.Pointer<__CFBag>; -typedef CFMutableBagRef = ffi.Pointer<__CFBag>; -typedef CFBagApplierFunction - = ffi.Pointer>; -typedef CFBagApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFBagApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); + /// setHTTPShouldUsePipelining: + set HTTPShouldUsePipelining(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); + } -final class CFBinaryHeapCompareContext extends ffi.Struct { - @CFIndex() - external int version; + /// ! + /// @method requestWithURL: + /// @abstract Allocates and initializes an NSURLRequest with the given + /// URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSMutableURLRequest requestWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_juohf7( + _class_NSMutableURLRequest, _sel_requestWithURL_, URL.ref.pointer); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } - external ffi.Pointer info; + /// ! + /// @property supportsSecureCoding + /// @abstract Indicates that NSURLRequest implements the NSSecureCoding protocol. + /// @result A BOOL value set to YES. + static bool getSupportsSecureCoding() { + return _objc_msgSend_olxnu1( + _class_NSMutableURLRequest, _sel_supportsSecureCoding); + } - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + /// ! + /// @method requestWithURL:cachePolicy:timeoutInterval: + /// @abstract Allocates and initializes a NSURLRequest with the given + /// URL and cache policy. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result A newly-created and autoreleased NSURLRequest instance. + static NSMutableURLRequest requestWithURL_cachePolicy_timeoutInterval_( + objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, + DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_191svj( + _class_NSMutableURLRequest, + _sel_requestWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSMutableURLRequest.castFromPointer(_ret, + retain: true, release: true); + } - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL. + /// @discussion Default values are used for cache policy + /// (NSURLRequestUseProtocolCachePolicy) and timeout interval (60 + /// seconds). + /// @param URL The URL for the request. + /// @result An initialized NSURLRequest. + NSMutableURLRequest initWithURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_juohf7( + this.ref.retainAndReturnPointer(), _sel_initWithURL_, URL.ref.pointer); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} + /// ! + /// @method initWithURL: + /// @abstract Initializes an NSURLRequest with the given URL and + /// cache policy. + /// @discussion This is the designated initializer for the + /// NSURLRequest class. + /// @param URL The URL for the request. + /// @param cachePolicy The cache policy for the request. + /// @param timeoutInterval The timeout interval for the request. See the + /// commentary for the timeoutInterval for more information on + /// timeout intervals. + /// @result An initialized NSURLRequest. + NSMutableURLRequest initWithURL_cachePolicy_timeoutInterval_(objc.NSURL URL, + NSURLRequestCachePolicy cachePolicy, DartNSTimeInterval timeoutInterval) { + final _ret = _objc_msgSend_191svj( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_cachePolicy_timeoutInterval_, + URL.ref.pointer, + cachePolicy.value, + timeoutInterval); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } -final class CFBinaryHeapCallBacks extends ffi.Struct { - @CFIndex() - external int version; + /// init + NSMutableURLRequest init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer ptr)>> retain; + /// new + static NSMutableURLRequest new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSMutableURLRequest, _sel_new); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer ptr)>> release; + /// allocWithZone: + static NSMutableURLRequest allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSMutableURLRequest, _sel_allocWithZone_, zone); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction ptr)>> - copyDescription; + /// alloc + static NSMutableURLRequest alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSMutableURLRequest, _sel_alloc); + return NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction< - ffi.Int32 Function( - ffi.Pointer ptr1, - ffi.Pointer ptr2, - ffi.Pointer context)>> compare; -} + /// initWithCoder: + NSMutableURLRequest? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); + return _ret.address == 0 + ? null + : NSMutableURLRequest.castFromPointer(_ret, + retain: false, release: true); + } +} + +late final _class_NSMutableURLRequest = objc.getClass("NSMutableURLRequest"); +late final _sel_setURL_ = objc.registerName("setURL:"); +late final _sel_setCachePolicy_ = objc.registerName("setCachePolicy:"); +final _objc_msgSend_12vaadl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setTimeoutInterval_ = objc.registerName("setTimeoutInterval:"); +final _objc_msgSend_suh039 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSTimeInterval)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, double)>(); +late final _sel_setMainDocumentURL_ = objc.registerName("setMainDocumentURL:"); +late final _sel_setNetworkServiceType_ = + objc.registerName("setNetworkServiceType:"); +final _objc_msgSend_br89tg = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setAllowsCellularAccess_ = + objc.registerName("setAllowsCellularAccess:"); +late final _sel_setAllowsExpensiveNetworkAccess_ = + objc.registerName("setAllowsExpensiveNetworkAccess:"); +late final _sel_setAllowsConstrainedNetworkAccess_ = + objc.registerName("setAllowsConstrainedNetworkAccess:"); +late final _sel_setAssumesHTTP3Capable_ = + objc.registerName("setAssumesHTTP3Capable:"); +late final _sel_setAttribution_ = objc.registerName("setAttribution:"); +final _objc_msgSend_1w8eyjo = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_setRequiresDNSSECValidation_ = + objc.registerName("setRequiresDNSSECValidation:"); +late final _sel_setHTTPMethod_ = objc.registerName("setHTTPMethod:"); +late final _sel_setAllHTTPHeaderFields_ = + objc.registerName("setAllHTTPHeaderFields:"); +late final _sel_setValue_forHTTPHeaderField_ = + objc.registerName("setValue:forHTTPHeaderField:"); +late final _sel_addValue_forHTTPHeaderField_ = + objc.registerName("addValue:forHTTPHeaderField:"); +late final _sel_setHTTPBody_ = objc.registerName("setHTTPBody:"); +late final _sel_setHTTPBodyStream_ = objc.registerName("setHTTPBodyStream:"); +late final _sel_setHTTPShouldHandleCookies_ = + objc.registerName("setHTTPShouldHandleCookies:"); +late final _sel_setHTTPShouldUsePipelining_ = + objc.registerName("setHTTPShouldUsePipelining:"); + +enum NSHTTPCookieAcceptPolicy { + NSHTTPCookieAcceptPolicyAlways(0), + NSHTTPCookieAcceptPolicyNever(1), + NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain(2); + + final int value; + const NSHTTPCookieAcceptPolicy(this.value); + + static NSHTTPCookieAcceptPolicy fromValue(int value) => switch (value) { + 0 => NSHTTPCookieAcceptPolicyAlways, + 1 => NSHTTPCookieAcceptPolicyNever, + 2 => NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain, + _ => throw ArgumentError( + "Unknown value for NSHTTPCookieAcceptPolicy: $value"), + }; +} + +/// NSHTTPCookieStorage +class NSHTTPCookieStorage extends objc.NSObject { + NSHTTPCookieStorage._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); -final class __CFBinaryHeap extends ffi.Opaque {} + /// Constructs a [NSHTTPCookieStorage] that points to the same underlying object as [other]. + NSHTTPCookieStorage.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -typedef CFBinaryHeapRef = ffi.Pointer<__CFBinaryHeap>; -typedef CFBinaryHeapApplierFunction - = ffi.Pointer>; -typedef CFBinaryHeapApplierFunctionFunction = ffi.Void Function( - ffi.Pointer val, ffi.Pointer context); -typedef DartCFBinaryHeapApplierFunctionFunction = void Function( - ffi.Pointer val, ffi.Pointer context); + /// Constructs a [NSHTTPCookieStorage] that wraps the given raw object pointer. + NSHTTPCookieStorage.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); -final class __CFBitVector extends ffi.Opaque {} + /// Returns whether [obj] is an instance of [NSHTTPCookieStorage]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPCookieStorage); + } -typedef CFBitVectorRef = ffi.Pointer<__CFBitVector>; -typedef CFMutableBitVectorRef = ffi.Pointer<__CFBitVector>; -typedef CFBit = UInt32; + /// sharedHTTPCookieStorage + static NSHTTPCookieStorage getSharedHTTPCookieStorage() { + final _ret = _objc_msgSend_1unuoxw( + _class_NSHTTPCookieStorage, _sel_sharedHTTPCookieStorage); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: true, release: true); + } -abstract class __CFByteOrder { - static const int CFByteOrderUnknown = 0; - static const int CFByteOrderLittleEndian = 1; - static const int CFByteOrderBigEndian = 2; -} + /// sharedCookieStorageForGroupContainerIdentifier: + static NSHTTPCookieStorage sharedCookieStorageForGroupContainerIdentifier_( + objc.NSString identifier) { + final _ret = _objc_msgSend_juohf7( + _class_NSHTTPCookieStorage, + _sel_sharedCookieStorageForGroupContainerIdentifier_, + identifier.ref.pointer); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: true, release: true); + } -final class CFSwappedFloat32 extends ffi.Struct { - @ffi.Uint32() - external int v; -} + /// cookies + objc.ObjCObjectBase? get cookies { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_cookies); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } -final class CFSwappedFloat64 extends ffi.Struct { - @ffi.Uint64() - external int v; -} + /// setCookie: + void setCookie_(NSHTTPCookie cookie) { + _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setCookie_, cookie.ref.pointer); + } -final class CFDictionaryKeyCallBacks extends ffi.Struct { - @CFIndex() - external int version; + /// deleteCookie: + void deleteCookie_(NSHTTPCookie cookie) { + _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_deleteCookie_, cookie.ref.pointer); + } - external CFDictionaryRetainCallBack retain; + /// removeCookiesSinceDate: + void removeCookiesSinceDate_(objc.NSDate date) { + _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_removeCookiesSinceDate_, date.ref.pointer); + } - external CFDictionaryReleaseCallBack release; + /// cookiesForURL: + objc.ObjCObjectBase? cookiesForURL_(objc.NSURL URL) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_cookiesForURL_, URL.ref.pointer); + return _ret.address == 0 + ? null + : objc.ObjCObjectBase(_ret, retain: true, release: true); + } - external CFDictionaryCopyDescriptionCallBack copyDescription; + /// setCookies:forURL:mainDocumentURL: + void setCookies_forURL_mainDocumentURL_(objc.ObjCObjectBase cookies, + objc.NSURL? URL, objc.NSURL? mainDocumentURL) { + _objc_msgSend_tenbla( + this.ref.pointer, + _sel_setCookies_forURL_mainDocumentURL_, + cookies.ref.pointer, + URL?.ref.pointer ?? ffi.nullptr, + mainDocumentURL?.ref.pointer ?? ffi.nullptr); + } - external CFDictionaryEqualCallBack equal; + /// cookieAcceptPolicy + NSHTTPCookieAcceptPolicy get cookieAcceptPolicy { + final _ret = + _objc_msgSend_1jpuqgg(this.ref.pointer, _sel_cookieAcceptPolicy); + return NSHTTPCookieAcceptPolicy.fromValue(_ret); + } - external CFDictionaryHashCallBack hash; -} + /// setCookieAcceptPolicy: + set cookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { + return _objc_msgSend_199e8fv( + this.ref.pointer, _sel_setCookieAcceptPolicy_, value.value); + } -typedef CFDictionaryRetainCallBack - = ffi.Pointer>; -typedef CFDictionaryRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFDictionaryReleaseCallBack - = ffi.Pointer>; -typedef CFDictionaryReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFDictionaryReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFDictionaryCopyDescriptionCallBack = ffi - .Pointer>; -typedef CFDictionaryCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFDictionaryEqualCallBack - = ffi.Pointer>; -typedef CFDictionaryEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFDictionaryEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef CFDictionaryHashCallBack - = ffi.Pointer>; -typedef CFDictionaryHashCallBackFunction = CFHashCode Function( - ffi.Pointer value); -typedef DartCFDictionaryHashCallBackFunction = DartCFHashCode Function( - ffi.Pointer value); + /// sortedCookiesUsingDescriptors: + objc.ObjCObjectBase sortedCookiesUsingDescriptors_( + objc.ObjCObjectBase sortOrder) { + final _ret = _objc_msgSend_juohf7(this.ref.pointer, + _sel_sortedCookiesUsingDescriptors_, sortOrder.ref.pointer); + return objc.ObjCObjectBase(_ret, retain: true, release: true); + } -final class CFDictionaryValueCallBacks extends ffi.Struct { - @CFIndex() - external int version; + /// storeCookies:forTask: + void storeCookies_forTask_(objc.NSArray cookies, NSURLSessionTask task) { + _objc_msgSend_1tjlcwl(this.ref.pointer, _sel_storeCookies_forTask_, + cookies.ref.pointer, task.ref.pointer); + } - external CFDictionaryRetainCallBack retain; + /// getCookiesForTask:completionHandler: + void getCookiesForTask_completionHandler_(NSURLSessionTask task, + objc.ObjCBlock completionHandler) { + _objc_msgSend_cmbt6k( + this.ref.pointer, + _sel_getCookiesForTask_completionHandler_, + task.ref.pointer, + completionHandler.ref.pointer); + } - external CFDictionaryReleaseCallBack release; + /// init + NSHTTPCookieStorage init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: false, release: true); + } - external CFDictionaryCopyDescriptionCallBack copyDescription; + /// new + static NSHTTPCookieStorage new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPCookieStorage, _sel_new); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: false, release: true); + } - external CFDictionaryEqualCallBack equal; + /// allocWithZone: + static NSHTTPCookieStorage allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSHTTPCookieStorage, _sel_allocWithZone_, zone); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: false, release: true); + } + + /// alloc + static NSHTTPCookieStorage alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPCookieStorage, _sel_alloc); + return NSHTTPCookieStorage.castFromPointer(_ret, + retain: false, release: true); + } } -final class __CFDictionary extends ffi.Opaque {} +late final _class_NSHTTPCookieStorage = objc.getClass("NSHTTPCookieStorage"); +late final _sel_sharedHTTPCookieStorage = + objc.registerName("sharedHTTPCookieStorage"); +late final _sel_sharedCookieStorageForGroupContainerIdentifier_ = + objc.registerName("sharedCookieStorageForGroupContainerIdentifier:"); +late final _sel_cookies = objc.registerName("cookies"); -typedef CFDictionaryRef = ffi.Pointer<__CFDictionary>; -typedef CFMutableDictionaryRef = ffi.Pointer<__CFDictionary>; -typedef CFDictionaryApplierFunction - = ffi.Pointer>; -typedef CFDictionaryApplierFunctionFunction = ffi.Void Function( - ffi.Pointer key, - ffi.Pointer value, - ffi.Pointer context); -typedef DartCFDictionaryApplierFunctionFunction = void Function( - ffi.Pointer key, - ffi.Pointer value, - ffi.Pointer context); +/// NSHTTPCookie +class NSHTTPCookie extends objc.ObjCObjectBase { + NSHTTPCookie._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); -final class __CFNotificationCenter extends ffi.Opaque {} + /// Constructs a [NSHTTPCookie] that points to the same underlying object as [other]. + NSHTTPCookie.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -abstract class CFNotificationSuspensionBehavior { - static const int CFNotificationSuspensionBehaviorDrop = 1; - static const int CFNotificationSuspensionBehaviorCoalesce = 2; - static const int CFNotificationSuspensionBehaviorHold = 3; - static const int CFNotificationSuspensionBehaviorDeliverImmediately = 4; -} + /// Constructs a [NSHTTPCookie] that wraps the given raw object pointer. + NSHTTPCookie.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); -typedef CFNotificationCenterRef = ffi.Pointer<__CFNotificationCenter>; -typedef CFNotificationCallback - = ffi.Pointer>; -typedef CFNotificationCallbackFunction = ffi.Void Function( - CFNotificationCenterRef center, - ffi.Pointer observer, - CFNotificationName name, - ffi.Pointer object, - CFDictionaryRef userInfo); -typedef DartCFNotificationCallbackFunction = void Function( - CFNotificationCenterRef center, - ffi.Pointer observer, - CFNotificationName name, - ffi.Pointer object, - CFDictionaryRef userInfo); -typedef CFNotificationName = CFStringRef; + /// Returns whether [obj] is an instance of [NSHTTPCookie]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPCookie); + } +} + +late final _class_NSHTTPCookie = objc.getClass("NSHTTPCookie"); +late final _sel_setCookie_ = objc.registerName("setCookie:"); +late final _sel_deleteCookie_ = objc.registerName("deleteCookie:"); +late final _sel_removeCookiesSinceDate_ = + objc.registerName("removeCookiesSinceDate:"); +late final _sel_cookiesForURL_ = objc.registerName("cookiesForURL:"); +late final _sel_setCookies_forURL_mainDocumentURL_ = + objc.registerName("setCookies:forURL:mainDocumentURL:"); +final _objc_msgSend_tenbla = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_cookieAcceptPolicy = objc.registerName("cookieAcceptPolicy"); +final _objc_msgSend_1jpuqgg = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSUInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setCookieAcceptPolicy_ = + objc.registerName("setCookieAcceptPolicy:"); +final _objc_msgSend_199e8fv = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSUInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_sortedCookiesUsingDescriptors_ = + objc.registerName("sortedCookiesUsingDescriptors:"); +late final _sel_storeCookies_forTask_ = + objc.registerName("storeCookies:forTask:"); +void _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSArray_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSArray_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSArray_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSArray_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSArray_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSArray_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSArray_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSArray_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSArray { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); -final class __CFLocale extends ffi.Opaque {} + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSArray_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -typedef CFLocaleRef = ffi.Pointer<__CFLocale>; -typedef CFLocaleIdentifier = CFStringRef; -typedef LangCode = SInt16; -typedef RegionCode = SInt16; + /// 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. + static objc.ObjCBlock fromFunction( + void Function(objc.NSArray?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSArray_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSArray.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); -abstract class CFLocaleLanguageDirection { - static const int kCFLocaleLanguageDirectionUnknown = 0; - static const int kCFLocaleLanguageDirectionLeftToRight = 1; - static const int kCFLocaleLanguageDirectionRightToLeft = 2; - static const int kCFLocaleLanguageDirectionTopToBottom = 3; - static const int kCFLocaleLanguageDirectionBottomToTop = 4; + /// 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. + static objc.ObjCBlock listener( + void Function(objc.NSArray?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSArray_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSArray.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } } -typedef CFLocaleKey = CFStringRef; -typedef CFCalendarIdentifier = CFStringRef; -typedef CFAbsoluteTime = CFTimeInterval; -typedef CFTimeInterval = ffi.Double; -typedef DartCFTimeInterval = double; - -final class __CFDate extends ffi.Opaque {} +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSArray_CallExtension + on objc.ObjCBlock { + void call(objc.NSArray? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} -typedef CFDateRef = ffi.Pointer<__CFDate>; +late final _sel_getCookiesForTask_completionHandler_ = + objc.registerName("getCookiesForTask:completionHandler:"); -final class __CFTimeZone extends ffi.Opaque {} +final class CFArrayCallBacks extends ffi.Struct { + @CFIndex() + external int version; -final class CFGregorianDate extends ffi.Struct { - @SInt32() - external int year; + external CFArrayRetainCallBack retain; - @SInt8() - external int month; + external CFArrayReleaseCallBack release; - @SInt8() - external int day; + external CFArrayCopyDescriptionCallBack copyDescription; - @SInt8() - external int hour; + external CFArrayEqualCallBack equal; +} - @SInt8() - external int minute; +typedef CFArrayRetainCallBack + = ffi.Pointer>; +typedef CFArrayRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFArrayReleaseCallBack + = ffi.Pointer>; +typedef CFArrayReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFArrayReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFArrayCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFArrayCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFArrayEqualCallBack + = ffi.Pointer>; +typedef CFArrayEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFArrayEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); - @ffi.Double() - external double second; -} +final class __CFArray extends ffi.Opaque {} -typedef SInt8 = ffi.SignedChar; -typedef DartSInt8 = int; +typedef CFArrayRef = ffi.Pointer<__CFArray>; +typedef CFMutableArrayRef = ffi.Pointer<__CFArray>; +typedef CFArrayApplierFunction + = ffi.Pointer>; +typedef CFArrayApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFArrayApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); +typedef CFComparatorFunction + = ffi.Pointer>; +typedef CFComparatorFunctionFunction = CFIndex Function( + ffi.Pointer val1, + ffi.Pointer val2, + ffi.Pointer context); +typedef DartCFComparatorFunctionFunction = CFComparisonResult Function( + ffi.Pointer val1, + ffi.Pointer val2, + ffi.Pointer context); -final class CFGregorianUnits extends ffi.Struct { - @SInt32() - external int years; +enum CFComparisonResult { + kCFCompareLessThan(-1), + kCFCompareEqualTo(0), + kCFCompareGreaterThan(1); - @SInt32() - external int months; + final int value; + const CFComparisonResult(this.value); - @SInt32() - external int days; + static CFComparisonResult fromValue(int value) => switch (value) { + -1 => kCFCompareLessThan, + 0 => kCFCompareEqualTo, + 1 => kCFCompareGreaterThan, + _ => + throw ArgumentError("Unknown value for CFComparisonResult: $value"), + }; +} - @SInt32() - external int hours; +/// OS_sec_object +abstract final class OS_sec_object { + /// Builds an object that implements the OS_sec_object protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @SInt32() - external int minutes; + return builder.build(); + } - @ffi.Double() - external double seconds; + /// Adds the implementation of the OS_sec_object protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -abstract class CFGregorianUnitFlags { - static const int kCFGregorianUnitsYears = 1; - static const int kCFGregorianUnitsMonths = 2; - static const int kCFGregorianUnitsDays = 4; - static const int kCFGregorianUnitsHours = 8; - static const int kCFGregorianUnitsMinutes = 16; - static const int kCFGregorianUnitsSeconds = 32; - static const int kCFGregorianAllUnits = 16777215; -} +late final _protocol_OS_sec_object = objc.getProtocol("OS_sec_object"); -typedef CFTimeZoneRef = ffi.Pointer<__CFTimeZone>; +final class __SecCertificate extends ffi.Opaque {} -final class __CFData extends ffi.Opaque {} +final class __SecIdentity extends ffi.Opaque {} -typedef CFDataRef = ffi.Pointer<__CFData>; -typedef CFMutableDataRef = ffi.Pointer<__CFData>; +final class __SecKey extends ffi.Opaque {} -abstract class CFDataSearchFlags { - static const int kCFDataSearchBackwards = 1; - static const int kCFDataSearchAnchored = 2; -} +final class __SecPolicy extends ffi.Opaque {} -final class __CFCharacterSet extends ffi.Opaque {} +final class __SecAccessControl extends ffi.Opaque {} -abstract class CFCharacterSetPredefinedSet { - static const int kCFCharacterSetControl = 1; - static const int kCFCharacterSetWhitespace = 2; - static const int kCFCharacterSetWhitespaceAndNewline = 3; - static const int kCFCharacterSetDecimalDigit = 4; - static const int kCFCharacterSetLetter = 5; - static const int kCFCharacterSetLowercaseLetter = 6; - static const int kCFCharacterSetUppercaseLetter = 7; - static const int kCFCharacterSetNonBase = 8; - static const int kCFCharacterSetDecomposable = 9; - static const int kCFCharacterSetAlphaNumeric = 10; - static const int kCFCharacterSetPunctuation = 11; - static const int kCFCharacterSetCapitalizedLetter = 13; - static const int kCFCharacterSetSymbol = 14; - static const int kCFCharacterSetNewline = 15; - static const int kCFCharacterSetIllegal = 12; -} +final class __SecKeychain extends ffi.Opaque {} -typedef CFCharacterSetRef = ffi.Pointer<__CFCharacterSet>; -typedef CFMutableCharacterSetRef = ffi.Pointer<__CFCharacterSet>; -typedef UniChar = UInt16; +final class __SecKeychainItem extends ffi.Opaque {} -final class __CFError extends ffi.Opaque {} +final class __SecKeychainSearch extends ffi.Opaque {} -typedef CFErrorDomain = CFStringRef; -typedef CFErrorRef = ffi.Pointer<__CFError>; +final class SecKeychainAttribute extends ffi.Struct { + @SecKeychainAttrType() + external int tag; + + @UInt32() + external int length; -abstract class CFStringBuiltInEncodings { - static const int kCFStringEncodingMacRoman = 0; - static const int kCFStringEncodingWindowsLatin1 = 1280; - static const int kCFStringEncodingISOLatin1 = 513; - static const int kCFStringEncodingNextStepLatin = 2817; - static const int kCFStringEncodingASCII = 1536; - static const int kCFStringEncodingUnicode = 256; - static const int kCFStringEncodingUTF8 = 134217984; - static const int kCFStringEncodingNonLossyASCII = 3071; - static const int kCFStringEncodingUTF16 = 256; - static const int kCFStringEncodingUTF16BE = 268435712; - static const int kCFStringEncodingUTF16LE = 335544576; - static const int kCFStringEncodingUTF32 = 201326848; - static const int kCFStringEncodingUTF32BE = 402653440; - static const int kCFStringEncodingUTF32LE = 469762304; + external ffi.Pointer data; } -typedef CFStringEncoding = UInt32; -typedef CFMutableStringRef = ffi.Pointer<__CFString>; -typedef StringPtr = ffi.Pointer; -typedef ConstStringPtr = ffi.Pointer; +typedef SecKeychainAttrType = OSType; +typedef OSType = FourCharCode; +typedef FourCharCode = UInt32; -abstract class CFStringCompareFlags { - static const int kCFCompareCaseInsensitive = 1; - static const int kCFCompareBackwards = 4; - static const int kCFCompareAnchored = 8; - static const int kCFCompareNonliteral = 16; - static const int kCFCompareLocalized = 32; - static const int kCFCompareNumerically = 64; - static const int kCFCompareDiacriticInsensitive = 128; - static const int kCFCompareWidthInsensitive = 256; - static const int kCFCompareForcedOrdering = 512; -} +final class SecKeychainAttributeList extends ffi.Struct { + @UInt32() + external int count; -abstract class CFStringNormalizationForm { - static const int kCFStringNormalizationFormD = 0; - static const int kCFStringNormalizationFormKD = 1; - static const int kCFStringNormalizationFormC = 2; - static const int kCFStringNormalizationFormKC = 3; + external ffi.Pointer attr; } -final class CFStringInlineBuffer extends ffi.Struct { - @ffi.Array.multi([64]) - external ffi.Array buffer; - - external CFStringRef theString; +final class __SecTrustedApplication extends ffi.Opaque {} - external ffi.Pointer directUniCharBuffer; +final class __SecAccess extends ffi.Opaque {} - external ffi.Pointer directCStringBuffer; +final class __SecACL extends ffi.Opaque {} - external CFRange rangeToBuffer; +final class __SecPassword extends ffi.Opaque {} - @CFIndex() - external int bufferedRangeStart; +final class SecKeychainAttributeInfo extends ffi.Struct { + @UInt32() + external int count; - @CFIndex() - external int bufferedRangeEnd; -} + external ffi.Pointer tag; -abstract class CFTimeZoneNameStyle { - static const int kCFTimeZoneNameStyleStandard = 0; - static const int kCFTimeZoneNameStyleShortStandard = 1; - static const int kCFTimeZoneNameStyleDaylightSaving = 2; - static const int kCFTimeZoneNameStyleShortDaylightSaving = 3; - static const int kCFTimeZoneNameStyleGeneric = 4; - static const int kCFTimeZoneNameStyleShortGeneric = 5; + external ffi.Pointer format; } -final class __CFCalendar extends ffi.Opaque {} +typedef OSStatus = SInt32; -typedef CFCalendarRef = ffi.Pointer<__CFCalendar>; +final class _RuneEntry extends ffi.Struct { + @__darwin_rune_t() + external int __min; -abstract class CFCalendarUnit { - static const int kCFCalendarUnitEra = 2; - static const int kCFCalendarUnitYear = 4; - static const int kCFCalendarUnitMonth = 8; - static const int kCFCalendarUnitDay = 16; - static const int kCFCalendarUnitHour = 32; - static const int kCFCalendarUnitMinute = 64; - static const int kCFCalendarUnitSecond = 128; - static const int kCFCalendarUnitWeek = 256; - static const int kCFCalendarUnitWeekday = 512; - static const int kCFCalendarUnitWeekdayOrdinal = 1024; - static const int kCFCalendarUnitQuarter = 2048; - static const int kCFCalendarUnitWeekOfMonth = 4096; - static const int kCFCalendarUnitWeekOfYear = 8192; - static const int kCFCalendarUnitYearForWeekOfYear = 16384; -} + @__darwin_rune_t() + external int __max; -final class CGPoint extends ffi.Struct { - @CGFloat() - external double x; + @__darwin_rune_t() + external int __map; - @CGFloat() - external double y; + external ffi.Pointer<__uint32_t> __types; } -typedef CGFloat = ffi.Double; -typedef DartCGFloat = double; +typedef __darwin_rune_t = __darwin_wchar_t; +typedef __darwin_wchar_t = ffi.Int; +typedef Dart__darwin_wchar_t = int; -final class CGSize extends ffi.Struct { - @CGFloat() - external double width; +final class _RuneRange extends ffi.Struct { + @ffi.Int() + external int __nranges; - @CGFloat() - external double height; + external ffi.Pointer<_RuneEntry> __ranges; } -final class CGVector extends ffi.Struct { - @CGFloat() - external double dx; +final class _RuneCharClass extends ffi.Struct { + @ffi.Array.multi([14]) + external ffi.Array __name; - @CGFloat() - external double dy; + @__uint32_t() + external int __mask; } -final class CGRect extends ffi.Struct { - external CGPoint origin; +final class _RuneLocale extends ffi.Struct { + @ffi.Array.multi([8]) + external ffi.Array __magic; - external CGSize size; -} + @ffi.Array.multi([32]) + external ffi.Array __encoding; -abstract class CGRectEdge { - static const int CGRectMinXEdge = 0; - static const int CGRectMinYEdge = 1; - static const int CGRectMaxXEdge = 2; - static const int CGRectMaxYEdge = 3; -} + external ffi.Pointer< + ffi.NativeFunction< + __darwin_rune_t Function(ffi.Pointer, __darwin_size_t, + ffi.Pointer>)>> __sgetrune; -final class CGAffineTransform extends ffi.Struct { - @CGFloat() - external double a; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(__darwin_rune_t, ffi.Pointer, + __darwin_size_t, ffi.Pointer>)>> __sputrune; - @CGFloat() - external double b; + @__darwin_rune_t() + external int __invalid_rune; - @CGFloat() - external double c; + @ffi.Array.multi([256]) + external ffi.Array<__uint32_t> __runetype; - @CGFloat() - external double d; + @ffi.Array.multi([256]) + external ffi.Array<__darwin_rune_t> __maplower; - @CGFloat() - external double tx; + @ffi.Array.multi([256]) + external ffi.Array<__darwin_rune_t> __mapupper; - @CGFloat() - external double ty; -} + external _RuneRange __runetype_ext; -final class CGAffineTransformComponents extends ffi.Struct { - external CGSize scale; + external _RuneRange __maplower_ext; - @CGFloat() - external double horizontalShear; + external _RuneRange __mapupper_ext; - @CGFloat() - external double rotation; + external ffi.Pointer __variable; - external CGVector translation; -} + @ffi.Int() + external int __variable_len; -final class __CFDateFormatter extends ffi.Opaque {} + @ffi.Int() + external int __ncharclasses; -abstract class CFDateFormatterStyle { - static const int kCFDateFormatterNoStyle = 0; - static const int kCFDateFormatterShortStyle = 1; - static const int kCFDateFormatterMediumStyle = 2; - static const int kCFDateFormatterLongStyle = 3; - static const int kCFDateFormatterFullStyle = 4; -} - -abstract class CFISO8601DateFormatOptions { - static const int kCFISO8601DateFormatWithYear = 1; - static const int kCFISO8601DateFormatWithMonth = 2; - static const int kCFISO8601DateFormatWithWeekOfYear = 4; - static const int kCFISO8601DateFormatWithDay = 16; - static const int kCFISO8601DateFormatWithTime = 32; - static const int kCFISO8601DateFormatWithTimeZone = 64; - static const int kCFISO8601DateFormatWithSpaceBetweenDateAndTime = 128; - static const int kCFISO8601DateFormatWithDashSeparatorInDate = 256; - static const int kCFISO8601DateFormatWithColonSeparatorInTime = 512; - static const int kCFISO8601DateFormatWithColonSeparatorInTimeZone = 1024; - static const int kCFISO8601DateFormatWithFractionalSeconds = 2048; - static const int kCFISO8601DateFormatWithFullDate = 275; - static const int kCFISO8601DateFormatWithFullTime = 1632; - static const int kCFISO8601DateFormatWithInternetDateTime = 1907; + external ffi.Pointer<_RuneCharClass> __charclasses; } -typedef CFDateFormatterRef = ffi.Pointer<__CFDateFormatter>; -typedef CFDateFormatterKey = CFStringRef; +typedef __darwin_ct_rune_t = ffi.Int; +typedef Dart__darwin_ct_rune_t = int; -final class __CFBoolean extends ffi.Opaque {} +final class lconv extends ffi.Struct { + external ffi.Pointer decimal_point; -typedef CFBooleanRef = ffi.Pointer<__CFBoolean>; + external ffi.Pointer thousands_sep; -abstract class CFNumberType { - static const int kCFNumberSInt8Type = 1; - static const int kCFNumberSInt16Type = 2; - static const int kCFNumberSInt32Type = 3; - static const int kCFNumberSInt64Type = 4; - static const int kCFNumberFloat32Type = 5; - static const int kCFNumberFloat64Type = 6; - static const int kCFNumberCharType = 7; - static const int kCFNumberShortType = 8; - static const int kCFNumberIntType = 9; - static const int kCFNumberLongType = 10; - static const int kCFNumberLongLongType = 11; - static const int kCFNumberFloatType = 12; - static const int kCFNumberDoubleType = 13; - static const int kCFNumberCFIndexType = 14; - static const int kCFNumberNSIntegerType = 15; - static const int kCFNumberCGFloatType = 16; - static const int kCFNumberMaxType = 16; -} + external ffi.Pointer grouping; -final class __CFNumber extends ffi.Opaque {} + external ffi.Pointer int_curr_symbol; -typedef CFNumberRef = ffi.Pointer<__CFNumber>; + external ffi.Pointer currency_symbol; -final class __CFNumberFormatter extends ffi.Opaque {} + external ffi.Pointer mon_decimal_point; -abstract class CFNumberFormatterStyle { - static const int kCFNumberFormatterNoStyle = 0; - static const int kCFNumberFormatterDecimalStyle = 1; - static const int kCFNumberFormatterCurrencyStyle = 2; - static const int kCFNumberFormatterPercentStyle = 3; - static const int kCFNumberFormatterScientificStyle = 4; - static const int kCFNumberFormatterSpellOutStyle = 5; - static const int kCFNumberFormatterOrdinalStyle = 6; - static const int kCFNumberFormatterCurrencyISOCodeStyle = 8; - static const int kCFNumberFormatterCurrencyPluralStyle = 9; - static const int kCFNumberFormatterCurrencyAccountingStyle = 10; -} + external ffi.Pointer mon_thousands_sep; -typedef CFNumberFormatterRef = ffi.Pointer<__CFNumberFormatter>; + external ffi.Pointer mon_grouping; -abstract class CFNumberFormatterOptionFlags { - static const int kCFNumberFormatterParseIntegersOnly = 1; -} + external ffi.Pointer positive_sign; -typedef CFNumberFormatterKey = CFStringRef; + external ffi.Pointer negative_sign; -abstract class CFNumberFormatterRoundingMode { - static const int kCFNumberFormatterRoundCeiling = 0; - static const int kCFNumberFormatterRoundFloor = 1; - static const int kCFNumberFormatterRoundDown = 2; - static const int kCFNumberFormatterRoundUp = 3; - static const int kCFNumberFormatterRoundHalfEven = 4; - static const int kCFNumberFormatterRoundHalfDown = 5; - static const int kCFNumberFormatterRoundHalfUp = 6; -} + @ffi.Char() + external int int_frac_digits; -abstract class CFNumberFormatterPadPosition { - static const int kCFNumberFormatterPadBeforePrefix = 0; - static const int kCFNumberFormatterPadAfterPrefix = 1; - static const int kCFNumberFormatterPadBeforeSuffix = 2; - static const int kCFNumberFormatterPadAfterSuffix = 3; -} + @ffi.Char() + external int frac_digits; -typedef CFPropertyListRef = CFTypeRef; + @ffi.Char() + external int p_cs_precedes; -abstract class CFURLPathStyle { - static const int kCFURLPOSIXPathStyle = 0; - static const int kCFURLHFSPathStyle = 1; - static const int kCFURLWindowsPathStyle = 2; -} + @ffi.Char() + external int p_sep_by_space; -final class __CFURL extends ffi.Opaque {} + @ffi.Char() + external int n_cs_precedes; -typedef CFURLRef = ffi.Pointer<__CFURL>; + @ffi.Char() + external int n_sep_by_space; -abstract class CFURLComponentType { - static const int kCFURLComponentScheme = 1; - static const int kCFURLComponentNetLocation = 2; - static const int kCFURLComponentPath = 3; - static const int kCFURLComponentResourceSpecifier = 4; - static const int kCFURLComponentUser = 5; - static const int kCFURLComponentPassword = 6; - static const int kCFURLComponentUserInfo = 7; - static const int kCFURLComponentHost = 8; - static const int kCFURLComponentPort = 9; - static const int kCFURLComponentParameterString = 10; - static const int kCFURLComponentQuery = 11; - static const int kCFURLComponentFragment = 12; -} + @ffi.Char() + external int p_sign_posn; -final class FSRef extends ffi.Opaque {} + @ffi.Char() + external int n_sign_posn; -abstract class CFURLBookmarkCreationOptions { - static const int kCFURLBookmarkCreationMinimalBookmarkMask = 512; - static const int kCFURLBookmarkCreationSuitableForBookmarkFile = 1024; - static const int kCFURLBookmarkCreationWithSecurityScope = 2048; - static const int kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess = - 4096; - static const int kCFURLBookmarkCreationWithoutImplicitSecurityScope = - 536870912; - static const int kCFURLBookmarkCreationPreferFileIDResolutionMask = 256; -} + @ffi.Char() + external int int_p_cs_precedes; -abstract class CFURLBookmarkResolutionOptions { - static const int kCFURLBookmarkResolutionWithoutUIMask = 256; - static const int kCFURLBookmarkResolutionWithoutMountingMask = 512; - static const int kCFURLBookmarkResolutionWithSecurityScope = 1024; - static const int kCFURLBookmarkResolutionWithoutImplicitStartAccessing = - 32768; - static const int kCFBookmarkResolutionWithoutUIMask = 256; - static const int kCFBookmarkResolutionWithoutMountingMask = 512; -} + @ffi.Char() + external int int_n_cs_precedes; -typedef CFURLBookmarkFileCreationOptions = CFOptionFlags; + @ffi.Char() + external int int_p_sep_by_space; -final class mach_port_status extends ffi.Struct { - @mach_port_rights_t() - external int mps_pset; + @ffi.Char() + external int int_n_sep_by_space; - @mach_port_seqno_t() - external int mps_seqno; + @ffi.Char() + external int int_p_sign_posn; - @mach_port_mscount_t() - external int mps_mscount; + @ffi.Char() + external int int_n_sign_posn; +} - @mach_port_msgcount_t() - external int mps_qlimit; +final class __float2 extends ffi.Struct { + @ffi.Float() + external double __sinval; - @mach_port_msgcount_t() - external int mps_msgcount; + @ffi.Float() + external double __cosval; +} - @mach_port_rights_t() - external int mps_sorights; +final class __double2 extends ffi.Struct { + @ffi.Double() + external double __sinval; - @boolean_t() - external int mps_srights; + @ffi.Double() + external double __cosval; +} - @boolean_t() - external int mps_pdrequest; +final class exception extends ffi.Struct { + @ffi.Int() + external int type; - @boolean_t() - external int mps_nsrequest; + external ffi.Pointer name; - @natural_t() - external int mps_flags; -} + @ffi.Double() + external double arg1; -typedef mach_port_rights_t = natural_t; -typedef natural_t = __darwin_natural_t; -typedef __darwin_natural_t = ffi.UnsignedInt; -typedef Dart__darwin_natural_t = int; -typedef mach_port_seqno_t = natural_t; -typedef mach_port_mscount_t = natural_t; -typedef mach_port_msgcount_t = natural_t; -typedef boolean_t = ffi.Int; -typedef Dartboolean_t = int; + @ffi.Double() + external double arg2; -final class mach_port_limits extends ffi.Struct { - @mach_port_msgcount_t() - external int mpl_qlimit; + @ffi.Double() + external double retval; } -final class mach_port_info_ext extends ffi.Struct { - external mach_port_status_t mpie_status; +typedef pthread_t = __darwin_pthread_t; +typedef __darwin_pthread_t = ffi.Pointer<_opaque_pthread_t>; +typedef stack_t = __darwin_sigaltstack; - @mach_port_msgcount_t() - external int mpie_boost_cnt; +final class __sbuf extends ffi.Struct { + external ffi.Pointer _base; - @ffi.Array.multi([6]) - external ffi.Array reserved; + @ffi.Int() + external int _size; } -typedef mach_port_status_t = mach_port_status; +final class __sFILEX extends ffi.Opaque {} -final class mach_port_guard_info extends ffi.Struct { - @ffi.Uint64() - external int mpgi_guard; -} +final class __sFILE extends ffi.Struct { + external ffi.Pointer _p; -final class mach_port_qos extends ffi.Opaque {} + @ffi.Int() + external int _r; -final class mach_service_port_info extends ffi.Struct { - @ffi.Array.multi([255]) - external ffi.Array mspi_string_name; + @ffi.Int() + external int _w; - @ffi.Uint8() - external int mspi_domain_type; -} + @ffi.Short() + external int _flags; -final class mach_port_options extends ffi.Struct { - @ffi.Uint32() - external int flags; + @ffi.Short() + external int _file; - external mach_port_limits_t mpl; + external __sbuf _bf; - external UnnamedUnion1 unnamed; -} + @ffi.Int() + external int _lbfsize; -typedef mach_port_limits_t = mach_port_limits; + external ffi.Pointer _cookie; -final class UnnamedUnion1 extends ffi.Union { - @ffi.Array.multi([2]) - external ffi.Array reserved; + external ffi + .Pointer)>> + _close; - @mach_port_name_t() - external int work_interval_port; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> _read; - external mach_service_port_info_t service_port_info; + external ffi.Pointer< + ffi.NativeFunction< + fpos_t Function(ffi.Pointer, fpos_t, ffi.Int)>> _seek; - @mach_port_name_t() - external int service_port_name; -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer, ffi.Int)>> _write; -typedef mach_port_name_t = natural_t; -typedef mach_service_port_info_t = ffi.Pointer; + external __sbuf _ub; -abstract class mach_port_guard_exception_codes { - static const int kGUARD_EXC_DESTROY = 1; - static const int kGUARD_EXC_MOD_REFS = 2; - static const int kGUARD_EXC_INVALID_OPTIONS = 3; - static const int kGUARD_EXC_SET_CONTEXT = 4; - static const int kGUARD_EXC_THREAD_SET_STATE = 5; - static const int kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE = 6; - static const int kGUARD_EXC_UNGUARDED = 8; - static const int kGUARD_EXC_INCORRECT_GUARD = 16; - static const int kGUARD_EXC_IMMOVABLE = 32; - static const int kGUARD_EXC_STRICT_REPLY = 64; - static const int kGUARD_EXC_MSG_FILTERED = 128; - static const int kGUARD_EXC_INVALID_RIGHT = 256; - static const int kGUARD_EXC_INVALID_NAME = 512; - static const int kGUARD_EXC_INVALID_VALUE = 1024; - static const int kGUARD_EXC_INVALID_ARGUMENT = 2048; - static const int kGUARD_EXC_RIGHT_EXISTS = 4096; - static const int kGUARD_EXC_KERN_NO_SPACE = 8192; - static const int kGUARD_EXC_KERN_FAILURE = 16384; - static const int kGUARD_EXC_KERN_RESOURCE = 32768; - static const int kGUARD_EXC_SEND_INVALID_REPLY = 65536; - static const int kGUARD_EXC_SEND_INVALID_VOUCHER = 131072; - static const int kGUARD_EXC_SEND_INVALID_RIGHT = 262144; - static const int kGUARD_EXC_RCV_INVALID_NAME = 524288; - static const int kGUARD_EXC_RCV_GUARDED_DESC = 1048576; - static const int kGUARD_EXC_MOD_REFS_NON_FATAL = 2097152; - static const int kGUARD_EXC_IMMOVABLE_NON_FATAL = 4194304; - static const int kGUARD_EXC_REQUIRE_REPLY_PORT_SEMANTICS = 8388608; -} + external ffi.Pointer<__sFILEX> _extra; -final class __CFRunLoop extends ffi.Opaque {} + @ffi.Int() + external int _ur; -final class __CFRunLoopSource extends ffi.Opaque {} + @ffi.Array.multi([3]) + external ffi.Array _ubuf; -final class __CFRunLoopObserver extends ffi.Opaque {} + @ffi.Array.multi([1]) + external ffi.Array _nbuf; -final class __CFRunLoopTimer extends ffi.Opaque {} + external __sbuf _lb; -abstract class CFRunLoopRunResult { - static const int kCFRunLoopRunFinished = 1; - static const int kCFRunLoopRunStopped = 2; - static const int kCFRunLoopRunTimedOut = 3; - static const int kCFRunLoopRunHandledSource = 4; -} + @ffi.Int() + external int _blksize; -abstract class CFRunLoopActivity { - static const int kCFRunLoopEntry = 1; - static const int kCFRunLoopBeforeTimers = 2; - static const int kCFRunLoopBeforeSources = 4; - static const int kCFRunLoopBeforeWaiting = 32; - static const int kCFRunLoopAfterWaiting = 64; - static const int kCFRunLoopExit = 128; - static const int kCFRunLoopAllActivities = 268435455; + @fpos_t() + external int _offset; } -typedef CFRunLoopMode = CFStringRef; -typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; -typedef CFRunLoopSourceRef = ffi.Pointer<__CFRunLoopSource>; -typedef CFRunLoopObserverRef = ffi.Pointer<__CFRunLoopObserver>; -typedef CFRunLoopTimerRef = ffi.Pointer<__CFRunLoopTimer>; - -final class CFRunLoopSourceContext extends ffi.Struct { - @CFIndex() - external int version; +typedef fpos_t = __darwin_off_t; +typedef __darwin_off_t = __int64_t; +typedef __int64_t = ffi.LongLong; +typedef Dart__int64_t = int; +typedef FILE = __sFILE; +typedef off_t = __darwin_off_t; +typedef ssize_t = __darwin_ssize_t; +typedef __darwin_ssize_t = ffi.Long; +typedef Dart__darwin_ssize_t = int; +typedef errno_t = ffi.Int; +typedef Darterrno_t = int; +typedef rsize_t = ffi.UnsignedLong; +typedef Dartrsize_t = int; - external ffi.Pointer info; +final class timespec extends ffi.Struct { + @__darwin_time_t() + external int tv_sec; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + @ffi.Long() + external int tv_nsec; +} - external ffi.Pointer< - ffi.NativeFunction info)>> - release; +final class tm extends ffi.Struct { + @ffi.Int() + external int tm_sec; - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; + @ffi.Int() + external int tm_min; - external ffi.Pointer< - ffi.NativeFunction< - Boolean Function( - ffi.Pointer info1, ffi.Pointer info2)>> equal; + @ffi.Int() + external int tm_hour; - external ffi.Pointer< - ffi.NativeFunction info)>> hash; + @ffi.Int() + external int tm_mday; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, - CFRunLoopMode mode)>> schedule; + @ffi.Int() + external int tm_mon; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, - CFRunLoopMode mode)>> cancel; + @ffi.Int() + external int tm_year; - external ffi.Pointer< - ffi.NativeFunction info)>> - perform; -} + @ffi.Int() + external int tm_wday; -final class CFRunLoopSourceContext1 extends ffi.Struct { - @CFIndex() - external int version; + @ffi.Int() + external int tm_yday; - external ffi.Pointer info; + @ffi.Int() + external int tm_isdst; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + @ffi.Long() + external int tm_gmtoff; - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + external ffi.Pointer tm_zone; +} - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; +typedef clock_t = __darwin_clock_t; +typedef __darwin_clock_t = ffi.UnsignedLong; +typedef Dart__darwin_clock_t = int; +typedef time_t = __darwin_time_t; - external ffi.Pointer< - ffi.NativeFunction< - Boolean Function( - ffi.Pointer info1, ffi.Pointer info2)>> equal; +enum clockid_t { + _CLOCK_REALTIME(0), + _CLOCK_MONOTONIC(6), + _CLOCK_MONOTONIC_RAW(4), + _CLOCK_MONOTONIC_RAW_APPROX(5), + _CLOCK_UPTIME_RAW(8), + _CLOCK_UPTIME_RAW_APPROX(9), + _CLOCK_PROCESS_CPUTIME_ID(12), + _CLOCK_THREAD_CPUTIME_ID(16); + + final int value; + const clockid_t(this.value); + + static clockid_t fromValue(int value) => switch (value) { + 0 => _CLOCK_REALTIME, + 6 => _CLOCK_MONOTONIC, + 4 => _CLOCK_MONOTONIC_RAW, + 5 => _CLOCK_MONOTONIC_RAW_APPROX, + 8 => _CLOCK_UPTIME_RAW, + 9 => _CLOCK_UPTIME_RAW_APPROX, + 12 => _CLOCK_PROCESS_CPUTIME_ID, + 16 => _CLOCK_THREAD_CPUTIME_ID, + _ => throw ArgumentError("Unknown value for clockid_t: $value"), + }; +} - external ffi.Pointer< - ffi.NativeFunction info)>> hash; +typedef intmax_t = ffi.Long; +typedef Dartintmax_t = int; - external ffi.Pointer< - ffi.NativeFunction info)>> - getPort; +final class imaxdiv_t extends ffi.Struct { + @intmax_t() + external int quot; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer msg, - CFIndex size, - CFAllocatorRef allocator, - ffi.Pointer info)>> perform; + @intmax_t() + external int rem; } -typedef mach_port_t = __darwin_mach_port_t; -typedef __darwin_mach_port_t = __darwin_mach_port_name_t; -typedef __darwin_mach_port_name_t = __darwin_natural_t; +typedef uintmax_t = ffi.UnsignedLong; +typedef Dartuintmax_t = int; -final class CFRunLoopObserverContext extends ffi.Struct { +final class CFBagCallBacks extends ffi.Struct { @CFIndex() external int version; - external ffi.Pointer info; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + external CFBagRetainCallBack retain; - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + external CFBagReleaseCallBack release; - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} + external CFBagCopyDescriptionCallBack copyDescription; -typedef CFRunLoopObserverCallBack - = ffi.Pointer>; -typedef CFRunLoopObserverCallBackFunction = ffi.Void Function( - CFRunLoopObserverRef observer, - ffi.Int32 activity, - ffi.Pointer info); -typedef DartCFRunLoopObserverCallBackFunction = void Function( - CFRunLoopObserverRef observer, int activity, ffi.Pointer info); -void _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, CFRunLoopObserverRef arg0, int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopObserverRef arg0, ffi.Int32 arg1)>>() - .asFunction()(arg0, arg1); -final _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_registerClosure( - void Function(CFRunLoopObserverRef, int) fn) { - final id = - ++_ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureRegistryIndex; - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, CFRunLoopObserverRef arg0, int arg1) => - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + external CFBagEqualCallBack equal; - /// 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. - ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(CFRunLoopObserverRef arg0, ffi.Int32 arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - CFRunLoopObserverRef, ffi.Int32)>( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external CFBagHashCallBack hash; +} - /// 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. - ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity.fromFunction( - NativeCupertinoHttp lib, void Function(CFRunLoopObserverRef, int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - CFRunLoopObserverRef, ffi.Int32)>( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_registerClosure( - (CFRunLoopObserverRef arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +typedef CFBagRetainCallBack + = ffi.Pointer>; +typedef CFBagRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFBagReleaseCallBack + = ffi.Pointer>; +typedef CFBagReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFBagReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFBagCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFBagCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFBagEqualCallBack + = ffi.Pointer>; +typedef CFBagEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFBagEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFBagHashCallBack + = ffi.Pointer>; +typedef CFBagHashCallBackFunction = CFHashCode Function( + ffi.Pointer value); +typedef DartCFBagHashCallBackFunction = DartCFHashCode Function( + ffi.Pointer value); - /// 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. - ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity.listener( - NativeCupertinoHttp lib, void Function(CFRunLoopObserverRef, int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - CFRunLoopObserverRef, ffi.Int32)>.listener( - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_registerClosure( - (CFRunLoopObserverRef arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, CFRunLoopObserverRef, ffi.Int32)>? - _dartFuncListenerTrampoline; +final class __CFBag extends ffi.Opaque {} - void call(CFRunLoopObserverRef arg0, int arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - CFRunLoopObserverRef arg0, ffi.Int32 arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, CFRunLoopObserverRef, - int)>()(_id, arg0, arg1); -} +typedef CFBagRef = ffi.Pointer<__CFBag>; +typedef CFMutableBagRef = ffi.Pointer<__CFBag>; +typedef CFBagApplierFunction + = ffi.Pointer>; +typedef CFBagApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFBagApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); -final class CFRunLoopTimerContext extends ffi.Struct { +final class CFBinaryHeapCompareContext extends ffi.Struct { @CFIndex() external int version; @@ -76109,1022 +49235,1173 @@ final class CFRunLoopTimerContext extends ffi.Struct { copyDescription; } -typedef CFRunLoopTimerCallBack - = ffi.Pointer>; -typedef CFRunLoopTimerCallBackFunction = ffi.Void Function( - CFRunLoopTimerRef timer, ffi.Pointer info); -typedef DartCFRunLoopTimerCallBackFunction = void Function( - CFRunLoopTimerRef timer, ffi.Pointer info); -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, CFRunLoopTimerRef arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_registerClosure( - void Function(CFRunLoopTimerRef) fn) { - final id = ++_ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureRegistryIndex; - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, CFRunLoopTimerRef arg0) => - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureRegistry[ - block.ref.target.address]!(arg0); +final class CFBinaryHeapCallBacks extends ffi.Struct { + @CFIndex() + external int version; -class ObjCBlock_ffiVoid_CFRunLoopTimerRef extends _ObjCBlockBase { - ObjCBlock_ffiVoid_CFRunLoopTimerRef._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer ptr)>> retain; - /// 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. - ObjCBlock_ffiVoid_CFRunLoopTimerRef.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, CFRunLoopTimerRef)>( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer ptr)>> release; - /// 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. - ObjCBlock_ffiVoid_CFRunLoopTimerRef.fromFunction( - NativeCupertinoHttp lib, void Function(CFRunLoopTimerRef) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, CFRunLoopTimerRef)>( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_registerClosure( - (CFRunLoopTimerRef arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + external ffi.Pointer< + ffi.NativeFunction ptr)>> + copyDescription; - /// 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. - ObjCBlock_ffiVoid_CFRunLoopTimerRef.listener( - NativeCupertinoHttp lib, void Function(CFRunLoopTimerRef) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - CFRunLoopTimerRef)>.listener( - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_CFRunLoopTimerRef_registerClosure( - (CFRunLoopTimerRef arg0) => fn(arg0))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, CFRunLoopTimerRef)>? - _dartFuncListenerTrampoline; - - void call(CFRunLoopTimerRef arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, CFRunLoopTimerRef arg0)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, CFRunLoopTimerRef)>()(_id, arg0); + external ffi.Pointer< + ffi.NativeFunction< + CFIndex Function( + ffi.Pointer ptr1, + ffi.Pointer ptr2, + ffi.Pointer context)>> compare; } -final class __CFSocket extends ffi.Opaque {} - -abstract class CFSocketError { - static const int kCFSocketSuccess = 0; - static const int kCFSocketError = -1; - static const int kCFSocketTimeout = -2; -} +final class __CFBinaryHeap extends ffi.Opaque {} -final class CFSocketSignature extends ffi.Struct { - @SInt32() - external int protocolFamily; +typedef CFBinaryHeapRef = ffi.Pointer<__CFBinaryHeap>; +typedef CFBinaryHeapApplierFunction + = ffi.Pointer>; +typedef CFBinaryHeapApplierFunctionFunction = ffi.Void Function( + ffi.Pointer val, ffi.Pointer context); +typedef DartCFBinaryHeapApplierFunctionFunction = void Function( + ffi.Pointer val, ffi.Pointer context); - @SInt32() - external int socketType; +final class __CFBitVector extends ffi.Opaque {} - @SInt32() - external int protocol; +typedef CFBitVectorRef = ffi.Pointer<__CFBitVector>; +typedef CFMutableBitVectorRef = ffi.Pointer<__CFBitVector>; +typedef CFBit = UInt32; - external CFDataRef address; +final class CFSwappedFloat32 extends ffi.Struct { + @ffi.Uint32() + external int v; } -abstract class CFSocketCallBackType { - static const int kCFSocketNoCallBack = 0; - static const int kCFSocketReadCallBack = 1; - static const int kCFSocketAcceptCallBack = 2; - static const int kCFSocketDataCallBack = 3; - static const int kCFSocketConnectCallBack = 4; - static const int kCFSocketWriteCallBack = 8; +final class CFSwappedFloat64 extends ffi.Struct { + @ffi.Uint64() + external int v; } -final class CFSocketContext extends ffi.Struct { +final class CFDictionaryKeyCallBacks extends ffi.Struct { @CFIndex() external int version; - external ffi.Pointer info; - - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; - - external ffi.Pointer< - ffi.NativeFunction info)>> - release; - - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} + external CFDictionaryRetainCallBack retain; -typedef CFSocketRef = ffi.Pointer<__CFSocket>; -typedef CFSocketCallBack - = ffi.Pointer>; -typedef CFSocketCallBackFunction = ffi.Void Function( - CFSocketRef s, - ffi.Int32 type, - CFDataRef address, - ffi.Pointer data, - ffi.Pointer info); -typedef DartCFSocketCallBackFunction = void Function(CFSocketRef s, int type, - CFDataRef address, ffi.Pointer data, ffi.Pointer info); -typedef CFSocketNativeHandle = ffi.Int; -typedef DartCFSocketNativeHandle = int; + external CFDictionaryReleaseCallBack release; -final class accessx_descriptor extends ffi.Struct { - @ffi.UnsignedInt() - external int ad_name_offset; + external CFDictionaryCopyDescriptionCallBack copyDescription; - @ffi.Int() - external int ad_flags; + external CFDictionaryEqualCallBack equal; - @ffi.Array.multi([2]) - external ffi.Array ad_pad; + external CFDictionaryHashCallBack hash; } -typedef gid_t = __darwin_gid_t; -typedef __darwin_gid_t = __uint32_t; -typedef useconds_t = __darwin_useconds_t; -typedef __darwin_useconds_t = __uint32_t; +typedef CFDictionaryRetainCallBack + = ffi.Pointer>; +typedef CFDictionaryRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFDictionaryReleaseCallBack + = ffi.Pointer>; +typedef CFDictionaryReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFDictionaryReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFDictionaryCopyDescriptionCallBack = ffi + .Pointer>; +typedef CFDictionaryCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFDictionaryEqualCallBack + = ffi.Pointer>; +typedef CFDictionaryEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFDictionaryEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFDictionaryHashCallBack + = ffi.Pointer>; +typedef CFDictionaryHashCallBackFunction = CFHashCode Function( + ffi.Pointer value); +typedef DartCFDictionaryHashCallBackFunction = DartCFHashCode Function( + ffi.Pointer value); -final class fssearchblock extends ffi.Opaque {} +final class CFDictionaryValueCallBacks extends ffi.Struct { + @CFIndex() + external int version; -final class searchstate extends ffi.Opaque {} + external CFDictionaryRetainCallBack retain; -final class flock extends ffi.Struct { - @off_t() - external int l_start; + external CFDictionaryReleaseCallBack release; - @off_t() - external int l_len; + external CFDictionaryCopyDescriptionCallBack copyDescription; - @pid_t() - external int l_pid; + external CFDictionaryEqualCallBack equal; +} - @ffi.Short() - external int l_type; +final class __CFDictionary extends ffi.Opaque {} - @ffi.Short() - external int l_whence; -} +typedef CFDictionaryRef = ffi.Pointer<__CFDictionary>; +typedef CFMutableDictionaryRef = ffi.Pointer<__CFDictionary>; +typedef CFDictionaryApplierFunction + = ffi.Pointer>; +typedef CFDictionaryApplierFunctionFunction = ffi.Void Function( + ffi.Pointer key, + ffi.Pointer value, + ffi.Pointer context); +typedef DartCFDictionaryApplierFunctionFunction = void Function( + ffi.Pointer key, + ffi.Pointer value, + ffi.Pointer context); -final class flocktimeout extends ffi.Struct { - external flock fl; +final class __CFNotificationCenter extends ffi.Opaque {} + +typedef CFNotificationCenterRef = ffi.Pointer<__CFNotificationCenter>; +typedef CFNotificationCallback + = ffi.Pointer>; +typedef CFNotificationCallbackFunction = ffi.Void Function( + CFNotificationCenterRef center, + ffi.Pointer observer, + CFNotificationName name, + ffi.Pointer object, + CFDictionaryRef userInfo); +typedef DartCFNotificationCallbackFunction = void Function( + CFNotificationCenterRef center, + ffi.Pointer observer, + CFNotificationName name, + ffi.Pointer object, + CFDictionaryRef userInfo); +typedef CFNotificationName = CFStringRef; - external timespec timeout; -} +enum CFNotificationSuspensionBehavior { + CFNotificationSuspensionBehaviorDrop(1), + CFNotificationSuspensionBehaviorCoalesce(2), + CFNotificationSuspensionBehaviorHold(3), + CFNotificationSuspensionBehaviorDeliverImmediately(4); -final class radvisory extends ffi.Struct { - @off_t() - external int ra_offset; + final int value; + const CFNotificationSuspensionBehavior(this.value); - @ffi.Int() - external int ra_count; + static CFNotificationSuspensionBehavior fromValue(int value) => + switch (value) { + 1 => CFNotificationSuspensionBehaviorDrop, + 2 => CFNotificationSuspensionBehaviorCoalesce, + 3 => CFNotificationSuspensionBehaviorHold, + 4 => CFNotificationSuspensionBehaviorDeliverImmediately, + _ => throw ArgumentError( + "Unknown value for CFNotificationSuspensionBehavior: $value"), + }; } -final class fsignatures extends ffi.Struct { - @off_t() - external int fs_file_start; - - external ffi.Pointer fs_blob_start; +final class __CFLocale extends ffi.Opaque {} - @ffi.Size() - external int fs_blob_size; +typedef CFLocaleRef = ffi.Pointer<__CFLocale>; +typedef CFLocaleIdentifier = CFStringRef; +typedef LangCode = SInt16; +typedef RegionCode = SInt16; - @ffi.Size() - external int fs_fsignatures_size; +enum CFLocaleLanguageDirection { + kCFLocaleLanguageDirectionUnknown(0), + kCFLocaleLanguageDirectionLeftToRight(1), + kCFLocaleLanguageDirectionRightToLeft(2), + kCFLocaleLanguageDirectionTopToBottom(3), + kCFLocaleLanguageDirectionBottomToTop(4); - @ffi.Array.multi([20]) - external ffi.Array fs_cdhash; + final int value; + const CFLocaleLanguageDirection(this.value); - @ffi.Int() - external int fs_hash_type; + static CFLocaleLanguageDirection fromValue(int value) => switch (value) { + 0 => kCFLocaleLanguageDirectionUnknown, + 1 => kCFLocaleLanguageDirectionLeftToRight, + 2 => kCFLocaleLanguageDirectionRightToLeft, + 3 => kCFLocaleLanguageDirectionTopToBottom, + 4 => kCFLocaleLanguageDirectionBottomToTop, + _ => throw ArgumentError( + "Unknown value for CFLocaleLanguageDirection: $value"), + }; } -final class fsupplement extends ffi.Struct { - @off_t() - external int fs_file_start; +typedef CFLocaleKey = CFStringRef; +typedef CFCalendarIdentifier = CFStringRef; +typedef CFAbsoluteTime = CFTimeInterval; +typedef CFTimeInterval = ffi.Double; +typedef DartCFTimeInterval = double; - @off_t() - external int fs_blob_start; +final class __CFDate extends ffi.Opaque {} - @ffi.Size() - external int fs_blob_size; +typedef CFDateRef = ffi.Pointer<__CFDate>; - @ffi.Int() - external int fs_orig_fd; -} +final class __CFTimeZone extends ffi.Opaque {} -final class fchecklv extends ffi.Struct { - @off_t() - external int lv_file_start; +final class CFGregorianDate extends ffi.Struct { + @SInt32() + external int year; - @ffi.Size() - external int lv_error_message_size; + @SInt8() + external int month; - external ffi.Pointer lv_error_message; -} + @SInt8() + external int day; -final class fgetsigsinfo extends ffi.Struct { - @off_t() - external int fg_file_start; + @SInt8() + external int hour; - @ffi.Int() - external int fg_info_request; + @SInt8() + external int minute; - @ffi.Int() - external int fg_sig_is_platform; + @ffi.Double() + external double second; } -final class fstore extends ffi.Struct { - @ffi.UnsignedInt() - external int fst_flags; - - @ffi.Int() - external int fst_posmode; - - @off_t() - external int fst_offset; +typedef SInt8 = ffi.SignedChar; +typedef DartSInt8 = int; - @off_t() - external int fst_length; +final class CFGregorianUnits extends ffi.Struct { + @SInt32() + external int years; - @off_t() - external int fst_bytesalloc; -} + @SInt32() + external int months; -final class fpunchhole extends ffi.Struct { - @ffi.UnsignedInt() - external int fp_flags; + @SInt32() + external int days; - @ffi.UnsignedInt() - external int reserved; + @SInt32() + external int hours; - @off_t() - external int fp_offset; + @SInt32() + external int minutes; - @off_t() - external int fp_length; + @ffi.Double() + external double seconds; } -final class ftrimactivefile extends ffi.Struct { - @off_t() - external int fta_offset; +typedef CFTimeZoneRef = ffi.Pointer<__CFTimeZone>; - @off_t() - external int fta_length; -} +final class __CFData extends ffi.Opaque {} -final class fspecread extends ffi.Struct { - @ffi.UnsignedInt() - external int fsr_flags; +typedef CFDataRef = ffi.Pointer<__CFData>; +typedef CFMutableDataRef = ffi.Pointer<__CFData>; - @ffi.UnsignedInt() - external int reserved; +enum CFDataSearchFlags { + kCFDataSearchBackwards(1), + kCFDataSearchAnchored(2); - @off_t() - external int fsr_offset; + final int value; + const CFDataSearchFlags(this.value); - @off_t() - external int fsr_length; + static CFDataSearchFlags fromValue(int value) => switch (value) { + 1 => kCFDataSearchBackwards, + 2 => kCFDataSearchAnchored, + _ => throw ArgumentError("Unknown value for CFDataSearchFlags: $value"), + }; } -final class fattributiontag extends ffi.Struct { - @ffi.UnsignedInt() - external int ft_flags; +final class __CFCharacterSet extends ffi.Opaque {} - @ffi.UnsignedLongLong() - external int ft_hash; +typedef CFCharacterSetRef = ffi.Pointer<__CFCharacterSet>; - @ffi.Array.multi([255]) - external ffi.Array ft_attribution_name; +enum CFCharacterSetPredefinedSet { + kCFCharacterSetControl(1), + kCFCharacterSetWhitespace(2), + kCFCharacterSetWhitespaceAndNewline(3), + kCFCharacterSetDecimalDigit(4), + kCFCharacterSetLetter(5), + kCFCharacterSetLowercaseLetter(6), + kCFCharacterSetUppercaseLetter(7), + kCFCharacterSetNonBase(8), + kCFCharacterSetDecomposable(9), + kCFCharacterSetAlphaNumeric(10), + kCFCharacterSetPunctuation(11), + kCFCharacterSetCapitalizedLetter(13), + kCFCharacterSetSymbol(14), + kCFCharacterSetNewline(15), + kCFCharacterSetIllegal(12); + + final int value; + const CFCharacterSetPredefinedSet(this.value); + + static CFCharacterSetPredefinedSet fromValue(int value) => switch (value) { + 1 => kCFCharacterSetControl, + 2 => kCFCharacterSetWhitespace, + 3 => kCFCharacterSetWhitespaceAndNewline, + 4 => kCFCharacterSetDecimalDigit, + 5 => kCFCharacterSetLetter, + 6 => kCFCharacterSetLowercaseLetter, + 7 => kCFCharacterSetUppercaseLetter, + 8 => kCFCharacterSetNonBase, + 9 => kCFCharacterSetDecomposable, + 10 => kCFCharacterSetAlphaNumeric, + 11 => kCFCharacterSetPunctuation, + 13 => kCFCharacterSetCapitalizedLetter, + 14 => kCFCharacterSetSymbol, + 15 => kCFCharacterSetNewline, + 12 => kCFCharacterSetIllegal, + _ => throw ArgumentError( + "Unknown value for CFCharacterSetPredefinedSet: $value"), + }; } -@ffi.Packed(4) -final class log2phys extends ffi.Struct { - @ffi.UnsignedInt() - external int l2p_flags; - - @off_t() - external int l2p_contigbytes; +typedef CFMutableCharacterSetRef = ffi.Pointer<__CFCharacterSet>; +typedef UniChar = UInt16; +typedef UTF32Char = UInt32; - @off_t() - external int l2p_devoffset; -} +final class __CFError extends ffi.Opaque {} -final class _filesec extends ffi.Opaque {} +typedef CFErrorDomain = CFStringRef; +typedef CFErrorRef = ffi.Pointer<__CFError>; +typedef CFStringEncoding = UInt32; +typedef CFMutableStringRef = ffi.Pointer<__CFString>; +typedef StringPtr = ffi.Pointer; +typedef ConstStringPtr = ffi.Pointer; -abstract class filesec_property_t { - static const int FILESEC_OWNER = 1; - static const int FILESEC_GROUP = 2; - static const int FILESEC_UUID = 3; - static const int FILESEC_MODE = 4; - static const int FILESEC_ACL = 5; - static const int FILESEC_GRPUUID = 6; - static const int FILESEC_ACL_RAW = 100; - static const int FILESEC_ACL_ALLOCSIZE = 101; +enum CFStringCompareFlags { + kCFCompareCaseInsensitive(1), + kCFCompareBackwards(4), + kCFCompareAnchored(8), + kCFCompareNonliteral(16), + kCFCompareLocalized(32), + kCFCompareNumerically(64), + kCFCompareDiacriticInsensitive(128), + kCFCompareWidthInsensitive(256), + kCFCompareForcedOrdering(512); + + final int value; + const CFStringCompareFlags(this.value); + + static CFStringCompareFlags fromValue(int value) => switch (value) { + 1 => kCFCompareCaseInsensitive, + 4 => kCFCompareBackwards, + 8 => kCFCompareAnchored, + 16 => kCFCompareNonliteral, + 32 => kCFCompareLocalized, + 64 => kCFCompareNumerically, + 128 => kCFCompareDiacriticInsensitive, + 256 => kCFCompareWidthInsensitive, + 512 => kCFCompareForcedOrdering, + _ => + throw ArgumentError("Unknown value for CFStringCompareFlags: $value"), + }; +} + +enum CFStringNormalizationForm { + kCFStringNormalizationFormD(0), + kCFStringNormalizationFormKD(1), + kCFStringNormalizationFormC(2), + kCFStringNormalizationFormKC(3); + + final int value; + const CFStringNormalizationForm(this.value); + + static CFStringNormalizationForm fromValue(int value) => switch (value) { + 0 => kCFStringNormalizationFormD, + 1 => kCFStringNormalizationFormKD, + 2 => kCFStringNormalizationFormC, + 3 => kCFStringNormalizationFormKC, + _ => throw ArgumentError( + "Unknown value for CFStringNormalizationForm: $value"), + }; } -typedef filesec_t = ffi.Pointer<_filesec>; +final class CFStringInlineBuffer extends ffi.Struct { + @ffi.Array.multi([64]) + external ffi.Array buffer; -abstract class os_clockid_t { - static const int OS_CLOCK_MACH_ABSOLUTE_TIME = 32; -} + external CFStringRef theString; -final class os_workgroup_attr_opaque_s extends ffi.Struct { - @ffi.Uint32() - external int sig; + external ffi.Pointer directUniCharBuffer; - @ffi.Array.multi([60]) - external ffi.Array opaque; -} + external ffi.Pointer directCStringBuffer; -final class os_workgroup_interval_data_opaque_s extends ffi.Struct { - @ffi.Uint32() - external int sig; + external CFRange rangeToBuffer; - @ffi.Array.multi([56]) - external ffi.Array opaque; + @CFIndex() + external int bufferedRangeStart; + + @CFIndex() + external int bufferedRangeEnd; } -final class os_workgroup_join_token_opaque_s extends ffi.Struct { - @ffi.Uint32() - external int sig; +enum CFTimeZoneNameStyle { + kCFTimeZoneNameStyleStandard(0), + kCFTimeZoneNameStyleShortStandard(1), + kCFTimeZoneNameStyleDaylightSaving(2), + kCFTimeZoneNameStyleShortDaylightSaving(3), + kCFTimeZoneNameStyleGeneric(4), + kCFTimeZoneNameStyleShortGeneric(5); - @ffi.Array.multi([36]) - external ffi.Array opaque; -} + final int value; + const CFTimeZoneNameStyle(this.value); -final class os_workgroup_s extends ffi.Opaque {} + static CFTimeZoneNameStyle fromValue(int value) => switch (value) { + 0 => kCFTimeZoneNameStyleStandard, + 1 => kCFTimeZoneNameStyleShortStandard, + 2 => kCFTimeZoneNameStyleDaylightSaving, + 3 => kCFTimeZoneNameStyleShortDaylightSaving, + 4 => kCFTimeZoneNameStyleGeneric, + 5 => kCFTimeZoneNameStyleShortGeneric, + _ => + throw ArgumentError("Unknown value for CFTimeZoneNameStyle: $value"), + }; +} -typedef os_workgroup_t = ffi.Pointer; -typedef os_workgroup_join_token_t - = ffi.Pointer; -typedef os_workgroup_working_arena_destructor_t = ffi.Pointer< - ffi.NativeFunction>; -typedef os_workgroup_working_arena_destructor_tFunction = ffi.Void Function( - ffi.Pointer); -typedef Dartos_workgroup_working_arena_destructor_tFunction = void Function( - ffi.Pointer); -typedef os_workgroup_index = ffi.Uint32; -typedef Dartos_workgroup_index = int; +final class __CFCalendar extends ffi.Opaque {} -final class os_workgroup_max_parallel_threads_attr_s extends ffi.Opaque {} +typedef CFCalendarRef = ffi.Pointer<__CFCalendar>; -typedef os_workgroup_mpt_attr_t - = ffi.Pointer; -typedef os_workgroup_interval_t = os_workgroup_t; -typedef os_workgroup_interval_data_t - = ffi.Pointer; -typedef os_workgroup_parallel_t = os_workgroup_t; -typedef os_workgroup_attr_t = ffi.Pointer; +enum CFCalendarUnit { + kCFCalendarUnitEra(2), + kCFCalendarUnitYear(4), + kCFCalendarUnitMonth(8), + kCFCalendarUnitDay(16), + kCFCalendarUnitHour(32), + kCFCalendarUnitMinute(64), + kCFCalendarUnitSecond(128), + kCFCalendarUnitWeek(256), + kCFCalendarUnitWeekday(512), + kCFCalendarUnitWeekdayOrdinal(1024), + kCFCalendarUnitQuarter(2048), + kCFCalendarUnitWeekOfMonth(4096), + kCFCalendarUnitWeekOfYear(8192), + kCFCalendarUnitYearForWeekOfYear(16384); + + final int value; + const CFCalendarUnit(this.value); + + static CFCalendarUnit fromValue(int value) => switch (value) { + 2 => kCFCalendarUnitEra, + 4 => kCFCalendarUnitYear, + 8 => kCFCalendarUnitMonth, + 16 => kCFCalendarUnitDay, + 32 => kCFCalendarUnitHour, + 64 => kCFCalendarUnitMinute, + 128 => kCFCalendarUnitSecond, + 256 => kCFCalendarUnitWeek, + 512 => kCFCalendarUnitWeekday, + 1024 => kCFCalendarUnitWeekdayOrdinal, + 2048 => kCFCalendarUnitQuarter, + 4096 => kCFCalendarUnitWeekOfMonth, + 8192 => kCFCalendarUnitWeekOfYear, + 16384 => kCFCalendarUnitYearForWeekOfYear, + _ => throw ArgumentError("Unknown value for CFCalendarUnit: $value"), + }; +} -final class time_value extends ffi.Struct { - @integer_t() - external int seconds; +final class CGPoint extends ffi.Struct { + @CGFloat() + external double x; - @integer_t() - external int microseconds; + @CGFloat() + external double y; } -typedef integer_t = ffi.Int; -typedef Dartinteger_t = int; +typedef CGFloat = ffi.Double; +typedef DartCGFloat = double; -final class mach_timespec extends ffi.Struct { - @ffi.UnsignedInt() - external int tv_sec; +final class CGSize extends ffi.Struct { + @CGFloat() + external double width; - @clock_res_t() - external int tv_nsec; + @CGFloat() + external double height; } -typedef clock_res_t = ffi.Int; -typedef Dartclock_res_t = int; -typedef dispatch_time_t = ffi.Uint64; -typedef Dartdispatch_time_t = int; +final class CGVector extends ffi.Struct { + @CGFloat() + external double dx; -abstract class qos_class_t { - static const int QOS_CLASS_USER_INTERACTIVE = 33; - static const int QOS_CLASS_USER_INITIATED = 25; - static const int QOS_CLASS_DEFAULT = 21; - static const int QOS_CLASS_UTILITY = 17; - static const int QOS_CLASS_BACKGROUND = 9; - static const int QOS_CLASS_UNSPECIFIED = 0; + @CGFloat() + external double dy; } -final class dispatch_object_t extends ffi.Union { - external ffi.Pointer<_os_object_s> _os_obj; +final class CGRect extends ffi.Struct { + external CGPoint origin; - external ffi.Pointer _do; + external CGSize size; +} - external ffi.Pointer _dq; +final class CGAffineTransform extends ffi.Struct { + @CGFloat() + external double a; - external ffi.Pointer _dqa; + @CGFloat() + external double b; - external ffi.Pointer _dg; + @CGFloat() + external double c; - external ffi.Pointer _ds; + @CGFloat() + external double d; - external ffi.Pointer _dch; + @CGFloat() + external double tx; - external ffi.Pointer _dm; + @CGFloat() + external double ty; +} - external ffi.Pointer _dmsg; +final class CGAffineTransformComponents extends ffi.Struct { + external CGSize scale; - external ffi.Pointer _dsema; + @CGFloat() + external double horizontalShear; - external ffi.Pointer _ddata; + @CGFloat() + external double rotation; - external ffi.Pointer _dchannel; + external CGVector translation; } -final class _os_object_s extends ffi.Opaque {} - -final class dispatch_object_s extends ffi.Opaque {} - -final class dispatch_queue_attr_s extends ffi.Opaque {} +final class __CFDateFormatter extends ffi.Opaque {} -final class dispatch_group_s extends ffi.Opaque {} +typedef CFDateFormatterRef = ffi.Pointer<__CFDateFormatter>; -final class dispatch_source_s extends ffi.Opaque {} +enum CFISO8601DateFormatOptions { + kCFISO8601DateFormatWithYear(1), + kCFISO8601DateFormatWithMonth(2), + kCFISO8601DateFormatWithWeekOfYear(4), + kCFISO8601DateFormatWithDay(16), + kCFISO8601DateFormatWithTime(32), + kCFISO8601DateFormatWithTimeZone(64), + kCFISO8601DateFormatWithSpaceBetweenDateAndTime(128), + kCFISO8601DateFormatWithDashSeparatorInDate(256), + kCFISO8601DateFormatWithColonSeparatorInTime(512), + kCFISO8601DateFormatWithColonSeparatorInTimeZone(1024), + kCFISO8601DateFormatWithFractionalSeconds(2048), + kCFISO8601DateFormatWithFullDate(275), + kCFISO8601DateFormatWithFullTime(1632), + kCFISO8601DateFormatWithInternetDateTime(1907); + + final int value; + const CFISO8601DateFormatOptions(this.value); + + static CFISO8601DateFormatOptions fromValue(int value) => switch (value) { + 1 => kCFISO8601DateFormatWithYear, + 2 => kCFISO8601DateFormatWithMonth, + 4 => kCFISO8601DateFormatWithWeekOfYear, + 16 => kCFISO8601DateFormatWithDay, + 32 => kCFISO8601DateFormatWithTime, + 64 => kCFISO8601DateFormatWithTimeZone, + 128 => kCFISO8601DateFormatWithSpaceBetweenDateAndTime, + 256 => kCFISO8601DateFormatWithDashSeparatorInDate, + 512 => kCFISO8601DateFormatWithColonSeparatorInTime, + 1024 => kCFISO8601DateFormatWithColonSeparatorInTimeZone, + 2048 => kCFISO8601DateFormatWithFractionalSeconds, + 275 => kCFISO8601DateFormatWithFullDate, + 1632 => kCFISO8601DateFormatWithFullTime, + 1907 => kCFISO8601DateFormatWithInternetDateTime, + _ => throw ArgumentError( + "Unknown value for CFISO8601DateFormatOptions: $value"), + }; +} + +enum CFDateFormatterStyle { + kCFDateFormatterNoStyle(0), + kCFDateFormatterShortStyle(1), + kCFDateFormatterMediumStyle(2), + kCFDateFormatterLongStyle(3), + kCFDateFormatterFullStyle(4); + + final int value; + const CFDateFormatterStyle(this.value); + + static CFDateFormatterStyle fromValue(int value) => switch (value) { + 0 => kCFDateFormatterNoStyle, + 1 => kCFDateFormatterShortStyle, + 2 => kCFDateFormatterMediumStyle, + 3 => kCFDateFormatterLongStyle, + 4 => kCFDateFormatterFullStyle, + _ => + throw ArgumentError("Unknown value for CFDateFormatterStyle: $value"), + }; +} -final class dispatch_channel_s extends ffi.Opaque {} +typedef CFDateFormatterKey = CFStringRef; -final class dispatch_mach_s extends ffi.Opaque {} +final class __CFBoolean extends ffi.Opaque {} -final class dispatch_mach_msg_s extends ffi.Opaque {} +typedef CFBooleanRef = ffi.Pointer<__CFBoolean>; -final class dispatch_semaphore_s extends ffi.Opaque {} +final class __CFNumber extends ffi.Opaque {} -final class dispatch_data_s extends ffi.Opaque {} +typedef CFNumberRef = ffi.Pointer<__CFNumber>; -final class dispatch_io_s extends ffi.Opaque {} +enum CFNumberType { + kCFNumberSInt8Type(1), + kCFNumberSInt16Type(2), + kCFNumberSInt32Type(3), + kCFNumberSInt64Type(4), + kCFNumberFloat32Type(5), + kCFNumberFloat64Type(6), + kCFNumberCharType(7), + kCFNumberShortType(8), + kCFNumberIntType(9), + kCFNumberLongType(10), + kCFNumberLongLongType(11), + kCFNumberFloatType(12), + kCFNumberDoubleType(13), + kCFNumberCFIndexType(14), + kCFNumberNSIntegerType(15), + kCFNumberCGFloatType(16); + + static const kCFNumberMaxType = kCFNumberCGFloatType; + + final int value; + const CFNumberType(this.value); + + static CFNumberType fromValue(int value) => switch (value) { + 1 => kCFNumberSInt8Type, + 2 => kCFNumberSInt16Type, + 3 => kCFNumberSInt32Type, + 4 => kCFNumberSInt64Type, + 5 => kCFNumberFloat32Type, + 6 => kCFNumberFloat64Type, + 7 => kCFNumberCharType, + 8 => kCFNumberShortType, + 9 => kCFNumberIntType, + 10 => kCFNumberLongType, + 11 => kCFNumberLongLongType, + 12 => kCFNumberFloatType, + 13 => kCFNumberDoubleType, + 14 => kCFNumberCFIndexType, + 15 => kCFNumberNSIntegerType, + 16 => kCFNumberCGFloatType, + _ => throw ArgumentError("Unknown value for CFNumberType: $value"), + }; -typedef dispatch_function_t - = ffi.Pointer>; -typedef dispatch_function_tFunction = ffi.Void Function(ffi.Pointer); -typedef Dartdispatch_function_tFunction = void Function(ffi.Pointer); -typedef dispatch_block_t = ffi.Pointer<_ObjCBlock>; -typedef Dartdispatch_block_t = ObjCBlock_ffiVoid; -void _ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_ffiSize_closureRegistry = {}; -int _ObjCBlock_ffiVoid_ffiSize_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_registerClosure( - void Function(int) fn) { - final id = ++_ObjCBlock_ffiVoid_ffiSize_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiSize_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + @override + String toString() { + if (this == kCFNumberCGFloatType) + return "CFNumberType.kCFNumberCGFloatType, CFNumberType.kCFNumberMaxType"; + return super.toString(); + } } -void _ObjCBlock_ffiVoid_ffiSize_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0) => - _ObjCBlock_ffiVoid_ffiSize_closureRegistry[block.ref.target.address]!(arg0); +final class __CFNumberFormatter extends ffi.Opaque {} -class ObjCBlock_ffiVoid_ffiSize extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiSize._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +typedef CFNumberFormatterRef = ffi.Pointer<__CFNumberFormatter>; - /// 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. - ObjCBlock_ffiVoid_ffiSize.fromFunctionPointer(NativeCupertinoHttp lib, - ffi.Pointer> ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Size)>( - _ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +enum CFNumberFormatterStyle { + kCFNumberFormatterNoStyle(0), + kCFNumberFormatterDecimalStyle(1), + kCFNumberFormatterCurrencyStyle(2), + kCFNumberFormatterPercentStyle(3), + kCFNumberFormatterScientificStyle(4), + kCFNumberFormatterSpellOutStyle(5), + kCFNumberFormatterOrdinalStyle(6), + kCFNumberFormatterCurrencyISOCodeStyle(8), + kCFNumberFormatterCurrencyPluralStyle(9), + kCFNumberFormatterCurrencyAccountingStyle(10); + + final int value; + const CFNumberFormatterStyle(this.value); + + static CFNumberFormatterStyle fromValue(int value) => switch (value) { + 0 => kCFNumberFormatterNoStyle, + 1 => kCFNumberFormatterDecimalStyle, + 2 => kCFNumberFormatterCurrencyStyle, + 3 => kCFNumberFormatterPercentStyle, + 4 => kCFNumberFormatterScientificStyle, + 5 => kCFNumberFormatterSpellOutStyle, + 6 => kCFNumberFormatterOrdinalStyle, + 8 => kCFNumberFormatterCurrencyISOCodeStyle, + 9 => kCFNumberFormatterCurrencyPluralStyle, + 10 => kCFNumberFormatterCurrencyAccountingStyle, + _ => throw ArgumentError( + "Unknown value for CFNumberFormatterStyle: $value"), + }; +} - /// 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. - ObjCBlock_ffiVoid_ffiSize.fromFunction( - NativeCupertinoHttp lib, void Function(int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Size)>( - _ObjCBlock_ffiVoid_ffiSize_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiSize_registerClosure( - (int arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +typedef CFNumberFormatterKey = CFStringRef; +typedef CFPropertyListRef = CFTypeRef; - /// 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. - ObjCBlock_ffiVoid_ffiSize.listener( - NativeCupertinoHttp lib, void Function(int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Size)>.listener( - _ObjCBlock_ffiVoid_ffiSize_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiSize_registerClosure( - (int arg0) => fn(arg0))), - lib); - static ffi - .NativeCallable, ffi.Size)>? - _dartFuncListenerTrampoline; - - void call(int arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, ffi.Size arg0)>>() - .asFunction, int)>()(_id, arg0); -} +final class __CFURL extends ffi.Opaque {} -typedef dispatch_queue_global_t = dispatch_queue_t; -typedef dispatch_queue_attr_t = ffi.Pointer; +typedef CFURLRef = ffi.Pointer<__CFURL>; -abstract class dispatch_autorelease_frequency_t { - static const int DISPATCH_AUTORELEASE_FREQUENCY_INHERIT = 0; - static const int DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM = 1; - static const int DISPATCH_AUTORELEASE_FREQUENCY_NEVER = 2; +enum CFURLPathStyle { + kCFURLPOSIXPathStyle(0), + kCFURLHFSPathStyle(1), + kCFURLWindowsPathStyle(2); + + final int value; + const CFURLPathStyle(this.value); + + static CFURLPathStyle fromValue(int value) => switch (value) { + 0 => kCFURLPOSIXPathStyle, + 1 => kCFURLHFSPathStyle, + 2 => kCFURLWindowsPathStyle, + _ => throw ArgumentError("Unknown value for CFURLPathStyle: $value"), + }; +} + +enum CFURLComponentType { + kCFURLComponentScheme(1), + kCFURLComponentNetLocation(2), + kCFURLComponentPath(3), + kCFURLComponentResourceSpecifier(4), + kCFURLComponentUser(5), + kCFURLComponentPassword(6), + kCFURLComponentUserInfo(7), + kCFURLComponentHost(8), + kCFURLComponentPort(9), + kCFURLComponentParameterString(10), + kCFURLComponentQuery(11), + kCFURLComponentFragment(12); + + final int value; + const CFURLComponentType(this.value); + + static CFURLComponentType fromValue(int value) => switch (value) { + 1 => kCFURLComponentScheme, + 2 => kCFURLComponentNetLocation, + 3 => kCFURLComponentPath, + 4 => kCFURLComponentResourceSpecifier, + 5 => kCFURLComponentUser, + 6 => kCFURLComponentPassword, + 7 => kCFURLComponentUserInfo, + 8 => kCFURLComponentHost, + 9 => kCFURLComponentPort, + 10 => kCFURLComponentParameterString, + 11 => kCFURLComponentQuery, + 12 => kCFURLComponentFragment, + _ => + throw ArgumentError("Unknown value for CFURLComponentType: $value"), + }; } -abstract class dispatch_block_flags_t { - static const int DISPATCH_BLOCK_BARRIER = 1; - static const int DISPATCH_BLOCK_DETACHED = 2; - static const int DISPATCH_BLOCK_ASSIGN_CURRENT = 4; - static const int DISPATCH_BLOCK_NO_QOS_CLASS = 8; - static const int DISPATCH_BLOCK_INHERIT_QOS_CLASS = 16; - static const int DISPATCH_BLOCK_ENFORCE_QOS_CLASS = 32; -} +final class FSRef extends ffi.Opaque {} -final class mach_msg_type_descriptor_t extends ffi.Opaque {} +enum CFURLBookmarkCreationOptions { + kCFURLBookmarkCreationMinimalBookmarkMask(512), + kCFURLBookmarkCreationSuitableForBookmarkFile(1024), + kCFURLBookmarkCreationWithSecurityScope(2048), + kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess(4096), + kCFURLBookmarkCreationWithoutImplicitSecurityScope(536870912), + kCFURLBookmarkCreationPreferFileIDResolutionMask(256); + + final int value; + const CFURLBookmarkCreationOptions(this.value); + + static CFURLBookmarkCreationOptions fromValue(int value) => switch (value) { + 512 => kCFURLBookmarkCreationMinimalBookmarkMask, + 1024 => kCFURLBookmarkCreationSuitableForBookmarkFile, + 2048 => kCFURLBookmarkCreationWithSecurityScope, + 4096 => kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess, + 536870912 => kCFURLBookmarkCreationWithoutImplicitSecurityScope, + 256 => kCFURLBookmarkCreationPreferFileIDResolutionMask, + _ => throw ArgumentError( + "Unknown value for CFURLBookmarkCreationOptions: $value"), + }; +} + +enum CFURLBookmarkResolutionOptions { + kCFURLBookmarkResolutionWithoutUIMask(256), + kCFURLBookmarkResolutionWithoutMountingMask(512), + kCFURLBookmarkResolutionWithSecurityScope(1024), + kCFURLBookmarkResolutionWithoutImplicitStartAccessing(32768); + + static const kCFBookmarkResolutionWithoutUIMask = + kCFURLBookmarkResolutionWithoutUIMask; + static const kCFBookmarkResolutionWithoutMountingMask = + kCFURLBookmarkResolutionWithoutMountingMask; + + final int value; + const CFURLBookmarkResolutionOptions(this.value); + + static CFURLBookmarkResolutionOptions fromValue(int value) => switch (value) { + 256 => kCFURLBookmarkResolutionWithoutUIMask, + 512 => kCFURLBookmarkResolutionWithoutMountingMask, + 1024 => kCFURLBookmarkResolutionWithSecurityScope, + 32768 => kCFURLBookmarkResolutionWithoutImplicitStartAccessing, + _ => throw ArgumentError( + "Unknown value for CFURLBookmarkResolutionOptions: $value"), + }; -final class mach_msg_port_descriptor_t extends ffi.Opaque {} + @override + String toString() { + if (this == kCFURLBookmarkResolutionWithoutUIMask) + return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutUIMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutUIMask"; + if (this == kCFURLBookmarkResolutionWithoutMountingMask) + return "CFURLBookmarkResolutionOptions.kCFURLBookmarkResolutionWithoutMountingMask, CFURLBookmarkResolutionOptions.kCFBookmarkResolutionWithoutMountingMask"; + return super.toString(); + } +} -final class mach_msg_ool_descriptor32_t extends ffi.Opaque {} +typedef CFURLBookmarkFileCreationOptions = CFOptionFlags; -final class mach_msg_ool_descriptor64_t extends ffi.Opaque {} +final class mach_port_status extends ffi.Struct { + @mach_port_rights_t() + external int mps_pset; -final class mach_msg_ool_descriptor_t extends ffi.Opaque {} + @mach_port_seqno_t() + external int mps_seqno; -final class mach_msg_ool_ports_descriptor32_t extends ffi.Opaque {} + @mach_port_mscount_t() + external int mps_mscount; -final class mach_msg_ool_ports_descriptor64_t extends ffi.Opaque {} + @mach_port_msgcount_t() + external int mps_qlimit; -final class mach_msg_ool_ports_descriptor_t extends ffi.Opaque {} + @mach_port_msgcount_t() + external int mps_msgcount; -final class mach_msg_guarded_port_descriptor32_t extends ffi.Opaque {} + @mach_port_rights_t() + external int mps_sorights; -final class mach_msg_guarded_port_descriptor64_t extends ffi.Opaque {} + @boolean_t() + external int mps_srights; -final class mach_msg_guarded_port_descriptor_t extends ffi.Opaque {} + @boolean_t() + external int mps_pdrequest; -final class mach_msg_descriptor_t extends ffi.Opaque {} + @boolean_t() + external int mps_nsrequest; -final class mach_msg_body_t extends ffi.Struct { - @mach_msg_size_t() - external int msgh_descriptor_count; + @natural_t() + external int mps_flags; } -typedef mach_msg_size_t = natural_t; +typedef mach_port_rights_t = natural_t; +typedef natural_t = __darwin_natural_t; +typedef __darwin_natural_t = ffi.UnsignedInt; +typedef Dart__darwin_natural_t = int; +typedef mach_port_seqno_t = natural_t; +typedef mach_port_mscount_t = natural_t; +typedef mach_port_msgcount_t = natural_t; +typedef boolean_t = ffi.Int; +typedef Dartboolean_t = int; -final class mach_msg_header_t extends ffi.Struct { - @mach_msg_bits_t() - external int msgh_bits; +final class mach_port_limits extends ffi.Struct { + @mach_port_msgcount_t() + external int mpl_qlimit; +} - @mach_msg_size_t() - external int msgh_size; +final class mach_port_info_ext extends ffi.Struct { + external mach_port_status_t mpie_status; - @mach_port_t() - external int msgh_remote_port; + @mach_port_msgcount_t() + external int mpie_boost_cnt; - @mach_port_t() - external int msgh_local_port; + @ffi.Array.multi([6]) + external ffi.Array reserved; +} - @mach_port_name_t() - external int msgh_voucher_port; +typedef mach_port_status_t = mach_port_status; - @mach_msg_id_t() - external int msgh_id; +final class mach_port_guard_info extends ffi.Struct { + @ffi.Uint64() + external int mpgi_guard; } -typedef mach_msg_bits_t = ffi.UnsignedInt; -typedef Dartmach_msg_bits_t = int; -typedef mach_msg_id_t = integer_t; +final class mach_port_qos extends ffi.Opaque {} -final class mach_msg_base_t extends ffi.Struct { - external mach_msg_header_t header; +final class mach_service_port_info extends ffi.Struct { + @ffi.Array.multi([255]) + external ffi.Array mspi_string_name; - external mach_msg_body_t body; + @ffi.Uint8() + external int mspi_domain_type; } -final class mach_msg_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +final class mach_port_options extends ffi.Struct { + @ffi.Uint32() + external int flags; - @mach_msg_trailer_size_t() - external int msgh_trailer_size; + external mach_port_limits_t mpl; + + external UnnamedUnion1 unnamed; } -typedef mach_msg_trailer_type_t = ffi.UnsignedInt; -typedef Dartmach_msg_trailer_type_t = int; -typedef mach_msg_trailer_size_t = ffi.UnsignedInt; -typedef Dartmach_msg_trailer_size_t = int; +typedef mach_port_limits_t = mach_port_limits; -final class mach_msg_seqno_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +final class UnnamedUnion1 extends ffi.Union { + @ffi.Array.multi([2]) + external ffi.Array reserved; - @mach_msg_trailer_size_t() - external int msgh_trailer_size; + @mach_port_name_t() + external int work_interval_port; - @mach_port_seqno_t() - external int msgh_seqno; -} + external mach_service_port_info_t service_port_info; -final class security_token_t extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array val; + @mach_port_name_t() + external int service_port_name; } -final class mach_msg_security_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; - - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +typedef mach_port_name_t = natural_t; +typedef mach_service_port_info_t = ffi.Pointer; - @mach_port_seqno_t() - external int msgh_seqno; +final class __CFRunLoop extends ffi.Opaque {} - external security_token_t msgh_sender; -} +final class __CFRunLoopSource extends ffi.Opaque {} -final class audit_token_t extends ffi.Struct { - @ffi.Array.multi([8]) - external ffi.Array val; -} +final class __CFRunLoopObserver extends ffi.Opaque {} -final class mach_msg_audit_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +final class __CFRunLoopTimer extends ffi.Opaque {} - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +typedef CFRunLoopMode = CFStringRef; +typedef CFRunLoopRef = ffi.Pointer<__CFRunLoop>; - @mach_port_seqno_t() - external int msgh_seqno; +enum CFRunLoopRunResult { + kCFRunLoopRunFinished(1), + kCFRunLoopRunStopped(2), + kCFRunLoopRunTimedOut(3), + kCFRunLoopRunHandledSource(4); - external security_token_t msgh_sender; + final int value; + const CFRunLoopRunResult(this.value); - external audit_token_t msgh_audit; + static CFRunLoopRunResult fromValue(int value) => switch (value) { + 1 => kCFRunLoopRunFinished, + 2 => kCFRunLoopRunStopped, + 3 => kCFRunLoopRunTimedOut, + 4 => kCFRunLoopRunHandledSource, + _ => + throw ArgumentError("Unknown value for CFRunLoopRunResult: $value"), + }; } -@ffi.Packed(4) -final class mach_msg_context_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; +typedef CFRunLoopSourceRef = ffi.Pointer<__CFRunLoopSource>; +typedef CFRunLoopObserverRef = ffi.Pointer<__CFRunLoopObserver>; +typedef CFRunLoopTimerRef = ffi.Pointer<__CFRunLoopTimer>; - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +final class CFRunLoopSourceContext extends ffi.Struct { + @CFIndex() + external int version; - @mach_port_seqno_t() - external int msgh_seqno; + external ffi.Pointer info; - external security_token_t msgh_sender; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; + + external ffi.Pointer< + ffi.NativeFunction info)>> + release; + + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; + + external ffi.Pointer< + ffi.NativeFunction< + Boolean Function( + ffi.Pointer info1, ffi.Pointer info2)>> equal; - external audit_token_t msgh_audit; + external ffi.Pointer< + ffi.NativeFunction info)>> hash; - @mach_port_context_t() - external int msgh_context; -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, + CFRunLoopMode mode)>> schedule; -typedef mach_port_context_t = vm_offset_t; -typedef vm_offset_t = ffi.UintPtr; -typedef Dartvm_offset_t = int; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer info, CFRunLoopRef rl, + CFRunLoopMode mode)>> cancel; -final class msg_labels_t extends ffi.Struct { - @mach_port_name_t() - external int sender; + external ffi.Pointer< + ffi.NativeFunction info)>> + perform; } -@ffi.Packed(4) -final class mach_msg_mac_trailer_t extends ffi.Struct { - @mach_msg_trailer_type_t() - external int msgh_trailer_type; - - @mach_msg_trailer_size_t() - external int msgh_trailer_size; +final class CFRunLoopSourceContext1 extends ffi.Struct { + @CFIndex() + external int version; - @mach_port_seqno_t() - external int msgh_seqno; + external ffi.Pointer info; - external security_token_t msgh_sender; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - external audit_token_t msgh_audit; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - @mach_port_context_t() - external int msgh_context; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; - @mach_msg_filter_id() - external int msgh_ad; + external ffi.Pointer< + ffi.NativeFunction< + Boolean Function( + ffi.Pointer info1, ffi.Pointer info2)>> equal; - external msg_labels_t msgh_labels; -} + external ffi.Pointer< + ffi.NativeFunction info)>> hash; -typedef mach_msg_filter_id = ffi.Int; -typedef Dartmach_msg_filter_id = int; + external ffi.Pointer< + ffi.NativeFunction info)>> + getPort; -final class mach_msg_empty_send_t extends ffi.Struct { - external mach_msg_header_t header; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer msg, + CFIndex size, + CFAllocatorRef allocator, + ffi.Pointer info)>> perform; } -final class mach_msg_empty_rcv_t extends ffi.Struct { - external mach_msg_header_t header; - - external mach_msg_trailer_t trailer; -} +typedef mach_port_t = __darwin_mach_port_t; +typedef __darwin_mach_port_t = __darwin_mach_port_name_t; +typedef __darwin_mach_port_name_t = __darwin_natural_t; -final class mach_msg_empty_t extends ffi.Union { - external mach_msg_empty_send_t send; +final class CFRunLoopObserverContext extends ffi.Struct { + @CFIndex() + external int version; - external mach_msg_empty_rcv_t rcv; -} + external ffi.Pointer info; -typedef mach_msg_return_t = kern_return_t; -typedef kern_return_t = ffi.Int; -typedef Dartkern_return_t = int; -typedef mach_msg_option_t = integer_t; -typedef mach_msg_timeout_t = natural_t; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; -final class dispatch_source_type_s extends ffi.Opaque {} + external ffi.Pointer< + ffi.NativeFunction info)>> + release; -typedef dispatch_source_t = ffi.Pointer; -typedef dispatch_source_type_t = ffi.Pointer; -typedef dispatch_group_t = ffi.Pointer; -typedef dispatch_semaphore_t = ffi.Pointer; -typedef dispatch_once_t = ffi.IntPtr; -typedef Dartdispatch_once_t = int; -typedef dispatch_data_t = ffi.Pointer; -typedef dispatch_data_applier_t = ffi.Pointer<_ObjCBlock>; -typedef Dartdispatch_data_applier_t - = ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize; -bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - dispatch_data_t arg0, - int arg1, - ffi.Pointer arg2, - int arg3) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Bool Function(dispatch_data_t arg0, ffi.Size arg1, - ffi.Pointer arg2, ffi.Size arg3)>>() - .asFunction< - bool Function(dispatch_data_t, int, ffi.Pointer, - int)>()(arg0, arg1, arg2, arg3); -final _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureRegistry = - , int)>{}; -int _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_registerClosure( - bool Function(dispatch_data_t, int, ffi.Pointer, int) fn) { - final id = - ++_ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureRegistryIndex; - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureRegistry[id] = - fn; - return ffi.Pointer.fromAddress(id); + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - dispatch_data_t arg0, - int arg1, - ffi.Pointer arg2, - int arg3) => - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2, arg3); - -class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize - extends _ObjCBlockBase { - ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Bool Function(dispatch_data_t arg0, ffi.Size arg1, - ffi.Pointer arg2, ffi.Size arg3)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - dispatch_data_t, - ffi.Size, - ffi.Pointer, - ffi.Size)>( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline, - false) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +typedef CFRunLoopObserverCallBack + = ffi.Pointer>; +typedef CFRunLoopObserverCallBackFunction = ffi.Void Function( + CFRunLoopObserverRef observer, + CFOptionFlags activity, + ffi.Pointer info); +typedef DartCFRunLoopObserverCallBackFunction = void Function( + CFRunLoopObserverRef observer, + CFRunLoopActivity activity, + ffi.Pointer info); - /// 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. - ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize.fromFunction( - NativeCupertinoHttp lib, - bool Function(dispatch_data_t, int, ffi.Pointer, int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock>, - dispatch_data_t, - ffi.Size, - ffi.Pointer, - ffi.Size)>( - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline, false) - .cast(), - _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_registerClosure( - (dispatch_data_t arg0, int arg1, ffi.Pointer arg2, - int arg3) => - fn(arg0, arg1, arg2, arg3))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - bool call(dispatch_data_t arg0, int arg1, ffi.Pointer arg2, - int arg3) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Bool Function( - ffi.Pointer<_ObjCBlock> block, - dispatch_data_t arg0, - ffi.Size arg1, - ffi.Pointer arg2, - ffi.Size arg3)>>() - .asFunction< - bool Function(ffi.Pointer<_ObjCBlock>, dispatch_data_t, int, - ffi.Pointer, int)>()(_id, arg0, arg1, arg2, arg3); +enum CFRunLoopActivity { + kCFRunLoopEntry(1), + kCFRunLoopBeforeTimers(2), + kCFRunLoopBeforeSources(4), + kCFRunLoopBeforeWaiting(32), + kCFRunLoopAfterWaiting(64), + kCFRunLoopExit(128), + kCFRunLoopAllActivities(268435455); + + final int value; + const CFRunLoopActivity(this.value); + + static CFRunLoopActivity fromValue(int value) => switch (value) { + 1 => kCFRunLoopEntry, + 2 => kCFRunLoopBeforeTimers, + 4 => kCFRunLoopBeforeSources, + 32 => kCFRunLoopBeforeWaiting, + 64 => kCFRunLoopAfterWaiting, + 128 => kCFRunLoopExit, + 268435455 => kCFRunLoopAllActivities, + _ => throw ArgumentError("Unknown value for CFRunLoopActivity: $value"), + }; } -typedef dispatch_fd_t = ffi.Int; -typedef Dartdispatch_fd_t = int; -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, dispatch_data_t arg0, int arg1) => +void _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline( + ffi.Pointer block, + CFRunLoopObserverRef arg0, + int arg1) => block.ref.target .cast< ffi.NativeFunction< - ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1)>>() - .asFunction()(arg0, arg1); -final _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_registerClosure( - void Function(dispatch_data_t, int) fn) { - final id = ++_ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureRegistryIndex; - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, dispatch_data_t arg0, int arg1) => - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_dispatchdatat_ffiInt extends _ObjCBlockBase { - ObjCBlock_ffiVoid_dispatchdatat_ffiInt._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + ffi.Void Function( + CFRunLoopObserverRef arg0, CFOptionFlags arg1)>>() + .asFunction()(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + CFRunLoopObserverRef, CFOptionFlags)>( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline( + ffi.Pointer block, + CFRunLoopObserverRef arg0, + int arg1) => + (objc.getBlockClosure(block) as void Function( + CFRunLoopObserverRef, int))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + CFRunLoopObserverRef, CFOptionFlags)>( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline( + ffi.Pointer block, + CFRunLoopObserverRef arg0, + int arg1) { + (objc.getBlockClosure(block) as void Function(CFRunLoopObserverRef, int))( + arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, CFRunLoopObserverRef, + CFOptionFlags)> + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + CFRunLoopObserverRef, CFOptionFlags)>.listener( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, CFOptionFlags)>`. +abstract final class ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, + CFOptionFlags)>(pointer, retain: retain, release: release); /// 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. - ObjCBlock_ffiVoid_dispatchdatat_ffiInt.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> + fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock, CFOptionFlags)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_dispatchdatat_ffiInt.fromFunction( - NativeCupertinoHttp lib, void Function(dispatch_data_t, int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_registerClosure( - (dispatch_data_t arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + static objc + .ObjCBlock, CFOptionFlags)> + fromFunction(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_closureCallable, + (CFRunLoopObserverRef arg0, int arg1) => + fn(arg0, CFRunLoopActivity.fromValue(arg1))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -77135,213 +50412,136 @@ class ObjCBlock_ffiVoid_dispatchdatat_ffiInt extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_dispatchdatat_ffiInt.listener( - NativeCupertinoHttp lib, void Function(dispatch_data_t, int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - dispatch_data_t, ffi.Int)>.listener( - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_registerClosure( - (dispatch_data_t arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, dispatch_data_t, ffi.Int)>? - _dartFuncListenerTrampoline; - - void call(dispatch_data_t arg0, int arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - dispatch_data_t arg0, ffi.Int arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, dispatch_data_t, int)>()( - _id, arg0, arg1); -} - -typedef dispatch_io_t = ffi.Pointer; -typedef dispatch_io_type_t = ffi.UnsignedLong; -typedef Dartdispatch_io_type_t = int; -void _ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_ffiInt_closureRegistry = {}; -int _ObjCBlock_ffiVoid_ffiInt_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_registerClosure( - void Function(int) fn) { - final id = ++_ObjCBlock_ffiVoid_ffiInt_closureRegistryIndex; - _ObjCBlock_ffiVoid_ffiInt_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> + listener(void Function(CFRunLoopObserverRef, CFRunLoopActivity) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_listenerCallable + .nativeFunction + .cast(), + (CFRunLoopObserverRef arg0, int arg1) => + fn(arg0, CFRunLoopActivity.fromValue(arg1))); + final wrapper = _wrapListenerBlock_ttt6u1(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, + CFOptionFlags)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, CFOptionFlags)>`. +extension ObjCBlock_ffiVoid_CFRunLoopObserverRef_CFRunLoopActivity_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopObserver>, CFOptionFlags)> { + void call(CFRunLoopObserverRef arg0, CFRunLoopActivity arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + CFRunLoopObserverRef arg0, CFOptionFlags arg1)>>() + .asFunction< + void Function(ffi.Pointer, CFRunLoopObserverRef, + int)>()(ref.pointer, arg0, arg1.value); } -void _ObjCBlock_ffiVoid_ffiInt_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0) => - _ObjCBlock_ffiVoid_ffiInt_closureRegistry[block.ref.target.address]!(arg0); +final class CFRunLoopTimerContext extends ffi.Struct { + @CFIndex() + external int version; -class ObjCBlock_ffiVoid_ffiInt extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ffiInt._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + external ffi.Pointer info; - /// 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. - ObjCBlock_ffiVoid_ffiInt.fromFunctionPointer(NativeCupertinoHttp lib, - ffi.Pointer> ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Int)>(_ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - /// 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. - ObjCBlock_ffiVoid_ffiInt.fromFunction( - NativeCupertinoHttp lib, void Function(int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Int)>( - _ObjCBlock_ffiVoid_ffiInt_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ffiInt_registerClosure( - (int arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - /// 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. - ObjCBlock_ffiVoid_ffiInt.listener( - NativeCupertinoHttp lib, void Function(int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Int)>.listener( - _ObjCBlock_ffiVoid_ffiInt_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ffiInt_registerClosure( - (int arg0) => fn(arg0))), - lib); - static ffi - .NativeCallable, ffi.Int)>? - _dartFuncListenerTrampoline; - - void call(int arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Int arg0)>>() - .asFunction, int)>()(_id, arg0); + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -typedef dispatch_io_handler_t = ffi.Pointer<_ObjCBlock>; -typedef Dartdispatch_io_handler_t = ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt; -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - bool arg0, - dispatch_data_t arg1, - int arg2) => +typedef CFRunLoopTimerCallBack + = ffi.Pointer>; +typedef CFRunLoopTimerCallBackFunction = ffi.Void Function( + CFRunLoopTimerRef timer, ffi.Pointer info); +typedef DartCFRunLoopTimerCallBackFunction = void Function( + CFRunLoopTimerRef timer, ffi.Pointer info); +void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline( + ffi.Pointer block, CFRunLoopTimerRef arg0) => block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>>() - .asFunction()( - arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_registerClosure( - void Function(bool, dispatch_data_t, int) fn) { - final id = - ++_ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureRegistryIndex; - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - bool arg0, - dispatch_data_t arg1, - int arg2) => - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt extends _ObjCBlockBase { - ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, CFRunLoopTimerRef)>( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline( + ffi.Pointer block, CFRunLoopTimerRef arg0) => + (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, CFRunLoopTimerRef)>( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline( + ffi.Pointer block, CFRunLoopTimerRef arg0) { + (objc.getBlockClosure(block) as void Function(CFRunLoopTimerRef))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, CFRunLoopTimerRef)> + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, CFRunLoopTimerRef)>.listener( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_CFRunLoopTimerRef { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); /// 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. - ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Bool, - dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__CFRunLoopTimer>)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt.fromFunction( - NativeCupertinoHttp lib, void Function(bool, dispatch_data_t, int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Bool, - dispatch_data_t, ffi.Int)>( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_registerClosure( - (bool arg0, dispatch_data_t arg1, int arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + static objc.ObjCBlock)> + fromFunction(void Function(CFRunLoopTimerRef) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_closureCallable, + (CFRunLoopTimerRef arg0) => fn(arg0)), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -77352,71 +50552,50 @@ class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt.listener( - NativeCupertinoHttp lib, void Function(bool, dispatch_data_t, int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Bool, - dispatch_data_t, ffi.Int)>.listener( - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_registerClosure( - (bool arg0, dispatch_data_t arg1, int arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Bool, dispatch_data_t, ffi.Int)>? - _dartFuncListenerTrampoline; + static objc.ObjCBlock)> + listener(void Function(CFRunLoopTimerRef) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_CFRunLoopTimerRef_listenerCallable.nativeFunction + .cast(), + (CFRunLoopTimerRef arg0) => fn(arg0)); + final wrapper = _wrapListenerBlock_1txhfzs(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); + } +} - void call(bool arg0, dispatch_data_t arg1, int arg2) => _id.ref.invoke +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_CFRunLoopTimerRef_CallExtension + on objc.ObjCBlock)> { + void call(CFRunLoopTimerRef arg0) => ref.pointer.ref.invoke .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0, - dispatch_data_t arg1, ffi.Int arg2)>>() + ffi.Void Function(ffi.Pointer block, + CFRunLoopTimerRef arg0)>>() .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, bool, dispatch_data_t, - int)>()(_id, arg0, arg1, arg2); + void Function(ffi.Pointer, + CFRunLoopTimerRef)>()(ref.pointer, arg0); } -typedef dispatch_io_close_flags_t = ffi.UnsignedLong; -typedef Dartdispatch_io_close_flags_t = int; -typedef dispatch_io_interval_flags_t = ffi.UnsignedLong; -typedef Dartdispatch_io_interval_flags_t = int; -typedef dispatch_workloop_t = dispatch_queue_t; +final class __CFSocket extends ffi.Opaque {} -final class CFStreamError extends ffi.Struct { - @CFIndex() - external int domain; +final class CFSocketSignature extends ffi.Struct { + @SInt32() + external int protocolFamily; @SInt32() - external int error; -} + external int socketType; -abstract class CFStreamStatus { - static const int kCFStreamStatusNotOpen = 0; - static const int kCFStreamStatusOpening = 1; - static const int kCFStreamStatusOpen = 2; - static const int kCFStreamStatusReading = 3; - static const int kCFStreamStatusWriting = 4; - static const int kCFStreamStatusAtEnd = 5; - static const int kCFStreamStatusClosed = 6; - static const int kCFStreamStatusError = 7; -} + @SInt32() + external int protocol; -abstract class CFStreamEventType { - static const int kCFStreamEventNone = 0; - static const int kCFStreamEventOpenCompleted = 1; - static const int kCFStreamEventHasBytesAvailable = 2; - static const int kCFStreamEventCanAcceptBytes = 4; - static const int kCFStreamEventErrorOccurred = 8; - static const int kCFStreamEventEndEncountered = 16; + external CFDataRef address; } -final class CFStreamClientContext extends ffi.Struct { +final class CFSocketContext extends ffi.Struct { @CFIndex() external int version; @@ -77435,6459 +50614,5040 @@ final class CFStreamClientContext extends ffi.Struct { copyDescription; } -final class __CFReadStream extends ffi.Opaque {} +typedef CFSocketRef = ffi.Pointer<__CFSocket>; +typedef CFSocketCallBack + = ffi.Pointer>; +typedef CFSocketCallBackFunction = ffi.Void Function( + CFSocketRef s, + CFOptionFlags type, + CFDataRef address, + ffi.Pointer data, + ffi.Pointer info); +typedef DartCFSocketCallBackFunction = void Function( + CFSocketRef s, + CFSocketCallBackType type, + CFDataRef address, + ffi.Pointer data, + ffi.Pointer info); -final class __CFWriteStream extends ffi.Opaque {} +enum CFSocketCallBackType { + kCFSocketNoCallBack(0), + kCFSocketReadCallBack(1), + kCFSocketAcceptCallBack(2), + kCFSocketDataCallBack(3), + kCFSocketConnectCallBack(4), + kCFSocketWriteCallBack(8); + + final int value; + const CFSocketCallBackType(this.value); + + static CFSocketCallBackType fromValue(int value) => switch (value) { + 0 => kCFSocketNoCallBack, + 1 => kCFSocketReadCallBack, + 2 => kCFSocketAcceptCallBack, + 3 => kCFSocketDataCallBack, + 4 => kCFSocketConnectCallBack, + 8 => kCFSocketWriteCallBack, + _ => + throw ArgumentError("Unknown value for CFSocketCallBackType: $value"), + }; +} -typedef CFStreamPropertyKey = CFStringRef; -typedef CFReadStreamRef = ffi.Pointer<__CFReadStream>; -typedef CFWriteStreamRef = ffi.Pointer<__CFWriteStream>; -typedef CFReadStreamClientCallBack - = ffi.Pointer>; -typedef CFReadStreamClientCallBackFunction = ffi.Void Function( - CFReadStreamRef stream, - ffi.Int32 type, - ffi.Pointer clientCallBackInfo); -typedef DartCFReadStreamClientCallBackFunction = void Function( - CFReadStreamRef stream, int type, ffi.Pointer clientCallBackInfo); -typedef CFWriteStreamClientCallBack - = ffi.Pointer>; -typedef CFWriteStreamClientCallBackFunction = ffi.Void Function( - CFWriteStreamRef stream, - ffi.Int32 type, - ffi.Pointer clientCallBackInfo); -typedef DartCFWriteStreamClientCallBackFunction = void Function( - CFWriteStreamRef stream, - int type, - ffi.Pointer clientCallBackInfo); +typedef CFSocketNativeHandle = ffi.Int; +typedef DartCFSocketNativeHandle = int; -abstract class CFStreamErrorDomain { - static const int kCFStreamErrorDomainCustom = -1; - static const int kCFStreamErrorDomainPOSIX = 1; - static const int kCFStreamErrorDomainMacOSStatus = 2; -} +enum CFSocketError { + kCFSocketSuccess(0), + kCFSocketError(-1), + kCFSocketTimeout(-2); + + final int value; + const CFSocketError(this.value); -abstract class CFPropertyListMutabilityOptions { - static const int kCFPropertyListImmutable = 0; - static const int kCFPropertyListMutableContainers = 1; - static const int kCFPropertyListMutableContainersAndLeaves = 2; + static CFSocketError fromValue(int value) => switch (value) { + 0 => kCFSocketSuccess, + -1 => kCFSocketError, + -2 => kCFSocketTimeout, + _ => throw ArgumentError("Unknown value for CFSocketError: $value"), + }; } -abstract class CFPropertyListFormat { - static const int kCFPropertyListOpenStepFormat = 1; - static const int kCFPropertyListXMLFormat_v1_0 = 100; - static const int kCFPropertyListBinaryFormat_v1_0 = 200; +final class accessx_descriptor extends ffi.Struct { + @ffi.UnsignedInt() + external int ad_name_offset; + + @ffi.Int() + external int ad_flags; + + @ffi.Array.multi([2]) + external ffi.Array ad_pad; } -final class CFSetCallBacks extends ffi.Struct { - @CFIndex() - external int version; +typedef gid_t = __darwin_gid_t; +typedef __darwin_gid_t = __uint32_t; +typedef useconds_t = __darwin_useconds_t; +typedef __darwin_useconds_t = __uint32_t; - external CFSetRetainCallBack retain; +final class fssearchblock extends ffi.Opaque {} - external CFSetReleaseCallBack release; +final class searchstate extends ffi.Opaque {} - external CFSetCopyDescriptionCallBack copyDescription; +final class flock extends ffi.Struct { + @off_t() + external int l_start; - external CFSetEqualCallBack equal; + @off_t() + external int l_len; - external CFSetHashCallBack hash; + @pid_t() + external int l_pid; + + @ffi.Short() + external int l_type; + + @ffi.Short() + external int l_whence; } -typedef CFSetRetainCallBack - = ffi.Pointer>; -typedef CFSetRetainCallBackFunction = ffi.Pointer Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFSetReleaseCallBack - = ffi.Pointer>; -typedef CFSetReleaseCallBackFunction = ffi.Void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef DartCFSetReleaseCallBackFunction = void Function( - CFAllocatorRef allocator, ffi.Pointer value); -typedef CFSetCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFSetCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer value); -typedef CFSetEqualCallBack - = ffi.Pointer>; -typedef CFSetEqualCallBackFunction = Boolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef DartCFSetEqualCallBackFunction = DartBoolean Function( - ffi.Pointer value1, ffi.Pointer value2); -typedef CFSetHashCallBack - = ffi.Pointer>; -typedef CFSetHashCallBackFunction = CFHashCode Function( - ffi.Pointer value); -typedef DartCFSetHashCallBackFunction = DartCFHashCode Function( - ffi.Pointer value); +final class flocktimeout extends ffi.Struct { + external flock fl; -final class __CFSet extends ffi.Opaque {} + external timespec timeout; +} -typedef CFSetRef = ffi.Pointer<__CFSet>; -typedef CFMutableSetRef = ffi.Pointer<__CFSet>; -typedef CFSetApplierFunction - = ffi.Pointer>; -typedef CFSetApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFSetApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); +final class radvisory extends ffi.Struct { + @off_t() + external int ra_offset; -abstract class CFStringEncodings { - static const int kCFStringEncodingMacJapanese = 1; - static const int kCFStringEncodingMacChineseTrad = 2; - static const int kCFStringEncodingMacKorean = 3; - static const int kCFStringEncodingMacArabic = 4; - static const int kCFStringEncodingMacHebrew = 5; - static const int kCFStringEncodingMacGreek = 6; - static const int kCFStringEncodingMacCyrillic = 7; - static const int kCFStringEncodingMacDevanagari = 9; - static const int kCFStringEncodingMacGurmukhi = 10; - static const int kCFStringEncodingMacGujarati = 11; - static const int kCFStringEncodingMacOriya = 12; - static const int kCFStringEncodingMacBengali = 13; - static const int kCFStringEncodingMacTamil = 14; - static const int kCFStringEncodingMacTelugu = 15; - static const int kCFStringEncodingMacKannada = 16; - static const int kCFStringEncodingMacMalayalam = 17; - static const int kCFStringEncodingMacSinhalese = 18; - static const int kCFStringEncodingMacBurmese = 19; - static const int kCFStringEncodingMacKhmer = 20; - static const int kCFStringEncodingMacThai = 21; - static const int kCFStringEncodingMacLaotian = 22; - static const int kCFStringEncodingMacGeorgian = 23; - static const int kCFStringEncodingMacArmenian = 24; - static const int kCFStringEncodingMacChineseSimp = 25; - static const int kCFStringEncodingMacTibetan = 26; - static const int kCFStringEncodingMacMongolian = 27; - static const int kCFStringEncodingMacEthiopic = 28; - static const int kCFStringEncodingMacCentralEurRoman = 29; - static const int kCFStringEncodingMacVietnamese = 30; - static const int kCFStringEncodingMacExtArabic = 31; - static const int kCFStringEncodingMacSymbol = 33; - static const int kCFStringEncodingMacDingbats = 34; - static const int kCFStringEncodingMacTurkish = 35; - static const int kCFStringEncodingMacCroatian = 36; - static const int kCFStringEncodingMacIcelandic = 37; - static const int kCFStringEncodingMacRomanian = 38; - static const int kCFStringEncodingMacCeltic = 39; - static const int kCFStringEncodingMacGaelic = 40; - static const int kCFStringEncodingMacFarsi = 140; - static const int kCFStringEncodingMacUkrainian = 152; - static const int kCFStringEncodingMacInuit = 236; - static const int kCFStringEncodingMacVT100 = 252; - static const int kCFStringEncodingMacHFS = 255; - static const int kCFStringEncodingISOLatin2 = 514; - static const int kCFStringEncodingISOLatin3 = 515; - static const int kCFStringEncodingISOLatin4 = 516; - static const int kCFStringEncodingISOLatinCyrillic = 517; - static const int kCFStringEncodingISOLatinArabic = 518; - static const int kCFStringEncodingISOLatinGreek = 519; - static const int kCFStringEncodingISOLatinHebrew = 520; - static const int kCFStringEncodingISOLatin5 = 521; - static const int kCFStringEncodingISOLatin6 = 522; - static const int kCFStringEncodingISOLatinThai = 523; - static const int kCFStringEncodingISOLatin7 = 525; - static const int kCFStringEncodingISOLatin8 = 526; - static const int kCFStringEncodingISOLatin9 = 527; - static const int kCFStringEncodingISOLatin10 = 528; - static const int kCFStringEncodingDOSLatinUS = 1024; - static const int kCFStringEncodingDOSGreek = 1029; - static const int kCFStringEncodingDOSBalticRim = 1030; - static const int kCFStringEncodingDOSLatin1 = 1040; - static const int kCFStringEncodingDOSGreek1 = 1041; - static const int kCFStringEncodingDOSLatin2 = 1042; - static const int kCFStringEncodingDOSCyrillic = 1043; - static const int kCFStringEncodingDOSTurkish = 1044; - static const int kCFStringEncodingDOSPortuguese = 1045; - static const int kCFStringEncodingDOSIcelandic = 1046; - static const int kCFStringEncodingDOSHebrew = 1047; - static const int kCFStringEncodingDOSCanadianFrench = 1048; - static const int kCFStringEncodingDOSArabic = 1049; - static const int kCFStringEncodingDOSNordic = 1050; - static const int kCFStringEncodingDOSRussian = 1051; - static const int kCFStringEncodingDOSGreek2 = 1052; - static const int kCFStringEncodingDOSThai = 1053; - static const int kCFStringEncodingDOSJapanese = 1056; - static const int kCFStringEncodingDOSChineseSimplif = 1057; - static const int kCFStringEncodingDOSKorean = 1058; - static const int kCFStringEncodingDOSChineseTrad = 1059; - static const int kCFStringEncodingWindowsLatin2 = 1281; - static const int kCFStringEncodingWindowsCyrillic = 1282; - static const int kCFStringEncodingWindowsGreek = 1283; - static const int kCFStringEncodingWindowsLatin5 = 1284; - static const int kCFStringEncodingWindowsHebrew = 1285; - static const int kCFStringEncodingWindowsArabic = 1286; - static const int kCFStringEncodingWindowsBalticRim = 1287; - static const int kCFStringEncodingWindowsVietnamese = 1288; - static const int kCFStringEncodingWindowsKoreanJohab = 1296; - static const int kCFStringEncodingANSEL = 1537; - static const int kCFStringEncodingJIS_X0201_76 = 1568; - static const int kCFStringEncodingJIS_X0208_83 = 1569; - static const int kCFStringEncodingJIS_X0208_90 = 1570; - static const int kCFStringEncodingJIS_X0212_90 = 1571; - static const int kCFStringEncodingJIS_C6226_78 = 1572; - static const int kCFStringEncodingShiftJIS_X0213 = 1576; - static const int kCFStringEncodingShiftJIS_X0213_MenKuTen = 1577; - static const int kCFStringEncodingGB_2312_80 = 1584; - static const int kCFStringEncodingGBK_95 = 1585; - static const int kCFStringEncodingGB_18030_2000 = 1586; - static const int kCFStringEncodingKSC_5601_87 = 1600; - static const int kCFStringEncodingKSC_5601_92_Johab = 1601; - static const int kCFStringEncodingCNS_11643_92_P1 = 1617; - static const int kCFStringEncodingCNS_11643_92_P2 = 1618; - static const int kCFStringEncodingCNS_11643_92_P3 = 1619; - static const int kCFStringEncodingISO_2022_JP = 2080; - static const int kCFStringEncodingISO_2022_JP_2 = 2081; - static const int kCFStringEncodingISO_2022_JP_1 = 2082; - static const int kCFStringEncodingISO_2022_JP_3 = 2083; - static const int kCFStringEncodingISO_2022_CN = 2096; - static const int kCFStringEncodingISO_2022_CN_EXT = 2097; - static const int kCFStringEncodingISO_2022_KR = 2112; - static const int kCFStringEncodingEUC_JP = 2336; - static const int kCFStringEncodingEUC_CN = 2352; - static const int kCFStringEncodingEUC_TW = 2353; - static const int kCFStringEncodingEUC_KR = 2368; - static const int kCFStringEncodingShiftJIS = 2561; - static const int kCFStringEncodingKOI8_R = 2562; - static const int kCFStringEncodingBig5 = 2563; - static const int kCFStringEncodingMacRomanLatin1 = 2564; - static const int kCFStringEncodingHZ_GB_2312 = 2565; - static const int kCFStringEncodingBig5_HKSCS_1999 = 2566; - static const int kCFStringEncodingVISCII = 2567; - static const int kCFStringEncodingKOI8_U = 2568; - static const int kCFStringEncodingBig5_E = 2569; - static const int kCFStringEncodingNextStepJapanese = 2818; - static const int kCFStringEncodingEBCDIC_US = 3073; - static const int kCFStringEncodingEBCDIC_CP037 = 3074; - static const int kCFStringEncodingUTF7 = 67109120; - static const int kCFStringEncodingUTF7_IMAP = 2576; - static const int kCFStringEncodingShiftJIS_X0213_00 = 1576; + @ffi.Int() + external int ra_count; } -final class CFTreeContext extends ffi.Struct { - @CFIndex() - external int version; +final class fsignatures extends ffi.Struct { + @off_t() + external int fs_file_start; - external ffi.Pointer info; + external ffi.Pointer fs_blob_start; - external CFTreeRetainCallBack retain; + @ffi.Size() + external int fs_blob_size; - external CFTreeReleaseCallBack release; + @ffi.Size() + external int fs_fsignatures_size; - external CFTreeCopyDescriptionCallBack copyDescription; + @ffi.Array.multi([20]) + external ffi.Array fs_cdhash; + + @ffi.Int() + external int fs_hash_type; } -typedef CFTreeRetainCallBack - = ffi.Pointer>; -typedef CFTreeRetainCallBackFunction = ffi.Pointer Function( - ffi.Pointer info); -typedef CFTreeReleaseCallBack - = ffi.Pointer>; -typedef CFTreeReleaseCallBackFunction = ffi.Void Function( - ffi.Pointer info); -typedef DartCFTreeReleaseCallBackFunction = void Function( - ffi.Pointer info); -typedef CFTreeCopyDescriptionCallBack - = ffi.Pointer>; -typedef CFTreeCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer info); +final class fsupplement extends ffi.Struct { + @off_t() + external int fs_file_start; -final class __CFTree extends ffi.Opaque {} + @off_t() + external int fs_blob_start; -typedef CFTreeRef = ffi.Pointer<__CFTree>; -typedef CFTreeApplierFunction - = ffi.Pointer>; -typedef CFTreeApplierFunctionFunction = ffi.Void Function( - ffi.Pointer value, ffi.Pointer context); -typedef DartCFTreeApplierFunctionFunction = void Function( - ffi.Pointer value, ffi.Pointer context); + @ffi.Size() + external int fs_blob_size; -abstract class CFURLError { - static const int kCFURLUnknownError = -10; - static const int kCFURLUnknownSchemeError = -11; - static const int kCFURLResourceNotFoundError = -12; - static const int kCFURLResourceAccessViolationError = -13; - static const int kCFURLRemoteHostUnavailableError = -14; - static const int kCFURLImproperArgumentsError = -15; - static const int kCFURLUnknownPropertyKeyError = -16; - static const int kCFURLPropertyKeyUnavailableError = -17; - static const int kCFURLTimeoutError = -18; + @ffi.Int() + external int fs_orig_fd; } -final class __CFUUID extends ffi.Opaque {} +final class fchecklv extends ffi.Struct { + @off_t() + external int lv_file_start; -final class CFUUIDBytes extends ffi.Struct { - @UInt8() - external int byte0; + @ffi.Size() + external int lv_error_message_size; - @UInt8() - external int byte1; + external ffi.Pointer lv_error_message; +} - @UInt8() - external int byte2; +final class fgetsigsinfo extends ffi.Struct { + @off_t() + external int fg_file_start; - @UInt8() - external int byte3; + @ffi.Int() + external int fg_info_request; - @UInt8() - external int byte4; + @ffi.Int() + external int fg_sig_is_platform; +} + +final class fstore extends ffi.Struct { + @ffi.UnsignedInt() + external int fst_flags; + + @ffi.Int() + external int fst_posmode; + + @off_t() + external int fst_offset; + + @off_t() + external int fst_length; + + @off_t() + external int fst_bytesalloc; +} + +final class fpunchhole extends ffi.Struct { + @ffi.UnsignedInt() + external int fp_flags; + + @ffi.UnsignedInt() + external int reserved; + + @off_t() + external int fp_offset; + + @off_t() + external int fp_length; +} + +final class ftrimactivefile extends ffi.Struct { + @off_t() + external int fta_offset; - @UInt8() - external int byte5; + @off_t() + external int fta_length; +} - @UInt8() - external int byte6; +final class fspecread extends ffi.Struct { + @ffi.UnsignedInt() + external int fsr_flags; - @UInt8() - external int byte7; + @ffi.UnsignedInt() + external int reserved; - @UInt8() - external int byte8; + @off_t() + external int fsr_offset; - @UInt8() - external int byte9; + @off_t() + external int fsr_length; +} - @UInt8() - external int byte10; +final class fattributiontag extends ffi.Struct { + @ffi.UnsignedInt() + external int ft_flags; - @UInt8() - external int byte11; + @ffi.UnsignedLongLong() + external int ft_hash; - @UInt8() - external int byte12; + @ffi.Array.multi([255]) + external ffi.Array ft_attribution_name; +} - @UInt8() - external int byte13; +@ffi.Packed(4) +final class log2phys extends ffi.Struct { + @ffi.UnsignedInt() + external int l2p_flags; - @UInt8() - external int byte14; + @off_t() + external int l2p_contigbytes; - @UInt8() - external int byte15; + @off_t() + external int l2p_devoffset; } -typedef CFUUIDRef = ffi.Pointer<__CFUUID>; +final class _filesec extends ffi.Opaque {} -final class __CFBundle extends ffi.Opaque {} +typedef filesec_t = ffi.Pointer<_filesec>; -typedef CFBundleRef = ffi.Pointer<__CFBundle>; -typedef cpu_type_t = integer_t; -typedef CFPlugInRef = ffi.Pointer<__CFBundle>; -typedef CFBundleRefNum = ffi.Int; -typedef DartCFBundleRefNum = int; +enum filesec_property_t { + FILESEC_OWNER(1), + FILESEC_GROUP(2), + FILESEC_UUID(3), + FILESEC_MODE(4), + FILESEC_ACL(5), + FILESEC_GRPUUID(6), + FILESEC_ACL_RAW(100), + FILESEC_ACL_ALLOCSIZE(101); + + final int value; + const filesec_property_t(this.value); + + static filesec_property_t fromValue(int value) => switch (value) { + 1 => FILESEC_OWNER, + 2 => FILESEC_GROUP, + 3 => FILESEC_UUID, + 4 => FILESEC_MODE, + 5 => FILESEC_ACL, + 6 => FILESEC_GRPUUID, + 100 => FILESEC_ACL_RAW, + 101 => FILESEC_ACL_ALLOCSIZE, + _ => + throw ArgumentError("Unknown value for filesec_property_t: $value"), + }; +} -final class __CFMessagePort extends ffi.Opaque {} +final class os_workgroup_attr_opaque_s extends ffi.Struct { + @ffi.Uint32() + external int sig; -final class CFMessagePortContext extends ffi.Struct { - @CFIndex() - external int version; + @ffi.Array.multi([60]) + external ffi.Array opaque; +} - external ffi.Pointer info; +final class os_workgroup_interval_data_opaque_s extends ffi.Struct { + @ffi.Uint32() + external int sig; - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + @ffi.Array.multi([56]) + external ffi.Array opaque; +} - external ffi.Pointer< - ffi.NativeFunction info)>> - release; +final class os_workgroup_join_token_opaque_s extends ffi.Struct { + @ffi.Uint32() + external int sig; - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; + @ffi.Array.multi([36]) + external ffi.Array opaque; } -typedef CFMessagePortRef = ffi.Pointer<__CFMessagePort>; -typedef CFMessagePortCallBack - = ffi.Pointer>; -typedef CFMessagePortCallBackFunction = CFDataRef Function( - CFMessagePortRef local, - SInt32 msgid, - CFDataRef data, - ffi.Pointer info); -typedef DartCFMessagePortCallBackFunction = CFDataRef Function( - CFMessagePortRef local, - DartSInt32 msgid, - CFDataRef data, - ffi.Pointer info); -typedef CFMessagePortInvalidationCallBack = ffi - .Pointer>; -typedef CFMessagePortInvalidationCallBackFunction = ffi.Void Function( - CFMessagePortRef ms, ffi.Pointer info); -typedef DartCFMessagePortInvalidationCallBackFunction = void Function( - CFMessagePortRef ms, ffi.Pointer info); -typedef CFPlugInFactoryFunction - = ffi.Pointer>; -typedef CFPlugInFactoryFunctionFunction = ffi.Pointer Function( - CFAllocatorRef allocator, CFUUIDRef typeUUID); +typedef os_workgroup_t = ffi.Pointer; +typedef Dartos_workgroup_t = OS_os_workgroup; -final class __CFPlugInInstance extends ffi.Opaque {} +/// OS_os_workgroup +class OS_os_workgroup extends OS_object { + OS_os_workgroup._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); -typedef CFPlugInInstanceRef = ffi.Pointer<__CFPlugInInstance>; -typedef CFPlugInInstanceDeallocateInstanceDataFunction = ffi.Pointer< - ffi.NativeFunction>; -typedef CFPlugInInstanceDeallocateInstanceDataFunctionFunction = ffi.Void - Function(ffi.Pointer instanceData); -typedef DartCFPlugInInstanceDeallocateInstanceDataFunctionFunction = void - Function(ffi.Pointer instanceData); -typedef CFPlugInInstanceGetInterfaceFunction = ffi - .Pointer>; -typedef CFPlugInInstanceGetInterfaceFunctionFunction = Boolean Function( - CFPlugInInstanceRef instance, - CFStringRef interfaceName, - ffi.Pointer> ftbl); -typedef DartCFPlugInInstanceGetInterfaceFunctionFunction = DartBoolean Function( - CFPlugInInstanceRef instance, - CFStringRef interfaceName, - ffi.Pointer> ftbl); + /// Constructs a [OS_os_workgroup] that points to the same underlying object as [other]. + OS_os_workgroup.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -final class __CFMachPort extends ffi.Opaque {} + /// Constructs a [OS_os_workgroup] that wraps the given raw object pointer. + OS_os_workgroup.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); -final class CFMachPortContext extends ffi.Struct { - @CFIndex() - external int version; + /// Returns whether [obj] is an instance of [OS_os_workgroup]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_OS_os_workgroup); + } - external ffi.Pointer info; + /// init + OS_os_workgroup init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; + /// new + static OS_os_workgroup new1() { + final _ret = _objc_msgSend_1unuoxw(_class_OS_os_workgroup, _sel_new); + return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction info)>> - release; + /// allocWithZone: + static OS_os_workgroup allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_OS_os_workgroup, _sel_allocWithZone_, zone); + return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); + } - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; + /// alloc + static OS_os_workgroup alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_OS_os_workgroup, _sel_alloc); + return OS_os_workgroup.castFromPointer(_ret, retain: false, release: true); + } } -typedef CFMachPortRef = ffi.Pointer<__CFMachPort>; -typedef CFMachPortCallBack - = ffi.Pointer>; -typedef CFMachPortCallBackFunction = ffi.Void Function(CFMachPortRef port, - ffi.Pointer msg, CFIndex size, ffi.Pointer info); -typedef DartCFMachPortCallBackFunction = void Function(CFMachPortRef port, - ffi.Pointer msg, DartCFIndex size, ffi.Pointer info); -typedef CFMachPortInvalidationCallBack - = ffi.Pointer>; -typedef CFMachPortInvalidationCallBackFunction = ffi.Void Function( - CFMachPortRef port, ffi.Pointer info); -typedef DartCFMachPortInvalidationCallBackFunction = void Function( - CFMachPortRef port, ffi.Pointer info); +late final _class_OS_os_workgroup = objc.getClass("OS_os_workgroup"); -final class __CFAttributedString extends ffi.Opaque {} +/// OS_object +class OS_object extends objc.NSObject { + OS_object._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); -typedef CFAttributedStringRef = ffi.Pointer<__CFAttributedString>; -typedef CFMutableAttributedStringRef = ffi.Pointer<__CFAttributedString>; + /// Constructs a [OS_object] that points to the same underlying object as [other]. + OS_object.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -final class __CFURLEnumerator extends ffi.Opaque {} + /// Constructs a [OS_object] that wraps the given raw object pointer. + OS_object.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); -abstract class CFURLEnumeratorOptions { - static const int kCFURLEnumeratorDefaultBehavior = 0; - static const int kCFURLEnumeratorDescendRecursively = 1; - static const int kCFURLEnumeratorSkipInvisibles = 2; - static const int kCFURLEnumeratorGenerateFileReferenceURLs = 4; - static const int kCFURLEnumeratorSkipPackageContents = 8; - static const int kCFURLEnumeratorIncludeDirectoriesPreOrder = 16; - static const int kCFURLEnumeratorIncludeDirectoriesPostOrder = 32; - static const int kCFURLEnumeratorGenerateRelativePathURLs = 64; -} + /// Returns whether [obj] is an instance of [OS_object]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_OS_object); + } -typedef CFURLEnumeratorRef = ffi.Pointer<__CFURLEnumerator>; + /// init + OS_object init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return OS_object.castFromPointer(_ret, retain: false, release: true); + } -abstract class CFURLEnumeratorResult { - static const int kCFURLEnumeratorSuccess = 1; - static const int kCFURLEnumeratorEnd = 2; - static const int kCFURLEnumeratorError = 3; - static const int kCFURLEnumeratorDirectoryPostOrderSuccess = 4; -} + /// new + static OS_object new1() { + final _ret = _objc_msgSend_1unuoxw(_class_OS_object, _sel_new); + return OS_object.castFromPointer(_ret, retain: false, release: true); + } -final class guid_t extends ffi.Union { - @ffi.Array.multi([16]) - external ffi.Array g_guid; + /// allocWithZone: + static OS_object allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_OS_object, _sel_allocWithZone_, zone); + return OS_object.castFromPointer(_ret, retain: false, release: true); + } - @ffi.Array.multi([4]) - external ffi.Array g_guid_asint; + /// alloc + static OS_object alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_OS_object, _sel_alloc); + return OS_object.castFromPointer(_ret, retain: false, release: true); + } } -@ffi.Packed(1) -final class ntsid_t extends ffi.Struct { - @u_int8_t() - external int sid_kind; +late final _class_OS_object = objc.getClass("OS_object"); +typedef os_workgroup_join_token_t + = ffi.Pointer; +typedef os_workgroup_working_arena_destructor_t = ffi.Pointer< + ffi.NativeFunction>; +typedef os_workgroup_working_arena_destructor_tFunction = ffi.Void Function( + ffi.Pointer); +typedef Dartos_workgroup_working_arena_destructor_tFunction = void Function( + ffi.Pointer); +typedef os_workgroup_index = ffi.Uint32; +typedef Dartos_workgroup_index = int; - @u_int8_t() - external int sid_authcount; +final class os_workgroup_max_parallel_threads_attr_s extends ffi.Opaque {} - @ffi.Array.multi([6]) - external ffi.Array sid_authority; +typedef os_workgroup_mpt_attr_t + = ffi.Pointer; - @ffi.Array.multi([16]) - external ffi.Array sid_authorities; -} +/// OS_os_workgroup_interval +abstract final class OS_os_workgroup_interval { + /// Builds an object that implements the OS_os_workgroup_interval protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); -typedef u_int8_t = ffi.UnsignedChar; -typedef Dartu_int8_t = int; -typedef u_int32_t = ffi.UnsignedInt; -typedef Dartu_int32_t = int; + return builder.build(); + } -final class kauth_identity_extlookup extends ffi.Struct { - @u_int32_t() - external int el_seqno; + /// Adds the implementation of the OS_os_workgroup_interval protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} - @u_int32_t() - external int el_result; +late final _protocol_OS_os_workgroup_interval = + objc.getProtocol("OS_os_workgroup_interval"); +typedef os_workgroup_interval_t = ffi.Pointer; +typedef Dartos_workgroup_interval_t = OS_os_workgroup; +typedef os_workgroup_interval_data_t + = ffi.Pointer; - @u_int32_t() - external int el_flags; +/// OS_os_workgroup_parallel +abstract final class OS_os_workgroup_parallel { + /// Builds an object that implements the OS_os_workgroup_parallel protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @__darwin_pid_t() - external int el_info_pid; + return builder.build(); + } - @u_int64_t() - external int el_extend; + /// Adds the implementation of the OS_os_workgroup_parallel protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} - @u_int32_t() - external int el_info_reserved_1; +late final _protocol_OS_os_workgroup_parallel = + objc.getProtocol("OS_os_workgroup_parallel"); +typedef os_workgroup_parallel_t = ffi.Pointer; +typedef Dartos_workgroup_parallel_t = OS_os_workgroup; +typedef os_workgroup_attr_t = ffi.Pointer; - @uid_t() - external int el_uid; +final class time_value extends ffi.Struct { + @integer_t() + external int seconds; - external guid_t el_uguid; + @integer_t() + external int microseconds; +} - @u_int32_t() - external int el_uguid_valid; +typedef integer_t = ffi.Int; +typedef Dartinteger_t = int; - external ntsid_t el_usid; +final class mach_timespec extends ffi.Struct { + @ffi.UnsignedInt() + external int tv_sec; - @u_int32_t() - external int el_usid_valid; + @clock_res_t() + external int tv_nsec; +} - @gid_t() - external int el_gid; +typedef clock_res_t = ffi.Int; +typedef Dartclock_res_t = int; +typedef dispatch_time_t = ffi.Uint64; +typedef Dartdispatch_time_t = int; - external guid_t el_gguid; +enum qos_class_t { + QOS_CLASS_USER_INTERACTIVE(33), + QOS_CLASS_USER_INITIATED(25), + QOS_CLASS_DEFAULT(21), + QOS_CLASS_UTILITY(17), + QOS_CLASS_BACKGROUND(9), + QOS_CLASS_UNSPECIFIED(0); + + final int value; + const qos_class_t(this.value); + + static qos_class_t fromValue(int value) => switch (value) { + 33 => QOS_CLASS_USER_INTERACTIVE, + 25 => QOS_CLASS_USER_INITIATED, + 21 => QOS_CLASS_DEFAULT, + 17 => QOS_CLASS_UTILITY, + 9 => QOS_CLASS_BACKGROUND, + 0 => QOS_CLASS_UNSPECIFIED, + _ => throw ArgumentError("Unknown value for qos_class_t: $value"), + }; +} + +/// OS_dispatch_object +abstract final class OS_dispatch_object { + /// Builds an object that implements the OS_dispatch_object protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); + } + + /// Adds the implementation of the OS_dispatch_object protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} + +late final _protocol_OS_dispatch_object = + objc.getProtocol("OS_dispatch_object"); +typedef dispatch_object_t = ffi.Pointer; +typedef Dartdispatch_object_t = objc.NSObject; +typedef dispatch_function_t + = ffi.Pointer>; +typedef dispatch_function_tFunction = ffi.Void Function(ffi.Pointer); +typedef Dartdispatch_function_tFunction = void Function(ffi.Pointer); +typedef dispatch_block_t = ffi.Pointer; +typedef Dartdispatch_block_t = objc.ObjCBlock; - @u_int32_t() - external int el_gguid_valid; +/// OS_dispatch_queue +abstract final class OS_dispatch_queue { + /// Builds an object that implements the OS_dispatch_queue protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external ntsid_t el_gsid; + return builder.build(); + } - @u_int32_t() - external int el_gsid_valid; + /// Adds the implementation of the OS_dispatch_queue protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} - @u_int32_t() - external int el_member_valid; +late final _protocol_OS_dispatch_queue = objc.getProtocol("OS_dispatch_queue"); - @u_int32_t() - external int el_sup_grp_cnt; +/// OS_dispatch_queue_global +abstract final class OS_dispatch_queue_global { + /// Builds an object that implements the OS_dispatch_queue_global protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @ffi.Array.multi([16]) - external ffi.Array el_sup_groups; + return builder.build(); + } + + /// Adds the implementation of the OS_dispatch_queue_global protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef u_int64_t = ffi.UnsignedLongLong; -typedef Dartu_int64_t = int; +late final _protocol_OS_dispatch_queue_global = + objc.getProtocol("OS_dispatch_queue_global"); -final class kauth_cache_sizes extends ffi.Struct { - @u_int32_t() - external int kcs_group_size; +/// OS_dispatch_queue_serial_executor +abstract final class OS_dispatch_queue_serial_executor { + /// Builds an object that implements the OS_dispatch_queue_serial_executor protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @u_int32_t() - external int kcs_id_size; + return builder.build(); + } + + /// Adds the implementation of the OS_dispatch_queue_serial_executor protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class kauth_ace extends ffi.Struct { - external guid_t ace_applicable; +late final _protocol_OS_dispatch_queue_serial_executor = + objc.getProtocol("OS_dispatch_queue_serial_executor"); - @u_int32_t() - external int ace_flags; +/// OS_dispatch_queue_serial +abstract final class OS_dispatch_queue_serial { + /// Builds an object that implements the OS_dispatch_queue_serial protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @kauth_ace_rights_t() - external int ace_rights; + return builder.build(); + } + + /// Adds the implementation of the OS_dispatch_queue_serial protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef kauth_ace_rights_t = u_int32_t; +late final _protocol_OS_dispatch_queue_serial = + objc.getProtocol("OS_dispatch_queue_serial"); -final class kauth_acl extends ffi.Struct { - @u_int32_t() - external int acl_entrycount; +/// OS_dispatch_queue_main +abstract final class OS_dispatch_queue_main { + /// Builds an object that implements the OS_dispatch_queue_main protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @u_int32_t() - external int acl_flags; + return builder.build(); + } - @ffi.Array.multi([1]) - external ffi.Array acl_ace; + /// Adds the implementation of the OS_dispatch_queue_main protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class kauth_filesec extends ffi.Struct { - @u_int32_t() - external int fsec_magic; - - external guid_t fsec_owner; +late final _protocol_OS_dispatch_queue_main = + objc.getProtocol("OS_dispatch_queue_main"); - external guid_t fsec_group; +/// OS_dispatch_queue_concurrent +abstract final class OS_dispatch_queue_concurrent { + /// Builds an object that implements the OS_dispatch_queue_concurrent protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external kauth_acl fsec_acl; -} + return builder.build(); + } -abstract class acl_perm_t { - static const int ACL_READ_DATA = 2; - static const int ACL_LIST_DIRECTORY = 2; - static const int ACL_WRITE_DATA = 4; - static const int ACL_ADD_FILE = 4; - static const int ACL_EXECUTE = 8; - static const int ACL_SEARCH = 8; - static const int ACL_DELETE = 16; - static const int ACL_APPEND_DATA = 32; - static const int ACL_ADD_SUBDIRECTORY = 32; - static const int ACL_DELETE_CHILD = 64; - static const int ACL_READ_ATTRIBUTES = 128; - static const int ACL_WRITE_ATTRIBUTES = 256; - static const int ACL_READ_EXTATTRIBUTES = 512; - static const int ACL_WRITE_EXTATTRIBUTES = 1024; - static const int ACL_READ_SECURITY = 2048; - static const int ACL_WRITE_SECURITY = 4096; - static const int ACL_CHANGE_OWNER = 8192; - static const int ACL_SYNCHRONIZE = 1048576; -} - -abstract class acl_tag_t { - static const int ACL_UNDEFINED_TAG = 0; - static const int ACL_EXTENDED_ALLOW = 1; - static const int ACL_EXTENDED_DENY = 2; -} - -abstract class acl_type_t { - static const int ACL_TYPE_EXTENDED = 256; - static const int ACL_TYPE_ACCESS = 0; - static const int ACL_TYPE_DEFAULT = 1; - static const int ACL_TYPE_AFS = 2; - static const int ACL_TYPE_CODA = 3; - static const int ACL_TYPE_NTFS = 4; - static const int ACL_TYPE_NWFS = 5; -} - -abstract class acl_entry_id_t { - static const int ACL_FIRST_ENTRY = 0; - static const int ACL_NEXT_ENTRY = -1; - static const int ACL_LAST_ENTRY = -2; -} - -abstract class acl_flag_t { - static const int ACL_FLAG_DEFER_INHERIT = 1; - static const int ACL_FLAG_NO_INHERIT = 131072; - static const int ACL_ENTRY_INHERITED = 16; - static const int ACL_ENTRY_FILE_INHERIT = 32; - static const int ACL_ENTRY_DIRECTORY_INHERIT = 64; - static const int ACL_ENTRY_LIMIT_INHERIT = 128; - static const int ACL_ENTRY_ONLY_INHERIT = 256; + /// Adds the implementation of the OS_dispatch_queue_concurrent protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -final class _acl extends ffi.Opaque {} +late final _protocol_OS_dispatch_queue_concurrent = + objc.getProtocol("OS_dispatch_queue_concurrent"); +typedef dispatch_queue_t = ffi.Pointer; +typedef Dartdispatch_queue_t = objc.NSObject; +void _ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Size)>(_ObjCBlock_ffiVoid_ffiSize_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiSize_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiSize_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Size)>(_ObjCBlock_ffiVoid_ffiSize_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiSize_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable, ffi.Size)> + _ObjCBlock_ffiVoid_ffiSize_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Size)>.listener(_ObjCBlock_ffiVoid_ffiSize_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_ffiSize { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); -final class _acl_entry extends ffi.Opaque {} + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiSize_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -final class _acl_permset extends ffi.Opaque {} + /// 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. + static objc.ObjCBlock fromFunction( + void Function(int) fn) => + objc.ObjCBlock( + objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiSize_closureCallable, + (int arg0) => fn(arg0)), + retain: false, + release: true); -final class _acl_flagset extends ffi.Opaque {} + /// 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. + static objc.ObjCBlock listener( + void Function(int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiSize_listenerCallable.nativeFunction.cast(), + (int arg0) => fn(arg0)); + final wrapper = _wrapListenerBlock_1hmngv6(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} -typedef acl_t = ffi.Pointer<_acl>; -typedef acl_entry_t = ffi.Pointer<_acl_entry>; -typedef acl_permset_t = ffi.Pointer<_acl_permset>; -typedef acl_permset_mask_t = u_int64_t; -typedef acl_flagset_t = ffi.Pointer<_acl_flagset>; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_ffiSize_CallExtension + on objc.ObjCBlock { + void call(int arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, ffi.Size arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0); +} -final class __CFFileSecurity extends ffi.Opaque {} +final class dispatch_queue_s extends ffi.Opaque {} -typedef CFFileSecurityRef = ffi.Pointer<__CFFileSecurity>; +typedef dispatch_queue_global_t = ffi.Pointer; +typedef Dartdispatch_queue_global_t = objc.NSObject; -abstract class CFFileSecurityClearOptions { - static const int kCFFileSecurityClearOwner = 1; - static const int kCFFileSecurityClearGroup = 2; - static const int kCFFileSecurityClearMode = 4; - static const int kCFFileSecurityClearOwnerUUID = 8; - static const int kCFFileSecurityClearGroupUUID = 16; - static const int kCFFileSecurityClearAccessControlList = 32; -} +/// OS_dispatch_queue_attr +abstract final class OS_dispatch_queue_attr { + /// Builds an object that implements the OS_dispatch_queue_attr protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); -final class __CFStringTokenizer extends ffi.Opaque {} + return builder.build(); + } -abstract class CFStringTokenizerTokenType { - static const int kCFStringTokenizerTokenNone = 0; - static const int kCFStringTokenizerTokenNormal = 1; - static const int kCFStringTokenizerTokenHasSubTokensMask = 2; - static const int kCFStringTokenizerTokenHasDerivedSubTokensMask = 4; - static const int kCFStringTokenizerTokenHasHasNumbersMask = 8; - static const int kCFStringTokenizerTokenHasNonLettersMask = 16; - static const int kCFStringTokenizerTokenIsCJWordMask = 32; + /// Adds the implementation of the OS_dispatch_queue_attr protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CFStringTokenizerRef = ffi.Pointer<__CFStringTokenizer>; - -final class __CFFileDescriptor extends ffi.Opaque {} +late final _protocol_OS_dispatch_queue_attr = + objc.getProtocol("OS_dispatch_queue_attr"); -final class CFFileDescriptorContext extends ffi.Struct { - @CFIndex() - external int version; +final class dispatch_queue_attr_s extends ffi.Opaque {} - external ffi.Pointer info; +typedef dispatch_queue_attr_t = ffi.Pointer; +typedef Dartdispatch_queue_attr_t = objc.NSObject; + +enum dispatch_autorelease_frequency_t { + DISPATCH_AUTORELEASE_FREQUENCY_INHERIT(0), + DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM(1), + DISPATCH_AUTORELEASE_FREQUENCY_NEVER(2); + + final int value; + const dispatch_autorelease_frequency_t(this.value); + + static dispatch_autorelease_frequency_t fromValue(int value) => + switch (value) { + 0 => DISPATCH_AUTORELEASE_FREQUENCY_INHERIT, + 1 => DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM, + 2 => DISPATCH_AUTORELEASE_FREQUENCY_NEVER, + _ => throw ArgumentError( + "Unknown value for dispatch_autorelease_frequency_t: $value"), + }; +} + +enum dispatch_block_flags_t { + DISPATCH_BLOCK_BARRIER(1), + DISPATCH_BLOCK_DETACHED(2), + DISPATCH_BLOCK_ASSIGN_CURRENT(4), + DISPATCH_BLOCK_NO_QOS_CLASS(8), + DISPATCH_BLOCK_INHERIT_QOS_CLASS(16), + DISPATCH_BLOCK_ENFORCE_QOS_CLASS(32); + + final int value; + const dispatch_block_flags_t(this.value); + + static dispatch_block_flags_t fromValue(int value) => switch (value) { + 1 => DISPATCH_BLOCK_BARRIER, + 2 => DISPATCH_BLOCK_DETACHED, + 4 => DISPATCH_BLOCK_ASSIGN_CURRENT, + 8 => DISPATCH_BLOCK_NO_QOS_CLASS, + 16 => DISPATCH_BLOCK_INHERIT_QOS_CLASS, + 32 => DISPATCH_BLOCK_ENFORCE_QOS_CLASS, + _ => throw ArgumentError( + "Unknown value for dispatch_block_flags_t: $value"), + }; +} - external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer info)>> retain; +final class mach_msg_type_descriptor_t extends ffi.Opaque {} - external ffi.Pointer< - ffi.NativeFunction info)>> - release; +final class mach_msg_port_descriptor_t extends ffi.Opaque {} - external ffi.Pointer< - ffi.NativeFunction info)>> - copyDescription; -} +final class mach_msg_ool_descriptor32_t extends ffi.Opaque {} -typedef CFFileDescriptorRef = ffi.Pointer<__CFFileDescriptor>; -typedef CFFileDescriptorNativeDescriptor = ffi.Int; -typedef DartCFFileDescriptorNativeDescriptor = int; -typedef CFFileDescriptorCallBack - = ffi.Pointer>; -typedef CFFileDescriptorCallBackFunction = ffi.Void Function( - CFFileDescriptorRef f, - CFOptionFlags callBackTypes, - ffi.Pointer info); -typedef DartCFFileDescriptorCallBackFunction = void Function( - CFFileDescriptorRef f, - DartCFOptionFlags callBackTypes, - ffi.Pointer info); +final class mach_msg_ool_descriptor64_t extends ffi.Opaque {} -final class __CFUserNotification extends ffi.Opaque {} +final class mach_msg_ool_descriptor_t extends ffi.Opaque {} -typedef CFUserNotificationRef = ffi.Pointer<__CFUserNotification>; -typedef CFUserNotificationCallBack - = ffi.Pointer>; -typedef CFUserNotificationCallBackFunction = ffi.Void Function( - CFUserNotificationRef userNotification, CFOptionFlags responseFlags); -typedef DartCFUserNotificationCallBackFunction = void Function( - CFUserNotificationRef userNotification, DartCFOptionFlags responseFlags); +final class mach_msg_ool_ports_descriptor32_t extends ffi.Opaque {} -final class __CFXMLNode extends ffi.Opaque {} +final class mach_msg_ool_ports_descriptor64_t extends ffi.Opaque {} -abstract class CFXMLNodeTypeCode { - static const int kCFXMLNodeTypeDocument = 1; - static const int kCFXMLNodeTypeElement = 2; - static const int kCFXMLNodeTypeAttribute = 3; - static const int kCFXMLNodeTypeProcessingInstruction = 4; - static const int kCFXMLNodeTypeComment = 5; - static const int kCFXMLNodeTypeText = 6; - static const int kCFXMLNodeTypeCDATASection = 7; - static const int kCFXMLNodeTypeDocumentFragment = 8; - static const int kCFXMLNodeTypeEntity = 9; - static const int kCFXMLNodeTypeEntityReference = 10; - static const int kCFXMLNodeTypeDocumentType = 11; - static const int kCFXMLNodeTypeWhitespace = 12; - static const int kCFXMLNodeTypeNotation = 13; - static const int kCFXMLNodeTypeElementTypeDeclaration = 14; - static const int kCFXMLNodeTypeAttributeListDeclaration = 15; -} +final class mach_msg_ool_ports_descriptor_t extends ffi.Opaque {} -final class CFXMLElementInfo extends ffi.Struct { - external CFDictionaryRef attributes; +final class mach_msg_guarded_port_descriptor32_t extends ffi.Opaque {} - external CFArrayRef attributeOrder; +final class mach_msg_guarded_port_descriptor64_t extends ffi.Opaque {} - @Boolean() - external int isEmpty; +final class mach_msg_guarded_port_descriptor_t extends ffi.Opaque {} - @ffi.Array.multi([3]) - external ffi.Array _reserved; -} +final class mach_msg_descriptor_t extends ffi.Opaque {} -final class CFXMLProcessingInstructionInfo extends ffi.Struct { - external CFStringRef dataString; +final class mach_msg_body_t extends ffi.Struct { + @mach_msg_size_t() + external int msgh_descriptor_count; } -final class CFXMLDocumentInfo extends ffi.Struct { - external CFURLRef sourceURL; +typedef mach_msg_size_t = natural_t; - @CFStringEncoding() - external int encoding; -} +final class mach_msg_header_t extends ffi.Struct { + @mach_msg_bits_t() + external int msgh_bits; -final class CFXMLExternalID extends ffi.Struct { - external CFURLRef systemID; + @mach_msg_size_t() + external int msgh_size; - external CFStringRef publicID; -} + @mach_port_t() + external int msgh_remote_port; -final class CFXMLDocumentTypeInfo extends ffi.Struct { - external CFXMLExternalID externalID; -} + @mach_port_t() + external int msgh_local_port; -final class CFXMLNotationInfo extends ffi.Struct { - external CFXMLExternalID externalID; -} + @mach_port_name_t() + external int msgh_voucher_port; -final class CFXMLElementTypeDeclarationInfo extends ffi.Struct { - external CFStringRef contentDescription; + @mach_msg_id_t() + external int msgh_id; } -final class CFXMLAttributeDeclarationInfo extends ffi.Struct { - external CFStringRef attributeName; +typedef mach_msg_bits_t = ffi.UnsignedInt; +typedef Dartmach_msg_bits_t = int; +typedef mach_msg_id_t = integer_t; - external CFStringRef typeString; +final class mach_msg_base_t extends ffi.Struct { + external mach_msg_header_t header; - external CFStringRef defaultString; + external mach_msg_body_t body; } -final class CFXMLAttributeListDeclarationInfo extends ffi.Struct { - @CFIndex() - external int numberOfAttributes; - - external ffi.Pointer attributes; -} +final class mach_msg_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; -abstract class CFXMLEntityTypeCode { - static const int kCFXMLEntityTypeParameter = 0; - static const int kCFXMLEntityTypeParsedInternal = 1; - static const int kCFXMLEntityTypeParsedExternal = 2; - static const int kCFXMLEntityTypeUnparsed = 3; - static const int kCFXMLEntityTypeCharacter = 4; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; } -final class CFXMLEntityInfo extends ffi.Struct { - @ffi.Int32() - external int entityType; +typedef mach_msg_trailer_type_t = ffi.UnsignedInt; +typedef Dartmach_msg_trailer_type_t = int; +typedef mach_msg_trailer_size_t = ffi.UnsignedInt; +typedef Dartmach_msg_trailer_size_t = int; - external CFStringRef replacementText; +final class mach_msg_seqno_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; - external CFXMLExternalID entityID; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; - external CFStringRef notationName; + @mach_port_seqno_t() + external int msgh_seqno; } -final class CFXMLEntityReferenceInfo extends ffi.Struct { - @ffi.Int32() - external int entityType; +final class security_token_t extends ffi.Struct { + @ffi.Array.multi([2]) + external ffi.Array val; } -typedef CFXMLNodeRef = ffi.Pointer<__CFXMLNode>; -typedef CFXMLTreeRef = CFTreeRef; +final class mach_msg_security_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; -final class __CFXMLParser extends ffi.Opaque {} + @mach_msg_trailer_size_t() + external int msgh_trailer_size; + + @mach_port_seqno_t() + external int msgh_seqno; -abstract class CFXMLParserOptions { - static const int kCFXMLParserValidateDocument = 1; - static const int kCFXMLParserSkipMetaData = 2; - static const int kCFXMLParserReplacePhysicalEntities = 4; - static const int kCFXMLParserSkipWhitespace = 8; - static const int kCFXMLParserResolveExternalEntities = 16; - static const int kCFXMLParserAddImpliedAttributes = 32; - static const int kCFXMLParserAllOptions = 16777215; - static const int kCFXMLParserNoOptions = 0; -} - -abstract class CFXMLParserStatusCode { - static const int kCFXMLStatusParseNotBegun = -2; - static const int kCFXMLStatusParseInProgress = -1; - static const int kCFXMLStatusParseSuccessful = 0; - static const int kCFXMLErrorUnexpectedEOF = 1; - static const int kCFXMLErrorUnknownEncoding = 2; - static const int kCFXMLErrorEncodingConversionFailure = 3; - static const int kCFXMLErrorMalformedProcessingInstruction = 4; - static const int kCFXMLErrorMalformedDTD = 5; - static const int kCFXMLErrorMalformedName = 6; - static const int kCFXMLErrorMalformedCDSect = 7; - static const int kCFXMLErrorMalformedCloseTag = 8; - static const int kCFXMLErrorMalformedStartTag = 9; - static const int kCFXMLErrorMalformedDocument = 10; - static const int kCFXMLErrorElementlessDocument = 11; - static const int kCFXMLErrorMalformedComment = 12; - static const int kCFXMLErrorMalformedCharacterReference = 13; - static const int kCFXMLErrorMalformedParsedCharacterData = 14; - static const int kCFXMLErrorNoData = 15; + external security_token_t msgh_sender; } -final class CFXMLParserCallBacks extends ffi.Struct { - @CFIndex() - external int version; +final class audit_token_t extends ffi.Struct { + @ffi.Array.multi([8]) + external ffi.Array val; +} - external CFXMLParserCreateXMLStructureCallBack createXMLStructure; +final class mach_msg_audit_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; - external CFXMLParserAddChildCallBack addChild; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; - external CFXMLParserEndXMLStructureCallBack endXMLStructure; + @mach_port_seqno_t() + external int msgh_seqno; - external CFXMLParserResolveExternalEntityCallBack resolveExternalEntity; + external security_token_t msgh_sender; - external CFXMLParserHandleErrorCallBack handleError; + external audit_token_t msgh_audit; } -typedef CFXMLParserCreateXMLStructureCallBack = ffi - .Pointer>; -typedef CFXMLParserCreateXMLStructureCallBackFunction - = ffi.Pointer Function(CFXMLParserRef parser, - CFXMLNodeRef nodeDesc, ffi.Pointer info); -typedef CFXMLParserRef = ffi.Pointer<__CFXMLParser>; -typedef CFXMLParserAddChildCallBack - = ffi.Pointer>; -typedef CFXMLParserAddChildCallBackFunction = ffi.Void Function( - CFXMLParserRef parser, - ffi.Pointer parent, - ffi.Pointer child, - ffi.Pointer info); -typedef DartCFXMLParserAddChildCallBackFunction = void Function( - CFXMLParserRef parser, - ffi.Pointer parent, - ffi.Pointer child, - ffi.Pointer info); -typedef CFXMLParserEndXMLStructureCallBack = ffi - .Pointer>; -typedef CFXMLParserEndXMLStructureCallBackFunction = ffi.Void Function( - CFXMLParserRef parser, - ffi.Pointer xmlType, - ffi.Pointer info); -typedef DartCFXMLParserEndXMLStructureCallBackFunction = void Function( - CFXMLParserRef parser, - ffi.Pointer xmlType, - ffi.Pointer info); -typedef CFXMLParserResolveExternalEntityCallBack = ffi.Pointer< - ffi.NativeFunction>; -typedef CFXMLParserResolveExternalEntityCallBackFunction = CFDataRef Function( - CFXMLParserRef parser, - ffi.Pointer extID, - ffi.Pointer info); -typedef CFXMLParserHandleErrorCallBack - = ffi.Pointer>; -typedef CFXMLParserHandleErrorCallBackFunction = Boolean Function( - CFXMLParserRef parser, ffi.Int32 error, ffi.Pointer info); -typedef DartCFXMLParserHandleErrorCallBackFunction = DartBoolean Function( - CFXMLParserRef parser, int error, ffi.Pointer info); +@ffi.Packed(4) +final class mach_msg_context_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; -final class CFXMLParserContext extends ffi.Struct { - @CFIndex() - external int version; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; - external ffi.Pointer info; + @mach_port_seqno_t() + external int msgh_seqno; - external CFXMLParserRetainCallBack retain; + external security_token_t msgh_sender; - external CFXMLParserReleaseCallBack release; + external audit_token_t msgh_audit; - external CFXMLParserCopyDescriptionCallBack copyDescription; + @mach_port_context_t() + external int msgh_context; } -typedef CFXMLParserRetainCallBack - = ffi.Pointer>; -typedef CFXMLParserRetainCallBackFunction = ffi.Pointer Function( - ffi.Pointer info); -typedef CFXMLParserReleaseCallBack - = ffi.Pointer>; -typedef CFXMLParserReleaseCallBackFunction = ffi.Void Function( - ffi.Pointer info); -typedef DartCFXMLParserReleaseCallBackFunction = void Function( - ffi.Pointer info); -typedef CFXMLParserCopyDescriptionCallBack = ffi - .Pointer>; -typedef CFXMLParserCopyDescriptionCallBackFunction = CFStringRef Function( - ffi.Pointer info); - -final class cssm_data extends ffi.Struct { - @ffi.Size() - external int Length; +typedef mach_port_context_t = vm_offset_t; +typedef vm_offset_t = ffi.UintPtr; +typedef Dartvm_offset_t = int; - external ffi.Pointer Data; +final class msg_labels_t extends ffi.Struct { + @mach_port_name_t() + external int sender; } -final class SecAsn1AlgId extends ffi.Struct { - external SecAsn1Oid algorithm; - - external SecAsn1Item parameters; -} +@ffi.Packed(4) +final class mach_msg_mac_trailer_t extends ffi.Struct { + @mach_msg_trailer_type_t() + external int msgh_trailer_type; -typedef SecAsn1Oid = cssm_data; -typedef SecAsn1Item = cssm_data; + @mach_msg_trailer_size_t() + external int msgh_trailer_size; -final class SecAsn1PubKeyInfo extends ffi.Struct { - external SecAsn1AlgId algorithm; + @mach_port_seqno_t() + external int msgh_seqno; - external SecAsn1Item subjectPublicKey; -} + external security_token_t msgh_sender; -final class SecAsn1Template_struct extends ffi.Struct { - @ffi.Uint32() - external int kind; + external audit_token_t msgh_audit; - @ffi.Uint32() - external int offset; + @mach_port_context_t() + external int msgh_context; - external ffi.Pointer sub; + @mach_msg_filter_id() + external int msgh_ad; - @ffi.Uint32() - external int size; + external msg_labels_t msgh_labels; } -final class cssm_guid extends ffi.Struct { - @uint32() - external int Data1; +typedef mach_msg_filter_id = ffi.Int; +typedef Dartmach_msg_filter_id = int; - @uint16() - external int Data2; +final class mach_msg_empty_send_t extends ffi.Struct { + external mach_msg_header_t header; +} - @uint16() - external int Data3; +final class mach_msg_empty_rcv_t extends ffi.Struct { + external mach_msg_header_t header; - @ffi.Array.multi([8]) - external ffi.Array Data4; + external mach_msg_trailer_t trailer; } -typedef uint32 = ffi.Uint32; -typedef Dartuint32 = int; -typedef uint16 = ffi.Uint16; -typedef Dartuint16 = int; -typedef uint8 = ffi.Uint8; -typedef Dartuint8 = int; - -final class cssm_version extends ffi.Struct { - @uint32() - external int Major; +final class mach_msg_empty_t extends ffi.Union { + external mach_msg_empty_send_t send; - @uint32() - external int Minor; + external mach_msg_empty_rcv_t rcv; } -final class cssm_subservice_uid extends ffi.Struct { - external CSSM_GUID Guid; +typedef mach_msg_return_t = kern_return_t; +typedef kern_return_t = ffi.Int; +typedef Dartkern_return_t = int; +typedef mach_msg_option_t = integer_t; +typedef mach_msg_timeout_t = natural_t; - external CSSM_VERSION Version; +/// OS_dispatch_source +abstract final class OS_dispatch_source { + /// Builds an object that implements the OS_dispatch_source protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @uint32() - external int SubserviceId; + return builder.build(); + } - @CSSM_SERVICE_TYPE() - external int SubserviceType; + /// Adds the implementation of the OS_dispatch_source protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_GUID = cssm_guid; -typedef CSSM_VERSION = cssm_version; -typedef CSSM_SERVICE_TYPE = CSSM_SERVICE_MASK; -typedef CSSM_SERVICE_MASK = uint32; - -final class cssm_net_address extends ffi.Struct { - @CSSM_NET_ADDRESS_TYPE() - external int AddressType; +late final _protocol_OS_dispatch_source = + objc.getProtocol("OS_dispatch_source"); - external SecAsn1Item Address; -} +final class dispatch_source_type_s extends ffi.Opaque {} -typedef CSSM_NET_ADDRESS_TYPE = uint32; +typedef dispatch_source_t = ffi.Pointer; +typedef Dartdispatch_source_t = objc.NSObject; +typedef dispatch_source_type_t = ffi.Pointer; -final class cssm_crypto_data extends ffi.Struct { - external SecAsn1Item Param; +/// OS_dispatch_group +abstract final class OS_dispatch_group { + /// Builds an object that implements the OS_dispatch_group protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external CSSM_CALLBACK Callback; + return builder.build(); + } - external ffi.Pointer CallerCtx; + /// Adds the implementation of the OS_dispatch_group protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_CALLBACK = ffi.Pointer>; -typedef CSSM_CALLBACKFunction = CSSM_RETURN Function( - CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); -typedef DartCSSM_CALLBACKFunction = Dartsint32 Function( - CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); -typedef CSSM_RETURN = sint32; -typedef sint32 = ffi.Int32; -typedef Dartsint32 = int; -typedef CSSM_DATA_PTR = ffi.Pointer; - -final class cssm_list_element extends ffi.Struct { - external ffi.Pointer NextElement; +late final _protocol_OS_dispatch_group = objc.getProtocol("OS_dispatch_group"); +typedef dispatch_group_t = ffi.Pointer; +typedef Dartdispatch_group_t = objc.NSObject; - @CSSM_WORDID_TYPE() - external int WordID; +/// OS_dispatch_semaphore +abstract final class OS_dispatch_semaphore { + /// Builds an object that implements the OS_dispatch_semaphore protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @CSSM_LIST_ELEMENT_TYPE() - external int ElementType; + return builder.build(); + } - external UnnamedUnion2 Element; + /// Adds the implementation of the OS_dispatch_semaphore protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_WORDID_TYPE = sint32; -typedef CSSM_LIST_ELEMENT_TYPE = uint32; +late final _protocol_OS_dispatch_semaphore = + objc.getProtocol("OS_dispatch_semaphore"); +typedef dispatch_semaphore_t = ffi.Pointer; +typedef Dartdispatch_semaphore_t = objc.NSObject; +typedef dispatch_once_t = ffi.IntPtr; +typedef Dartdispatch_once_t = int; -final class UnnamedUnion2 extends ffi.Union { - external CSSM_LIST Sublist; +/// OS_dispatch_data +abstract final class OS_dispatch_data { + /// Builds an object that implements the OS_dispatch_data protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - external SecAsn1Item Word; + return builder.build(); + } + + /// Adds the implementation of the OS_dispatch_data protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_LIST = cssm_list; +late final _protocol_OS_dispatch_data = objc.getProtocol("OS_dispatch_data"); -final class cssm_list extends ffi.Struct { - @CSSM_LIST_TYPE() - external int ListType; +final class dispatch_data_s extends ffi.Opaque {} - external CSSM_LIST_ELEMENT_PTR Head; +typedef dispatch_data_t = ffi.Pointer; +typedef Dartdispatch_data_t = objc.NSObject; +typedef dispatch_data_applier_t = ffi.Pointer; +typedef Dartdispatch_data_applier_t = objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)>; +bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ffi.Pointer arg2, + int arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Bool Function(dispatch_data_t arg0, ffi.Size arg1, + ffi.Pointer arg2, ffi.Size arg3)>>() + .asFunction< + bool Function(dispatch_data_t, int, ffi.Pointer, + int)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + dispatch_data_t, + ffi.Size, + ffi.Pointer, + ffi.Size)>( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrTrampoline, + false) + .cast(); +bool _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1, + ffi.Pointer arg2, + int arg3) => + (objc.getBlockClosure(block) as bool Function(dispatch_data_t, int, + ffi.Pointer, int))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable = + ffi.Pointer.fromFunction< + ffi.Bool Function( + ffi.Pointer, + dispatch_data_t, + ffi.Size, + ffi.Pointer, + ffi.Size)>( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureTrampoline, + false) + .cast(); + +/// Construction methods for `objc.ObjCBlock, ffi.Size)>`. +abstract final class ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Bool Function(objc.NSObject, ffi.Size, ffi.Pointer, + ffi.Size)>(pointer, retain: retain, release: release); - external CSSM_LIST_ELEMENT_PTR Tail; -} + /// 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. + static objc + .ObjCBlock, ffi.Size)> + fromFunctionPointer(ffi.Pointer arg2, ffi.Size arg3)>> ptr) => + objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)>( + objc.newPointerBlock( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); -typedef CSSM_LIST_TYPE = uint32; -typedef CSSM_LIST_ELEMENT_PTR = ffi.Pointer; + /// 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. + static objc.ObjCBlock, ffi.Size)> fromFunction( + bool Function(Dartdispatch_data_t, int, ffi.Pointer, int) + fn) => + objc.ObjCBlock, ffi.Size)>( + objc.newClosureBlock( + _ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_closureCallable, + (dispatch_data_t arg0, int arg1, ffi.Pointer arg2, + int arg3) => + fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), arg1, arg2, arg3)), + retain: false, + release: true); +} -final class CSSM_TUPLE extends ffi.Struct { - external CSSM_LIST Issuer; +/// Call operator for `objc.ObjCBlock, ffi.Size)>`. +extension ObjCBlock_bool_dispatchdatat_ffiSize_ffiVoid_ffiSize_CallExtension + on objc.ObjCBlock< + ffi.Bool Function( + objc.NSObject, ffi.Size, ffi.Pointer, ffi.Size)> { + bool call(Dartdispatch_data_t arg0, int arg1, ffi.Pointer arg2, + int arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer block, + dispatch_data_t arg0, + ffi.Size arg1, + ffi.Pointer arg2, + ffi.Size arg3)>>() + .asFunction< + bool Function( + ffi.Pointer, + dispatch_data_t, + int, + ffi.Pointer, + int)>()(ref.pointer, arg0.ref.pointer, arg1, arg2, arg3); +} - external CSSM_LIST Subject; +typedef dispatch_fd_t = ffi.Int; +typedef Dartdispatch_fd_t = int; +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(dispatch_data_t arg0, ffi.Int arg1)>>() + .asFunction()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + int arg1) => + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline( + ffi.Pointer block, dispatch_data_t arg0, int arg1) { + (objc.getBlockClosure(block) as void Function(dispatch_data_t, int))( + arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, ffi.Int)> + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t, + ffi.Int)>.listener( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_dispatchdatat_ffiInt { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - @CSSM_BOOL() - external int Delegate; + /// 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. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, ffi.Int)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - external CSSM_LIST AuthorizationTag; + /// 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. + static objc.ObjCBlock fromFunction( + void Function(Dartdispatch_data_t, int) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_closureCallable, + (dispatch_data_t arg0, int arg1) => fn( + objc.NSObject.castFromPointer(arg0, + retain: true, release: true), + arg1)), + retain: false, + release: true); - external CSSM_LIST ValidityPeriod; + /// 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. + static objc.ObjCBlock listener( + void Function(Dartdispatch_data_t, int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_ffiInt_listenerCallable.nativeFunction + .cast(), + (dispatch_data_t arg0, int arg1) => fn( + objc.NSObject.castFromPointer(arg0, retain: false, release: true), + arg1)); + final wrapper = _wrapListenerBlock_108ugvk(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } } -typedef CSSM_BOOL = sint32; - -final class cssm_tuplegroup extends ffi.Struct { - @uint32() - external int NumberOfTuples; - - external CSSM_TUPLE_PTR Tuples; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_dispatchdatat_ffiInt_CallExtension + on objc.ObjCBlock { + void call(Dartdispatch_data_t arg0, int arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + dispatch_data_t arg0, ffi.Int arg1)>>() + .asFunction< + void Function(ffi.Pointer, dispatch_data_t, + int)>()(ref.pointer, arg0.ref.pointer, arg1); } -typedef CSSM_TUPLE_PTR = ffi.Pointer; +/// OS_dispatch_io +abstract final class OS_dispatch_io { + /// Builds an object that implements the OS_dispatch_io protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); -final class cssm_sample extends ffi.Struct { - external CSSM_LIST TypedSample; + return builder.build(); + } - external ffi.Pointer Verifier; + /// Adds the implementation of the OS_dispatch_io protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_SUBSERVICE_UID = cssm_subservice_uid; +late final _protocol_OS_dispatch_io = objc.getProtocol("OS_dispatch_io"); +typedef dispatch_io_t = ffi.Pointer; +typedef Dartdispatch_io_t = objc.NSObject; +typedef dispatch_io_type_t = ffi.UnsignedLong; +typedef Dartdispatch_io_type_t = int; +void _ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int)>(_ObjCBlock_ffiVoid_ffiInt_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiInt_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_ffiInt_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Int)>(_ObjCBlock_ffiVoid_ffiInt_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiInt_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable, ffi.Int)> + _ObjCBlock_ffiVoid_ffiInt_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Int)>.listener(_ObjCBlock_ffiVoid_ffiInt_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_ffiInt { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); -final class cssm_samplegroup extends ffi.Struct { - @uint32() - external int NumberOfSamples; + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiInt_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - external ffi.Pointer Samples; + /// 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. + static objc.ObjCBlock fromFunction( + void Function(int) fn) => + objc.ObjCBlock( + objc.newClosureBlock(_ObjCBlock_ffiVoid_ffiInt_closureCallable, + (int arg0) => fn(arg0)), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock listener( + void Function(int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiInt_listenerCallable.nativeFunction.cast(), + (int arg0) => fn(arg0)); + final wrapper = _wrapListenerBlock_1afulej(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } } -typedef CSSM_SAMPLE = cssm_sample; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_ffiInt_CallExtension + on objc.ObjCBlock { + void call(int arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, ffi.Int arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0); +} -final class cssm_memory_funcs extends ffi.Struct { - external CSSM_MALLOC malloc_func; +typedef dispatch_io_handler_t = ffi.Pointer; +typedef Dartdispatch_io_handler_t + = objc.ObjCBlock; +void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>>() + .asFunction()( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2) => + (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)>( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline( + ffi.Pointer block, + bool arg0, + dispatch_data_t arg1, + int arg2) { + (objc.getBlockClosure(block) as void Function(bool, dispatch_data_t, int))( + arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)> + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Bool, + dispatch_data_t, ffi.Int)>.listener( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); - external CSSM_FREE free_func; + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Bool, objc.NSObject, ffi.Int)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - external CSSM_REALLOC realloc_func; + /// 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. + static objc.ObjCBlock + fromFunction(void Function(bool, Dartdispatch_data_t, int) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_closureCallable, + (bool arg0, dispatch_data_t arg1, int arg2) => fn( + arg0, + objc.NSObject.castFromPointer(arg1, + retain: true, release: true), + arg2)), + retain: false, + release: true); - external CSSM_CALLOC calloc_func; + /// 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. + static objc.ObjCBlock + listener(void Function(bool, Dartdispatch_data_t, int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_listenerCallable + .nativeFunction + .cast(), + (bool arg0, dispatch_data_t arg1, int arg2) => fn( + arg0, + objc.NSObject.castFromPointer(arg1, retain: false, release: true), + arg2)); + final wrapper = _wrapListenerBlock_elldw5(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); + } +} - external ffi.Pointer AllocRef; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_bool_dispatchdatat_ffiInt_CallExtension + on objc.ObjCBlock { + void call(bool arg0, Dartdispatch_data_t arg1, int arg2) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Bool arg0, dispatch_data_t arg1, ffi.Int arg2)>>() + .asFunction< + void Function(ffi.Pointer, bool, dispatch_data_t, + int)>()(ref.pointer, arg0, arg1.ref.pointer, arg2); } -typedef CSSM_MALLOC = ffi.Pointer>; -typedef CSSM_MALLOCFunction = ffi.Pointer Function( - CSSM_SIZE size, ffi.Pointer allocref); -typedef DartCSSM_MALLOCFunction = ffi.Pointer Function( - DartCSSM_SIZE size, ffi.Pointer allocref); -typedef CSSM_SIZE = ffi.Size; -typedef DartCSSM_SIZE = int; -typedef CSSM_FREE = ffi.Pointer>; -typedef CSSM_FREEFunction = ffi.Void Function( - ffi.Pointer memblock, ffi.Pointer allocref); -typedef DartCSSM_FREEFunction = void Function( - ffi.Pointer memblock, ffi.Pointer allocref); -typedef CSSM_REALLOC = ffi.Pointer>; -typedef CSSM_REALLOCFunction = ffi.Pointer Function( - ffi.Pointer memblock, - CSSM_SIZE size, - ffi.Pointer allocref); -typedef DartCSSM_REALLOCFunction = ffi.Pointer Function( - ffi.Pointer memblock, - DartCSSM_SIZE size, - ffi.Pointer allocref); -typedef CSSM_CALLOC = ffi.Pointer>; -typedef CSSM_CALLOCFunction = ffi.Pointer Function( - uint32 num, CSSM_SIZE size, ffi.Pointer allocref); -typedef DartCSSM_CALLOCFunction = ffi.Pointer Function( - Dartuint32 num, DartCSSM_SIZE size, ffi.Pointer allocref); +typedef dispatch_io_close_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_io_close_flags_t = int; +typedef dispatch_io_interval_flags_t = ffi.UnsignedLong; +typedef Dartdispatch_io_interval_flags_t = int; -final class cssm_encoded_cert extends ffi.Struct { - @CSSM_CERT_TYPE() - external int CertType; +/// OS_dispatch_workloop +abstract final class OS_dispatch_workloop { + /// Builds an object that implements the OS_dispatch_workloop protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - @CSSM_CERT_ENCODING() - external int CertEncoding; + return builder.build(); + } - external SecAsn1Item CertBlob; + /// Adds the implementation of the OS_dispatch_workloop protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} } -typedef CSSM_CERT_TYPE = uint32; -typedef CSSM_CERT_ENCODING = uint32; - -final class cssm_parsed_cert extends ffi.Struct { - @CSSM_CERT_TYPE() - external int CertType; +late final _protocol_OS_dispatch_workloop = + objc.getProtocol("OS_dispatch_workloop"); +typedef dispatch_workloop_t = ffi.Pointer; +typedef Dartdispatch_workloop_t = objc.NSObject; - @CSSM_CERT_PARSE_FORMAT() - external int ParsedCertFormat; +final class CFStreamError extends ffi.Struct { + @CFIndex() + external int domain; - external ffi.Pointer ParsedCert; + @SInt32() + external int error; } -typedef CSSM_CERT_PARSE_FORMAT = uint32; - -final class cssm_cert_pair extends ffi.Struct { - external CSSM_ENCODED_CERT EncodedCert; +final class CFStreamClientContext extends ffi.Struct { + @CFIndex() + external int version; - external CSSM_PARSED_CERT ParsedCert; -} + external ffi.Pointer info; -typedef CSSM_ENCODED_CERT = cssm_encoded_cert; -typedef CSSM_PARSED_CERT = cssm_parsed_cert; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; -final class cssm_certgroup extends ffi.Struct { - @CSSM_CERT_TYPE() - external int CertType; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - @CSSM_CERT_ENCODING() - external int CertEncoding; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; +} - @uint32() - external int NumCerts; +final class __CFReadStream extends ffi.Opaque {} - external UnnamedUnion3 GroupList; +final class __CFWriteStream extends ffi.Opaque {} - @CSSM_CERTGROUP_TYPE() - external int CertGroupType; +typedef CFStreamPropertyKey = CFStringRef; +typedef CFReadStreamRef = ffi.Pointer<__CFReadStream>; +typedef CFWriteStreamRef = ffi.Pointer<__CFWriteStream>; - external ffi.Pointer Reserved; +enum CFStreamStatus { + kCFStreamStatusNotOpen(0), + kCFStreamStatusOpening(1), + kCFStreamStatusOpen(2), + kCFStreamStatusReading(3), + kCFStreamStatusWriting(4), + kCFStreamStatusAtEnd(5), + kCFStreamStatusClosed(6), + kCFStreamStatusError(7); + + final int value; + const CFStreamStatus(this.value); + + static CFStreamStatus fromValue(int value) => switch (value) { + 0 => kCFStreamStatusNotOpen, + 1 => kCFStreamStatusOpening, + 2 => kCFStreamStatusOpen, + 3 => kCFStreamStatusReading, + 4 => kCFStreamStatusWriting, + 5 => kCFStreamStatusAtEnd, + 6 => kCFStreamStatusClosed, + 7 => kCFStreamStatusError, + _ => throw ArgumentError("Unknown value for CFStreamStatus: $value"), + }; } -final class UnnamedUnion3 extends ffi.Union { - external CSSM_DATA_PTR CertList; +typedef CFReadStreamClientCallBack + = ffi.Pointer>; +typedef CFReadStreamClientCallBackFunction = ffi.Void Function( + CFReadStreamRef stream, + CFOptionFlags type, + ffi.Pointer clientCallBackInfo); +typedef DartCFReadStreamClientCallBackFunction = void Function( + CFReadStreamRef stream, + CFStreamEventType type, + ffi.Pointer clientCallBackInfo); - external CSSM_ENCODED_CERT_PTR EncodedCertList; +enum CFStreamEventType { + kCFStreamEventNone(0), + kCFStreamEventOpenCompleted(1), + kCFStreamEventHasBytesAvailable(2), + kCFStreamEventCanAcceptBytes(4), + kCFStreamEventErrorOccurred(8), + kCFStreamEventEndEncountered(16); - external CSSM_PARSED_CERT_PTR ParsedCertList; + final int value; + const CFStreamEventType(this.value); - external CSSM_CERT_PAIR_PTR PairCertList; + static CFStreamEventType fromValue(int value) => switch (value) { + 0 => kCFStreamEventNone, + 1 => kCFStreamEventOpenCompleted, + 2 => kCFStreamEventHasBytesAvailable, + 4 => kCFStreamEventCanAcceptBytes, + 8 => kCFStreamEventErrorOccurred, + 16 => kCFStreamEventEndEncountered, + _ => throw ArgumentError("Unknown value for CFStreamEventType: $value"), + }; } -typedef CSSM_ENCODED_CERT_PTR = ffi.Pointer; -typedef CSSM_PARSED_CERT_PTR = ffi.Pointer; -typedef CSSM_CERT_PAIR_PTR = ffi.Pointer; -typedef CSSM_CERTGROUP_TYPE = uint32; +typedef CFWriteStreamClientCallBack + = ffi.Pointer>; +typedef CFWriteStreamClientCallBackFunction = ffi.Void Function( + CFWriteStreamRef stream, + CFOptionFlags type, + ffi.Pointer clientCallBackInfo); +typedef DartCFWriteStreamClientCallBackFunction = void Function( + CFWriteStreamRef stream, + CFStreamEventType type, + ffi.Pointer clientCallBackInfo); -final class cssm_base_certs extends ffi.Struct { - @CSSM_TP_HANDLE() - external int TPHandle; +enum CFPropertyListFormat { + kCFPropertyListOpenStepFormat(1), + kCFPropertyListXMLFormat_v1_0(100), + kCFPropertyListBinaryFormat_v1_0(200); - @CSSM_CL_HANDLE() - external int CLHandle; + final int value; + const CFPropertyListFormat(this.value); - external CSSM_CERTGROUP Certs; + static CFPropertyListFormat fromValue(int value) => switch (value) { + 1 => kCFPropertyListOpenStepFormat, + 100 => kCFPropertyListXMLFormat_v1_0, + 200 => kCFPropertyListBinaryFormat_v1_0, + _ => + throw ArgumentError("Unknown value for CFPropertyListFormat: $value"), + }; } -typedef CSSM_TP_HANDLE = CSSM_MODULE_HANDLE; -typedef CSSM_MODULE_HANDLE = CSSM_HANDLE; -typedef CSSM_HANDLE = CSSM_INTPTR; -typedef CSSM_INTPTR = ffi.IntPtr; -typedef DartCSSM_INTPTR = int; -typedef CSSM_CL_HANDLE = CSSM_MODULE_HANDLE; -typedef CSSM_CERTGROUP = cssm_certgroup; +final class CFSetCallBacks extends ffi.Struct { + @CFIndex() + external int version; -final class cssm_access_credentials extends ffi.Struct { - @ffi.Array.multi([68]) - external ffi.Array EntryTag; + external CFSetRetainCallBack retain; - external CSSM_BASE_CERTS BaseCerts; + external CFSetReleaseCallBack release; - external CSSM_SAMPLEGROUP Samples; + external CFSetCopyDescriptionCallBack copyDescription; - external CSSM_CHALLENGE_CALLBACK Callback; + external CFSetEqualCallBack equal; - external ffi.Pointer CallerCtx; + external CFSetHashCallBack hash; } -typedef CSSM_BASE_CERTS = cssm_base_certs; -typedef CSSM_SAMPLEGROUP = cssm_samplegroup; -typedef CSSM_CHALLENGE_CALLBACK - = ffi.Pointer>; -typedef CSSM_CHALLENGE_CALLBACKFunction = CSSM_RETURN Function( - ffi.Pointer Challenge, - CSSM_SAMPLEGROUP_PTR Response, - ffi.Pointer CallerCtx, - ffi.Pointer MemFuncs); -typedef DartCSSM_CHALLENGE_CALLBACKFunction = Dartsint32 Function( - ffi.Pointer Challenge, - CSSM_SAMPLEGROUP_PTR Response, - ffi.Pointer CallerCtx, - ffi.Pointer MemFuncs); -typedef CSSM_SAMPLEGROUP_PTR = ffi.Pointer; -typedef CSSM_MEMORY_FUNCS = cssm_memory_funcs; +typedef CFSetRetainCallBack + = ffi.Pointer>; +typedef CFSetRetainCallBackFunction = ffi.Pointer Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFSetReleaseCallBack + = ffi.Pointer>; +typedef CFSetReleaseCallBackFunction = ffi.Void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef DartCFSetReleaseCallBackFunction = void Function( + CFAllocatorRef allocator, ffi.Pointer value); +typedef CFSetCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFSetCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer value); +typedef CFSetEqualCallBack + = ffi.Pointer>; +typedef CFSetEqualCallBackFunction = Boolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef DartCFSetEqualCallBackFunction = DartBoolean Function( + ffi.Pointer value1, ffi.Pointer value2); +typedef CFSetHashCallBack + = ffi.Pointer>; +typedef CFSetHashCallBackFunction = CFHashCode Function( + ffi.Pointer value); +typedef DartCFSetHashCallBackFunction = DartCFHashCode Function( + ffi.Pointer value); -final class cssm_authorizationgroup extends ffi.Struct { - @uint32() - external int NumberOfAuthTags; +final class __CFSet extends ffi.Opaque {} - external ffi.Pointer AuthTags; -} +typedef CFSetRef = ffi.Pointer<__CFSet>; +typedef CFMutableSetRef = ffi.Pointer<__CFSet>; +typedef CFSetApplierFunction + = ffi.Pointer>; +typedef CFSetApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFSetApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); -typedef CSSM_ACL_AUTHORIZATION_TAG = sint32; +final class CFTreeContext extends ffi.Struct { + @CFIndex() + external int version; -final class cssm_acl_validity_period extends ffi.Struct { - external SecAsn1Item StartDate; + external ffi.Pointer info; - external SecAsn1Item EndDate; -} + external CFTreeRetainCallBack retain; -final class cssm_acl_entry_prototype extends ffi.Struct { - external CSSM_LIST TypedSubject; + external CFTreeReleaseCallBack release; - @CSSM_BOOL() - external int Delegate; + external CFTreeCopyDescriptionCallBack copyDescription; +} - external CSSM_AUTHORIZATIONGROUP Authorization; +typedef CFTreeRetainCallBack + = ffi.Pointer>; +typedef CFTreeRetainCallBackFunction = ffi.Pointer Function( + ffi.Pointer info); +typedef CFTreeReleaseCallBack + = ffi.Pointer>; +typedef CFTreeReleaseCallBackFunction = ffi.Void Function( + ffi.Pointer info); +typedef DartCFTreeReleaseCallBackFunction = void Function( + ffi.Pointer info); +typedef CFTreeCopyDescriptionCallBack + = ffi.Pointer>; +typedef CFTreeCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer info); - external CSSM_ACL_VALIDITY_PERIOD TimeRange; +final class __CFTree extends ffi.Opaque {} - @ffi.Array.multi([68]) - external ffi.Array EntryTag; -} +typedef CFTreeRef = ffi.Pointer<__CFTree>; +typedef CFTreeApplierFunction + = ffi.Pointer>; +typedef CFTreeApplierFunctionFunction = ffi.Void Function( + ffi.Pointer value, ffi.Pointer context); +typedef DartCFTreeApplierFunctionFunction = void Function( + ffi.Pointer value, ffi.Pointer context); -typedef CSSM_AUTHORIZATIONGROUP = cssm_authorizationgroup; -typedef CSSM_ACL_VALIDITY_PERIOD = cssm_acl_validity_period; +final class __CFUUID extends ffi.Opaque {} -final class cssm_acl_owner_prototype extends ffi.Struct { - external CSSM_LIST TypedSubject; +final class CFUUIDBytes extends ffi.Struct { + @UInt8() + external int byte0; - @CSSM_BOOL() - external int Delegate; -} + @UInt8() + external int byte1; -final class cssm_acl_entry_input extends ffi.Struct { - external CSSM_ACL_ENTRY_PROTOTYPE Prototype; + @UInt8() + external int byte2; - external CSSM_ACL_SUBJECT_CALLBACK Callback; + @UInt8() + external int byte3; - external ffi.Pointer CallerContext; -} + @UInt8() + external int byte4; -typedef CSSM_ACL_ENTRY_PROTOTYPE = cssm_acl_entry_prototype; -typedef CSSM_ACL_SUBJECT_CALLBACK - = ffi.Pointer>; -typedef CSSM_ACL_SUBJECT_CALLBACKFunction = CSSM_RETURN Function( - ffi.Pointer SubjectRequest, - CSSM_LIST_PTR SubjectResponse, - ffi.Pointer CallerContext, - ffi.Pointer MemFuncs); -typedef DartCSSM_ACL_SUBJECT_CALLBACKFunction = Dartsint32 Function( - ffi.Pointer SubjectRequest, - CSSM_LIST_PTR SubjectResponse, - ffi.Pointer CallerContext, - ffi.Pointer MemFuncs); -typedef CSSM_LIST_PTR = ffi.Pointer; + @UInt8() + external int byte5; -final class cssm_resource_control_context extends ffi.Struct { - external CSSM_ACCESS_CREDENTIALS_PTR AccessCred; + @UInt8() + external int byte6; - external CSSM_ACL_ENTRY_INPUT InitialAclEntry; -} + @UInt8() + external int byte7; -typedef CSSM_ACCESS_CREDENTIALS_PTR = ffi.Pointer; -typedef CSSM_ACL_ENTRY_INPUT = cssm_acl_entry_input; + @UInt8() + external int byte8; -final class cssm_acl_entry_info extends ffi.Struct { - external CSSM_ACL_ENTRY_PROTOTYPE EntryPublicInfo; + @UInt8() + external int byte9; - @CSSM_ACL_HANDLE() - external int EntryHandle; -} + @UInt8() + external int byte10; -typedef CSSM_ACL_HANDLE = CSSM_HANDLE; + @UInt8() + external int byte11; -final class cssm_acl_edit extends ffi.Struct { - @CSSM_ACL_EDIT_MODE() - external int EditMode; + @UInt8() + external int byte12; - @CSSM_ACL_HANDLE() - external int OldEntryHandle; + @UInt8() + external int byte13; - external ffi.Pointer NewEntry; + @UInt8() + external int byte14; + + @UInt8() + external int byte15; } -typedef CSSM_ACL_EDIT_MODE = uint32; +typedef CFUUIDRef = ffi.Pointer<__CFUUID>; -final class cssm_func_name_addr extends ffi.Struct { - @ffi.Array.multi([68]) - external ffi.Array Name; +final class __CFBundle extends ffi.Opaque {} - external CSSM_PROC_ADDR Address; -} +typedef CFBundleRef = ffi.Pointer<__CFBundle>; +typedef cpu_type_t = integer_t; +typedef CFPlugInRef = ffi.Pointer<__CFBundle>; +typedef CFBundleRefNum = ffi.Int; +typedef DartCFBundleRefNum = int; -typedef CSSM_PROC_ADDR - = ffi.Pointer>; -typedef CSSM_PROC_ADDRFunction = ffi.Void Function(); -typedef DartCSSM_PROC_ADDRFunction = void Function(); +final class __CFMessagePort extends ffi.Opaque {} -final class cssm_date extends ffi.Struct { - @ffi.Array.multi([4]) - external ffi.Array Year; +final class CFMessagePortContext extends ffi.Struct { + @CFIndex() + external int version; - @ffi.Array.multi([2]) - external ffi.Array Month; + external ffi.Pointer info; - @ffi.Array.multi([2]) - external ffi.Array Day; -} + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; -final class cssm_range extends ffi.Struct { - @uint32() - external int Min; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - @uint32() - external int Max; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -final class cssm_query_size_data extends ffi.Struct { - @uint32() - external int SizeInputBlock; - - @uint32() - external int SizeOutputBlock; -} +typedef CFMessagePortRef = ffi.Pointer<__CFMessagePort>; +typedef CFMessagePortCallBack + = ffi.Pointer>; +typedef CFMessagePortCallBackFunction = CFDataRef Function( + CFMessagePortRef local, + SInt32 msgid, + CFDataRef data, + ffi.Pointer info); +typedef DartCFMessagePortCallBackFunction = CFDataRef Function( + CFMessagePortRef local, + DartSInt32 msgid, + CFDataRef data, + ffi.Pointer info); +typedef CFMessagePortInvalidationCallBack = ffi + .Pointer>; +typedef CFMessagePortInvalidationCallBackFunction = ffi.Void Function( + CFMessagePortRef ms, ffi.Pointer info); +typedef DartCFMessagePortInvalidationCallBackFunction = void Function( + CFMessagePortRef ms, ffi.Pointer info); +typedef CFPlugInFactoryFunction + = ffi.Pointer>; +typedef CFPlugInFactoryFunctionFunction = ffi.Pointer Function( + CFAllocatorRef allocator, CFUUIDRef typeUUID); -final class cssm_key_size extends ffi.Struct { - @uint32() - external int LogicalKeySizeInBits; +final class __CFPlugInInstance extends ffi.Opaque {} - @uint32() - external int EffectiveKeySizeInBits; -} +typedef CFPlugInInstanceRef = ffi.Pointer<__CFPlugInInstance>; +typedef CFPlugInInstanceDeallocateInstanceDataFunction = ffi.Pointer< + ffi.NativeFunction>; +typedef CFPlugInInstanceDeallocateInstanceDataFunctionFunction = ffi.Void + Function(ffi.Pointer instanceData); +typedef DartCFPlugInInstanceDeallocateInstanceDataFunctionFunction = void + Function(ffi.Pointer instanceData); +typedef CFPlugInInstanceGetInterfaceFunction = ffi + .Pointer>; +typedef CFPlugInInstanceGetInterfaceFunctionFunction = Boolean Function( + CFPlugInInstanceRef instance, + CFStringRef interfaceName, + ffi.Pointer> ftbl); +typedef DartCFPlugInInstanceGetInterfaceFunctionFunction = DartBoolean Function( + CFPlugInInstanceRef instance, + CFStringRef interfaceName, + ffi.Pointer> ftbl); -final class cssm_keyheader extends ffi.Struct { - @CSSM_HEADERVERSION() - external int HeaderVersion; +final class __CFMachPort extends ffi.Opaque {} - external CSSM_GUID CspId; +final class CFMachPortContext extends ffi.Struct { + @CFIndex() + external int version; - @CSSM_KEYBLOB_TYPE() - external int BlobType; + external ffi.Pointer info; - @CSSM_KEYBLOB_FORMAT() - external int Format; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - @CSSM_ALGORITHMS() - external int AlgorithmId; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; - @CSSM_KEYCLASS() - external int KeyClass; + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; +} - @uint32() - external int LogicalKeySizeInBits; +typedef CFMachPortRef = ffi.Pointer<__CFMachPort>; +typedef CFMachPortCallBack + = ffi.Pointer>; +typedef CFMachPortCallBackFunction = ffi.Void Function(CFMachPortRef port, + ffi.Pointer msg, CFIndex size, ffi.Pointer info); +typedef DartCFMachPortCallBackFunction = void Function(CFMachPortRef port, + ffi.Pointer msg, DartCFIndex size, ffi.Pointer info); +typedef CFMachPortInvalidationCallBack + = ffi.Pointer>; +typedef CFMachPortInvalidationCallBackFunction = ffi.Void Function( + CFMachPortRef port, ffi.Pointer info); +typedef DartCFMachPortInvalidationCallBackFunction = void Function( + CFMachPortRef port, ffi.Pointer info); - @CSSM_KEYATTR_FLAGS() - external int KeyAttr; +final class __CFAttributedString extends ffi.Opaque {} - @CSSM_KEYUSE() - external int KeyUsage; +typedef CFAttributedStringRef = ffi.Pointer<__CFAttributedString>; +typedef CFMutableAttributedStringRef = ffi.Pointer<__CFAttributedString>; - external CSSM_DATE StartDate; +final class __CFURLEnumerator extends ffi.Opaque {} - external CSSM_DATE EndDate; +typedef CFURLEnumeratorRef = ffi.Pointer<__CFURLEnumerator>; - @CSSM_ALGORITHMS() - external int WrapAlgorithmId; +enum CFURLEnumeratorOptions { + kCFURLEnumeratorDefaultBehavior(0), + kCFURLEnumeratorDescendRecursively(1), + kCFURLEnumeratorSkipInvisibles(2), + kCFURLEnumeratorGenerateFileReferenceURLs(4), + kCFURLEnumeratorSkipPackageContents(8), + kCFURLEnumeratorIncludeDirectoriesPreOrder(16), + kCFURLEnumeratorIncludeDirectoriesPostOrder(32), + kCFURLEnumeratorGenerateRelativePathURLs(64); + + final int value; + const CFURLEnumeratorOptions(this.value); + + static CFURLEnumeratorOptions fromValue(int value) => switch (value) { + 0 => kCFURLEnumeratorDefaultBehavior, + 1 => kCFURLEnumeratorDescendRecursively, + 2 => kCFURLEnumeratorSkipInvisibles, + 4 => kCFURLEnumeratorGenerateFileReferenceURLs, + 8 => kCFURLEnumeratorSkipPackageContents, + 16 => kCFURLEnumeratorIncludeDirectoriesPreOrder, + 32 => kCFURLEnumeratorIncludeDirectoriesPostOrder, + 64 => kCFURLEnumeratorGenerateRelativePathURLs, + _ => throw ArgumentError( + "Unknown value for CFURLEnumeratorOptions: $value"), + }; +} + +enum CFURLEnumeratorResult { + kCFURLEnumeratorSuccess(1), + kCFURLEnumeratorEnd(2), + kCFURLEnumeratorError(3), + kCFURLEnumeratorDirectoryPostOrderSuccess(4); + + final int value; + const CFURLEnumeratorResult(this.value); + + static CFURLEnumeratorResult fromValue(int value) => switch (value) { + 1 => kCFURLEnumeratorSuccess, + 2 => kCFURLEnumeratorEnd, + 3 => kCFURLEnumeratorError, + 4 => kCFURLEnumeratorDirectoryPostOrderSuccess, + _ => throw ArgumentError( + "Unknown value for CFURLEnumeratorResult: $value"), + }; +} - @CSSM_ENCRYPT_MODE() - external int WrapMode; +final class guid_t extends ffi.Union { + @ffi.Array.multi([16]) + external ffi.Array g_guid; - @uint32() - external int Reserved; + @ffi.Array.multi([4]) + external ffi.Array g_guid_asint; } -typedef CSSM_HEADERVERSION = uint32; -typedef CSSM_KEYBLOB_TYPE = uint32; -typedef CSSM_KEYBLOB_FORMAT = uint32; -typedef CSSM_ALGORITHMS = uint32; -typedef CSSM_KEYCLASS = uint32; -typedef CSSM_KEYATTR_FLAGS = uint32; -typedef CSSM_KEYUSE = uint32; -typedef CSSM_DATE = cssm_date; -typedef CSSM_ENCRYPT_MODE = uint32; +@ffi.Packed(1) +final class ntsid_t extends ffi.Struct { + @u_int8_t() + external int sid_kind; -final class cssm_key extends ffi.Struct { - external CSSM_KEYHEADER KeyHeader; + @u_int8_t() + external int sid_authcount; - external SecAsn1Item KeyData; + @ffi.Array.multi([6]) + external ffi.Array sid_authority; + + @ffi.Array.multi([16]) + external ffi.Array sid_authorities; } -typedef CSSM_KEYHEADER = cssm_keyheader; +typedef u_int8_t = ffi.UnsignedChar; +typedef Dartu_int8_t = int; +typedef u_int32_t = ffi.UnsignedInt; +typedef Dartu_int32_t = int; -final class cssm_dl_db_handle extends ffi.Struct { - @CSSM_DL_HANDLE() - external int DLHandle; +final class kauth_identity_extlookup extends ffi.Struct { + @u_int32_t() + external int el_seqno; - @CSSM_DB_HANDLE() - external int DBHandle; -} + @u_int32_t() + external int el_result; -typedef CSSM_DL_HANDLE = CSSM_MODULE_HANDLE; -typedef CSSM_DB_HANDLE = CSSM_MODULE_HANDLE; + @u_int32_t() + external int el_flags; -final class cssm_context_attribute extends ffi.Struct { - @CSSM_ATTRIBUTE_TYPE() - external int AttributeType; + @__darwin_pid_t() + external int el_info_pid; - @uint32() - external int AttributeLength; + @u_int64_t() + external int el_extend; - external cssm_context_attribute_value Attribute; -} + @u_int32_t() + external int el_info_reserved_1; -typedef CSSM_ATTRIBUTE_TYPE = uint32; + @uid_t() + external int el_uid; -final class cssm_context_attribute_value extends ffi.Union { - external ffi.Pointer String; + external guid_t el_uguid; - @uint32() - external int Uint32; + @u_int32_t() + external int el_uguid_valid; - external CSSM_ACCESS_CREDENTIALS_PTR AccessCredentials; + external ntsid_t el_usid; - external CSSM_KEY_PTR Key; + @u_int32_t() + external int el_usid_valid; - external CSSM_DATA_PTR Data; + @gid_t() + external int el_gid; - @CSSM_PADDING() - external int Padding; + external guid_t el_gguid; + + @u_int32_t() + external int el_gguid_valid; + + external ntsid_t el_gsid; + + @u_int32_t() + external int el_gsid_valid; - external CSSM_DATE_PTR Date; + @u_int32_t() + external int el_member_valid; - external CSSM_RANGE_PTR Range; + @u_int32_t() + external int el_sup_grp_cnt; - external CSSM_CRYPTO_DATA_PTR CryptoData; + @ffi.Array.multi([16]) + external ffi.Array el_sup_groups; +} - external CSSM_VERSION_PTR Version; +typedef u_int64_t = ffi.UnsignedLongLong; +typedef Dartu_int64_t = int; - external CSSM_DL_DB_HANDLE_PTR DLDBHandle; +final class kauth_cache_sizes extends ffi.Struct { + @u_int32_t() + external int kcs_group_size; - external ffi.Pointer KRProfile; + @u_int32_t() + external int kcs_id_size; } -typedef CSSM_KEY_PTR = ffi.Pointer; -typedef CSSM_PADDING = uint32; -typedef CSSM_DATE_PTR = ffi.Pointer; -typedef CSSM_RANGE_PTR = ffi.Pointer; -typedef CSSM_CRYPTO_DATA_PTR = ffi.Pointer; -typedef CSSM_VERSION_PTR = ffi.Pointer; -typedef CSSM_DL_DB_HANDLE_PTR = ffi.Pointer; +final class kauth_ace extends ffi.Struct { + external guid_t ace_applicable; -final class cssm_kr_profile extends ffi.Opaque {} + @u_int32_t() + external int ace_flags; -final class cssm_context extends ffi.Struct { - @CSSM_CONTEXT_TYPE() - external int ContextType; + @kauth_ace_rights_t() + external int ace_rights; +} - @CSSM_ALGORITHMS() - external int AlgorithmType; +typedef kauth_ace_rights_t = u_int32_t; - @uint32() - external int NumberOfAttributes; +final class kauth_acl extends ffi.Struct { + @u_int32_t() + external int acl_entrycount; - external CSSM_CONTEXT_ATTRIBUTE_PTR ContextAttributes; + @u_int32_t() + external int acl_flags; - @CSSM_CSP_HANDLE() - external int CSPHandle; + @ffi.Array.multi([1]) + external ffi.Array acl_ace; +} - @CSSM_BOOL() - external int Privileged; +final class kauth_filesec extends ffi.Struct { + @u_int32_t() + external int fsec_magic; - @uint32() - external int EncryptionProhibited; + external guid_t fsec_owner; - @uint32() - external int WorkFactor; + external guid_t fsec_group; - @uint32() - external int Reserved; + external kauth_acl fsec_acl; } -typedef CSSM_CONTEXT_TYPE = uint32; -typedef CSSM_CONTEXT_ATTRIBUTE_PTR = ffi.Pointer; -typedef CSSM_CSP_HANDLE = CSSM_MODULE_HANDLE; - -final class cssm_pkcs1_oaep_params extends ffi.Struct { - @uint32() - external int HashAlgorithm; +final class _acl extends ffi.Opaque {} - external SecAsn1Item HashParams; +final class _acl_entry extends ffi.Opaque {} - @CSSM_PKCS_OAEP_MGF() - external int MGF; +final class _acl_permset extends ffi.Opaque {} - external SecAsn1Item MGFParams; +final class _acl_flagset extends ffi.Opaque {} - @CSSM_PKCS_OAEP_PSOURCE() - external int PSource; +typedef acl_t = ffi.Pointer<_acl>; +typedef acl_entry_t = ffi.Pointer<_acl_entry>; - external SecAsn1Item PSourceParams; +enum acl_type_t { + ACL_TYPE_EXTENDED(256), + ACL_TYPE_ACCESS(0), + ACL_TYPE_DEFAULT(1), + ACL_TYPE_AFS(2), + ACL_TYPE_CODA(3), + ACL_TYPE_NTFS(4), + ACL_TYPE_NWFS(5); + + final int value; + const acl_type_t(this.value); + + static acl_type_t fromValue(int value) => switch (value) { + 256 => ACL_TYPE_EXTENDED, + 0 => ACL_TYPE_ACCESS, + 1 => ACL_TYPE_DEFAULT, + 2 => ACL_TYPE_AFS, + 3 => ACL_TYPE_CODA, + 4 => ACL_TYPE_NTFS, + 5 => ACL_TYPE_NWFS, + _ => throw ArgumentError("Unknown value for acl_type_t: $value"), + }; } -typedef CSSM_PKCS_OAEP_MGF = uint32; -typedef CSSM_PKCS_OAEP_PSOURCE = uint32; +typedef acl_permset_t = ffi.Pointer<_acl_permset>; -final class cssm_csp_operational_statistics extends ffi.Struct { - @CSSM_BOOL() - external int UserAuthenticated; +enum acl_perm_t { + ACL_READ_DATA(2), + ACL_WRITE_DATA(4), + ACL_EXECUTE(8), + ACL_DELETE(16), + ACL_APPEND_DATA(32), + ACL_DELETE_CHILD(64), + ACL_READ_ATTRIBUTES(128), + ACL_WRITE_ATTRIBUTES(256), + ACL_READ_EXTATTRIBUTES(512), + ACL_WRITE_EXTATTRIBUTES(1024), + ACL_READ_SECURITY(2048), + ACL_WRITE_SECURITY(4096), + ACL_CHANGE_OWNER(8192), + ACL_SYNCHRONIZE(1048576); + + static const ACL_LIST_DIRECTORY = ACL_READ_DATA; + static const ACL_ADD_FILE = ACL_WRITE_DATA; + static const ACL_SEARCH = ACL_EXECUTE; + static const ACL_ADD_SUBDIRECTORY = ACL_APPEND_DATA; + + final int value; + const acl_perm_t(this.value); + + static acl_perm_t fromValue(int value) => switch (value) { + 2 => ACL_READ_DATA, + 4 => ACL_WRITE_DATA, + 8 => ACL_EXECUTE, + 16 => ACL_DELETE, + 32 => ACL_APPEND_DATA, + 64 => ACL_DELETE_CHILD, + 128 => ACL_READ_ATTRIBUTES, + 256 => ACL_WRITE_ATTRIBUTES, + 512 => ACL_READ_EXTATTRIBUTES, + 1024 => ACL_WRITE_EXTATTRIBUTES, + 2048 => ACL_READ_SECURITY, + 4096 => ACL_WRITE_SECURITY, + 8192 => ACL_CHANGE_OWNER, + 1048576 => ACL_SYNCHRONIZE, + _ => throw ArgumentError("Unknown value for acl_perm_t: $value"), + }; - @CSSM_CSP_FLAGS() - external int DeviceFlags; + @override + String toString() { + if (this == ACL_READ_DATA) + return "acl_perm_t.ACL_READ_DATA, acl_perm_t.ACL_LIST_DIRECTORY"; + if (this == ACL_WRITE_DATA) + return "acl_perm_t.ACL_WRITE_DATA, acl_perm_t.ACL_ADD_FILE"; + if (this == ACL_EXECUTE) + return "acl_perm_t.ACL_EXECUTE, acl_perm_t.ACL_SEARCH"; + if (this == ACL_APPEND_DATA) + return "acl_perm_t.ACL_APPEND_DATA, acl_perm_t.ACL_ADD_SUBDIRECTORY"; + return super.toString(); + } +} - @uint32() - external int TokenMaxSessionCount; +typedef acl_permset_mask_t = u_int64_t; +typedef acl_flagset_t = ffi.Pointer<_acl_flagset>; - @uint32() - external int TokenOpenedSessionCount; +enum acl_flag_t { + ACL_FLAG_DEFER_INHERIT(1), + ACL_FLAG_NO_INHERIT(131072), + ACL_ENTRY_INHERITED(16), + ACL_ENTRY_FILE_INHERIT(32), + ACL_ENTRY_DIRECTORY_INHERIT(64), + ACL_ENTRY_LIMIT_INHERIT(128), + ACL_ENTRY_ONLY_INHERIT(256); + + final int value; + const acl_flag_t(this.value); + + static acl_flag_t fromValue(int value) => switch (value) { + 1 => ACL_FLAG_DEFER_INHERIT, + 131072 => ACL_FLAG_NO_INHERIT, + 16 => ACL_ENTRY_INHERITED, + 32 => ACL_ENTRY_FILE_INHERIT, + 64 => ACL_ENTRY_DIRECTORY_INHERIT, + 128 => ACL_ENTRY_LIMIT_INHERIT, + 256 => ACL_ENTRY_ONLY_INHERIT, + _ => throw ArgumentError("Unknown value for acl_flag_t: $value"), + }; +} + +enum acl_tag_t { + ACL_UNDEFINED_TAG(0), + ACL_EXTENDED_ALLOW(1), + ACL_EXTENDED_DENY(2); + + final int value; + const acl_tag_t(this.value); + + static acl_tag_t fromValue(int value) => switch (value) { + 0 => ACL_UNDEFINED_TAG, + 1 => ACL_EXTENDED_ALLOW, + 2 => ACL_EXTENDED_DENY, + _ => throw ArgumentError("Unknown value for acl_tag_t: $value"), + }; +} - @uint32() - external int TokenMaxRWSessionCount; +final class __CFFileSecurity extends ffi.Opaque {} - @uint32() - external int TokenOpenedRWSessionCount; +typedef CFFileSecurityRef = ffi.Pointer<__CFFileSecurity>; - @uint32() - external int TokenTotalPublicMem; +enum CFFileSecurityClearOptions { + kCFFileSecurityClearOwner(1), + kCFFileSecurityClearGroup(2), + kCFFileSecurityClearMode(4), + kCFFileSecurityClearOwnerUUID(8), + kCFFileSecurityClearGroupUUID(16), + kCFFileSecurityClearAccessControlList(32); + + final int value; + const CFFileSecurityClearOptions(this.value); + + static CFFileSecurityClearOptions fromValue(int value) => switch (value) { + 1 => kCFFileSecurityClearOwner, + 2 => kCFFileSecurityClearGroup, + 4 => kCFFileSecurityClearMode, + 8 => kCFFileSecurityClearOwnerUUID, + 16 => kCFFileSecurityClearGroupUUID, + 32 => kCFFileSecurityClearAccessControlList, + _ => throw ArgumentError( + "Unknown value for CFFileSecurityClearOptions: $value"), + }; +} - @uint32() - external int TokenFreePublicMem; +final class __CFStringTokenizer extends ffi.Opaque {} - @uint32() - external int TokenTotalPrivateMem; +typedef CFStringTokenizerRef = ffi.Pointer<__CFStringTokenizer>; - @uint32() - external int TokenFreePrivateMem; +enum CFStringTokenizerTokenType { + kCFStringTokenizerTokenNone(0), + kCFStringTokenizerTokenNormal(1), + kCFStringTokenizerTokenHasSubTokensMask(2), + kCFStringTokenizerTokenHasDerivedSubTokensMask(4), + kCFStringTokenizerTokenHasHasNumbersMask(8), + kCFStringTokenizerTokenHasNonLettersMask(16), + kCFStringTokenizerTokenIsCJWordMask(32); + + final int value; + const CFStringTokenizerTokenType(this.value); + + static CFStringTokenizerTokenType fromValue(int value) => switch (value) { + 0 => kCFStringTokenizerTokenNone, + 1 => kCFStringTokenizerTokenNormal, + 2 => kCFStringTokenizerTokenHasSubTokensMask, + 4 => kCFStringTokenizerTokenHasDerivedSubTokensMask, + 8 => kCFStringTokenizerTokenHasHasNumbersMask, + 16 => kCFStringTokenizerTokenHasNonLettersMask, + 32 => kCFStringTokenizerTokenIsCJWordMask, + _ => throw ArgumentError( + "Unknown value for CFStringTokenizerTokenType: $value"), + }; } -typedef CSSM_CSP_FLAGS = uint32; +final class __CFFileDescriptor extends ffi.Opaque {} -final class cssm_pkcs5_pbkdf1_params extends ffi.Struct { - external SecAsn1Item Passphrase; +final class CFFileDescriptorContext extends ffi.Struct { + @CFIndex() + external int version; - external SecAsn1Item InitVector; -} + external ffi.Pointer info; -final class cssm_pkcs5_pbkdf2_params extends ffi.Struct { - external SecAsn1Item Passphrase; + external ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer info)>> retain; - @CSSM_PKCS5_PBKDF2_PRF() - external int PseudoRandomFunction; + external ffi.Pointer< + ffi.NativeFunction info)>> + release; + + external ffi.Pointer< + ffi.NativeFunction info)>> + copyDescription; } -typedef CSSM_PKCS5_PBKDF2_PRF = uint32; +typedef CFFileDescriptorRef = ffi.Pointer<__CFFileDescriptor>; +typedef CFFileDescriptorNativeDescriptor = ffi.Int; +typedef DartCFFileDescriptorNativeDescriptor = int; +typedef CFFileDescriptorCallBack + = ffi.Pointer>; +typedef CFFileDescriptorCallBackFunction = ffi.Void Function( + CFFileDescriptorRef f, + CFOptionFlags callBackTypes, + ffi.Pointer info); +typedef DartCFFileDescriptorCallBackFunction = void Function( + CFFileDescriptorRef f, + DartCFOptionFlags callBackTypes, + ffi.Pointer info); -final class cssm_kea_derive_params extends ffi.Struct { - external SecAsn1Item Rb; +final class __CFUserNotification extends ffi.Opaque {} - external SecAsn1Item Yb; -} +typedef CFUserNotificationRef = ffi.Pointer<__CFUserNotification>; +typedef CFUserNotificationCallBack + = ffi.Pointer>; +typedef CFUserNotificationCallBackFunction = ffi.Void Function( + CFUserNotificationRef userNotification, CFOptionFlags responseFlags); +typedef DartCFUserNotificationCallBackFunction = void Function( + CFUserNotificationRef userNotification, DartCFOptionFlags responseFlags); -final class cssm_tp_authority_id extends ffi.Struct { - external ffi.Pointer AuthorityCert; +final class __CFXMLNode extends ffi.Opaque {} - external CSSM_NET_ADDRESS_PTR AuthorityLocation; -} +final class CFXMLElementInfo extends ffi.Struct { + external CFDictionaryRef attributes; -typedef CSSM_NET_ADDRESS_PTR = ffi.Pointer; + external CFArrayRef attributeOrder; -final class cssm_field extends ffi.Struct { - external SecAsn1Oid FieldOid; + @Boolean() + external int isEmpty; - external SecAsn1Item FieldValue; + @ffi.Array.multi([3]) + external ffi.Array _reserved; } -final class cssm_tp_policyinfo extends ffi.Struct { - @uint32() - external int NumberOfPolicyIds; +final class CFXMLProcessingInstructionInfo extends ffi.Struct { + external CFStringRef dataString; +} - external CSSM_FIELD_PTR PolicyIds; +final class CFXMLDocumentInfo extends ffi.Struct { + external CFURLRef sourceURL; - external ffi.Pointer PolicyControl; + @CFStringEncoding() + external int encoding; } -typedef CSSM_FIELD_PTR = ffi.Pointer; - -final class cssm_dl_db_list extends ffi.Struct { - @uint32() - external int NumHandles; +final class CFXMLExternalID extends ffi.Struct { + external CFURLRef systemID; - external CSSM_DL_DB_HANDLE_PTR DLDBHandle; + external CFStringRef publicID; } -final class cssm_tp_callerauth_context extends ffi.Struct { - external CSSM_TP_POLICYINFO Policy; +final class CFXMLDocumentTypeInfo extends ffi.Struct { + external CFXMLExternalID externalID; +} - external CSSM_TIMESTRING VerifyTime; +final class CFXMLNotationInfo extends ffi.Struct { + external CFXMLExternalID externalID; +} - @CSSM_TP_STOP_ON() - external int VerificationAbortOn; +final class CFXMLElementTypeDeclarationInfo extends ffi.Struct { + external CFStringRef contentDescription; +} - external CSSM_TP_VERIFICATION_RESULTS_CALLBACK CallbackWithVerifiedCert; +final class CFXMLAttributeDeclarationInfo extends ffi.Struct { + external CFStringRef attributeName; - @uint32() - external int NumberOfAnchorCerts; + external CFStringRef typeString; - external CSSM_DATA_PTR AnchorCerts; + external CFStringRef defaultString; +} - external CSSM_DL_DB_LIST_PTR DBList; +final class CFXMLAttributeListDeclarationInfo extends ffi.Struct { + @CFIndex() + external int numberOfAttributes; - external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; + external ffi.Pointer attributes; } -typedef CSSM_TP_POLICYINFO = cssm_tp_policyinfo; -typedef CSSM_TIMESTRING = ffi.Pointer; -typedef CSSM_TP_STOP_ON = uint32; -typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACK = ffi - .Pointer>; -typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = CSSM_RETURN Function( - CSSM_MODULE_HANDLE ModuleHandle, - ffi.Pointer CallerCtx, - CSSM_DATA_PTR VerifiedCert); -typedef DartCSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = Dartsint32 Function( - DartCSSM_INTPTR ModuleHandle, - ffi.Pointer CallerCtx, - CSSM_DATA_PTR VerifiedCert); -typedef CSSM_DL_DB_LIST_PTR = ffi.Pointer; +final class CFXMLEntityInfo extends ffi.Struct { + @CFIndex() + external int entityTypeAsInt; -final class cssm_encoded_crl extends ffi.Struct { - @CSSM_CRL_TYPE() - external int CrlType; + CFXMLEntityTypeCode get entityType => + CFXMLEntityTypeCode.fromValue(entityTypeAsInt); - @CSSM_CRL_ENCODING() - external int CrlEncoding; + external CFStringRef replacementText; - external SecAsn1Item CrlBlob; -} + external CFXMLExternalID entityID; -typedef CSSM_CRL_TYPE = uint32; -typedef CSSM_CRL_ENCODING = uint32; + external CFStringRef notationName; +} -final class cssm_parsed_crl extends ffi.Struct { - @CSSM_CRL_TYPE() - external int CrlType; +enum CFXMLEntityTypeCode { + kCFXMLEntityTypeParameter(0), + kCFXMLEntityTypeParsedInternal(1), + kCFXMLEntityTypeParsedExternal(2), + kCFXMLEntityTypeUnparsed(3), + kCFXMLEntityTypeCharacter(4); - @CSSM_CRL_PARSE_FORMAT() - external int ParsedCrlFormat; + final int value; + const CFXMLEntityTypeCode(this.value); - external ffi.Pointer ParsedCrl; + static CFXMLEntityTypeCode fromValue(int value) => switch (value) { + 0 => kCFXMLEntityTypeParameter, + 1 => kCFXMLEntityTypeParsedInternal, + 2 => kCFXMLEntityTypeParsedExternal, + 3 => kCFXMLEntityTypeUnparsed, + 4 => kCFXMLEntityTypeCharacter, + _ => + throw ArgumentError("Unknown value for CFXMLEntityTypeCode: $value"), + }; } -typedef CSSM_CRL_PARSE_FORMAT = uint32; +final class CFXMLEntityReferenceInfo extends ffi.Struct { + @CFIndex() + external int entityTypeAsInt; -final class cssm_crl_pair extends ffi.Struct { - external CSSM_ENCODED_CRL EncodedCrl; + CFXMLEntityTypeCode get entityType => + CFXMLEntityTypeCode.fromValue(entityTypeAsInt); +} - external CSSM_PARSED_CRL ParsedCrl; +typedef CFXMLNodeRef = ffi.Pointer<__CFXMLNode>; + +enum CFXMLNodeTypeCode { + kCFXMLNodeTypeDocument(1), + kCFXMLNodeTypeElement(2), + kCFXMLNodeTypeAttribute(3), + kCFXMLNodeTypeProcessingInstruction(4), + kCFXMLNodeTypeComment(5), + kCFXMLNodeTypeText(6), + kCFXMLNodeTypeCDATASection(7), + kCFXMLNodeTypeDocumentFragment(8), + kCFXMLNodeTypeEntity(9), + kCFXMLNodeTypeEntityReference(10), + kCFXMLNodeTypeDocumentType(11), + kCFXMLNodeTypeWhitespace(12), + kCFXMLNodeTypeNotation(13), + kCFXMLNodeTypeElementTypeDeclaration(14), + kCFXMLNodeTypeAttributeListDeclaration(15); + + final int value; + const CFXMLNodeTypeCode(this.value); + + static CFXMLNodeTypeCode fromValue(int value) => switch (value) { + 1 => kCFXMLNodeTypeDocument, + 2 => kCFXMLNodeTypeElement, + 3 => kCFXMLNodeTypeAttribute, + 4 => kCFXMLNodeTypeProcessingInstruction, + 5 => kCFXMLNodeTypeComment, + 6 => kCFXMLNodeTypeText, + 7 => kCFXMLNodeTypeCDATASection, + 8 => kCFXMLNodeTypeDocumentFragment, + 9 => kCFXMLNodeTypeEntity, + 10 => kCFXMLNodeTypeEntityReference, + 11 => kCFXMLNodeTypeDocumentType, + 12 => kCFXMLNodeTypeWhitespace, + 13 => kCFXMLNodeTypeNotation, + 14 => kCFXMLNodeTypeElementTypeDeclaration, + 15 => kCFXMLNodeTypeAttributeListDeclaration, + _ => throw ArgumentError("Unknown value for CFXMLNodeTypeCode: $value"), + }; } -typedef CSSM_ENCODED_CRL = cssm_encoded_crl; -typedef CSSM_PARSED_CRL = cssm_parsed_crl; +typedef CFXMLTreeRef = CFTreeRef; -final class cssm_crlgroup extends ffi.Struct { - @CSSM_CRL_TYPE() - external int CrlType; +final class __CFXMLParser extends ffi.Opaque {} - @CSSM_CRL_ENCODING() - external int CrlEncoding; +final class CFXMLParserCallBacks extends ffi.Struct { + @CFIndex() + external int version; - @uint32() - external int NumberOfCrls; + external CFXMLParserCreateXMLStructureCallBack createXMLStructure; - external UnnamedUnion4 GroupCrlList; + external CFXMLParserAddChildCallBack addChild; - @CSSM_CRLGROUP_TYPE() - external int CrlGroupType; -} + external CFXMLParserEndXMLStructureCallBack endXMLStructure; -final class UnnamedUnion4 extends ffi.Union { - external CSSM_DATA_PTR CrlList; + external CFXMLParserResolveExternalEntityCallBack resolveExternalEntity; - external CSSM_ENCODED_CRL_PTR EncodedCrlList; + external CFXMLParserHandleErrorCallBack handleError; +} - external CSSM_PARSED_CRL_PTR ParsedCrlList; +typedef CFXMLParserCreateXMLStructureCallBack = ffi + .Pointer>; +typedef CFXMLParserCreateXMLStructureCallBackFunction + = ffi.Pointer Function(CFXMLParserRef parser, + CFXMLNodeRef nodeDesc, ffi.Pointer info); +typedef CFXMLParserRef = ffi.Pointer<__CFXMLParser>; +typedef CFXMLParserAddChildCallBack + = ffi.Pointer>; +typedef CFXMLParserAddChildCallBackFunction = ffi.Void Function( + CFXMLParserRef parser, + ffi.Pointer parent, + ffi.Pointer child, + ffi.Pointer info); +typedef DartCFXMLParserAddChildCallBackFunction = void Function( + CFXMLParserRef parser, + ffi.Pointer parent, + ffi.Pointer child, + ffi.Pointer info); +typedef CFXMLParserEndXMLStructureCallBack = ffi + .Pointer>; +typedef CFXMLParserEndXMLStructureCallBackFunction = ffi.Void Function( + CFXMLParserRef parser, + ffi.Pointer xmlType, + ffi.Pointer info); +typedef DartCFXMLParserEndXMLStructureCallBackFunction = void Function( + CFXMLParserRef parser, + ffi.Pointer xmlType, + ffi.Pointer info); +typedef CFXMLParserResolveExternalEntityCallBack = ffi.Pointer< + ffi.NativeFunction>; +typedef CFXMLParserResolveExternalEntityCallBackFunction = CFDataRef Function( + CFXMLParserRef parser, + ffi.Pointer extID, + ffi.Pointer info); +typedef CFXMLParserHandleErrorCallBack + = ffi.Pointer>; +typedef CFXMLParserHandleErrorCallBackFunction = Boolean Function( + CFXMLParserRef parser, CFIndex error, ffi.Pointer info); +typedef DartCFXMLParserHandleErrorCallBackFunction = DartBoolean Function( + CFXMLParserRef parser, + CFXMLParserStatusCode error, + ffi.Pointer info); - external CSSM_CRL_PAIR_PTR PairCrlList; +enum CFXMLParserStatusCode { + kCFXMLStatusParseNotBegun(-2), + kCFXMLStatusParseInProgress(-1), + kCFXMLStatusParseSuccessful(0), + kCFXMLErrorUnexpectedEOF(1), + kCFXMLErrorUnknownEncoding(2), + kCFXMLErrorEncodingConversionFailure(3), + kCFXMLErrorMalformedProcessingInstruction(4), + kCFXMLErrorMalformedDTD(5), + kCFXMLErrorMalformedName(6), + kCFXMLErrorMalformedCDSect(7), + kCFXMLErrorMalformedCloseTag(8), + kCFXMLErrorMalformedStartTag(9), + kCFXMLErrorMalformedDocument(10), + kCFXMLErrorElementlessDocument(11), + kCFXMLErrorMalformedComment(12), + kCFXMLErrorMalformedCharacterReference(13), + kCFXMLErrorMalformedParsedCharacterData(14), + kCFXMLErrorNoData(15); + + final int value; + const CFXMLParserStatusCode(this.value); + + static CFXMLParserStatusCode fromValue(int value) => switch (value) { + -2 => kCFXMLStatusParseNotBegun, + -1 => kCFXMLStatusParseInProgress, + 0 => kCFXMLStatusParseSuccessful, + 1 => kCFXMLErrorUnexpectedEOF, + 2 => kCFXMLErrorUnknownEncoding, + 3 => kCFXMLErrorEncodingConversionFailure, + 4 => kCFXMLErrorMalformedProcessingInstruction, + 5 => kCFXMLErrorMalformedDTD, + 6 => kCFXMLErrorMalformedName, + 7 => kCFXMLErrorMalformedCDSect, + 8 => kCFXMLErrorMalformedCloseTag, + 9 => kCFXMLErrorMalformedStartTag, + 10 => kCFXMLErrorMalformedDocument, + 11 => kCFXMLErrorElementlessDocument, + 12 => kCFXMLErrorMalformedComment, + 13 => kCFXMLErrorMalformedCharacterReference, + 14 => kCFXMLErrorMalformedParsedCharacterData, + 15 => kCFXMLErrorNoData, + _ => throw ArgumentError( + "Unknown value for CFXMLParserStatusCode: $value"), + }; } -typedef CSSM_ENCODED_CRL_PTR = ffi.Pointer; -typedef CSSM_PARSED_CRL_PTR = ffi.Pointer; -typedef CSSM_CRL_PAIR_PTR = ffi.Pointer; -typedef CSSM_CRLGROUP_TYPE = uint32; +final class CFXMLParserContext extends ffi.Struct { + @CFIndex() + external int version; -final class cssm_fieldgroup extends ffi.Struct { - @ffi.Int() - external int NumberOfFields; + external ffi.Pointer info; - external CSSM_FIELD_PTR Fields; -} + external CFXMLParserRetainCallBack retain; -final class cssm_evidence extends ffi.Struct { - @CSSM_EVIDENCE_FORM() - external int EvidenceForm; + external CFXMLParserReleaseCallBack release; - external ffi.Pointer Evidence; + external CFXMLParserCopyDescriptionCallBack copyDescription; } -typedef CSSM_EVIDENCE_FORM = uint32; +typedef CFXMLParserRetainCallBack + = ffi.Pointer>; +typedef CFXMLParserRetainCallBackFunction = ffi.Pointer Function( + ffi.Pointer info); +typedef CFXMLParserReleaseCallBack + = ffi.Pointer>; +typedef CFXMLParserReleaseCallBackFunction = ffi.Void Function( + ffi.Pointer info); +typedef DartCFXMLParserReleaseCallBackFunction = void Function( + ffi.Pointer info); +typedef CFXMLParserCopyDescriptionCallBack = ffi + .Pointer>; +typedef CFXMLParserCopyDescriptionCallBackFunction = CFStringRef Function( + ffi.Pointer info); -final class cssm_tp_verify_context extends ffi.Struct { - @CSSM_TP_ACTION() - external int Action; +final class cssm_data extends ffi.Struct { + @ffi.Size() + external int Length; - external SecAsn1Item ActionData; + external ffi.Pointer Data; +} - external CSSM_CRLGROUP Crls; +final class SecAsn1AlgId extends ffi.Struct { + external SecAsn1Oid algorithm; - external CSSM_TP_CALLERAUTH_CONTEXT_PTR Cred; + external SecAsn1Item parameters; } -typedef CSSM_TP_ACTION = uint32; -typedef CSSM_CRLGROUP = cssm_crlgroup; -typedef CSSM_TP_CALLERAUTH_CONTEXT_PTR - = ffi.Pointer; +typedef SecAsn1Oid = cssm_data; +typedef SecAsn1Item = cssm_data; -final class cssm_tp_verify_context_result extends ffi.Struct { - @uint32() - external int NumberOfEvidences; +final class SecAsn1PubKeyInfo extends ffi.Struct { + external SecAsn1AlgId algorithm; - external CSSM_EVIDENCE_PTR Evidence; + external SecAsn1Item subjectPublicKey; } -typedef CSSM_EVIDENCE_PTR = ffi.Pointer; +final class SecAsn1Template_struct extends ffi.Struct { + @ffi.Uint32() + external int kind; -final class cssm_tp_request_set extends ffi.Struct { - @uint32() - external int NumberOfRequests; + @ffi.Uint32() + external int offset; - external ffi.Pointer Requests; + external ffi.Pointer sub; + + @ffi.Uint32() + external int size; } -final class cssm_tp_result_set extends ffi.Struct { +final class cssm_guid extends ffi.Struct { @uint32() - external int NumberOfResults; + external int Data1; - external ffi.Pointer Results; -} + @uint16() + external int Data2; -final class cssm_tp_confirm_response extends ffi.Struct { - @uint32() - external int NumberOfResponses; + @uint16() + external int Data3; - external CSSM_TP_CONFIRM_STATUS_PTR Responses; + @ffi.Array.multi([8]) + external ffi.Array Data4; } -typedef CSSM_TP_CONFIRM_STATUS_PTR = ffi.Pointer; - -final class cssm_tp_certissue_input extends ffi.Struct { - external CSSM_SUBSERVICE_UID CSPSubserviceUid; +typedef uint32 = ffi.Uint32; +typedef Dartuint32 = int; +typedef uint16 = ffi.Uint16; +typedef Dartuint16 = int; +typedef uint8 = ffi.Uint8; +typedef Dartuint8 = int; - @CSSM_CL_HANDLE() - external int CLHandle; +final class cssm_version extends ffi.Struct { + @uint32() + external int Major; @uint32() - external int NumberOfTemplateFields; + external int Minor; +} - external CSSM_FIELD_PTR SubjectCertFields; +final class cssm_subservice_uid extends ffi.Struct { + external CSSM_GUID Guid; - @CSSM_TP_SERVICES() - external int MoreServiceRequests; + external CSSM_VERSION Version; @uint32() - external int NumberOfServiceControls; - - external CSSM_FIELD_PTR ServiceControls; + external int SubserviceId; - external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; + @CSSM_SERVICE_TYPE() + external int SubserviceType; } -typedef CSSM_TP_SERVICES = uint32; - -final class cssm_tp_certissue_output extends ffi.Struct { - @CSSM_TP_CERTISSUE_STATUS() - external int IssueStatus; +typedef CSSM_GUID = cssm_guid; +typedef CSSM_VERSION = cssm_version; +typedef CSSM_SERVICE_TYPE = CSSM_SERVICE_MASK; +typedef CSSM_SERVICE_MASK = uint32; - external CSSM_CERTGROUP_PTR CertGroup; +final class cssm_net_address extends ffi.Struct { + @CSSM_NET_ADDRESS_TYPE() + external int AddressType; - @CSSM_TP_SERVICES() - external int PerformedServiceRequests; + external SecAsn1Item Address; } -typedef CSSM_TP_CERTISSUE_STATUS = uint32; -typedef CSSM_CERTGROUP_PTR = ffi.Pointer; +typedef CSSM_NET_ADDRESS_TYPE = uint32; -final class cssm_tp_certchange_input extends ffi.Struct { - @CSSM_TP_CERTCHANGE_ACTION() - external int Action; +final class cssm_crypto_data extends ffi.Struct { + external SecAsn1Item Param; - @CSSM_TP_CERTCHANGE_REASON() - external int Reason; + external CSSM_CALLBACK Callback; - @CSSM_CL_HANDLE() - external int CLHandle; + external ffi.Pointer CallerCtx; +} + +typedef CSSM_CALLBACK = ffi.Pointer>; +typedef CSSM_CALLBACKFunction = CSSM_RETURN Function( + CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); +typedef DartCSSM_CALLBACKFunction = Dartsint32 Function( + CSSM_DATA_PTR OutData, ffi.Pointer CallerCtx); +typedef CSSM_RETURN = sint32; +typedef sint32 = ffi.Int32; +typedef Dartsint32 = int; +typedef CSSM_DATA_PTR = ffi.Pointer; - external CSSM_DATA_PTR Cert; +final class cssm_list_element extends ffi.Struct { + external ffi.Pointer NextElement; - external CSSM_FIELD_PTR ChangeInfo; + @CSSM_WORDID_TYPE() + external int WordID; - external CSSM_TIMESTRING StartTime; + @CSSM_LIST_ELEMENT_TYPE() + external int ElementType; - external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; + external UnnamedUnion2 Element; } -typedef CSSM_TP_CERTCHANGE_ACTION = uint32; -typedef CSSM_TP_CERTCHANGE_REASON = uint32; +typedef CSSM_WORDID_TYPE = sint32; +typedef CSSM_LIST_ELEMENT_TYPE = uint32; -final class cssm_tp_certchange_output extends ffi.Struct { - @CSSM_TP_CERTCHANGE_STATUS() - external int ActionStatus; +final class UnnamedUnion2 extends ffi.Union { + external CSSM_LIST Sublist; - external CSSM_FIELD RevokeInfo; + external SecAsn1Item Word; } -typedef CSSM_TP_CERTCHANGE_STATUS = uint32; -typedef CSSM_FIELD = cssm_field; +typedef CSSM_LIST = cssm_list; -final class cssm_tp_certverify_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; +final class cssm_list extends ffi.Struct { + @CSSM_LIST_TYPE() + external int ListType; - external CSSM_DATA_PTR Cert; + external CSSM_LIST_ELEMENT_PTR Head; - external CSSM_TP_VERIFY_CONTEXT_PTR VerifyContext; + external CSSM_LIST_ELEMENT_PTR Tail; } -typedef CSSM_TP_VERIFY_CONTEXT_PTR = ffi.Pointer; - -final class cssm_tp_certverify_output extends ffi.Struct { - @CSSM_TP_CERTVERIFY_STATUS() - external int VerifyStatus; - - @uint32() - external int NumberOfEvidence; +typedef CSSM_LIST_TYPE = uint32; +typedef CSSM_LIST_ELEMENT_PTR = ffi.Pointer; - external CSSM_EVIDENCE_PTR Evidence; -} +final class CSSM_TUPLE extends ffi.Struct { + external CSSM_LIST Issuer; -typedef CSSM_TP_CERTVERIFY_STATUS = uint32; + external CSSM_LIST Subject; -final class cssm_tp_certnotarize_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; + @CSSM_BOOL() + external int Delegate; - @uint32() - external int NumberOfFields; + external CSSM_LIST AuthorizationTag; - external CSSM_FIELD_PTR MoreFields; + external CSSM_LIST ValidityPeriod; +} - external CSSM_FIELD_PTR SignScope; +typedef CSSM_BOOL = sint32; +final class cssm_tuplegroup extends ffi.Struct { @uint32() - external int ScopeSize; + external int NumberOfTuples; - @CSSM_TP_SERVICES() - external int MoreServiceRequests; + external CSSM_TUPLE_PTR Tuples; +} - @uint32() - external int NumberOfServiceControls; +typedef CSSM_TUPLE_PTR = ffi.Pointer; - external CSSM_FIELD_PTR ServiceControls; +final class cssm_sample extends ffi.Struct { + external CSSM_LIST TypedSample; - external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; + external ffi.Pointer Verifier; } -final class cssm_tp_certnotarize_output extends ffi.Struct { - @CSSM_TP_CERTNOTARIZE_STATUS() - external int NotarizeStatus; +typedef CSSM_SUBSERVICE_UID = cssm_subservice_uid; - external CSSM_CERTGROUP_PTR NotarizedCertGroup; +final class cssm_samplegroup extends ffi.Struct { + @uint32() + external int NumberOfSamples; - @CSSM_TP_SERVICES() - external int PerformedServiceRequests; + external ffi.Pointer Samples; } -typedef CSSM_TP_CERTNOTARIZE_STATUS = uint32; +typedef CSSM_SAMPLE = cssm_sample; -final class cssm_tp_certreclaim_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; +final class cssm_memory_funcs extends ffi.Struct { + external CSSM_MALLOC malloc_func; - @uint32() - external int NumberOfSelectionFields; + external CSSM_FREE free_func; - external CSSM_FIELD_PTR SelectionFields; + external CSSM_REALLOC realloc_func; - external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; + external CSSM_CALLOC calloc_func; + + external ffi.Pointer AllocRef; } -final class cssm_tp_certreclaim_output extends ffi.Struct { - @CSSM_TP_CERTRECLAIM_STATUS() - external int ReclaimStatus; +typedef CSSM_MALLOC = ffi.Pointer>; +typedef CSSM_MALLOCFunction = ffi.Pointer Function( + CSSM_SIZE size, ffi.Pointer allocref); +typedef DartCSSM_MALLOCFunction = ffi.Pointer Function( + DartCSSM_SIZE size, ffi.Pointer allocref); +typedef CSSM_SIZE = ffi.Size; +typedef DartCSSM_SIZE = int; +typedef CSSM_FREE = ffi.Pointer>; +typedef CSSM_FREEFunction = ffi.Void Function( + ffi.Pointer memblock, ffi.Pointer allocref); +typedef DartCSSM_FREEFunction = void Function( + ffi.Pointer memblock, ffi.Pointer allocref); +typedef CSSM_REALLOC = ffi.Pointer>; +typedef CSSM_REALLOCFunction = ffi.Pointer Function( + ffi.Pointer memblock, + CSSM_SIZE size, + ffi.Pointer allocref); +typedef DartCSSM_REALLOCFunction = ffi.Pointer Function( + ffi.Pointer memblock, + DartCSSM_SIZE size, + ffi.Pointer allocref); +typedef CSSM_CALLOC = ffi.Pointer>; +typedef CSSM_CALLOCFunction = ffi.Pointer Function( + uint32 num, CSSM_SIZE size, ffi.Pointer allocref); +typedef DartCSSM_CALLOCFunction = ffi.Pointer Function( + Dartuint32 num, DartCSSM_SIZE size, ffi.Pointer allocref); - external CSSM_CERTGROUP_PTR ReclaimedCertGroup; +final class cssm_encoded_cert extends ffi.Struct { + @CSSM_CERT_TYPE() + external int CertType; - @CSSM_LONG_HANDLE() - external int KeyCacheHandle; + @CSSM_CERT_ENCODING() + external int CertEncoding; + + external SecAsn1Item CertBlob; } -typedef CSSM_TP_CERTRECLAIM_STATUS = uint32; -typedef CSSM_LONG_HANDLE = uint64; -typedef uint64 = ffi.Uint64; -typedef Dartuint64 = int; +typedef CSSM_CERT_TYPE = uint32; +typedef CSSM_CERT_ENCODING = uint32; -final class cssm_tp_crlissue_input extends ffi.Struct { - @CSSM_CL_HANDLE() - external int CLHandle; +final class cssm_parsed_cert extends ffi.Struct { + @CSSM_CERT_TYPE() + external int CertType; - @uint32() - external int CrlIdentifier; + @CSSM_CERT_PARSE_FORMAT() + external int ParsedCertFormat; - external CSSM_TIMESTRING CrlThisTime; + external ffi.Pointer ParsedCert; +} - external CSSM_FIELD_PTR PolicyIdentifier; +typedef CSSM_CERT_PARSE_FORMAT = uint32; - external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; +final class cssm_cert_pair extends ffi.Struct { + external CSSM_ENCODED_CERT EncodedCert; + + external CSSM_PARSED_CERT ParsedCert; } -final class cssm_tp_crlissue_output extends ffi.Struct { - @CSSM_TP_CRLISSUE_STATUS() - external int IssueStatus; +typedef CSSM_ENCODED_CERT = cssm_encoded_cert; +typedef CSSM_PARSED_CERT = cssm_parsed_cert; - external CSSM_ENCODED_CRL_PTR Crl; +final class cssm_certgroup extends ffi.Struct { + @CSSM_CERT_TYPE() + external int CertType; - external CSSM_TIMESTRING CrlNextTime; -} + @CSSM_CERT_ENCODING() + external int CertEncoding; -typedef CSSM_TP_CRLISSUE_STATUS = uint32; + @uint32() + external int NumCerts; -final class cssm_cert_bundle_header extends ffi.Struct { - @CSSM_CERT_BUNDLE_TYPE() - external int BundleType; + external UnnamedUnion3 GroupList; - @CSSM_CERT_BUNDLE_ENCODING() - external int BundleEncoding; + @CSSM_CERTGROUP_TYPE() + external int CertGroupType; + + external ffi.Pointer Reserved; } -typedef CSSM_CERT_BUNDLE_TYPE = uint32; -typedef CSSM_CERT_BUNDLE_ENCODING = uint32; +final class UnnamedUnion3 extends ffi.Union { + external CSSM_DATA_PTR CertList; -final class cssm_cert_bundle extends ffi.Struct { - external CSSM_CERT_BUNDLE_HEADER BundleHeader; + external CSSM_ENCODED_CERT_PTR EncodedCertList; - external SecAsn1Item Bundle; + external CSSM_PARSED_CERT_PTR ParsedCertList; + + external CSSM_CERT_PAIR_PTR PairCertList; } -typedef CSSM_CERT_BUNDLE_HEADER = cssm_cert_bundle_header; +typedef CSSM_ENCODED_CERT_PTR = ffi.Pointer; +typedef CSSM_PARSED_CERT_PTR = ffi.Pointer; +typedef CSSM_CERT_PAIR_PTR = ffi.Pointer; +typedef CSSM_CERTGROUP_TYPE = uint32; -final class cssm_db_attribute_info extends ffi.Struct { - @CSSM_DB_ATTRIBUTE_NAME_FORMAT() - external int AttributeNameFormat; +final class cssm_base_certs extends ffi.Struct { + @CSSM_TP_HANDLE() + external int TPHandle; - external cssm_db_attribute_label Label; + @CSSM_CL_HANDLE() + external int CLHandle; - @CSSM_DB_ATTRIBUTE_FORMAT() - external int AttributeFormat; + external CSSM_CERTGROUP Certs; } -typedef CSSM_DB_ATTRIBUTE_NAME_FORMAT = uint32; +typedef CSSM_TP_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_MODULE_HANDLE = CSSM_HANDLE; +typedef CSSM_HANDLE = CSSM_INTPTR; +typedef CSSM_INTPTR = ffi.IntPtr; +typedef DartCSSM_INTPTR = int; +typedef CSSM_CL_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_CERTGROUP = cssm_certgroup; -final class cssm_db_attribute_label extends ffi.Union { - external ffi.Pointer AttributeName; +final class cssm_access_credentials extends ffi.Struct { + @ffi.Array.multi([68]) + external ffi.Array EntryTag; - external SecAsn1Oid AttributeOID; + external CSSM_BASE_CERTS BaseCerts; - @uint32() - external int AttributeID; -} + external CSSM_SAMPLEGROUP Samples; -typedef CSSM_DB_ATTRIBUTE_FORMAT = uint32; + external CSSM_CHALLENGE_CALLBACK Callback; -final class cssm_db_attribute_data extends ffi.Struct { - external CSSM_DB_ATTRIBUTE_INFO Info; + external ffi.Pointer CallerCtx; +} + +typedef CSSM_BASE_CERTS = cssm_base_certs; +typedef CSSM_SAMPLEGROUP = cssm_samplegroup; +typedef CSSM_CHALLENGE_CALLBACK + = ffi.Pointer>; +typedef CSSM_CHALLENGE_CALLBACKFunction = CSSM_RETURN Function( + ffi.Pointer Challenge, + CSSM_SAMPLEGROUP_PTR Response, + ffi.Pointer CallerCtx, + ffi.Pointer MemFuncs); +typedef DartCSSM_CHALLENGE_CALLBACKFunction = Dartsint32 Function( + ffi.Pointer Challenge, + CSSM_SAMPLEGROUP_PTR Response, + ffi.Pointer CallerCtx, + ffi.Pointer MemFuncs); +typedef CSSM_SAMPLEGROUP_PTR = ffi.Pointer; +typedef CSSM_MEMORY_FUNCS = cssm_memory_funcs; +final class cssm_authorizationgroup extends ffi.Struct { @uint32() - external int NumberOfValues; + external int NumberOfAuthTags; - external CSSM_DATA_PTR Value; + external ffi.Pointer AuthTags; } -typedef CSSM_DB_ATTRIBUTE_INFO = cssm_db_attribute_info; - -final class cssm_db_record_attribute_info extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int DataRecordType; +typedef CSSM_ACL_AUTHORIZATION_TAG = sint32; - @uint32() - external int NumberOfAttributes; +final class cssm_acl_validity_period extends ffi.Struct { + external SecAsn1Item StartDate; - external CSSM_DB_ATTRIBUTE_INFO_PTR AttributeInfo; + external SecAsn1Item EndDate; } -typedef CSSM_DB_RECORDTYPE = uint32; -typedef CSSM_DB_ATTRIBUTE_INFO_PTR = ffi.Pointer; +final class cssm_acl_entry_prototype extends ffi.Struct { + external CSSM_LIST TypedSubject; -final class cssm_db_record_attribute_data extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int DataRecordType; + @CSSM_BOOL() + external int Delegate; - @uint32() - external int SemanticInformation; + external CSSM_AUTHORIZATIONGROUP Authorization; - @uint32() - external int NumberOfAttributes; + external CSSM_ACL_VALIDITY_PERIOD TimeRange; - external CSSM_DB_ATTRIBUTE_DATA_PTR AttributeData; + @ffi.Array.multi([68]) + external ffi.Array EntryTag; } -typedef CSSM_DB_ATTRIBUTE_DATA_PTR = ffi.Pointer; +typedef CSSM_AUTHORIZATIONGROUP = cssm_authorizationgroup; +typedef CSSM_ACL_VALIDITY_PERIOD = cssm_acl_validity_period; -final class cssm_db_parsing_module_info extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int RecordType; +final class cssm_acl_owner_prototype extends ffi.Struct { + external CSSM_LIST TypedSubject; - external CSSM_SUBSERVICE_UID ModuleSubserviceUid; + @CSSM_BOOL() + external int Delegate; } -final class cssm_db_index_info extends ffi.Struct { - @CSSM_DB_INDEX_TYPE() - external int IndexType; +final class cssm_acl_entry_input extends ffi.Struct { + external CSSM_ACL_ENTRY_PROTOTYPE Prototype; - @CSSM_DB_INDEXED_DATA_LOCATION() - external int IndexedDataLocation; + external CSSM_ACL_SUBJECT_CALLBACK Callback; - external CSSM_DB_ATTRIBUTE_INFO Info; + external ffi.Pointer CallerContext; } -typedef CSSM_DB_INDEX_TYPE = uint32; -typedef CSSM_DB_INDEXED_DATA_LOCATION = uint32; +typedef CSSM_ACL_ENTRY_PROTOTYPE = cssm_acl_entry_prototype; +typedef CSSM_ACL_SUBJECT_CALLBACK + = ffi.Pointer>; +typedef CSSM_ACL_SUBJECT_CALLBACKFunction = CSSM_RETURN Function( + ffi.Pointer SubjectRequest, + CSSM_LIST_PTR SubjectResponse, + ffi.Pointer CallerContext, + ffi.Pointer MemFuncs); +typedef DartCSSM_ACL_SUBJECT_CALLBACKFunction = Dartsint32 Function( + ffi.Pointer SubjectRequest, + CSSM_LIST_PTR SubjectResponse, + ffi.Pointer CallerContext, + ffi.Pointer MemFuncs); +typedef CSSM_LIST_PTR = ffi.Pointer; -final class cssm_db_unique_record extends ffi.Struct { - external CSSM_DB_INDEX_INFO RecordLocator; +final class cssm_resource_control_context extends ffi.Struct { + external CSSM_ACCESS_CREDENTIALS_PTR AccessCred; - external SecAsn1Item RecordIdentifier; + external CSSM_ACL_ENTRY_INPUT InitialAclEntry; } -typedef CSSM_DB_INDEX_INFO = cssm_db_index_info; - -final class cssm_db_record_index_info extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int DataRecordType; +typedef CSSM_ACCESS_CREDENTIALS_PTR = ffi.Pointer; +typedef CSSM_ACL_ENTRY_INPUT = cssm_acl_entry_input; - @uint32() - external int NumberOfIndexes; +final class cssm_acl_entry_info extends ffi.Struct { + external CSSM_ACL_ENTRY_PROTOTYPE EntryPublicInfo; - external CSSM_DB_INDEX_INFO_PTR IndexInfo; + @CSSM_ACL_HANDLE() + external int EntryHandle; } -typedef CSSM_DB_INDEX_INFO_PTR = ffi.Pointer; - -final class cssm_dbinfo extends ffi.Struct { - @uint32() - external int NumberOfRecordTypes; +typedef CSSM_ACL_HANDLE = CSSM_HANDLE; - external CSSM_DB_PARSING_MODULE_INFO_PTR DefaultParsingModules; +final class cssm_acl_edit extends ffi.Struct { + @CSSM_ACL_EDIT_MODE() + external int EditMode; - external CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR RecordAttributeNames; + @CSSM_ACL_HANDLE() + external int OldEntryHandle; - external CSSM_DB_RECORD_INDEX_INFO_PTR RecordIndexes; + external ffi.Pointer NewEntry; +} - @CSSM_BOOL() - external int IsLocal; +typedef CSSM_ACL_EDIT_MODE = uint32; - external ffi.Pointer AccessPath; +final class cssm_func_name_addr extends ffi.Struct { + @ffi.Array.multi([68]) + external ffi.Array Name; - external ffi.Pointer Reserved; + external CSSM_PROC_ADDR Address; } -typedef CSSM_DB_PARSING_MODULE_INFO_PTR - = ffi.Pointer; -typedef CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR - = ffi.Pointer; -typedef CSSM_DB_RECORD_INDEX_INFO_PTR = ffi.Pointer; +typedef CSSM_PROC_ADDR + = ffi.Pointer>; +typedef CSSM_PROC_ADDRFunction = ffi.Void Function(); +typedef DartCSSM_PROC_ADDRFunction = void Function(); -final class cssm_selection_predicate extends ffi.Struct { - @CSSM_DB_OPERATOR() - external int DbOperator; +final class cssm_date extends ffi.Struct { + @ffi.Array.multi([4]) + external ffi.Array Year; - external CSSM_DB_ATTRIBUTE_DATA Attribute; -} + @ffi.Array.multi([2]) + external ffi.Array Month; -typedef CSSM_DB_OPERATOR = uint32; -typedef CSSM_DB_ATTRIBUTE_DATA = cssm_db_attribute_data; + @ffi.Array.multi([2]) + external ffi.Array Day; +} -final class cssm_query_limits extends ffi.Struct { +final class cssm_range extends ffi.Struct { @uint32() - external int TimeLimit; + external int Min; @uint32() - external int SizeLimit; + external int Max; } -final class cssm_query extends ffi.Struct { - @CSSM_DB_RECORDTYPE() - external int RecordType; +final class cssm_query_size_data extends ffi.Struct { + @uint32() + external int SizeInputBlock; - @CSSM_DB_CONJUNCTIVE() - external int Conjunctive; + @uint32() + external int SizeOutputBlock; +} +final class cssm_key_size extends ffi.Struct { @uint32() - external int NumSelectionPredicates; + external int LogicalKeySizeInBits; - external CSSM_SELECTION_PREDICATE_PTR SelectionPredicate; + @uint32() + external int EffectiveKeySizeInBits; +} - external CSSM_QUERY_LIMITS QueryLimits; +final class cssm_keyheader extends ffi.Struct { + @CSSM_HEADERVERSION() + external int HeaderVersion; - @CSSM_QUERY_FLAGS() - external int QueryFlags; -} + external CSSM_GUID CspId; -typedef CSSM_DB_CONJUNCTIVE = uint32; -typedef CSSM_SELECTION_PREDICATE_PTR = ffi.Pointer; -typedef CSSM_QUERY_LIMITS = cssm_query_limits; -typedef CSSM_QUERY_FLAGS = uint32; + @CSSM_KEYBLOB_TYPE() + external int BlobType; -final class cssm_dl_pkcs11_attributes extends ffi.Struct { - @uint32() - external int DeviceAccessFlags; -} + @CSSM_KEYBLOB_FORMAT() + external int Format; -final class cssm_name_list extends ffi.Struct { - @uint32() - external int NumStrings; + @CSSM_ALGORITHMS() + external int AlgorithmId; - external ffi.Pointer> String; -} + @CSSM_KEYCLASS() + external int KeyClass; -final class cssm_db_schema_attribute_info extends ffi.Struct { @uint32() - external int AttributeId; + external int LogicalKeySizeInBits; - external ffi.Pointer AttributeName; + @CSSM_KEYATTR_FLAGS() + external int KeyAttr; - external SecAsn1Oid AttributeNameID; + @CSSM_KEYUSE() + external int KeyUsage; - @CSSM_DB_ATTRIBUTE_FORMAT() - external int DataType; -} + external CSSM_DATE StartDate; -final class cssm_db_schema_index_info extends ffi.Struct { - @uint32() - external int AttributeId; + external CSSM_DATE EndDate; + + @CSSM_ALGORITHMS() + external int WrapAlgorithmId; + + @CSSM_ENCRYPT_MODE() + external int WrapMode; @uint32() - external int IndexId; + external int Reserved; +} - @CSSM_DB_INDEX_TYPE() - external int IndexType; +typedef CSSM_HEADERVERSION = uint32; +typedef CSSM_KEYBLOB_TYPE = uint32; +typedef CSSM_KEYBLOB_FORMAT = uint32; +typedef CSSM_ALGORITHMS = uint32; +typedef CSSM_KEYCLASS = uint32; +typedef CSSM_KEYATTR_FLAGS = uint32; +typedef CSSM_KEYUSE = uint32; +typedef CSSM_DATE = cssm_date; +typedef CSSM_ENCRYPT_MODE = uint32; - @CSSM_DB_INDEXED_DATA_LOCATION() - external int IndexedDataLocation; +final class cssm_key extends ffi.Struct { + external CSSM_KEYHEADER KeyHeader; + + external SecAsn1Item KeyData; } -final class cssm_x509_type_value_pair extends ffi.Struct { - external SecAsn1Oid type; +typedef CSSM_KEYHEADER = cssm_keyheader; - @CSSM_BER_TAG() - external int valueType; +final class cssm_dl_db_handle extends ffi.Struct { + @CSSM_DL_HANDLE() + external int DLHandle; - external SecAsn1Item value; + @CSSM_DB_HANDLE() + external int DBHandle; } -typedef CSSM_BER_TAG = uint8; +typedef CSSM_DL_HANDLE = CSSM_MODULE_HANDLE; +typedef CSSM_DB_HANDLE = CSSM_MODULE_HANDLE; + +final class cssm_context_attribute extends ffi.Struct { + @CSSM_ATTRIBUTE_TYPE() + external int AttributeType; -final class cssm_x509_rdn extends ffi.Struct { @uint32() - external int numberOfPairs; + external int AttributeLength; - external CSSM_X509_TYPE_VALUE_PAIR_PTR AttributeTypeAndValue; + external cssm_context_attribute_value Attribute; } -typedef CSSM_X509_TYPE_VALUE_PAIR_PTR = ffi.Pointer; +typedef CSSM_ATTRIBUTE_TYPE = uint32; + +final class cssm_context_attribute_value extends ffi.Union { + external ffi.Pointer String; -final class cssm_x509_name extends ffi.Struct { @uint32() - external int numberOfRDNs; + external int Uint32; - external CSSM_X509_RDN_PTR RelativeDistinguishedName; -} + external CSSM_ACCESS_CREDENTIALS_PTR AccessCredentials; -typedef CSSM_X509_RDN_PTR = ffi.Pointer; + external CSSM_KEY_PTR Key; -final class cssm_x509_time extends ffi.Struct { - @CSSM_BER_TAG() - external int timeType; + external CSSM_DATA_PTR Data; - external SecAsn1Item time; -} + @CSSM_PADDING() + external int Padding; -final class x509_validity extends ffi.Struct { - external CSSM_X509_TIME notBefore; + external CSSM_DATE_PTR Date; - external CSSM_X509_TIME notAfter; -} + external CSSM_RANGE_PTR Range; -typedef CSSM_X509_TIME = cssm_x509_time; + external CSSM_CRYPTO_DATA_PTR CryptoData; -final class cssm_x509ext_basicConstraints extends ffi.Struct { - @CSSM_BOOL() - external int cA; + external CSSM_VERSION_PTR Version; - @CSSM_X509_OPTION() - external int pathLenConstraintPresent; + external CSSM_DL_DB_HANDLE_PTR DLDBHandle; - @uint32() - external int pathLenConstraint; + external ffi.Pointer KRProfile; } -typedef CSSM_X509_OPTION = CSSM_BOOL; - -abstract class extension_data_format { - static const int CSSM_X509_DATAFORMAT_ENCODED = 0; - static const int CSSM_X509_DATAFORMAT_PARSED = 1; - static const int CSSM_X509_DATAFORMAT_PAIR = 2; -} +typedef CSSM_KEY_PTR = ffi.Pointer; +typedef CSSM_PADDING = uint32; +typedef CSSM_DATE_PTR = ffi.Pointer; +typedef CSSM_RANGE_PTR = ffi.Pointer; +typedef CSSM_CRYPTO_DATA_PTR = ffi.Pointer; +typedef CSSM_VERSION_PTR = ffi.Pointer; +typedef CSSM_DL_DB_HANDLE_PTR = ffi.Pointer; -final class cssm_x509_extensionTagAndValue extends ffi.Struct { - @CSSM_BER_TAG() - external int type; +final class cssm_kr_profile extends ffi.Opaque {} - external SecAsn1Item value; -} +final class cssm_context extends ffi.Struct { + @CSSM_CONTEXT_TYPE() + external int ContextType; -final class cssm_x509ext_pair extends ffi.Struct { - external CSSM_X509EXT_TAGandVALUE tagAndValue; + @CSSM_ALGORITHMS() + external int AlgorithmType; - external ffi.Pointer parsedValue; -} + @uint32() + external int NumberOfAttributes; -typedef CSSM_X509EXT_TAGandVALUE = cssm_x509_extensionTagAndValue; + external CSSM_CONTEXT_ATTRIBUTE_PTR ContextAttributes; -final class cssm_x509_extension extends ffi.Struct { - external SecAsn1Oid extnId; + @CSSM_CSP_HANDLE() + external int CSPHandle; @CSSM_BOOL() - external int critical; + external int Privileged; - @ffi.Int32() - external int format; + @uint32() + external int EncryptionProhibited; - external cssm_x509ext_value value; + @uint32() + external int WorkFactor; - external SecAsn1Item BERvalue; + @uint32() + external int Reserved; } -final class cssm_x509ext_value extends ffi.Union { - external ffi.Pointer tagAndValue; +typedef CSSM_CONTEXT_TYPE = uint32; +typedef CSSM_CONTEXT_ATTRIBUTE_PTR = ffi.Pointer; +typedef CSSM_CSP_HANDLE = CSSM_MODULE_HANDLE; - external ffi.Pointer parsedValue; +final class cssm_pkcs1_oaep_params extends ffi.Struct { + @uint32() + external int HashAlgorithm; - external ffi.Pointer valuePair; -} + external SecAsn1Item HashParams; -typedef CSSM_X509EXT_PAIR = cssm_x509ext_pair; + @CSSM_PKCS_OAEP_MGF() + external int MGF; -final class cssm_x509_extensions extends ffi.Struct { - @uint32() - external int numberOfExtensions; + external SecAsn1Item MGFParams; - external CSSM_X509_EXTENSION_PTR extensions; + @CSSM_PKCS_OAEP_PSOURCE() + external int PSource; + + external SecAsn1Item PSourceParams; } -typedef CSSM_X509_EXTENSION_PTR = ffi.Pointer; +typedef CSSM_PKCS_OAEP_MGF = uint32; +typedef CSSM_PKCS_OAEP_PSOURCE = uint32; -final class cssm_x509_tbs_certificate extends ffi.Struct { - external SecAsn1Item version; +final class cssm_csp_operational_statistics extends ffi.Struct { + @CSSM_BOOL() + external int UserAuthenticated; - external SecAsn1Item serialNumber; + @CSSM_CSP_FLAGS() + external int DeviceFlags; - external SecAsn1AlgId signature; + @uint32() + external int TokenMaxSessionCount; - external CSSM_X509_NAME issuer; + @uint32() + external int TokenOpenedSessionCount; - external CSSM_X509_VALIDITY validity; + @uint32() + external int TokenMaxRWSessionCount; - external CSSM_X509_NAME subject; + @uint32() + external int TokenOpenedRWSessionCount; - external SecAsn1PubKeyInfo subjectPublicKeyInfo; + @uint32() + external int TokenTotalPublicMem; - external SecAsn1Item issuerUniqueIdentifier; + @uint32() + external int TokenFreePublicMem; - external SecAsn1Item subjectUniqueIdentifier; + @uint32() + external int TokenTotalPrivateMem; - external CSSM_X509_EXTENSIONS extensions; + @uint32() + external int TokenFreePrivateMem; } -typedef CSSM_X509_NAME = cssm_x509_name; -typedef CSSM_X509_VALIDITY = x509_validity; -typedef CSSM_X509_EXTENSIONS = cssm_x509_extensions; +typedef CSSM_CSP_FLAGS = uint32; -final class cssm_x509_signature extends ffi.Struct { - external SecAsn1AlgId algorithmIdentifier; +final class cssm_pkcs5_pbkdf1_params extends ffi.Struct { + external SecAsn1Item Passphrase; - external SecAsn1Item encrypted; + external SecAsn1Item InitVector; } -final class cssm_x509_signed_certificate extends ffi.Struct { - external CSSM_X509_TBS_CERTIFICATE certificate; +final class cssm_pkcs5_pbkdf2_params extends ffi.Struct { + external SecAsn1Item Passphrase; - external CSSM_X509_SIGNATURE signature; + @CSSM_PKCS5_PBKDF2_PRF() + external int PseudoRandomFunction; } -typedef CSSM_X509_TBS_CERTIFICATE = cssm_x509_tbs_certificate; -typedef CSSM_X509_SIGNATURE = cssm_x509_signature; +typedef CSSM_PKCS5_PBKDF2_PRF = uint32; -final class cssm_x509ext_policyQualifierInfo extends ffi.Struct { - external SecAsn1Oid policyQualifierId; +final class cssm_kea_derive_params extends ffi.Struct { + external SecAsn1Item Rb; - external SecAsn1Item value; + external SecAsn1Item Yb; } -final class cssm_x509ext_policyQualifiers extends ffi.Struct { - @uint32() - external int numberOfPolicyQualifiers; +final class cssm_tp_authority_id extends ffi.Struct { + external ffi.Pointer AuthorityCert; - external ffi.Pointer policyQualifier; + external CSSM_NET_ADDRESS_PTR AuthorityLocation; } -typedef CSSM_X509EXT_POLICYQUALIFIERINFO = cssm_x509ext_policyQualifierInfo; +typedef CSSM_NET_ADDRESS_PTR = ffi.Pointer; -final class cssm_x509ext_policyInfo extends ffi.Struct { - external SecAsn1Oid policyIdentifier; +final class cssm_field extends ffi.Struct { + external SecAsn1Oid FieldOid; - external CSSM_X509EXT_POLICYQUALIFIERS policyQualifiers; + external SecAsn1Item FieldValue; } -typedef CSSM_X509EXT_POLICYQUALIFIERS = cssm_x509ext_policyQualifiers; - -final class cssm_x509_revoked_cert_entry extends ffi.Struct { - external SecAsn1Item certificateSerialNumber; +final class cssm_tp_policyinfo extends ffi.Struct { + @uint32() + external int NumberOfPolicyIds; - external CSSM_X509_TIME revocationDate; + external CSSM_FIELD_PTR PolicyIds; - external CSSM_X509_EXTENSIONS extensions; + external ffi.Pointer PolicyControl; } -final class cssm_x509_revoked_cert_list extends ffi.Struct { +typedef CSSM_FIELD_PTR = ffi.Pointer; + +final class cssm_dl_db_list extends ffi.Struct { @uint32() - external int numberOfRevokedCertEntries; + external int NumHandles; - external CSSM_X509_REVOKED_CERT_ENTRY_PTR revokedCertEntry; + external CSSM_DL_DB_HANDLE_PTR DLDBHandle; } -typedef CSSM_X509_REVOKED_CERT_ENTRY_PTR - = ffi.Pointer; +final class cssm_tp_callerauth_context extends ffi.Struct { + external CSSM_TP_POLICYINFO Policy; -final class cssm_x509_tbs_certlist extends ffi.Struct { - external SecAsn1Item version; + external CSSM_TIMESTRING VerifyTime; - external SecAsn1AlgId signature; + @CSSM_TP_STOP_ON() + external int VerificationAbortOn; - external CSSM_X509_NAME issuer; + external CSSM_TP_VERIFICATION_RESULTS_CALLBACK CallbackWithVerifiedCert; - external CSSM_X509_TIME thisUpdate; + @uint32() + external int NumberOfAnchorCerts; - external CSSM_X509_TIME nextUpdate; + external CSSM_DATA_PTR AnchorCerts; - external CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates; + external CSSM_DL_DB_LIST_PTR DBList; - external CSSM_X509_EXTENSIONS extensions; + external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; } -typedef CSSM_X509_REVOKED_CERT_LIST_PTR - = ffi.Pointer; +typedef CSSM_TP_POLICYINFO = cssm_tp_policyinfo; +typedef CSSM_TIMESTRING = ffi.Pointer; +typedef CSSM_TP_STOP_ON = uint32; +typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACK = ffi + .Pointer>; +typedef CSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = CSSM_RETURN Function( + CSSM_MODULE_HANDLE ModuleHandle, + ffi.Pointer CallerCtx, + CSSM_DATA_PTR VerifiedCert); +typedef DartCSSM_TP_VERIFICATION_RESULTS_CALLBACKFunction = Dartsint32 Function( + DartCSSM_INTPTR ModuleHandle, + ffi.Pointer CallerCtx, + CSSM_DATA_PTR VerifiedCert); +typedef CSSM_DL_DB_LIST_PTR = ffi.Pointer; -final class cssm_x509_signed_crl extends ffi.Struct { - external CSSM_X509_TBS_CERTLIST tbsCertList; +final class cssm_encoded_crl extends ffi.Struct { + @CSSM_CRL_TYPE() + external int CrlType; - external CSSM_X509_SIGNATURE signature; + @CSSM_CRL_ENCODING() + external int CrlEncoding; + + external SecAsn1Item CrlBlob; } -typedef CSSM_X509_TBS_CERTLIST = cssm_x509_tbs_certlist; +typedef CSSM_CRL_TYPE = uint32; +typedef CSSM_CRL_ENCODING = uint32; -abstract class __CE_GeneralNameType { - static const int GNT_OtherName = 0; - static const int GNT_RFC822Name = 1; - static const int GNT_DNSName = 2; - static const int GNT_X400Address = 3; - static const int GNT_DirectoryName = 4; - static const int GNT_EdiPartyName = 5; - static const int GNT_URI = 6; - static const int GNT_IPAddress = 7; - static const int GNT_RegisteredID = 8; -} +final class cssm_parsed_crl extends ffi.Struct { + @CSSM_CRL_TYPE() + external int CrlType; -final class __CE_OtherName extends ffi.Struct { - external SecAsn1Oid typeId; + @CSSM_CRL_PARSE_FORMAT() + external int ParsedCrlFormat; - external SecAsn1Item value; + external ffi.Pointer ParsedCrl; } -final class __CE_GeneralName extends ffi.Struct { - @ffi.Int32() - external int nameType; +typedef CSSM_CRL_PARSE_FORMAT = uint32; - @CSSM_BOOL() - external int berEncoded; +final class cssm_crl_pair extends ffi.Struct { + external CSSM_ENCODED_CRL EncodedCrl; - external SecAsn1Item name; + external CSSM_PARSED_CRL ParsedCrl; } -final class __CE_GeneralNames extends ffi.Struct { - @uint32() - external int numNames; +typedef CSSM_ENCODED_CRL = cssm_encoded_crl; +typedef CSSM_PARSED_CRL = cssm_parsed_crl; - external ffi.Pointer generalName; -} +final class cssm_crlgroup extends ffi.Struct { + @CSSM_CRL_TYPE() + external int CrlType; -typedef CE_GeneralName = __CE_GeneralName; + @CSSM_CRL_ENCODING() + external int CrlEncoding; -final class __CE_AuthorityKeyID extends ffi.Struct { - @CSSM_BOOL() - external int keyIdentifierPresent; + @uint32() + external int NumberOfCrls; - external SecAsn1Item keyIdentifier; + external UnnamedUnion4 GroupCrlList; - @CSSM_BOOL() - external int generalNamesPresent; + @CSSM_CRLGROUP_TYPE() + external int CrlGroupType; +} - external ffi.Pointer generalNames; +final class UnnamedUnion4 extends ffi.Union { + external CSSM_DATA_PTR CrlList; - @CSSM_BOOL() - external int serialNumberPresent; + external CSSM_ENCODED_CRL_PTR EncodedCrlList; - external SecAsn1Item serialNumber; + external CSSM_PARSED_CRL_PTR ParsedCrlList; + + external CSSM_CRL_PAIR_PTR PairCrlList; } -typedef CE_GeneralNames = __CE_GeneralNames; +typedef CSSM_ENCODED_CRL_PTR = ffi.Pointer; +typedef CSSM_PARSED_CRL_PTR = ffi.Pointer; +typedef CSSM_CRL_PAIR_PTR = ffi.Pointer; +typedef CSSM_CRLGROUP_TYPE = uint32; -final class __CE_ExtendedKeyUsage extends ffi.Struct { - @uint32() - external int numPurposes; +final class cssm_fieldgroup extends ffi.Struct { + @ffi.Int() + external int NumberOfFields; - external CSSM_OID_PTR purposes; + external CSSM_FIELD_PTR Fields; } -typedef CSSM_OID_PTR = ffi.Pointer; +final class cssm_evidence extends ffi.Struct { + @CSSM_EVIDENCE_FORM() + external int EvidenceForm; -final class __CE_BasicConstraints extends ffi.Struct { - @CSSM_BOOL() - external int cA; + external ffi.Pointer Evidence; +} - @CSSM_BOOL() - external int pathLenConstraintPresent; +typedef CSSM_EVIDENCE_FORM = uint32; - @uint32() - external int pathLenConstraint; -} +final class cssm_tp_verify_context extends ffi.Struct { + @CSSM_TP_ACTION() + external int Action; -final class __CE_PolicyQualifierInfo extends ffi.Struct { - external SecAsn1Oid policyQualifierId; + external SecAsn1Item ActionData; - external SecAsn1Item qualifier; + external CSSM_CRLGROUP Crls; + + external CSSM_TP_CALLERAUTH_CONTEXT_PTR Cred; } -final class __CE_PolicyInformation extends ffi.Struct { - external SecAsn1Oid certPolicyId; +typedef CSSM_TP_ACTION = uint32; +typedef CSSM_CRLGROUP = cssm_crlgroup; +typedef CSSM_TP_CALLERAUTH_CONTEXT_PTR + = ffi.Pointer; +final class cssm_tp_verify_context_result extends ffi.Struct { @uint32() - external int numPolicyQualifiers; + external int NumberOfEvidences; - external ffi.Pointer policyQualifiers; + external CSSM_EVIDENCE_PTR Evidence; } -typedef CE_PolicyQualifierInfo = __CE_PolicyQualifierInfo; +typedef CSSM_EVIDENCE_PTR = ffi.Pointer; -final class __CE_CertPolicies extends ffi.Struct { +final class cssm_tp_request_set extends ffi.Struct { @uint32() - external int numPolicies; + external int NumberOfRequests; - external ffi.Pointer policies; + external ffi.Pointer Requests; } -typedef CE_PolicyInformation = __CE_PolicyInformation; +final class cssm_tp_result_set extends ffi.Struct { + @uint32() + external int NumberOfResults; -abstract class __CE_CrlDistributionPointNameType { - static const int CE_CDNT_FullName = 0; - static const int CE_CDNT_NameRelativeToCrlIssuer = 1; + external ffi.Pointer Results; } -final class __CE_DistributionPointName extends ffi.Struct { - @ffi.Int32() - external int nameType; +final class cssm_tp_confirm_response extends ffi.Struct { + @uint32() + external int NumberOfResponses; - external UnnamedUnion5 dpn; + external CSSM_TP_CONFIRM_STATUS_PTR Responses; } -final class UnnamedUnion5 extends ffi.Union { - external ffi.Pointer fullName; - - external CSSM_X509_RDN_PTR rdn; -} +typedef CSSM_TP_CONFIRM_STATUS_PTR = ffi.Pointer; -final class __CE_CRLDistributionPoint extends ffi.Struct { - external ffi.Pointer distPointName; +final class cssm_tp_certissue_input extends ffi.Struct { + external CSSM_SUBSERVICE_UID CSPSubserviceUid; - @CSSM_BOOL() - external int reasonsPresent; + @CSSM_CL_HANDLE() + external int CLHandle; - @CE_CrlDistReasonFlags() - external int reasons; + @uint32() + external int NumberOfTemplateFields; - external ffi.Pointer crlIssuer; -} + external CSSM_FIELD_PTR SubjectCertFields; -typedef CE_DistributionPointName = __CE_DistributionPointName; -typedef CE_CrlDistReasonFlags = uint8; + @CSSM_TP_SERVICES() + external int MoreServiceRequests; -final class __CE_CRLDistPointsSyntax extends ffi.Struct { @uint32() - external int numDistPoints; + external int NumberOfServiceControls; - external ffi.Pointer distPoints; -} + external CSSM_FIELD_PTR ServiceControls; -typedef CE_CRLDistributionPoint = __CE_CRLDistributionPoint; + external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; +} -final class __CE_AccessDescription extends ffi.Struct { - external SecAsn1Oid accessMethod; +typedef CSSM_TP_SERVICES = uint32; - external CE_GeneralName accessLocation; -} +final class cssm_tp_certissue_output extends ffi.Struct { + @CSSM_TP_CERTISSUE_STATUS() + external int IssueStatus; -final class __CE_AuthorityInfoAccess extends ffi.Struct { - @uint32() - external int numAccessDescriptions; + external CSSM_CERTGROUP_PTR CertGroup; - external ffi.Pointer accessDescriptions; + @CSSM_TP_SERVICES() + external int PerformedServiceRequests; } -typedef CE_AccessDescription = __CE_AccessDescription; +typedef CSSM_TP_CERTISSUE_STATUS = uint32; +typedef CSSM_CERTGROUP_PTR = ffi.Pointer; -final class __CE_SemanticsInformation extends ffi.Struct { - external ffi.Pointer semanticsIdentifier; +final class cssm_tp_certchange_input extends ffi.Struct { + @CSSM_TP_CERTCHANGE_ACTION() + external int Action; - external ffi.Pointer - nameRegistrationAuthorities; -} + @CSSM_TP_CERTCHANGE_REASON() + external int Reason; -typedef CE_NameRegistrationAuthorities = CE_GeneralNames; + @CSSM_CL_HANDLE() + external int CLHandle; -final class __CE_QC_Statement extends ffi.Struct { - external SecAsn1Oid statementId; + external CSSM_DATA_PTR Cert; - external ffi.Pointer semanticsInfo; + external CSSM_FIELD_PTR ChangeInfo; - external ffi.Pointer otherInfo; + external CSSM_TIMESTRING StartTime; + + external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; } -typedef CE_SemanticsInformation = __CE_SemanticsInformation; +typedef CSSM_TP_CERTCHANGE_ACTION = uint32; +typedef CSSM_TP_CERTCHANGE_REASON = uint32; -final class __CE_QC_Statements extends ffi.Struct { - @uint32() - external int numQCStatements; +final class cssm_tp_certchange_output extends ffi.Struct { + @CSSM_TP_CERTCHANGE_STATUS() + external int ActionStatus; - external ffi.Pointer qcStatements; + external CSSM_FIELD RevokeInfo; } -typedef CE_QC_Statement = __CE_QC_Statement; - -final class __CE_IssuingDistributionPoint extends ffi.Struct { - external ffi.Pointer distPointName; - - @CSSM_BOOL() - external int onlyUserCertsPresent; +typedef CSSM_TP_CERTCHANGE_STATUS = uint32; +typedef CSSM_FIELD = cssm_field; - @CSSM_BOOL() - external int onlyUserCerts; +final class cssm_tp_certverify_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; - @CSSM_BOOL() - external int onlyCACertsPresent; + external CSSM_DATA_PTR Cert; - @CSSM_BOOL() - external int onlyCACerts; + external CSSM_TP_VERIFY_CONTEXT_PTR VerifyContext; +} - @CSSM_BOOL() - external int onlySomeReasonsPresent; +typedef CSSM_TP_VERIFY_CONTEXT_PTR = ffi.Pointer; - @CE_CrlDistReasonFlags() - external int onlySomeReasons; +final class cssm_tp_certverify_output extends ffi.Struct { + @CSSM_TP_CERTVERIFY_STATUS() + external int VerifyStatus; - @CSSM_BOOL() - external int indirectCrlPresent; + @uint32() + external int NumberOfEvidence; - @CSSM_BOOL() - external int indirectCrl; + external CSSM_EVIDENCE_PTR Evidence; } -final class __CE_GeneralSubtree extends ffi.Struct { - external ffi.Pointer base; +typedef CSSM_TP_CERTVERIFY_STATUS = uint32; + +final class cssm_tp_certnotarize_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; @uint32() - external int minimum; + external int NumberOfFields; - @CSSM_BOOL() - external int maximumPresent; + external CSSM_FIELD_PTR MoreFields; - @uint32() - external int maximum; -} + external CSSM_FIELD_PTR SignScope; -final class __CE_GeneralSubtrees extends ffi.Struct { @uint32() - external int numSubtrees; + external int ScopeSize; - external ffi.Pointer subtrees; -} + @CSSM_TP_SERVICES() + external int MoreServiceRequests; -typedef CE_GeneralSubtree = __CE_GeneralSubtree; + @uint32() + external int NumberOfServiceControls; -final class __CE_NameConstraints extends ffi.Struct { - external ffi.Pointer permitted; + external CSSM_FIELD_PTR ServiceControls; - external ffi.Pointer excluded; + external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; } -typedef CE_GeneralSubtrees = __CE_GeneralSubtrees; - -final class __CE_PolicyMapping extends ffi.Struct { - external SecAsn1Oid issuerDomainPolicy; - - external SecAsn1Oid subjectDomainPolicy; -} +final class cssm_tp_certnotarize_output extends ffi.Struct { + @CSSM_TP_CERTNOTARIZE_STATUS() + external int NotarizeStatus; -final class __CE_PolicyMappings extends ffi.Struct { - @uint32() - external int numPolicyMappings; + external CSSM_CERTGROUP_PTR NotarizedCertGroup; - external ffi.Pointer policyMappings; + @CSSM_TP_SERVICES() + external int PerformedServiceRequests; } -typedef CE_PolicyMapping = __CE_PolicyMapping; +typedef CSSM_TP_CERTNOTARIZE_STATUS = uint32; -final class __CE_PolicyConstraints extends ffi.Struct { - @CSSM_BOOL() - external int requireExplicitPolicyPresent; +final class cssm_tp_certreclaim_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; @uint32() - external int requireExplicitPolicy; + external int NumberOfSelectionFields; - @CSSM_BOOL() - external int inhibitPolicyMappingPresent; + external CSSM_FIELD_PTR SelectionFields; - @uint32() - external int inhibitPolicyMapping; + external CSSM_ACCESS_CREDENTIALS_PTR UserCredentials; } -abstract class __CE_DataType { - static const int DT_AuthorityKeyID = 0; - static const int DT_SubjectKeyID = 1; - static const int DT_KeyUsage = 2; - static const int DT_SubjectAltName = 3; - static const int DT_IssuerAltName = 4; - static const int DT_ExtendedKeyUsage = 5; - static const int DT_BasicConstraints = 6; - static const int DT_CertPolicies = 7; - static const int DT_NetscapeCertType = 8; - static const int DT_CrlNumber = 9; - static const int DT_DeltaCrl = 10; - static const int DT_CrlReason = 11; - static const int DT_CrlDistributionPoints = 12; - static const int DT_IssuingDistributionPoint = 13; - static const int DT_AuthorityInfoAccess = 14; - static const int DT_Other = 15; - static const int DT_QC_Statements = 16; - static const int DT_NameConstraints = 17; - static const int DT_PolicyMappings = 18; - static const int DT_PolicyConstraints = 19; - static const int DT_InhibitAnyPolicy = 20; -} +final class cssm_tp_certreclaim_output extends ffi.Struct { + @CSSM_TP_CERTRECLAIM_STATUS() + external int ReclaimStatus; -final class CE_Data extends ffi.Union { - external CE_AuthorityKeyID authorityKeyID; + external CSSM_CERTGROUP_PTR ReclaimedCertGroup; - external CE_SubjectKeyID subjectKeyID; + @CSSM_LONG_HANDLE() + external int KeyCacheHandle; +} - @CE_KeyUsage() - external int keyUsage; +typedef CSSM_TP_CERTRECLAIM_STATUS = uint32; +typedef CSSM_LONG_HANDLE = uint64; +typedef uint64 = ffi.Uint64; +typedef Dartuint64 = int; - external CE_GeneralNames subjectAltName; +final class cssm_tp_crlissue_input extends ffi.Struct { + @CSSM_CL_HANDLE() + external int CLHandle; - external CE_GeneralNames issuerAltName; + @uint32() + external int CrlIdentifier; - external CE_ExtendedKeyUsage extendedKeyUsage; + external CSSM_TIMESTRING CrlThisTime; - external CE_BasicConstraints basicConstraints; + external CSSM_FIELD_PTR PolicyIdentifier; - external CE_CertPolicies certPolicies; + external CSSM_ACCESS_CREDENTIALS_PTR CallerCredentials; +} - @CE_NetscapeCertType() - external int netscapeCertType; +final class cssm_tp_crlissue_output extends ffi.Struct { + @CSSM_TP_CRLISSUE_STATUS() + external int IssueStatus; - @CE_CrlNumber() - external int crlNumber; + external CSSM_ENCODED_CRL_PTR Crl; - @CE_DeltaCrl() - external int deltaCrl; + external CSSM_TIMESTRING CrlNextTime; +} - @CE_CrlReason() - external int crlReason; +typedef CSSM_TP_CRLISSUE_STATUS = uint32; - external CE_CRLDistPointsSyntax crlDistPoints; +final class cssm_cert_bundle_header extends ffi.Struct { + @CSSM_CERT_BUNDLE_TYPE() + external int BundleType; - external CE_IssuingDistributionPoint issuingDistPoint; + @CSSM_CERT_BUNDLE_ENCODING() + external int BundleEncoding; +} - external CE_AuthorityInfoAccess authorityInfoAccess; +typedef CSSM_CERT_BUNDLE_TYPE = uint32; +typedef CSSM_CERT_BUNDLE_ENCODING = uint32; - external CE_QC_Statements qualifiedCertStatements; +final class cssm_cert_bundle extends ffi.Struct { + external CSSM_CERT_BUNDLE_HEADER BundleHeader; - external CE_NameConstraints nameConstraints; + external SecAsn1Item Bundle; +} - external CE_PolicyMappings policyMappings; +typedef CSSM_CERT_BUNDLE_HEADER = cssm_cert_bundle_header; - external CE_PolicyConstraints policyConstraints; +final class cssm_db_attribute_info extends ffi.Struct { + @CSSM_DB_ATTRIBUTE_NAME_FORMAT() + external int AttributeNameFormat; - @CE_InhibitAnyPolicy() - external int inhibitAnyPolicy; + external cssm_db_attribute_label Label; - external SecAsn1Item rawData; + @CSSM_DB_ATTRIBUTE_FORMAT() + external int AttributeFormat; } -typedef CE_AuthorityKeyID = __CE_AuthorityKeyID; -typedef CE_SubjectKeyID = SecAsn1Item; -typedef CE_KeyUsage = uint16; -typedef CE_ExtendedKeyUsage = __CE_ExtendedKeyUsage; -typedef CE_BasicConstraints = __CE_BasicConstraints; -typedef CE_CertPolicies = __CE_CertPolicies; -typedef CE_NetscapeCertType = uint16; -typedef CE_CrlNumber = uint32; -typedef CE_DeltaCrl = uint32; -typedef CE_CrlReason = uint32; -typedef CE_CRLDistPointsSyntax = __CE_CRLDistPointsSyntax; -typedef CE_IssuingDistributionPoint = __CE_IssuingDistributionPoint; -typedef CE_AuthorityInfoAccess = __CE_AuthorityInfoAccess; -typedef CE_QC_Statements = __CE_QC_Statements; -typedef CE_NameConstraints = __CE_NameConstraints; -typedef CE_PolicyMappings = __CE_PolicyMappings; -typedef CE_PolicyConstraints = __CE_PolicyConstraints; -typedef CE_InhibitAnyPolicy = uint32; +typedef CSSM_DB_ATTRIBUTE_NAME_FORMAT = uint32; -final class __CE_DataAndType extends ffi.Struct { - @ffi.Int32() - external int type; +final class cssm_db_attribute_label extends ffi.Union { + external ffi.Pointer AttributeName; - external CE_Data extension1; + external SecAsn1Oid AttributeOID; - @CSSM_BOOL() - external int critical; + @uint32() + external int AttributeID; } -final class cssm_acl_process_subject_selector extends ffi.Struct { - @uint16() - external int version; +typedef CSSM_DB_ATTRIBUTE_FORMAT = uint32; - @uint16() - external int mask; +final class cssm_db_attribute_data extends ffi.Struct { + external CSSM_DB_ATTRIBUTE_INFO Info; @uint32() - external int uid; + external int NumberOfValues; - @uint32() - external int gid; + external CSSM_DATA_PTR Value; } -final class cssm_acl_keychain_prompt_selector extends ffi.Struct { - @uint16() - external int version; +typedef CSSM_DB_ATTRIBUTE_INFO = cssm_db_attribute_info; - @uint16() - external int flags; -} +final class cssm_db_record_attribute_info extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int DataRecordType; -abstract class cssm_appledl_open_parameters_mask { - static const int kCSSM_APPLEDL_MASK_MODE = 1; + @uint32() + external int NumberOfAttributes; + + external CSSM_DB_ATTRIBUTE_INFO_PTR AttributeInfo; } -final class cssm_appledl_open_parameters extends ffi.Struct { - @uint32() - external int length; +typedef CSSM_DB_RECORDTYPE = uint32; +typedef CSSM_DB_ATTRIBUTE_INFO_PTR = ffi.Pointer; - @uint32() - external int version; +final class cssm_db_record_attribute_data extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int DataRecordType; - @CSSM_BOOL() - external int autoCommit; + @uint32() + external int SemanticInformation; @uint32() - external int mask; + external int NumberOfAttributes; - @mode_t() - external int mode; + external CSSM_DB_ATTRIBUTE_DATA_PTR AttributeData; } -final class cssm_applecspdl_db_settings_parameters extends ffi.Struct { - @uint32() - external int idleTimeout; +typedef CSSM_DB_ATTRIBUTE_DATA_PTR = ffi.Pointer; - @uint8() - external int lockOnSleep; -} +final class cssm_db_parsing_module_info extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int RecordType; -final class cssm_applecspdl_db_is_locked_parameters extends ffi.Struct { - @uint8() - external int isLocked; + external CSSM_SUBSERVICE_UID ModuleSubserviceUid; } -final class cssm_applecspdl_db_change_password_parameters extends ffi.Struct { - external ffi.Pointer accessCredentials; +final class cssm_db_index_info extends ffi.Struct { + @CSSM_DB_INDEX_TYPE() + external int IndexType; + + @CSSM_DB_INDEXED_DATA_LOCATION() + external int IndexedDataLocation; + + external CSSM_DB_ATTRIBUTE_INFO Info; } -typedef CSSM_ACCESS_CREDENTIALS = cssm_access_credentials; +typedef CSSM_DB_INDEX_TYPE = uint32; +typedef CSSM_DB_INDEXED_DATA_LOCATION = uint32; -final class CSSM_APPLE_TP_NAME_OID extends ffi.Struct { - external ffi.Pointer string; +final class cssm_db_unique_record extends ffi.Struct { + external CSSM_DB_INDEX_INFO RecordLocator; - external ffi.Pointer oid; + external SecAsn1Item RecordIdentifier; } -final class CSSM_APPLE_TP_CERT_REQUEST extends ffi.Struct { - @CSSM_CSP_HANDLE() - external int cspHand; +typedef CSSM_DB_INDEX_INFO = cssm_db_index_info; - @CSSM_CL_HANDLE() - external int clHand; +final class cssm_db_record_index_info extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int DataRecordType; @uint32() - external int serialNumber; + external int NumberOfIndexes; - @uint32() - external int numSubjectNames; + external CSSM_DB_INDEX_INFO_PTR IndexInfo; +} - external ffi.Pointer subjectNames; +typedef CSSM_DB_INDEX_INFO_PTR = ffi.Pointer; +final class cssm_dbinfo extends ffi.Struct { @uint32() - external int numIssuerNames; - - external ffi.Pointer issuerNames; - - external CSSM_X509_NAME_PTR issuerNameX509; + external int NumberOfRecordTypes; - external ffi.Pointer certPublicKey; + external CSSM_DB_PARSING_MODULE_INFO_PTR DefaultParsingModules; - external ffi.Pointer issuerPrivateKey; + external CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR RecordAttributeNames; - @CSSM_ALGORITHMS() - external int signatureAlg; + external CSSM_DB_RECORD_INDEX_INFO_PTR RecordIndexes; - external SecAsn1Oid signatureOid; + @CSSM_BOOL() + external int IsLocal; - @uint32() - external int notBefore; + external ffi.Pointer AccessPath; - @uint32() - external int notAfter; + external ffi.Pointer Reserved; +} - @uint32() - external int numExtensions; +typedef CSSM_DB_PARSING_MODULE_INFO_PTR + = ffi.Pointer; +typedef CSSM_DB_RECORD_ATTRIBUTE_INFO_PTR + = ffi.Pointer; +typedef CSSM_DB_RECORD_INDEX_INFO_PTR = ffi.Pointer; - external ffi.Pointer extensions; +final class cssm_selection_predicate extends ffi.Struct { + @CSSM_DB_OPERATOR() + external int DbOperator; - external ffi.Pointer challengeString; + external CSSM_DB_ATTRIBUTE_DATA Attribute; } -typedef CSSM_X509_NAME_PTR = ffi.Pointer; -typedef CSSM_KEY = cssm_key; -typedef CE_DataAndType = __CE_DataAndType; +typedef CSSM_DB_OPERATOR = uint32; +typedef CSSM_DB_ATTRIBUTE_DATA = cssm_db_attribute_data; -final class CSSM_APPLE_TP_SSL_OPTIONS extends ffi.Struct { +final class cssm_query_limits extends ffi.Struct { @uint32() - external int Version; + external int TimeLimit; @uint32() - external int ServerNameLen; + external int SizeLimit; +} - external ffi.Pointer ServerName; +final class cssm_query extends ffi.Struct { + @CSSM_DB_RECORDTYPE() + external int RecordType; - @uint32() - external int Flags; -} + @CSSM_DB_CONJUNCTIVE() + external int Conjunctive; -final class CSSM_APPLE_TP_CRL_OPTIONS extends ffi.Struct { @uint32() - external int Version; - - @CSSM_APPLE_TP_CRL_OPT_FLAGS() - external int CrlFlags; + external int NumSelectionPredicates; - external CSSM_DL_DB_HANDLE_PTR crlStore; -} + external CSSM_SELECTION_PREDICATE_PTR SelectionPredicate; -typedef CSSM_APPLE_TP_CRL_OPT_FLAGS = uint32; + external CSSM_QUERY_LIMITS QueryLimits; -final class CSSM_APPLE_TP_SMIME_OPTIONS extends ffi.Struct { - @uint32() - external int Version; + @CSSM_QUERY_FLAGS() + external int QueryFlags; +} - @CE_KeyUsage() - external int IntendedUsage; +typedef CSSM_DB_CONJUNCTIVE = uint32; +typedef CSSM_SELECTION_PREDICATE_PTR = ffi.Pointer; +typedef CSSM_QUERY_LIMITS = cssm_query_limits; +typedef CSSM_QUERY_FLAGS = uint32; +final class cssm_dl_pkcs11_attributes extends ffi.Struct { @uint32() - external int SenderEmailLen; - - external ffi.Pointer SenderEmail; + external int DeviceAccessFlags; } -final class CSSM_APPLE_TP_ACTION_DATA extends ffi.Struct { +final class cssm_name_list extends ffi.Struct { @uint32() - external int Version; + external int NumStrings; - @CSSM_APPLE_TP_ACTION_FLAGS() - external int ActionFlags; + external ffi.Pointer> String; } -typedef CSSM_APPLE_TP_ACTION_FLAGS = uint32; - -final class CSSM_TP_APPLE_EVIDENCE_INFO extends ffi.Struct { - @CSSM_TP_APPLE_CERT_STATUS() - external int StatusBits; - +final class cssm_db_schema_attribute_info extends ffi.Struct { @uint32() - external int NumStatusCodes; - - external ffi.Pointer StatusCodes; + external int AttributeId; - @uint32() - external int Index; + external ffi.Pointer AttributeName; - external CSSM_DL_DB_HANDLE DlDbHandle; + external SecAsn1Oid AttributeNameID; - external CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord; + @CSSM_DB_ATTRIBUTE_FORMAT() + external int DataType; } -typedef CSSM_TP_APPLE_CERT_STATUS = uint32; -typedef CSSM_DL_DB_HANDLE = cssm_dl_db_handle; -typedef CSSM_DB_UNIQUE_RECORD_PTR = ffi.Pointer; - -final class CSSM_TP_APPLE_EVIDENCE_HEADER extends ffi.Struct { +final class cssm_db_schema_index_info extends ffi.Struct { @uint32() - external int Version; -} - -final class CSSM_APPLE_CL_CSR_REQUEST extends ffi.Struct { - external CSSM_X509_NAME_PTR subjectNameX509; - - @CSSM_ALGORITHMS() - external int signatureAlg; - - external SecAsn1Oid signatureOid; - - @CSSM_CSP_HANDLE() - external int cspHand; + external int AttributeId; - external ffi.Pointer subjectPublicKey; + @uint32() + external int IndexId; - external ffi.Pointer subjectPrivateKey; + @CSSM_DB_INDEX_TYPE() + external int IndexType; - external ffi.Pointer challengeString; + @CSSM_DB_INDEXED_DATA_LOCATION() + external int IndexedDataLocation; } -abstract class SecTrustResultType { - static const int kSecTrustResultInvalid = 0; - static const int kSecTrustResultProceed = 1; - static const int kSecTrustResultConfirm = 2; - static const int kSecTrustResultDeny = 3; - static const int kSecTrustResultUnspecified = 4; - static const int kSecTrustResultRecoverableTrustFailure = 5; - static const int kSecTrustResultFatalTrustFailure = 6; - static const int kSecTrustResultOtherError = 7; -} +final class cssm_x509_type_value_pair extends ffi.Struct { + external SecAsn1Oid type; -final class __SecTrust extends ffi.Opaque {} + @CSSM_BER_TAG() + external int valueType; -typedef SecTrustRef = ffi.Pointer<__SecTrust>; -typedef SecTrustCallback = ffi.Pointer<_ObjCBlock>; -typedef DartSecTrustCallback = ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType; -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, SecTrustRef arg0, int arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(SecTrustRef arg0, ffi.Int32 arg1)>>() - .asFunction()(arg0, arg1); -final _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_registerClosure( - void Function(SecTrustRef, int) fn) { - final id = - ++_ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureRegistryIndex; - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + external SecAsn1Item value; } -void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, SecTrustRef arg0, int arg1) => - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType extends _ObjCBlockBase { - ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(SecTrustRef arg0, ffi.Int32 arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - SecTrustRef, ffi.Int32)>( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType.fromFunction( - NativeCupertinoHttp lib, void Function(SecTrustRef, int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - SecTrustRef, ffi.Int32)>( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_registerClosure( - (SecTrustRef arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +typedef CSSM_BER_TAG = uint8; - /// 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. - ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType.listener( - NativeCupertinoHttp lib, void Function(SecTrustRef, int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - SecTrustRef, ffi.Int32)>.listener( - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_registerClosure( - (SecTrustRef arg0, int arg1) => fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, SecTrustRef, ffi.Int32)>? - _dartFuncListenerTrampoline; - - void call(SecTrustRef arg0, int arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, SecTrustRef arg0, - ffi.Int32 arg1)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, SecTrustRef, int)>()(_id, arg0, arg1); -} +final class cssm_x509_rdn extends ffi.Struct { + @uint32() + external int numberOfPairs; -typedef SecTrustWithErrorCallback = ffi.Pointer<_ObjCBlock>; -typedef DartSecTrustWithErrorCallback - = ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef; -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>>() - .asFunction()( - arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_registerClosure( - void Function(SecTrustRef, bool, CFErrorRef) fn) { - final id = - ++_ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureRegistryIndex; - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + external CSSM_X509_TYPE_VALUE_PAIR_PTR AttributeTypeAndValue; } -void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - SecTrustRef arg0, - bool arg1, - CFErrorRef arg2) => - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); +typedef CSSM_X509_TYPE_VALUE_PAIR_PTR = ffi.Pointer; -class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef extends _ObjCBlockBase { - ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +final class cssm_x509_name extends ffi.Struct { + @uint32() + external int numberOfRDNs; - /// 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. - ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - SecTrustRef, ffi.Bool, CFErrorRef)>( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external CSSM_X509_RDN_PTR RelativeDistinguishedName; +} - /// 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. - ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef.fromFunction( - NativeCupertinoHttp lib, void Function(SecTrustRef, bool, CFErrorRef) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - SecTrustRef, ffi.Bool, CFErrorRef)>( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_registerClosure( - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +typedef CSSM_X509_RDN_PTR = ffi.Pointer; - /// 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. - ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef.listener( - NativeCupertinoHttp lib, void Function(SecTrustRef, bool, CFErrorRef) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - SecTrustRef, ffi.Bool, CFErrorRef)>.listener( - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_registerClosure( - (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => - fn(arg0, arg1, arg2))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, SecTrustRef, ffi.Bool, CFErrorRef)>? - _dartFuncListenerTrampoline; +final class cssm_x509_time extends ffi.Struct { + @CSSM_BER_TAG() + external int timeType; - void call(SecTrustRef arg0, bool arg1, CFErrorRef arg2) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, SecTrustRef arg0, - ffi.Bool arg1, CFErrorRef arg2)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, SecTrustRef, bool, - CFErrorRef)>()(_id, arg0, arg1, arg2); + external SecAsn1Item time; } -typedef SecKeyRef = ffi.Pointer<__SecKey>; -typedef SecCertificateRef = ffi.Pointer<__SecCertificate>; +final class x509_validity extends ffi.Struct { + external CSSM_X509_TIME notBefore; -abstract class SecTrustOptionFlags { - static const int kSecTrustOptionAllowExpired = 1; - static const int kSecTrustOptionLeafIsCA = 2; - static const int kSecTrustOptionFetchIssuerFromNet = 4; - static const int kSecTrustOptionAllowExpiredRoot = 8; - static const int kSecTrustOptionRequireRevPerCert = 16; - static const int kSecTrustOptionUseTrustSettings = 32; - static const int kSecTrustOptionImplicitAnchors = 64; + external CSSM_X509_TIME notAfter; } -typedef CSSM_TP_VERIFY_CONTEXT_RESULT_PTR - = ffi.Pointer; -typedef SecKeychainRef = ffi.Pointer<__SecKeychain>; +typedef CSSM_X509_TIME = cssm_x509_time; -abstract class SecKeyUsage { - static const int kSecKeyUsageUnspecified = 0; - static const int kSecKeyUsageDigitalSignature = 1; - static const int kSecKeyUsageNonRepudiation = 2; - static const int kSecKeyUsageContentCommitment = 2; - static const int kSecKeyUsageKeyEncipherment = 4; - static const int kSecKeyUsageDataEncipherment = 8; - static const int kSecKeyUsageKeyAgreement = 16; - static const int kSecKeyUsageKeyCertSign = 32; - static const int kSecKeyUsageCRLSign = 64; - static const int kSecKeyUsageEncipherOnly = 128; - static const int kSecKeyUsageDecipherOnly = 256; - static const int kSecKeyUsageCritical = -2147483648; - static const int kSecKeyUsageAll = 2147483647; -} +final class cssm_x509ext_basicConstraints extends ffi.Struct { + @CSSM_BOOL() + external int cA; -typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; + @CSSM_X509_OPTION() + external int pathLenConstraintPresent; -abstract class SSLCiphersuiteGroup { - static const int kSSLCiphersuiteGroupDefault = 0; - static const int kSSLCiphersuiteGroupCompatibility = 1; - static const int kSSLCiphersuiteGroupLegacy = 2; - static const int kSSLCiphersuiteGroupATS = 3; - static const int kSSLCiphersuiteGroupATSCompatibility = 4; -} - -final class sec_trust extends ffi.Opaque {} - -final class sec_identity extends ffi.Opaque {} - -final class sec_certificate extends ffi.Opaque {} - -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 tls_ciphersuite_t { - static const int tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA = 10; - static const int tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA = 47; - static const int tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA = 53; - static const int tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256 = 156; - static const int tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384 = 157; - static const int tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256 = 60; - static const int tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256 = 61; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA = -16376; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = -16375; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = -16374; - static const int tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA = -16366; - static const int tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA = -16365; - static const int tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA = -16364; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = -16349; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = -16348; - static const int tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = -16345; - static const int tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = -16344; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = -16341; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = -16340; - static const int tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = -16337; - static const int tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = -16336; - static const int tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 = - -13144; - static const int tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 = - -13143; - static const int tls_ciphersuite_AES_128_GCM_SHA256 = 4865; - static const int tls_ciphersuite_AES_256_GCM_SHA384 = 4866; - static const int tls_ciphersuite_CHACHA20_POLY1305_SHA256 = 4867; -} - -abstract class tls_ciphersuite_group_t { - static const int tls_ciphersuite_group_default = 0; - static const int tls_ciphersuite_group_compatibility = 1; - static const int tls_ciphersuite_group_legacy = 2; - static const int tls_ciphersuite_group_ats = 3; - static const int tls_ciphersuite_group_ats_compatibility = 4; -} - -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; -} - -typedef sec_trust_t = ffi.Pointer; -typedef sec_identity_t = ffi.Pointer; -void _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, sec_certificate_t arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_seccertificatet_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_seccertificatet_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_registerClosure( - void Function(sec_certificate_t) fn) { - final id = ++_ObjCBlock_ffiVoid_seccertificatet_closureRegistryIndex; - _ObjCBlock_ffiVoid_seccertificatet_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + @uint32() + external int pathLenConstraint; } -void _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, sec_certificate_t arg0) => - _ObjCBlock_ffiVoid_seccertificatet_closureRegistry[ - block.ref.target.address]!(arg0); +typedef CSSM_X509_OPTION = CSSM_BOOL; -class ObjCBlock_ffiVoid_seccertificatet extends _ObjCBlockBase { - ObjCBlock_ffiVoid_seccertificatet._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +final class cssm_x509_extensionTagAndValue extends ffi.Struct { + @CSSM_BER_TAG() + external int type; - /// 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. - ObjCBlock_ffiVoid_seccertificatet.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, sec_certificate_t)>( - _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external SecAsn1Item value; +} - /// 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. - ObjCBlock_ffiVoid_seccertificatet.fromFunction( - NativeCupertinoHttp lib, void Function(sec_certificate_t) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, sec_certificate_t)>( - _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_seccertificatet_registerClosure( - (sec_certificate_t arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +final class cssm_x509ext_pair extends ffi.Struct { + external CSSM_X509EXT_TAGandVALUE tagAndValue; - /// 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. - ObjCBlock_ffiVoid_seccertificatet.listener( - NativeCupertinoHttp lib, void Function(sec_certificate_t) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - sec_certificate_t)>.listener( - _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_seccertificatet_registerClosure( - (sec_certificate_t arg0) => fn(arg0))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, sec_certificate_t)>? - _dartFuncListenerTrampoline; - - void call(sec_certificate_t arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, sec_certificate_t arg0)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, sec_certificate_t)>()(_id, arg0); + external ffi.Pointer parsedValue; } -typedef sec_certificate_t = ffi.Pointer; +typedef CSSM_X509EXT_TAGandVALUE = cssm_x509_extensionTagAndValue; -final class sec_protocol_metadata extends ffi.Opaque {} +final class cssm_x509_extension extends ffi.Struct { + external SecAsn1Oid extnId; -typedef sec_protocol_metadata_t = ffi.Pointer; -typedef SSLCipherSuite = ffi.Uint16; -typedef DartSSLCipherSuite = int; -void _ObjCBlock_ffiVoid_dispatchdatat_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, dispatch_data_t arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_dispatchdatat_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_dispatchdatat_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_dispatchdatat_registerClosure( - void Function(dispatch_data_t) fn) { - final id = ++_ObjCBlock_ffiVoid_dispatchdatat_closureRegistryIndex; - _ObjCBlock_ffiVoid_dispatchdatat_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_dispatchdatat_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, dispatch_data_t arg0) => - _ObjCBlock_ffiVoid_dispatchdatat_closureRegistry[block.ref.target.address]!( - arg0); - -class ObjCBlock_ffiVoid_dispatchdatat extends _ObjCBlockBase { - ObjCBlock_ffiVoid_dispatchdatat._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + @CSSM_BOOL() + external int critical; - /// 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. - ObjCBlock_ffiVoid_dispatchdatat.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, dispatch_data_t)>( - _ObjCBlock_ffiVoid_dispatchdatat_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + @ffi.UnsignedInt() + external int formatAsInt; - /// 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. - ObjCBlock_ffiVoid_dispatchdatat.fromFunction( - NativeCupertinoHttp lib, void Function(dispatch_data_t) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, dispatch_data_t)>( - _ObjCBlock_ffiVoid_dispatchdatat_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_dispatchdatat_registerClosure( - (dispatch_data_t arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + extension_data_format get format => + extension_data_format.fromValue(formatAsInt); - /// 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. - ObjCBlock_ffiVoid_dispatchdatat.listener( - NativeCupertinoHttp lib, void Function(dispatch_data_t) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - dispatch_data_t)>.listener( - _ObjCBlock_ffiVoid_dispatchdatat_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_dispatchdatat_registerClosure( - (dispatch_data_t arg0) => fn(arg0))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, dispatch_data_t)>? - _dartFuncListenerTrampoline; - - void call(dispatch_data_t arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, dispatch_data_t arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, dispatch_data_t)>()(_id, arg0); -} + external cssm_x509ext_value value; -void _ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_Uint16_closureRegistry = {}; -int _ObjCBlock_ffiVoid_Uint16_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_Uint16_registerClosure( - void Function(int) fn) { - final id = ++_ObjCBlock_ffiVoid_Uint16_closureRegistryIndex; - _ObjCBlock_ffiVoid_Uint16_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + external SecAsn1Item BERvalue; } -void _ObjCBlock_ffiVoid_Uint16_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, int arg0) => - _ObjCBlock_ffiVoid_Uint16_closureRegistry[block.ref.target.address]!(arg0); +enum extension_data_format { + CSSM_X509_DATAFORMAT_ENCODED(0), + CSSM_X509_DATAFORMAT_PARSED(1), + CSSM_X509_DATAFORMAT_PAIR(2); -class ObjCBlock_ffiVoid_Uint16 extends _ObjCBlockBase { - ObjCBlock_ffiVoid_Uint16._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + final int value; + const extension_data_format(this.value); - /// 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. - ObjCBlock_ffiVoid_Uint16.fromFunctionPointer(NativeCupertinoHttp lib, - ffi.Pointer> ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Uint16)>( - _ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static extension_data_format fromValue(int value) => switch (value) { + 0 => CSSM_X509_DATAFORMAT_ENCODED, + 1 => CSSM_X509_DATAFORMAT_PARSED, + 2 => CSSM_X509_DATAFORMAT_PAIR, + _ => throw ArgumentError( + "Unknown value for extension_data_format: $value"), + }; +} - /// 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. - ObjCBlock_ffiVoid_Uint16.fromFunction( - NativeCupertinoHttp lib, void Function(int) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Uint16)>( - _ObjCBlock_ffiVoid_Uint16_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_Uint16_registerClosure( - (int arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +final class cssm_x509ext_value extends ffi.Union { + external ffi.Pointer tagAndValue; - /// 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. - ObjCBlock_ffiVoid_Uint16.listener( - NativeCupertinoHttp lib, void Function(int) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Uint16)>.listener( - _ObjCBlock_ffiVoid_Uint16_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_Uint16_registerClosure( - (int arg0) => fn(arg0))), - lib); - static ffi - .NativeCallable, ffi.Uint16)>? - _dartFuncListenerTrampoline; - - void call(int arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, ffi.Uint16 arg0)>>() - .asFunction, int)>()(_id, arg0); -} + external ffi.Pointer parsedValue; -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - dispatch_data_t arg0, - dispatch_data_t arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - dispatch_data_t arg0, dispatch_data_t arg1)>>() - .asFunction()( - arg0, arg1); -final _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_registerClosure( - void Function(dispatch_data_t, dispatch_data_t) fn) { - final id = - ++_ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureRegistryIndex; - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + external ffi.Pointer valuePair; } -void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - dispatch_data_t arg0, - dispatch_data_t arg1) => - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureRegistry[ - block.ref.target.address]!(arg0, arg1); +typedef CSSM_X509EXT_PAIR = cssm_x509ext_pair; -class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat extends _ObjCBlockBase { - ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +final class cssm_x509_extensions extends ffi.Struct { + @uint32() + external int numberOfExtensions; - /// 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. - ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - dispatch_data_t arg0, dispatch_data_t arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - dispatch_data_t, dispatch_data_t)>( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external CSSM_X509_EXTENSION_PTR extensions; +} - /// 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. - ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat.fromFunction( - NativeCupertinoHttp lib, - void Function(dispatch_data_t, dispatch_data_t) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - dispatch_data_t, dispatch_data_t)>( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_registerClosure( - (dispatch_data_t arg0, dispatch_data_t arg1) => - fn(arg0, arg1))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +typedef CSSM_X509_EXTENSION_PTR = ffi.Pointer; - /// 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. - ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat.listener( - NativeCupertinoHttp lib, - void Function(dispatch_data_t, dispatch_data_t) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - dispatch_data_t, dispatch_data_t)>.listener( - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_registerClosure( - (dispatch_data_t arg0, dispatch_data_t arg1) => - fn(arg0, arg1))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, dispatch_data_t, dispatch_data_t)>? - _dartFuncListenerTrampoline; +final class cssm_x509_tbs_certificate extends ffi.Struct { + external SecAsn1Item version; - void call(dispatch_data_t arg0, dispatch_data_t arg1) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - dispatch_data_t arg0, dispatch_data_t arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, dispatch_data_t, - dispatch_data_t)>()(_id, arg0, arg1); -} + external SecAsn1Item serialNumber; -final class sec_protocol_options extends ffi.Opaque {} + external SecAsn1AlgId signature; -typedef sec_protocol_options_t = ffi.Pointer; -typedef sec_protocol_pre_shared_key_selection_t = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_pre_shared_key_selection_t - = ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t - arg2)>>() - .asFunction< - void Function(sec_protocol_metadata_t, dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>()( - arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_registerClosure( - void Function(sec_protocol_metadata_t, dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t) - fn) { - final id = - ++_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureRegistryIndex; - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) => - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); + external CSSM_X509_NAME issuer; -class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + external CSSM_X509_VALIDITY validity; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external CSSM_X509_NAME subject; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet.fromFunction( - NativeCupertinoHttp lib, - void Function(sec_protocol_metadata_t, dispatch_data_t, - Dartsec_protocol_pre_shared_key_selection_complete_t) - fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, sec_protocol_metadata_t, dispatch_data_t, sec_protocol_pre_shared_key_selection_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_registerClosure( - (sec_protocol_metadata_t arg0, dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) => - fn(arg0, arg1, ObjCBlock_ffiVoid_dispatchdatat._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + external SecAsn1PubKeyInfo subjectPublicKeyInfo; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet.listener( - NativeCupertinoHttp lib, - void Function(sec_protocol_metadata_t, dispatch_data_t, - Dartsec_protocol_pre_shared_key_selection_complete_t) - fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, sec_protocol_metadata_t, dispatch_data_t, sec_protocol_pre_shared_key_selection_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_registerClosure( - (sec_protocol_metadata_t arg0, dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t arg2) => - fn(arg0, arg1, ObjCBlock_ffiVoid_dispatchdatat._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>? - _dartFuncListenerTrampoline; + external SecAsn1Item issuerUniqueIdentifier; - void - call(sec_protocol_metadata_t arg0, dispatch_data_t arg1, - Dartsec_protocol_pre_shared_key_selection_complete_t arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - dispatch_data_t arg1, - sec_protocol_pre_shared_key_selection_complete_t - arg2)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - dispatch_data_t, - sec_protocol_pre_shared_key_selection_complete_t)>()( - _id, arg0, arg1, arg2._id); -} + external SecAsn1Item subjectUniqueIdentifier; -typedef sec_protocol_pre_shared_key_selection_complete_t - = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_pre_shared_key_selection_complete_t - = ObjCBlock_ffiVoid_dispatchdatat; -typedef sec_protocol_key_update_t = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_key_update_t - = ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1)>>() - .asFunction< - void Function(sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_registerClosure( - void Function( - sec_protocol_metadata_t, sec_protocol_key_update_complete_t) - fn) { - final id = - ++_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureRegistryIndex; - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); + external CSSM_X509_EXTENSIONS extensions; } -void _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1) => - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureRegistry[ - block.ref.target.address]!(arg0, arg1); +typedef CSSM_X509_NAME = cssm_x509_name; +typedef CSSM_X509_VALIDITY = x509_validity; +typedef CSSM_X509_EXTENSIONS = cssm_x509_extensions; -class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +final class cssm_x509_signature extends ffi.Struct { + external SecAsn1AlgId algorithmIdentifier; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + external SecAsn1Item encrypted; +} - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet.fromFunction( - NativeCupertinoHttp lib, - void Function( - sec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) - fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_registerClosure( - (sec_protocol_metadata_t arg0, sec_protocol_key_update_complete_t arg1) => - fn(arg0, ObjCBlock_ffiVoid._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +final class cssm_x509_signed_certificate extends ffi.Struct { + external CSSM_X509_TBS_CERTIFICATE certificate; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet.listener( - NativeCupertinoHttp lib, - void Function(sec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) - fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_registerClosure( - (sec_protocol_metadata_t arg0, sec_protocol_key_update_complete_t arg1) => - fn(arg0, ObjCBlock_ffiVoid._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>? _dartFuncListenerTrampoline; - - void call(sec_protocol_metadata_t arg0, - Dartsec_protocol_key_update_complete_t arg1) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_protocol_key_update_complete_t arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, sec_protocol_metadata_t, - sec_protocol_key_update_complete_t)>()(_id, arg0, arg1._id); + external CSSM_X509_SIGNATURE signature; } -typedef sec_protocol_key_update_complete_t = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_key_update_complete_t = ObjCBlock_ffiVoid; -typedef sec_protocol_challenge_t = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_challenge_t - = ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1)>>() - .asFunction< - void Function(sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_registerClosure( - void Function( - sec_protocol_metadata_t, sec_protocol_challenge_complete_t) - fn) { - final id = - ++_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureRegistryIndex; - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); +typedef CSSM_X509_TBS_CERTIFICATE = cssm_x509_tbs_certificate; +typedef CSSM_X509_SIGNATURE = cssm_x509_signature; + +final class cssm_x509ext_policyQualifierInfo extends ffi.Struct { + external SecAsn1Oid policyQualifierId; + + external SecAsn1Item value; } -void _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1) => - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureRegistry[ - block.ref.target.address]!(arg0, arg1); +final class cssm_x509ext_policyQualifiers extends ffi.Struct { + @uint32() + external int numberOfPolicyQualifiers; -class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + external ffi.Pointer policyQualifier; +} - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +typedef CSSM_X509EXT_POLICYQUALIFIERINFO = cssm_x509ext_policyQualifierInfo; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet.fromFunction( - NativeCupertinoHttp lib, - void Function( - sec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) - fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_registerClosure( - (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => - fn(arg0, ObjCBlock_ffiVoid_secidentityt._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +final class cssm_x509ext_policyInfo extends ffi.Struct { + external SecAsn1Oid policyIdentifier; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet.listener( - NativeCupertinoHttp lib, - void Function(sec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) - fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, sec_protocol_metadata_t, sec_protocol_challenge_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_registerClosure( - (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => - fn(arg0, ObjCBlock_ffiVoid_secidentityt._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>? _dartFuncListenerTrampoline; - - void call(sec_protocol_metadata_t arg0, - Dartsec_protocol_challenge_complete_t arg1) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_protocol_challenge_complete_t arg1)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, sec_protocol_metadata_t, - sec_protocol_challenge_complete_t)>()(_id, arg0, arg1._id); + external CSSM_X509EXT_POLICYQUALIFIERS policyQualifiers; } -typedef sec_protocol_challenge_complete_t = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_challenge_complete_t = ObjCBlock_ffiVoid_secidentityt; -void _ObjCBlock_ffiVoid_secidentityt_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, sec_identity_t arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_secidentityt_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_secidentityt_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_secidentityt_registerClosure( - void Function(sec_identity_t) fn) { - final id = ++_ObjCBlock_ffiVoid_secidentityt_closureRegistryIndex; - _ObjCBlock_ffiVoid_secidentityt_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_secidentityt_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, sec_identity_t arg0) => - _ObjCBlock_ffiVoid_secidentityt_closureRegistry[block.ref.target.address]!( - arg0); - -class ObjCBlock_ffiVoid_secidentityt extends _ObjCBlockBase { - ObjCBlock_ffiVoid_secidentityt._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +typedef CSSM_X509EXT_POLICYQUALIFIERS = cssm_x509ext_policyQualifiers; - /// 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. - ObjCBlock_ffiVoid_secidentityt.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, sec_identity_t)>( - _ObjCBlock_ffiVoid_secidentityt_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +final class cssm_x509_revoked_cert_entry extends ffi.Struct { + external SecAsn1Item certificateSerialNumber; - /// 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. - ObjCBlock_ffiVoid_secidentityt.fromFunction( - NativeCupertinoHttp lib, void Function(sec_identity_t) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, sec_identity_t)>( - _ObjCBlock_ffiVoid_secidentityt_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_secidentityt_registerClosure( - (sec_identity_t arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + external CSSM_X509_TIME revocationDate; - /// 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. - ObjCBlock_ffiVoid_secidentityt.listener( - NativeCupertinoHttp lib, void Function(sec_identity_t) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - sec_identity_t)>.listener( - _ObjCBlock_ffiVoid_secidentityt_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_secidentityt_registerClosure( - (sec_identity_t arg0) => fn(arg0))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, sec_identity_t)>? - _dartFuncListenerTrampoline; - - void call(sec_identity_t arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, sec_identity_t arg0)>>() - .asFunction, sec_identity_t)>()( - _id, arg0); + external CSSM_X509_EXTENSIONS extensions; } -typedef sec_protocol_verify_t = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_verify_t - = ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet; -void - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2)>>() - .asFunction< - void Function(sec_protocol_metadata_t, sec_trust_t, - sec_protocol_verify_complete_t)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureRegistry = - {}; -int _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_registerClosure( - void Function(sec_protocol_metadata_t, sec_trust_t, - sec_protocol_verify_complete_t) - fn) { - final id = - ++_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureRegistryIndex; - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2) => - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); +final class cssm_x509_revoked_cert_list extends ffi.Struct { + @uint32() + external int numberOfRevokedCertEntries; -class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + external CSSM_X509_REVOKED_CERT_ENTRY_PTR revokedCertEntry; +} - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(sec_protocol_metadata_t arg0, - sec_trust_t arg1, sec_protocol_verify_complete_t arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +typedef CSSM_X509_REVOKED_CERT_ENTRY_PTR + = ffi.Pointer; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet.fromFunction( - NativeCupertinoHttp lib, - void Function(sec_protocol_metadata_t, sec_trust_t, Dartsec_protocol_verify_complete_t) - fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_registerClosure( - (sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2) => - fn(arg0, arg1, ObjCBlock_ffiVoid_bool._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +final class cssm_x509_tbs_certlist extends ffi.Struct { + external SecAsn1Item version; - /// 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. - ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet.listener( - NativeCupertinoHttp lib, - void Function(sec_protocol_metadata_t, sec_trust_t, - Dartsec_protocol_verify_complete_t) - fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, sec_protocol_metadata_t, sec_trust_t, sec_protocol_verify_complete_t)>.listener( - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_registerClosure( - (sec_protocol_metadata_t arg0, sec_trust_t arg1, - sec_protocol_verify_complete_t arg2) => - fn(arg0, arg1, ObjCBlock_ffiVoid_bool._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>? _dartFuncListenerTrampoline; + external SecAsn1AlgId signature; - void call(sec_protocol_metadata_t arg0, sec_trust_t arg1, - Dartsec_protocol_verify_complete_t arg2) => - _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, - sec_protocol_metadata_t arg0, - sec_trust_t arg1, - sec_protocol_verify_complete_t arg2)>>() - .asFunction< - void Function( - ffi.Pointer<_ObjCBlock>, - sec_protocol_metadata_t, - sec_trust_t, - sec_protocol_verify_complete_t)>()(_id, arg0, arg1, arg2._id); -} + external CSSM_X509_NAME issuer; -typedef sec_protocol_verify_complete_t = ffi.Pointer<_ObjCBlock>; -typedef Dartsec_protocol_verify_complete_t = ObjCBlock_ffiVoid_bool; -void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, bool arg0) => - block.ref.target - .cast>() - .asFunction()(arg0); -final _ObjCBlock_ffiVoid_bool_closureRegistry = {}; -int _ObjCBlock_ffiVoid_bool_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_bool_registerClosure( - void Function(bool) fn) { - final id = ++_ObjCBlock_ffiVoid_bool_closureRegistryIndex; - _ObjCBlock_ffiVoid_bool_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} + external CSSM_X509_TIME thisUpdate; -void _ObjCBlock_ffiVoid_bool_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, bool arg0) => - _ObjCBlock_ffiVoid_bool_closureRegistry[block.ref.target.address]!(arg0); + external CSSM_X509_TIME nextUpdate; + + external CSSM_X509_REVOKED_CERT_LIST_PTR revokedCertificates; -class ObjCBlock_ffiVoid_bool extends _ObjCBlockBase { - ObjCBlock_ffiVoid_bool._(ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + external CSSM_X509_EXTENSIONS extensions; +} - /// 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. - ObjCBlock_ffiVoid_bool.fromFunctionPointer(NativeCupertinoHttp lib, - ffi.Pointer> ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Bool)>(_ObjCBlock_ffiVoid_bool_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +typedef CSSM_X509_REVOKED_CERT_LIST_PTR + = ffi.Pointer; - /// 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. - ObjCBlock_ffiVoid_bool.fromFunction( - NativeCupertinoHttp lib, void Function(bool) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Bool)>( - _ObjCBlock_ffiVoid_bool_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_bool_registerClosure( - (bool arg0) => fn(arg0))), - lib); - static ffi.Pointer? _dartFuncTrampoline; +final class cssm_x509_signed_crl extends ffi.Struct { + external CSSM_X509_TBS_CERTLIST tbsCertList; - /// 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. - ObjCBlock_ffiVoid_bool.listener( - NativeCupertinoHttp lib, void Function(bool) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Bool)>.listener( - _ObjCBlock_ffiVoid_bool_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_bool_registerClosure( - (bool arg0) => fn(arg0))), - lib); - static ffi - .NativeCallable, ffi.Bool)>? - _dartFuncListenerTrampoline; - - void call(bool arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock> block, ffi.Bool arg0)>>() - .asFunction, bool)>()(_id, arg0); + external CSSM_X509_SIGNATURE signature; } -final class SSLContext extends ffi.Opaque {} +typedef CSSM_X509_TBS_CERTLIST = cssm_x509_tbs_certlist; -abstract class SSLSessionOption { - static const int kSSLSessionOptionBreakOnServerAuth = 0; - static const int kSSLSessionOptionBreakOnCertRequested = 1; - static const int kSSLSessionOptionBreakOnClientAuth = 2; - static const int kSSLSessionOptionFalseStart = 3; - static const int kSSLSessionOptionSendOneByteRecord = 4; - static const int kSSLSessionOptionAllowServerIdentityChange = 5; - static const int kSSLSessionOptionFallback = 6; - static const int kSSLSessionOptionBreakOnClientHello = 7; - static const int kSSLSessionOptionAllowRenegotiation = 8; - static const int kSSLSessionOptionEnableSessionTickets = 9; -} +final class __CE_OtherName extends ffi.Struct { + external SecAsn1Oid typeId; -abstract class SSLSessionState { - static const int kSSLIdle = 0; - static const int kSSLHandshake = 1; - static const int kSSLConnected = 2; - static const int kSSLClosed = 3; - static const int kSSLAborted = 4; + external SecAsn1Item value; } -abstract class SSLClientCertificateState { - static const int kSSLClientCertNone = 0; - static const int kSSLClientCertRequested = 1; - static const int kSSLClientCertSent = 2; - static const int kSSLClientCertRejected = 3; -} +final class __CE_GeneralName extends ffi.Struct { + @ffi.UnsignedInt() + external int nameTypeAsInt; + + __CE_GeneralNameType get nameType => + __CE_GeneralNameType.fromValue(nameTypeAsInt); -abstract class SSLProtocolSide { - static const int kSSLServerSide = 0; - static const int kSSLClientSide = 1; + @CSSM_BOOL() + external int berEncoded; + + external SecAsn1Item name; } -abstract class SSLConnectionType { - static const int kSSLStreamType = 0; - static const int kSSLDatagramType = 1; +enum __CE_GeneralNameType { + GNT_OtherName(0), + GNT_RFC822Name(1), + GNT_DNSName(2), + GNT_X400Address(3), + GNT_DirectoryName(4), + GNT_EdiPartyName(5), + GNT_URI(6), + GNT_IPAddress(7), + GNT_RegisteredID(8); + + final int value; + const __CE_GeneralNameType(this.value); + + static __CE_GeneralNameType fromValue(int value) => switch (value) { + 0 => GNT_OtherName, + 1 => GNT_RFC822Name, + 2 => GNT_DNSName, + 3 => GNT_X400Address, + 4 => GNT_DirectoryName, + 5 => GNT_EdiPartyName, + 6 => GNT_URI, + 7 => GNT_IPAddress, + 8 => GNT_RegisteredID, + _ => + throw ArgumentError("Unknown value for __CE_GeneralNameType: $value"), + }; } -typedef SSLContextRef = ffi.Pointer; -typedef SSLReadFunc = ffi.Pointer>; -typedef SSLReadFuncFunction = OSStatus Function(SSLConnectionRef connection, - ffi.Pointer data, ffi.Pointer dataLength); -typedef DartSSLReadFuncFunction = DartSInt32 Function( - SSLConnectionRef connection, - ffi.Pointer data, - ffi.Pointer dataLength); -typedef SSLConnectionRef = ffi.Pointer; -typedef SSLWriteFunc = ffi.Pointer>; -typedef SSLWriteFuncFunction = OSStatus Function(SSLConnectionRef connection, - ffi.Pointer data, ffi.Pointer dataLength); -typedef DartSSLWriteFuncFunction = DartSInt32 Function( - SSLConnectionRef connection, - ffi.Pointer data, - ffi.Pointer dataLength); +final class __CE_GeneralNames extends ffi.Struct { + @uint32() + external int numNames; -abstract class SSLAuthenticate { - static const int kNeverAuthenticate = 0; - static const int kAlwaysAuthenticate = 1; - static const int kTryAuthenticate = 2; + external ffi.Pointer generalName; } -/// NSURLSession is a replacement API for NSURLConnection. It provides -/// options that affect the policy of, and various aspects of the -/// mechanism by which NSURLRequest objects are retrieved from the -/// network. -/// -/// An NSURLSession may be bound to a delegate object. The delegate is -/// invoked for certain events during the lifetime of a session, such as -/// server authentication or determining whether a resource to be loaded -/// should be converted into a download. -/// -/// NSURLSession instances are thread-safe. -/// -/// The default NSURLSession uses a system provided delegate and is -/// appropriate to use in place of existing code that uses -/// +[NSURLConnection sendAsynchronousRequest:queue:completionHandler:] -/// -/// An NSURLSession creates NSURLSessionTask objects which represent the -/// action of a resource being loaded. These are analogous to -/// NSURLConnection objects but provide for more control and a unified -/// delegate model. -/// -/// NSURLSessionTask objects are always created in a suspended state and -/// must be sent the -resume message before they will execute. -/// -/// Subclasses of NSURLSessionTask are used to syntactically -/// differentiate between data and file downloads. -/// -/// An NSURLSessionDataTask receives the resource as a series of calls to -/// the URLSession:dataTask:didReceiveData: delegate method. This is type of -/// task most commonly associated with retrieving objects for immediate parsing -/// by the consumer. -/// -/// An NSURLSessionUploadTask differs from an NSURLSessionDataTask -/// in how its instance is constructed. Upload tasks are explicitly created -/// by referencing a file or data object to upload, or by utilizing the -/// -URLSession:task:needNewBodyStream: delegate message to supply an upload -/// body. -/// -/// An NSURLSessionDownloadTask will directly write the response data to -/// a temporary file. When completed, the delegate is sent -/// URLSession:downloadTask:didFinishDownloadingToURL: and given an opportunity -/// to move this file to a permanent location in its sandboxed container, or to -/// otherwise read the file. If canceled, an NSURLSessionDownloadTask can -/// produce a data blob that can be used to resume a download at a later -/// time. -/// -/// Beginning with iOS 9 and Mac OS X 10.11, NSURLSessionStream is -/// available as a task type. This allows for direct TCP/IP connection -/// to a given host and port with optional secure handshaking and -/// navigation of proxies. Data tasks may also be upgraded to a -/// NSURLSessionStream task via the HTTP Upgrade: header and appropriate -/// use of the pipelining option of NSURLSessionConfiguration. See RFC -/// 2817 and RFC 6455 for information about the Upgrade: header, and -/// comments below on turning data tasks into stream tasks. -/// -/// An NSURLSessionWebSocketTask is a task that allows clients to connect to servers supporting -/// WebSocket. The task will perform the HTTP handshake to upgrade the connection -/// and once the WebSocket handshake is successful, the client can read and write -/// messages that will be framed using the WebSocket protocol by the framework. -class NSURLSession extends NSObject { - NSURLSession._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +typedef CE_GeneralName = __CE_GeneralName; - /// 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); - } +final class __CE_AuthorityKeyID extends ffi.Struct { + @CSSM_BOOL() + external int keyIdentifierPresent; - /// Returns a [NSURLSession] that wraps the given raw object pointer. - static NSURLSession castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSession._(other, lib, retain: retain, release: release); - } + external SecAsn1Item keyIdentifier; - /// 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); - } + @CSSM_BOOL() + external int generalNamesPresent; - /// The shared session uses the currently set global NSURLCache, - /// NSHTTPCookieStorage and NSURLCredentialStorage objects. - static NSURLSession getSharedSession(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_438( - _lib._class_NSURLSession1, _lib._sel_sharedSession1); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } + external ffi.Pointer generalNames; - /// Customization of NSURLSession occurs during creation of a new session. - /// If you only need to use the convenience routines with custom - /// configuration options it is not necessary to specify a delegate. - /// If you do specify a delegate, the delegate will be retained until after - /// the delegate has been sent the URLSession:didBecomeInvalidWithError: message. - static NSURLSession sessionWithConfiguration_( - NativeCupertinoHttp _lib, NSURLSessionConfiguration configuration) { - final _ret = _lib._objc_msgSend_454(_lib._class_NSURLSession1, - _lib._sel_sessionWithConfiguration_1, configuration._id); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } + @CSSM_BOOL() + external int serialNumberPresent; - static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( - NativeCupertinoHttp _lib, - NSURLSessionConfiguration configuration, - NSObject? delegate, - NSOperationQueue? queue) { - final _ret = _lib._objc_msgSend_455( - _lib._class_NSURLSession1, - _lib._sel_sessionWithConfiguration_delegate_delegateQueue_1, - configuration._id, - delegate?._id ?? ffi.nullptr, - queue?._id ?? ffi.nullptr); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } + external SecAsn1Item serialNumber; +} - NSOperationQueue get delegateQueue { - final _ret = _lib._objc_msgSend_420(_id, _lib._sel_delegateQueue1); - return NSOperationQueue._(_ret, _lib, retain: true, release: true); - } +typedef CE_GeneralNames = __CE_GeneralNames; - NSObject? get delegate { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_delegate1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } +final class __CE_ExtendedKeyUsage extends ffi.Struct { + @uint32() + external int numPurposes; - NSURLSessionConfiguration get configuration { - final _ret = _lib._objc_msgSend_439(_id, _lib._sel_configuration1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } + external CSSM_OID_PTR purposes; +} - /// The sessionDescription property is available for the developer to - /// provide a descriptive label for the session. - NSString? get sessionDescription { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_sessionDescription1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } +typedef CSSM_OID_PTR = ffi.Pointer; - /// The sessionDescription property is available for the developer to - /// provide a descriptive label for the session. - set sessionDescription(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setSessionDescription_1, value?._id ?? ffi.nullptr); - } +final class __CE_BasicConstraints extends ffi.Struct { + @CSSM_BOOL() + external int cA; - /// -finishTasksAndInvalidate returns immediately and existing tasks will be allowed - /// to run to completion. New tasks may not be created. The session - /// will continue to make delegate callbacks until URLSession:didBecomeInvalidWithError: - /// has been issued. - /// - /// -finishTasksAndInvalidate and -invalidateAndCancel do not - /// have any effect on the shared session singleton. - /// - /// When invalidating a background session, it is not safe to create another background - /// session with the same identifier until URLSession:didBecomeInvalidWithError: has - /// been issued. - void finishTasksAndInvalidate() { - _lib._objc_msgSend_1(_id, _lib._sel_finishTasksAndInvalidate1); - } + @CSSM_BOOL() + external int pathLenConstraintPresent; - /// -invalidateAndCancel acts as -finishTasksAndInvalidate, but issues - /// -cancel to all outstanding tasks for this session. Note task - /// cancellation is subject to the state of the task, and some tasks may - /// have already have completed at the time they are sent -cancel. - void invalidateAndCancel() { - _lib._objc_msgSend_1(_id, _lib._sel_invalidateAndCancel1); - } + @uint32() + external int pathLenConstraint; +} - /// empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue. - void resetWithCompletionHandler_(ObjCBlock_ffiVoid completionHandler) { - _lib._objc_msgSend_415( - _id, _lib._sel_resetWithCompletionHandler_1, completionHandler._id); - } +final class __CE_PolicyQualifierInfo extends ffi.Struct { + external SecAsn1Oid policyQualifierId; - /// flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue. - void flushWithCompletionHandler_(ObjCBlock_ffiVoid completionHandler) { - _lib._objc_msgSend_415( - _id, _lib._sel_flushWithCompletionHandler_1, completionHandler._id); - } + external SecAsn1Item qualifier; +} - /// invokes completionHandler with outstanding data, upload and download tasks. - void getTasksWithCompletionHandler_( - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray completionHandler) { - _lib._objc_msgSend_456( - _id, _lib._sel_getTasksWithCompletionHandler_1, completionHandler._id); - } +final class __CE_PolicyInformation extends ffi.Struct { + external SecAsn1Oid certPolicyId; - /// invokes completionHandler with all outstanding tasks. - void getAllTasksWithCompletionHandler_( - ObjCBlock_ffiVoid_NSArray1 completionHandler) { - _lib._objc_msgSend_457(_id, _lib._sel_getAllTasksWithCompletionHandler_1, - completionHandler._id); - } + @uint32() + external int numPolicyQualifiers; - /// Creates a data task with the given request. The request may have a body stream. - NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_458( - _id, _lib._sel_dataTaskWithRequest_1, request._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } + external ffi.Pointer policyQualifiers; +} - /// Creates a data task to retrieve the contents of the given URL. - NSURLSessionDataTask dataTaskWithURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_459(_id, _lib._sel_dataTaskWithURL_1, url._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } +typedef CE_PolicyQualifierInfo = __CE_PolicyQualifierInfo; - /// Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL - NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( - NSURLRequest request, NSURL fileURL) { - final _ret = _lib._objc_msgSend_461(_id, - _lib._sel_uploadTaskWithRequest_fromFile_1, request._id, fileURL._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } +final class __CE_CertPolicies extends ffi.Struct { + @uint32() + external int numPolicies; - /// Creates an upload task with the given request. The body of the request is provided from the bodyData. - NSURLSessionUploadTask uploadTaskWithRequest_fromData_( - NSURLRequest request, NSData bodyData) { - final _ret = _lib._objc_msgSend_462(_id, - _lib._sel_uploadTaskWithRequest_fromData_1, request._id, bodyData._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } + external ffi.Pointer policies; +} - /// Creates an upload task from a resume data blob. Requires the server to support the latest resumable uploads - /// Internet-Draft from the HTTP Working Group, found at - /// https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/ - /// If resuming from an upload file, the file must still exist and be unmodified. If the upload cannot be successfully - /// resumed, URLSession:task:didCompleteWithError: will be called. - /// - /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. - /// - Returns: A new session upload task, or nil if the resumeData is invalid. - NSURLSessionUploadTask uploadTaskWithResumeData_(NSData resumeData) { - final _ret = _lib._objc_msgSend_463( - _id, _lib._sel_uploadTaskWithResumeData_1, resumeData._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } +typedef CE_PolicyInformation = __CE_PolicyInformation; - /// Creates an upload task with the given request. The previously set body stream of the request (if any) is ignored and the URLSession:task:needNewBodyStream: delegate will be called when the body payload is required. - NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_464( - _id, _lib._sel_uploadTaskWithStreamedRequest_1, request._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } +final class __CE_DistributionPointName extends ffi.Struct { + @ffi.UnsignedInt() + external int nameTypeAsInt; - /// Creates a download task with the given request. - NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_465( - _id, _lib._sel_downloadTaskWithRequest_1, request._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } + __CE_CrlDistributionPointNameType get nameType => + __CE_CrlDistributionPointNameType.fromValue(nameTypeAsInt); - /// Creates a download task to download the contents of the given URL. - NSURLSessionDownloadTask downloadTaskWithURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_466(_id, _lib._sel_downloadTaskWithURL_1, url._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } + external UnnamedUnion5 dpn; +} - /// Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called. - NSURLSessionDownloadTask downloadTaskWithResumeData_(NSData resumeData) { - final _ret = _lib._objc_msgSend_467( - _id, _lib._sel_downloadTaskWithResumeData_1, resumeData._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } +enum __CE_CrlDistributionPointNameType { + CE_CDNT_FullName(0), + CE_CDNT_NameRelativeToCrlIssuer(1); - /// Creates a bidirectional stream task to a given host and port. - NSURLSessionStreamTask streamTaskWithHostName_port_( - NSString hostname, DartNSInteger port) { - final _ret = _lib._objc_msgSend_470( - _id, _lib._sel_streamTaskWithHostName_port_1, hostname._id, port); - return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); - } + final int value; + const __CE_CrlDistributionPointNameType(this.value); - /// Creates a bidirectional stream task with an NSNetService to identify the endpoint. - /// The NSNetService will be resolved before any IO completes. - NSURLSessionStreamTask streamTaskWithNetService_(NSNetService service) { - final _ret = _lib._objc_msgSend_471( - _id, _lib._sel_streamTaskWithNetService_1, service._id); - return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); - } + static __CE_CrlDistributionPointNameType fromValue(int value) => + switch (value) { + 0 => CE_CDNT_FullName, + 1 => CE_CDNT_NameRelativeToCrlIssuer, + _ => throw ArgumentError( + "Unknown value for __CE_CrlDistributionPointNameType: $value"), + }; +} - /// Creates a WebSocket task given the url. The given url must have a ws or wss scheme. - NSURLSessionWebSocketTask webSocketTaskWithURL_(NSURL url) { - final _ret = - _lib._objc_msgSend_478(_id, _lib._sel_webSocketTaskWithURL_1, url._id); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } +final class UnnamedUnion5 extends ffi.Union { + external ffi.Pointer fullName; - /// Creates a WebSocket task given the url and an array of protocols. The protocols will be used in the WebSocket handshake to - /// negotiate a preferred protocol with the server - /// Note - The protocol will not affect the WebSocket framing. More details on the protocol can be found by reading the WebSocket RFC - NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( - NSURL url, NSArray protocols) { - final _ret = _lib._objc_msgSend_479(_id, - _lib._sel_webSocketTaskWithURL_protocols_1, url._id, protocols._id); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } + external CSSM_X509_RDN_PTR rdn; +} - /// Creates a WebSocket task given the request. The request properties can be modified and will be used by the task during the HTTP handshake phase. - /// Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol - /// and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server. - NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest request) { - final _ret = _lib._objc_msgSend_480( - _id, _lib._sel_webSocketTaskWithRequest_1, request._id); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } +final class __CE_CRLDistributionPoint extends ffi.Struct { + external ffi.Pointer distPointName; - @override - NSURLSession init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSession._(_ret, _lib, retain: true, release: true); - } + @CSSM_BOOL() + external int reasonsPresent; - static NSURLSession new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_new1); - return NSURLSession._(_ret, _lib, retain: false, release: true); - } + @CE_CrlDistReasonFlags() + external int reasons; - /// data task convenience methods. These methods create tasks that - /// bypass the normal delegate calls for response and data delivery, - /// and provide a simple cancelable asynchronous interface to receiving - /// data. Errors will be returned in the NSURLErrorDomain, - /// see . The delegate, if any, will still be - /// called for authentication challenges. - NSURLSessionDataTask dataTaskWithRequest_completionHandler_( - NSURLRequest request, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_481( - _id, - _lib._sel_dataTaskWithRequest_completionHandler_1, - request._id, - completionHandler._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } - - NSURLSessionDataTask dataTaskWithURL_completionHandler_(NSURL url, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_482( - _id, - _lib._sel_dataTaskWithURL_completionHandler_1, - url._id, - completionHandler._id); - return NSURLSessionDataTask._(_ret, _lib, retain: true, release: true); - } - - /// upload convenience method. - NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( - NSURLRequest request, - NSURL fileURL, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_483( - _id, - _lib._sel_uploadTaskWithRequest_fromFile_completionHandler_1, - request._id, - fileURL._id, - completionHandler._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } + external ffi.Pointer crlIssuer; +} - NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( - NSURLRequest request, - NSData? bodyData, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_484( - _id, - _lib._sel_uploadTaskWithRequest_fromData_completionHandler_1, - request._id, - bodyData?._id ?? ffi.nullptr, - completionHandler._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - /// Creates a URLSessionUploadTask from a resume data blob. If resuming from an upload - /// file, the file must still exist and be unmodified. - /// - /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. - /// - Parameter completionHandler: The completion handler to call when the load request is complete. - /// - Returns: A new session upload task, or nil if the resumeData is invalid. - NSURLSessionUploadTask uploadTaskWithResumeData_completionHandler_( - NSData resumeData, - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_485( - _id, - _lib._sel_uploadTaskWithResumeData_completionHandler_1, - resumeData._id, - completionHandler._id); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } - - /// download task convenience methods. When a download successfully - /// completes, the NSURL will point to a file that must be read or - /// copied during the invocation of the completion routine. The file - /// will be removed automatically. - NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( - NSURLRequest request, - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_486( - _id, - _lib._sel_downloadTaskWithRequest_completionHandler_1, - request._id, - completionHandler._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } +typedef CE_DistributionPointName = __CE_DistributionPointName; +typedef CE_CrlDistReasonFlags = uint8; - NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_(NSURL url, - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_487( - _id, - _lib._sel_downloadTaskWithURL_completionHandler_1, - url._id, - completionHandler._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } +final class __CE_CRLDistPointsSyntax extends ffi.Struct { + @uint32() + external int numDistPoints; - NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( - NSData resumeData, - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError completionHandler) { - final _ret = _lib._objc_msgSend_488( - _id, - _lib._sel_downloadTaskWithResumeData_completionHandler_1, - resumeData._id, - completionHandler._id); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } + external ffi.Pointer distPoints; +} - static NSURLSession allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSession1, _lib._sel_allocWithZone_1, zone); - return NSURLSession._(_ret, _lib, retain: false, release: true); - } +typedef CE_CRLDistributionPoint = __CE_CRLDistributionPoint; - static NSURLSession alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLSession1, _lib._sel_alloc1); - return NSURLSession._(_ret, _lib, retain: false, release: true); - } +final class __CE_AccessDescription extends ffi.Struct { + external SecAsn1Oid accessMethod; + + external CE_GeneralName accessLocation; } -/// Configuration options for an NSURLSession. When a session is -/// created, a copy of the configuration object is made - you cannot -/// modify the configuration of a session after it has been created. -/// -/// The shared session uses the global singleton credential, cache -/// and cookie storage objects. -/// -/// An ephemeral session has no persistent disk storage for cookies, -/// cache or credentials. -/// -/// A background session can be used to perform networking operations -/// on behalf of a suspended application, within certain constraints. -class NSURLSessionConfiguration extends NSObject { - NSURLSessionConfiguration._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +final class __CE_AuthorityInfoAccess extends ffi.Struct { + @uint32() + external int numAccessDescriptions; - /// 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); - } + external ffi.Pointer accessDescriptions; +} - /// Returns a [NSURLSessionConfiguration] that wraps the given raw object pointer. - static NSURLSessionConfiguration castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionConfiguration._(other, lib, - retain: retain, release: release); - } +typedef CE_AccessDescription = __CE_AccessDescription; - /// 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); - } +final class __CE_SemanticsInformation extends ffi.Struct { + external ffi.Pointer semanticsIdentifier; - static NSURLSessionConfiguration getDefaultSessionConfiguration( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_439(_lib._class_NSURLSessionConfiguration1, - _lib._sel_defaultSessionConfiguration1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } + external ffi.Pointer + nameRegistrationAuthorities; +} - static NSURLSessionConfiguration getEphemeralSessionConfiguration( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_439(_lib._class_NSURLSessionConfiguration1, - _lib._sel_ephemeralSessionConfiguration1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } +typedef CE_NameRegistrationAuthorities = CE_GeneralNames; - static NSURLSessionConfiguration - backgroundSessionConfigurationWithIdentifier_( - NativeCupertinoHttp _lib, NSString identifier) { - final _ret = _lib._objc_msgSend_440( - _lib._class_NSURLSessionConfiguration1, - _lib._sel_backgroundSessionConfigurationWithIdentifier_1, - identifier._id); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } +final class __CE_QC_Statement extends ffi.Struct { + external SecAsn1Oid statementId; - /// identifier for the background session configuration - NSString? get identifier { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_identifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + external ffi.Pointer semanticsInfo; - /// default cache policy for requests - int get requestCachePolicy { - return _lib._objc_msgSend_344(_id, _lib._sel_requestCachePolicy1); - } + external ffi.Pointer otherInfo; +} - /// default cache policy for requests - set requestCachePolicy(int value) { - return _lib._objc_msgSend_422( - _id, _lib._sel_setRequestCachePolicy_1, value); - } +typedef CE_SemanticsInformation = __CE_SemanticsInformation; - /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. - DartNSTimeInterval get timeoutIntervalForRequest { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret(_id, _lib._sel_timeoutIntervalForRequest1) - : _lib._objc_msgSend_90(_id, _lib._sel_timeoutIntervalForRequest1); - } +final class __CE_QC_Statements extends ffi.Struct { + @uint32() + external int numQCStatements; - /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. - set timeoutIntervalForRequest(DartNSTimeInterval value) { - return _lib._objc_msgSend_411( - _id, _lib._sel_setTimeoutIntervalForRequest_1, value); - } + external ffi.Pointer qcStatements; +} - /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. - DartNSTimeInterval get timeoutIntervalForResource { - return _lib._objc_msgSend_useVariants1 - ? _lib._objc_msgSend_90_fpret( - _id, _lib._sel_timeoutIntervalForResource1) - : _lib._objc_msgSend_90(_id, _lib._sel_timeoutIntervalForResource1); - } +typedef CE_QC_Statement = __CE_QC_Statement; - /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. - set timeoutIntervalForResource(DartNSTimeInterval value) { - return _lib._objc_msgSend_411( - _id, _lib._sel_setTimeoutIntervalForResource_1, value); - } +final class __CE_IssuingDistributionPoint extends ffi.Struct { + external ffi.Pointer distPointName; - /// type of service for requests. - int get networkServiceType { - return _lib._objc_msgSend_345(_id, _lib._sel_networkServiceType1); - } + @CSSM_BOOL() + external int onlyUserCertsPresent; - /// type of service for requests. - set networkServiceType(int value) { - return _lib._objc_msgSend_423( - _id, _lib._sel_setNetworkServiceType_1, value); - } + @CSSM_BOOL() + external int onlyUserCerts; - /// allow request to route over cellular. - bool get allowsCellularAccess { - return _lib._objc_msgSend_11(_id, _lib._sel_allowsCellularAccess1); - } + @CSSM_BOOL() + external int onlyCACertsPresent; - /// allow request to route over cellular. - set allowsCellularAccess(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setAllowsCellularAccess_1, value); - } + @CSSM_BOOL() + external int onlyCACerts; - /// allow request to route over expensive networks. Defaults to YES. - bool get allowsExpensiveNetworkAccess { - return _lib._objc_msgSend_11(_id, _lib._sel_allowsExpensiveNetworkAccess1); - } + @CSSM_BOOL() + external int onlySomeReasonsPresent; - /// allow request to route over expensive networks. Defaults to YES. - set allowsExpensiveNetworkAccess(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setAllowsExpensiveNetworkAccess_1, value); - } + @CE_CrlDistReasonFlags() + external int onlySomeReasons; - /// allow request to route over networks in constrained mode. Defaults to YES. - bool get allowsConstrainedNetworkAccess { - return _lib._objc_msgSend_11( - _id, _lib._sel_allowsConstrainedNetworkAccess1); - } + @CSSM_BOOL() + external int indirectCrlPresent; - /// allow request to route over networks in constrained mode. Defaults to YES. - set allowsConstrainedNetworkAccess(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setAllowsConstrainedNetworkAccess_1, value); - } + @CSSM_BOOL() + external int indirectCrl; +} - /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. - bool get requiresDNSSECValidation { - return _lib._objc_msgSend_11(_id, _lib._sel_requiresDNSSECValidation1); - } +final class __CE_GeneralSubtree extends ffi.Struct { + external ffi.Pointer base; - /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. - set requiresDNSSECValidation(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setRequiresDNSSECValidation_1, value); - } + @uint32() + external int minimum; - /// Causes tasks to wait for network connectivity to become available, rather - /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) - /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest - /// property does not apply, but the timeoutIntervalForResource property does. - /// - /// Unsatisfactory connectivity (that requires waiting) includes cases where the - /// device has limited or insufficient connectivity for a task (e.g., only has a - /// cellular connection but the allowsCellularAccess property is NO, or requires - /// a VPN connection in order to reach the desired host). - /// - /// Default value is NO. Ignored by background sessions, as background sessions - /// always wait for connectivity. - bool get waitsForConnectivity { - return _lib._objc_msgSend_11(_id, _lib._sel_waitsForConnectivity1); - } + @CSSM_BOOL() + external int maximumPresent; - /// Causes tasks to wait for network connectivity to become available, rather - /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) - /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest - /// property does not apply, but the timeoutIntervalForResource property does. - /// - /// Unsatisfactory connectivity (that requires waiting) includes cases where the - /// device has limited or insufficient connectivity for a task (e.g., only has a - /// cellular connection but the allowsCellularAccess property is NO, or requires - /// a VPN connection in order to reach the desired host). - /// - /// Default value is NO. Ignored by background sessions, as background sessions - /// always wait for connectivity. - set waitsForConnectivity(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setWaitsForConnectivity_1, value); - } + @uint32() + external int maximum; +} - /// allows background tasks to be scheduled at the discretion of the system for optimal performance. - bool get discretionary { - return _lib._objc_msgSend_11(_id, _lib._sel_isDiscretionary1); - } +final class __CE_GeneralSubtrees extends ffi.Struct { + @uint32() + external int numSubtrees; - /// allows background tasks to be scheduled at the discretion of the system for optimal performance. - set discretionary(bool value) { - return _lib._objc_msgSend_386(_id, _lib._sel_setDiscretionary_1, value); - } + external ffi.Pointer subtrees; +} - /// The identifier of the shared data container into which files in background sessions should be downloaded. - /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or - /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. - NSString? get sharedContainerIdentifier { - final _ret = - _lib._objc_msgSend_55(_id, _lib._sel_sharedContainerIdentifier1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } +typedef CE_GeneralSubtree = __CE_GeneralSubtree; - /// The identifier of the shared data container into which files in background sessions should be downloaded. - /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or - /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. - set sharedContainerIdentifier(NSString? value) { - return _lib._objc_msgSend_395(_id, _lib._sel_setSharedContainerIdentifier_1, - value?._id ?? ffi.nullptr); - } +final class __CE_NameConstraints extends ffi.Struct { + external ffi.Pointer permitted; - /// Allows the app to be resumed or launched in the background when tasks in background sessions complete - /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: - /// and the default value is YES. - /// - /// NOTE: macOS apps based on AppKit do not support background launch. - bool get sessionSendsLaunchEvents { - return _lib._objc_msgSend_11(_id, _lib._sel_sessionSendsLaunchEvents1); - } + external ffi.Pointer excluded; +} - /// Allows the app to be resumed or launched in the background when tasks in background sessions complete - /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: - /// and the default value is YES. - /// - /// NOTE: macOS apps based on AppKit do not support background launch. - set sessionSendsLaunchEvents(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setSessionSendsLaunchEvents_1, value); - } +typedef CE_GeneralSubtrees = __CE_GeneralSubtrees; - /// The proxy dictionary, as described by - NSDictionary? get connectionProxyDictionary { - final _ret = - _lib._objc_msgSend_288(_id, _lib._sel_connectionProxyDictionary1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } +final class __CE_PolicyMapping extends ffi.Struct { + external SecAsn1Oid issuerDomainPolicy; - /// The proxy dictionary, as described by - set connectionProxyDictionary(NSDictionary? value) { - return _lib._objc_msgSend_425(_id, _lib._sel_setConnectionProxyDictionary_1, - value?._id ?? ffi.nullptr); - } + external SecAsn1Oid subjectDomainPolicy; +} - /// The minimum allowable versions of the TLS protocol, from - int get TLSMinimumSupportedProtocol { - return _lib._objc_msgSend_441(_id, _lib._sel_TLSMinimumSupportedProtocol1); - } +final class __CE_PolicyMappings extends ffi.Struct { + @uint32() + external int numPolicyMappings; - /// The minimum allowable versions of the TLS protocol, from - set TLSMinimumSupportedProtocol(int value) { - return _lib._objc_msgSend_442( - _id, _lib._sel_setTLSMinimumSupportedProtocol_1, value); - } + external ffi.Pointer policyMappings; +} - /// The maximum allowable versions of the TLS protocol, from - int get TLSMaximumSupportedProtocol { - return _lib._objc_msgSend_441(_id, _lib._sel_TLSMaximumSupportedProtocol1); - } +typedef CE_PolicyMapping = __CE_PolicyMapping; - /// The maximum allowable versions of the TLS protocol, from - set TLSMaximumSupportedProtocol(int value) { - return _lib._objc_msgSend_442( - _id, _lib._sel_setTLSMaximumSupportedProtocol_1, value); - } +final class __CE_PolicyConstraints extends ffi.Struct { + @CSSM_BOOL() + external int requireExplicitPolicyPresent; - /// The minimum allowable versions of the TLS protocol, from - int get TLSMinimumSupportedProtocolVersion { - return _lib._objc_msgSend_443( - _id, _lib._sel_TLSMinimumSupportedProtocolVersion1); - } + @uint32() + external int requireExplicitPolicy; - /// The minimum allowable versions of the TLS protocol, from - set TLSMinimumSupportedProtocolVersion(int value) { - return _lib._objc_msgSend_444( - _id, _lib._sel_setTLSMinimumSupportedProtocolVersion_1, value); - } + @CSSM_BOOL() + external int inhibitPolicyMappingPresent; + + @uint32() + external int inhibitPolicyMapping; +} + +final class CE_Data extends ffi.Union { + external CE_AuthorityKeyID authorityKeyID; + + external CE_SubjectKeyID subjectKeyID; + + @CE_KeyUsage() + external int keyUsage; - /// The maximum allowable versions of the TLS protocol, from - int get TLSMaximumSupportedProtocolVersion { - return _lib._objc_msgSend_443( - _id, _lib._sel_TLSMaximumSupportedProtocolVersion1); - } + external CE_GeneralNames subjectAltName; - /// The maximum allowable versions of the TLS protocol, from - set TLSMaximumSupportedProtocolVersion(int value) { - return _lib._objc_msgSend_444( - _id, _lib._sel_setTLSMaximumSupportedProtocolVersion_1, value); - } + external CE_GeneralNames issuerAltName; - /// Allow the use of HTTP pipelining - bool get HTTPShouldUsePipelining { - return _lib._objc_msgSend_11(_id, _lib._sel_HTTPShouldUsePipelining1); - } + external CE_ExtendedKeyUsage extendedKeyUsage; - /// Allow the use of HTTP pipelining - set HTTPShouldUsePipelining(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setHTTPShouldUsePipelining_1, value); - } + external CE_BasicConstraints basicConstraints; - /// Allow the session to set cookies on requests - bool get HTTPShouldSetCookies { - return _lib._objc_msgSend_11(_id, _lib._sel_HTTPShouldSetCookies1); - } + external CE_CertPolicies certPolicies; - /// Allow the session to set cookies on requests - set HTTPShouldSetCookies(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setHTTPShouldSetCookies_1, value); - } + @CE_NetscapeCertType() + external int netscapeCertType; - /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. - int get HTTPCookieAcceptPolicy { - return _lib._objc_msgSend_434(_id, _lib._sel_HTTPCookieAcceptPolicy1); - } + @CE_CrlNumber() + external int crlNumber; - /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. - set HTTPCookieAcceptPolicy(int value) { - return _lib._objc_msgSend_435( - _id, _lib._sel_setHTTPCookieAcceptPolicy_1, value); - } + @CE_DeltaCrl() + external int deltaCrl; - /// Specifies additional headers which will be set on outgoing requests. - /// Note that these headers are added to the request only if not already present. - NSDictionary? get HTTPAdditionalHeaders { - final _ret = _lib._objc_msgSend_288(_id, _lib._sel_HTTPAdditionalHeaders1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, release: true); - } + @CE_CrlReason() + external int crlReason; - /// Specifies additional headers which will be set on outgoing requests. - /// Note that these headers are added to the request only if not already present. - set HTTPAdditionalHeaders(NSDictionary? value) { - return _lib._objc_msgSend_425( - _id, _lib._sel_setHTTPAdditionalHeaders_1, value?._id ?? ffi.nullptr); - } + external CE_CRLDistPointsSyntax crlDistPoints; - /// The maximum number of simultaneous persistent connections per host - DartNSInteger get HTTPMaximumConnectionsPerHost { - return _lib._objc_msgSend_86(_id, _lib._sel_HTTPMaximumConnectionsPerHost1); - } + external CE_IssuingDistributionPoint issuingDistPoint; - /// The maximum number of simultaneous persistent connections per host - set HTTPMaximumConnectionsPerHost(DartNSInteger value) { - return _lib._objc_msgSend_416( - _id, _lib._sel_setHTTPMaximumConnectionsPerHost_1, value); - } + external CE_AuthorityInfoAccess authorityInfoAccess; - /// The cookie storage object to use, or nil to indicate that no cookies should be handled - NSHTTPCookieStorage? get HTTPCookieStorage { - final _ret = _lib._objc_msgSend_445(_id, _lib._sel_HTTPCookieStorage1); - return _ret.address == 0 - ? null - : NSHTTPCookieStorage._(_ret, _lib, retain: true, release: true); - } + external CE_QC_Statements qualifiedCertStatements; - /// The cookie storage object to use, or nil to indicate that no cookies should be handled - set HTTPCookieStorage(NSHTTPCookieStorage? value) { - return _lib._objc_msgSend_446( - _id, _lib._sel_setHTTPCookieStorage_1, value?._id ?? ffi.nullptr); - } + external CE_NameConstraints nameConstraints; - /// The credential storage object, or nil to indicate that no credential storage is to be used - NSURLCredentialStorage? get URLCredentialStorage { - final _ret = _lib._objc_msgSend_447(_id, _lib._sel_URLCredentialStorage1); - return _ret.address == 0 - ? null - : NSURLCredentialStorage._(_ret, _lib, retain: true, release: true); - } + external CE_PolicyMappings policyMappings; - /// The credential storage object, or nil to indicate that no credential storage is to be used - set URLCredentialStorage(NSURLCredentialStorage? value) { - return _lib._objc_msgSend_448( - _id, _lib._sel_setURLCredentialStorage_1, value?._id ?? ffi.nullptr); - } + external CE_PolicyConstraints policyConstraints; - /// The URL resource cache, or nil to indicate that no caching is to be performed - NSURLCache? get URLCache { - final _ret = _lib._objc_msgSend_449(_id, _lib._sel_URLCache1); - return _ret.address == 0 - ? null - : NSURLCache._(_ret, _lib, retain: true, release: true); - } + @CE_InhibitAnyPolicy() + external int inhibitAnyPolicy; - /// The URL resource cache, or nil to indicate that no caching is to be performed - set URLCache(NSURLCache? value) { - return _lib._objc_msgSend_450( - _id, _lib._sel_setURLCache_1, value?._id ?? ffi.nullptr); - } + external SecAsn1Item rawData; +} - /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open - /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) - bool get shouldUseExtendedBackgroundIdleMode { - return _lib._objc_msgSend_11( - _id, _lib._sel_shouldUseExtendedBackgroundIdleMode1); - } +typedef CE_AuthorityKeyID = __CE_AuthorityKeyID; +typedef CE_SubjectKeyID = SecAsn1Item; +typedef CE_KeyUsage = uint16; +typedef CE_ExtendedKeyUsage = __CE_ExtendedKeyUsage; +typedef CE_BasicConstraints = __CE_BasicConstraints; +typedef CE_CertPolicies = __CE_CertPolicies; +typedef CE_NetscapeCertType = uint16; +typedef CE_CrlNumber = uint32; +typedef CE_DeltaCrl = uint32; +typedef CE_CrlReason = uint32; +typedef CE_CRLDistPointsSyntax = __CE_CRLDistPointsSyntax; +typedef CE_IssuingDistributionPoint = __CE_IssuingDistributionPoint; +typedef CE_AuthorityInfoAccess = __CE_AuthorityInfoAccess; +typedef CE_QC_Statements = __CE_QC_Statements; +typedef CE_NameConstraints = __CE_NameConstraints; +typedef CE_PolicyMappings = __CE_PolicyMappings; +typedef CE_PolicyConstraints = __CE_PolicyConstraints; +typedef CE_InhibitAnyPolicy = uint32; - /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open - /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) - set shouldUseExtendedBackgroundIdleMode(bool value) { - return _lib._objc_msgSend_386( - _id, _lib._sel_setShouldUseExtendedBackgroundIdleMode_1, value); - } +final class __CE_DataAndType extends ffi.Struct { + @ffi.UnsignedInt() + external int typeAsInt; - /// An optional array of Class objects which subclass NSURLProtocol. - /// The Class will be sent +canInitWithRequest: when determining if - /// an instance of the class can be used for a given URL scheme. - /// You should not use +[NSURLProtocol registerClass:], as that - /// method will register your class with the default session rather - /// than with an instance of NSURLSession. - /// Custom NSURLProtocol subclasses are not available to background - /// sessions. - NSArray? get protocolClasses { - final _ret = _lib._objc_msgSend_188(_id, _lib._sel_protocolClasses1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } + __CE_DataType get type => __CE_DataType.fromValue(typeAsInt); - /// An optional array of Class objects which subclass NSURLProtocol. - /// The Class will be sent +canInitWithRequest: when determining if - /// an instance of the class can be used for a given URL scheme. - /// You should not use +[NSURLProtocol registerClass:], as that - /// method will register your class with the default session rather - /// than with an instance of NSURLSession. - /// Custom NSURLProtocol subclasses are not available to background - /// sessions. - set protocolClasses(NSArray? value) { - return _lib._objc_msgSend_451( - _id, _lib._sel_setProtocolClasses_1, value?._id ?? ffi.nullptr); - } + external CE_Data extension1; - /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone - int get multipathServiceType { - return _lib._objc_msgSend_452(_id, _lib._sel_multipathServiceType1); - } + @CSSM_BOOL() + external int critical; +} - /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone - set multipathServiceType(int value) { - return _lib._objc_msgSend_453( - _id, _lib._sel_setMultipathServiceType_1, value); - } +enum __CE_DataType { + DT_AuthorityKeyID(0), + DT_SubjectKeyID(1), + DT_KeyUsage(2), + DT_SubjectAltName(3), + DT_IssuerAltName(4), + DT_ExtendedKeyUsage(5), + DT_BasicConstraints(6), + DT_CertPolicies(7), + DT_NetscapeCertType(8), + DT_CrlNumber(9), + DT_DeltaCrl(10), + DT_CrlReason(11), + DT_CrlDistributionPoints(12), + DT_IssuingDistributionPoint(13), + DT_AuthorityInfoAccess(14), + DT_Other(15), + DT_QC_Statements(16), + DT_NameConstraints(17), + DT_PolicyMappings(18), + DT_PolicyConstraints(19), + DT_InhibitAnyPolicy(20); + + final int value; + const __CE_DataType(this.value); + + static __CE_DataType fromValue(int value) => switch (value) { + 0 => DT_AuthorityKeyID, + 1 => DT_SubjectKeyID, + 2 => DT_KeyUsage, + 3 => DT_SubjectAltName, + 4 => DT_IssuerAltName, + 5 => DT_ExtendedKeyUsage, + 6 => DT_BasicConstraints, + 7 => DT_CertPolicies, + 8 => DT_NetscapeCertType, + 9 => DT_CrlNumber, + 10 => DT_DeltaCrl, + 11 => DT_CrlReason, + 12 => DT_CrlDistributionPoints, + 13 => DT_IssuingDistributionPoint, + 14 => DT_AuthorityInfoAccess, + 15 => DT_Other, + 16 => DT_QC_Statements, + 17 => DT_NameConstraints, + 18 => DT_PolicyMappings, + 19 => DT_PolicyConstraints, + 20 => DT_InhibitAnyPolicy, + _ => throw ArgumentError("Unknown value for __CE_DataType: $value"), + }; +} - @override - NSURLSessionConfiguration init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } +final class cssm_acl_process_subject_selector extends ffi.Struct { + @uint16() + external int version; - static NSURLSessionConfiguration new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionConfiguration1, _lib._sel_new1); - return NSURLSessionConfiguration._(_ret, _lib, - retain: false, release: true); - } + @uint16() + external int mask; - static NSURLSessionConfiguration backgroundSessionConfiguration_( - NativeCupertinoHttp _lib, NSString identifier) { - final _ret = _lib._objc_msgSend_440(_lib._class_NSURLSessionConfiguration1, - _lib._sel_backgroundSessionConfiguration_1, identifier._id); - return NSURLSessionConfiguration._(_ret, _lib, retain: true, release: true); - } + @uint32() + external int uid; - static NSURLSessionConfiguration allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionConfiguration1, - _lib._sel_allocWithZone_1, zone); - return NSURLSessionConfiguration._(_ret, _lib, - retain: false, release: true); - } + @uint32() + external int gid; +} - static NSURLSessionConfiguration alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionConfiguration1, _lib._sel_alloc1); - return NSURLSessionConfiguration._(_ret, _lib, - retain: false, release: true); - } +final class cssm_acl_keychain_prompt_selector extends ffi.Struct { + @uint16() + external int version; + + @uint16() + external int flags; } -class NSURLCredentialStorage extends _ObjCWrapper { - NSURLCredentialStorage._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +final class cssm_appledl_open_parameters extends ffi.Struct { + @uint32() + external int length; - /// 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); - } + @uint32() + external int version; - /// Returns a [NSURLCredentialStorage] that wraps the given raw object pointer. - static NSURLCredentialStorage castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLCredentialStorage._(other, lib, - retain: retain, release: release); - } + @CSSM_BOOL() + external int autoCommit; - /// 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); - } + @uint32() + external int mask; + + @mode_t() + external int mode; } -/// ! -/// @enum NSURLSessionMultipathServiceType -/// -/// @discussion The NSURLSessionMultipathServiceType enum defines constants that -/// can be used to specify the multipath service type to associate an NSURLSession. The -/// multipath service type determines whether multipath TCP should be attempted and the conditions -/// for creating and switching between subflows. Using these service types requires the appropriate entitlement. Any connection attempt will fail if the process does not have the required entitlement. -/// A primary interface is a generally less expensive interface in terms of both cost and power (such as WiFi or ethernet). A secondary interface is more expensive (such as 3G or LTE). -/// -/// @constant NSURLSessionMultipathServiceTypeNone Specifies that multipath tcp should not be used. Connections will use a single flow. -/// This is the default value. No entitlement is required to set this value. -/// -/// @constant NSURLSessionMultipathServiceTypeHandover Specifies that a secondary subflow should only be used -/// when the primary subflow is not performing adequately. Requires the com.apple.developer.networking.multipath entitlement. -/// -/// @constant NSURLSessionMultipathServiceTypeInteractive Specifies that a secondary subflow should be used if the -/// primary subflow is not performing adequately (packet loss, high round trip times, bandwidth issues). The secondary -/// subflow will be created more aggressively than with NSURLSessionMultipathServiceTypeHandover. Requires the com.apple.developer.networking.multipath entitlement. -/// -/// @constant NSURLSessionMultipathServiceTypeAggregate Specifies that multiple subflows across multiple interfaces should be -/// used for better bandwidth. This mode is only available for experimentation on devices configured for development use. -/// It can be enabled in the Developer section of the Settings app. -abstract class NSURLSessionMultipathServiceType { - /// None - no multipath (default) - static const int NSURLSessionMultipathServiceTypeNone = 0; +final class cssm_applecspdl_db_settings_parameters extends ffi.Struct { + @uint32() + external int idleTimeout; - /// Handover - secondary flows brought up when primary flow is not performing adequately. - static const int NSURLSessionMultipathServiceTypeHandover = 1; + @uint8() + external int lockOnSleep; +} - /// Interactive - secondary flows created more aggressively. - static const int NSURLSessionMultipathServiceTypeInteractive = 2; +final class cssm_applecspdl_db_is_locked_parameters extends ffi.Struct { + @uint8() + external int isLocked; +} - /// Aggregate - multiple subflows used for greater bandwidth. - static const int NSURLSessionMultipathServiceTypeAggregate = 3; +final class cssm_applecspdl_db_change_password_parameters extends ffi.Struct { + external ffi.Pointer accessCredentials; } -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = ++_ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSArray_NSArray_NSArray extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +typedef CSSM_ACCESS_CREDENTIALS = cssm_access_credentials; - /// 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. - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +final class CSSM_APPLE_TP_NAME_OID extends ffi.Struct { + external ffi.Pointer string; - /// 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. - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.fromFunction(NativeCupertinoHttp lib, void Function(NSArray, NSArray, NSArray) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - NSArray._(arg0, lib, retain: true, release: true), - NSArray._(arg1, lib, retain: true, release: true), - NSArray._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + external ffi.Pointer oid; +} - /// 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. - ObjCBlock_ffiVoid_NSArray_NSArray_NSArray.listener(NativeCupertinoHttp lib, void Function(NSArray, NSArray, NSArray) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSArray_NSArray_NSArray_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - NSArray._(arg0, lib, retain: true, release: true), - NSArray._(arg1, lib, retain: true, release: true), - NSArray._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; +final class CSSM_APPLE_TP_CERT_REQUEST extends ffi.Struct { + @CSSM_CSP_HANDLE() + external int cspHand; - void call(NSArray arg0, NSArray arg1, NSArray arg2) => _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>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>()(_id, arg0._id, arg1._id, arg2._id); -} + @CSSM_CL_HANDLE() + external int clHand; -void _ObjCBlock_ffiVoid_NSArray1_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSArray1_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSArray1_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSArray1_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSArray1_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSArray1_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSArray1_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSArray1_closureRegistry[block.ref.target.address]!( - arg0); - -class ObjCBlock_ffiVoid_NSArray1 extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSArray1._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + @uint32() + external int serialNumber; - /// 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. - ObjCBlock_ffiVoid_NSArray1.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray1_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + @uint32() + external int numSubjectNames; - /// 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. - ObjCBlock_ffiVoid_NSArray1.fromFunction( - NativeCupertinoHttp lib, void Function(NSArray) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSArray1_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSArray1_registerClosure( - (ffi.Pointer arg0) => - fn(NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + external ffi.Pointer subjectNames; - /// 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. - ObjCBlock_ffiVoid_NSArray1.listener( - NativeCupertinoHttp lib, void Function(NSArray) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSArray1_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSArray1_registerClosure( - (ffi.Pointer arg0) => - fn(NSArray._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSArray arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0._id); -} + @uint32() + external int numIssuerNames; -/// An NSURLSessionUploadTask does not currently provide any additional -/// functionality over an NSURLSessionDataTask. All delegate messages -/// that may be sent referencing an NSURLSessionDataTask equally apply -/// to NSURLSessionUploadTasks. -class NSURLSessionUploadTask extends NSURLSessionDataTask { - NSURLSessionUploadTask._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + external ffi.Pointer issuerNames; - /// 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); - } + external CSSM_X509_NAME_PTR issuerNameX509; - /// Returns a [NSURLSessionUploadTask] that wraps the given raw object pointer. - static NSURLSessionUploadTask castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionUploadTask._(other, lib, - retain: retain, release: release); - } + external ffi.Pointer certPublicKey; - /// 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); - } + external ffi.Pointer issuerPrivateKey; - @override - NSURLSessionUploadTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionUploadTask._(_ret, _lib, retain: true, release: true); - } + @CSSM_ALGORITHMS() + external int signatureAlg; - static NSURLSessionUploadTask new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionUploadTask1, _lib._sel_new1); - return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); - } + external SecAsn1Oid signatureOid; - /// Cancels an upload and calls the completion handler with resume data for later use. - /// resumeData will be nil if the server does not support the latest resumable uploads - /// Internet-Draft from the HTTP Working Group, found at - /// https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/ - /// - /// - Parameter completionHandler: The completion handler to call when the upload has been successfully canceled. - void cancelByProducingResumeData_( - ObjCBlock_ffiVoid_NSData completionHandler) { - _lib._objc_msgSend_460( - _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._id); - } + @uint32() + external int notBefore; - static NSURLSessionUploadTask allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionUploadTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); - } + @uint32() + external int notAfter; - static NSURLSessionUploadTask alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionUploadTask1, _lib._sel_alloc1); - return NSURLSessionUploadTask._(_ret, _lib, retain: false, release: true); - } -} + @uint32() + external int numExtensions; -void _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSData_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSData_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSData_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSData_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + external ffi.Pointer extensions; + + external ffi.Pointer challengeString; } -void _ObjCBlock_ffiVoid_NSData_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSData_closureRegistry[block.ref.target.address]!(arg0); +typedef CSSM_X509_NAME_PTR = ffi.Pointer; +typedef CSSM_KEY = cssm_key; +typedef CE_DataAndType = __CE_DataAndType; -class ObjCBlock_ffiVoid_NSData extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +final class CSSM_APPLE_TP_SSL_OPTIONS extends ffi.Struct { + @uint32() + external int Version; - /// 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. - ObjCBlock_ffiVoid_NSData.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + @uint32() + external int ServerNameLen; - /// 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. - ObjCBlock_ffiVoid_NSData.fromFunction( - NativeCupertinoHttp lib, void Function(NSData?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + external ffi.Pointer ServerName; - /// 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. - ObjCBlock_ffiVoid_NSData.listener( - NativeCupertinoHttp lib, void Function(NSData?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSData? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); + @uint32() + external int Flags; } -/// NSURLSessionDownloadTask is a task that represents a download to -/// local storage. -class NSURLSessionDownloadTask extends NSURLSessionTask { - NSURLSessionDownloadTask._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +final class CSSM_APPLE_TP_CRL_OPTIONS extends ffi.Struct { + @uint32() + external int Version; - /// 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); - } + @CSSM_APPLE_TP_CRL_OPT_FLAGS() + external int CrlFlags; - /// Returns a [NSURLSessionDownloadTask] that wraps the given raw object pointer. - static NSURLSessionDownloadTask castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionDownloadTask._(other, lib, - retain: retain, release: release); - } + external CSSM_DL_DB_HANDLE_PTR crlStore; +} - /// 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); - } +typedef CSSM_APPLE_TP_CRL_OPT_FLAGS = uint32; - /// Cancel the download (and calls the superclass -cancel). If - /// conditions will allow for resuming the download in the future, the - /// callback will be called with an opaque data blob, which may be used - /// with -downloadTaskWithResumeData: to attempt to resume the download. - /// If resume data cannot be created, the completion handler will be - /// called with nil resumeData. - void cancelByProducingResumeData_( - ObjCBlock_ffiVoid_NSData completionHandler) { - _lib._objc_msgSend_460( - _id, _lib._sel_cancelByProducingResumeData_1, completionHandler._id); - } +final class CSSM_APPLE_TP_SMIME_OPTIONS extends ffi.Struct { + @uint32() + external int Version; - @override - NSURLSessionDownloadTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionDownloadTask._(_ret, _lib, retain: true, release: true); - } + @CE_KeyUsage() + external int IntendedUsage; - static NSURLSessionDownloadTask new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionDownloadTask1, _lib._sel_new1); - return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); - } + @uint32() + external int SenderEmailLen; - static NSURLSessionDownloadTask allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionDownloadTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); - } + external ffi.Pointer SenderEmail; +} - static NSURLSessionDownloadTask alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionDownloadTask1, _lib._sel_alloc1); - return NSURLSessionDownloadTask._(_ret, _lib, retain: false, release: true); - } +final class CSSM_APPLE_TP_ACTION_DATA extends ffi.Struct { + @uint32() + external int Version; + + @CSSM_APPLE_TP_ACTION_FLAGS() + external int ActionFlags; } -/// An NSURLSessionStreamTask provides an interface to perform reads -/// and writes to a TCP/IP stream created via NSURLSession. This task -/// may be explicitly created from an NSURLSession, or created as a -/// result of the appropriate disposition response to a -/// -URLSession:dataTask:didReceiveResponse: delegate message. -/// -/// NSURLSessionStreamTask can be used to perform asynchronous reads -/// and writes. Reads and writes are enqueued and executed serially, -/// with the completion handler being invoked on the sessions delegate -/// queue. If an error occurs, or the task is canceled, all -/// outstanding read and write calls will have their completion -/// handlers invoked with an appropriate error. -/// -/// It is also possible to create NSInputStream and NSOutputStream -/// instances from an NSURLSessionTask by sending -/// -captureStreams to the task. All outstanding reads and writes are -/// completed before the streams are created. Once the streams are -/// delivered to the session delegate, the task is considered complete -/// and will receive no more messages. These streams are -/// disassociated from the underlying session. -class NSURLSessionStreamTask extends NSURLSessionTask { - NSURLSessionStreamTask._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +typedef CSSM_APPLE_TP_ACTION_FLAGS = uint32; - /// 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); - } +final class CSSM_TP_APPLE_EVIDENCE_INFO extends ffi.Struct { + @CSSM_TP_APPLE_CERT_STATUS() + external int StatusBits; - /// Returns a [NSURLSessionStreamTask] that wraps the given raw object pointer. - static NSURLSessionStreamTask castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionStreamTask._(other, lib, - retain: retain, release: release); - } + @uint32() + external int NumStatusCodes; - /// 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); - } + external ffi.Pointer StatusCodes; - /// Read minBytes, or at most maxBytes bytes and invoke the completion - /// handler on the sessions delegate queue with the data or an error. - /// If an error occurs, any outstanding reads will also fail, and new - /// read requests will error out immediately. - void readDataOfMinLength_maxLength_timeout_completionHandler_( - DartNSUInteger minBytes, - DartNSUInteger maxBytes, - DartNSTimeInterval timeout, - ObjCBlock_ffiVoid_NSData_bool_NSError completionHandler) { - _lib._objc_msgSend_468( - _id, - _lib._sel_readDataOfMinLength_maxLength_timeout_completionHandler_1, - minBytes, - maxBytes, - timeout, - completionHandler._id); - } + @uint32() + external int Index; - /// Write the data completely to the underlying socket. If all the - /// bytes have not been written by the timeout, a timeout error will - /// occur. Note that invocation of the completion handler does not - /// guarantee that the remote side has received all the bytes, only - /// that they have been written to the kernel. - void writeData_timeout_completionHandler_(NSData data, - DartNSTimeInterval timeout, ObjCBlock_ffiVoid_NSError completionHandler) { - _lib._objc_msgSend_469(_id, _lib._sel_writeData_timeout_completionHandler_1, - data._id, timeout, completionHandler._id); - } + external CSSM_DL_DB_HANDLE DlDbHandle; - /// -captureStreams completes any already enqueued reads - /// and writes, and then invokes the - /// URLSession:streamTask:didBecomeInputStream:outputStream: delegate - /// message. When that message is received, the task object is - /// considered completed and will not receive any more delegate - /// messages. - void captureStreams() { - _lib._objc_msgSend_1(_id, _lib._sel_captureStreams1); - } + external CSSM_DB_UNIQUE_RECORD_PTR UniqueRecord; +} - /// Enqueue a request to close the write end of the underlying socket. - /// All outstanding IO will complete before the write side of the - /// socket is closed. The server, however, may continue to write bytes - /// back to the client, so best practice is to continue reading from - /// the server until you receive EOF. - void closeWrite() { - _lib._objc_msgSend_1(_id, _lib._sel_closeWrite1); - } +typedef CSSM_TP_APPLE_CERT_STATUS = uint32; +typedef CSSM_DL_DB_HANDLE = cssm_dl_db_handle; +typedef CSSM_DB_UNIQUE_RECORD_PTR = ffi.Pointer; - /// Enqueue a request to close the read side of the underlying socket. - /// All outstanding IO will complete before the read side is closed. - /// You may continue writing to the server. - void closeRead() { - _lib._objc_msgSend_1(_id, _lib._sel_closeRead1); - } +final class CSSM_TP_APPLE_EVIDENCE_HEADER extends ffi.Struct { + @uint32() + external int Version; +} + +final class CSSM_APPLE_CL_CSR_REQUEST extends ffi.Struct { + external CSSM_X509_NAME_PTR subjectNameX509; - /// Begin encrypted handshake. The handshake begins after all pending - /// IO has completed. TLS authentication callbacks are sent to the - /// session's -URLSession:task:didReceiveChallenge:completionHandler: - void startSecureConnection() { - _lib._objc_msgSend_1(_id, _lib._sel_startSecureConnection1); - } + @CSSM_ALGORITHMS() + external int signatureAlg; - /// Cleanly close a secure connection after all pending secure IO has - /// completed. - /// - /// @warning This API is non-functional. - void stopSecureConnection() { - _lib._objc_msgSend_1(_id, _lib._sel_stopSecureConnection1); - } + external SecAsn1Oid signatureOid; - @override - NSURLSessionStreamTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionStreamTask._(_ret, _lib, retain: true, release: true); - } + @CSSM_CSP_HANDLE() + external int cspHand; - static NSURLSessionStreamTask new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionStreamTask1, _lib._sel_new1); - return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); - } + external ffi.Pointer subjectPublicKey; - static NSURLSessionStreamTask allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionStreamTask1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); - } + external ffi.Pointer subjectPrivateKey; - static NSURLSessionStreamTask alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionStreamTask1, _lib._sel_alloc1); - return NSURLSessionStreamTask._(_ret, _lib, retain: false, release: true); - } + external ffi.Pointer challengeString; } -void _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => +final class __SecTrust extends ffi.Opaque {} + +typedef SecTrustRef = ffi.Pointer<__SecTrust>; + +enum SecTrustResultType { + kSecTrustResultInvalid(0), + kSecTrustResultProceed(1), + kSecTrustResultConfirm(2), + kSecTrustResultDeny(3), + kSecTrustResultUnspecified(4), + kSecTrustResultRecoverableTrustFailure(5), + kSecTrustResultFatalTrustFailure(6), + kSecTrustResultOtherError(7); + + final int value; + const SecTrustResultType(this.value); + + static SecTrustResultType fromValue(int value) => switch (value) { + 0 => kSecTrustResultInvalid, + 1 => kSecTrustResultProceed, + 2 => kSecTrustResultConfirm, + 3 => kSecTrustResultDeny, + 4 => kSecTrustResultUnspecified, + 5 => kSecTrustResultRecoverableTrustFailure, + 6 => kSecTrustResultFatalTrustFailure, + 7 => kSecTrustResultOtherError, + _ => + throw ArgumentError("Unknown value for SecTrustResultType: $value"), + }; +} + +typedef SecTrustCallback = ffi.Pointer; +typedef DartSecTrustCallback + = objc.ObjCBlock, ffi.Uint32)>; +void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline( + ffi.Pointer block, SecTrustRef arg0, int arg1) => block.ref.target .cast< ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, bool, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry = , bool, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure( - void Function(ffi.Pointer, bool, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSData_bool_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData_bool_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + ffi.Void Function(SecTrustRef arg0, ffi.Uint32 arg1)>>() + .asFunction()(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, SecTrustRef, ffi.Uint32)>( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline( + ffi.Pointer block, SecTrustRef arg0, int arg1) => + (objc.getBlockClosure(block) as void Function(SecTrustRef, int))( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, SecTrustRef, ffi.Uint32)>( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline( + ffi.Pointer block, SecTrustRef arg0, int arg1) { + (objc.getBlockClosure(block) as void Function(SecTrustRef, int))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, SecTrustRef, ffi.Uint32)> + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Uint32)>.listener( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, ffi.Uint32)>`. +abstract final class ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock, ffi.Uint32)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, + ffi.Uint32)>(pointer, retain: retain, release: release); /// 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. - ObjCBlock_ffiVoid_NSData_bool_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock, ffi.Uint32)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_NSData_bool_NSError.fromFunction( - NativeCupertinoHttp lib, void Function(NSData, bool, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Bool, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) => fn( - NSData._(arg0, lib, retain: true, release: true), - arg1, - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)> fromFunction( + void Function(SecTrustRef, SecTrustResultType) fn) => + objc.ObjCBlock, ffi.Uint32)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_closureCallable, + (SecTrustRef arg0, int arg1) => + fn(arg0, SecTrustResultType.fromValue(arg1))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -83898,112 +55658,138 @@ class ObjCBlock_ffiVoid_NSData_bool_NSError extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSData_bool_NSError.listener( - NativeCupertinoHttp lib, void Function(NSData, bool, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, - ffi.Pointer arg2) => - fn(NSData._(arg0, lib, retain: true, release: true), arg1, arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Bool, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSData arg0, bool arg1, NSError? arg2) => _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>, ffi.Pointer, - bool, ffi.Pointer)>()( - _id, arg0._id, arg1, arg2?._id ?? ffi.nullptr); + static objc.ObjCBlock, ffi.Uint32)> + listener(void Function(SecTrustRef, SecTrustResultType) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_listenerCallable + .nativeFunction + .cast(), + (SecTrustRef arg0, int arg1) => + fn(arg0, SecTrustResultType.fromValue(arg1))); + final wrapper = _wrapListenerBlock_129ffij(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Uint32)>(wrapper, + retain: false, release: true); + } } -void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - block.ref.target - .cast< - ffi - .NativeFunction arg0)>>() - .asFunction)>()(arg0); -final _ObjCBlock_ffiVoid_NSError_closureRegistry = - )>{}; -int _ObjCBlock_ffiVoid_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSError_registerClosure( - void Function(ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); +/// Call operator for `objc.ObjCBlock, ffi.Uint32)>`. +extension ObjCBlock_ffiVoid_SecTrustRef_SecTrustResultType_CallExtension + on objc.ObjCBlock, ffi.Uint32)> { + void call(SecTrustRef arg0, SecTrustResultType arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + SecTrustRef arg0, ffi.Uint32 arg1)>>() + .asFunction< + void Function(ffi.Pointer, SecTrustRef, + int)>()(ref.pointer, arg0, arg1.value); } -void _ObjCBlock_ffiVoid_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer arg0) => - _ObjCBlock_ffiVoid_NSError_closureRegistry[block.ref.target.address]!(arg0); - -class ObjCBlock_ffiVoid_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +typedef SecTrustWithErrorCallback = ffi.Pointer; +typedef DartSecTrustWithErrorCallback = objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)>; +void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>>() + .asFunction()( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Bool, CFErrorRef)>( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2) => + (objc.getBlockClosure(block) as void Function( + SecTrustRef, bool, CFErrorRef))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Bool, CFErrorRef)>( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline( + ffi.Pointer block, + SecTrustRef arg0, + bool arg1, + CFErrorRef arg2) { + (objc.getBlockClosure(block) as void Function(SecTrustRef, bool, CFErrorRef))( + arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, SecTrustRef, ffi.Bool, CFErrorRef)> + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, SecTrustRef, + ffi.Bool, CFErrorRef)>.listener( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. +abstract final class ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>(pointer, + retain: retain, release: release); /// 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. - ObjCBlock_ffiVoid_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi - .NativeFunction arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc + .ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_NSError.fromFunction( - NativeCupertinoHttp lib, void Function(NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSError_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSError._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + static objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)> + fromFunction(void Function(SecTrustRef, bool, CFErrorRef) fn) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_closureCallable, + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => + fn(arg0, arg1, arg2)), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -84014,371 +55800,1000 @@ class ObjCBlock_ffiVoid_NSError extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSError.listener( - NativeCupertinoHttp lib, void Function(NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSError_registerClosure( - (ffi.Pointer arg0) => fn(arg0.address == 0 - ? null - : NSError._(arg0, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer)>? - _dartFuncListenerTrampoline; - - void call(NSError? arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0)>>() - .asFunction< - void Function(ffi.Pointer<_ObjCBlock>, - ffi.Pointer)>()(_id, arg0?._id ?? ffi.nullptr); + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> listener( + void Function(SecTrustRef, bool, CFErrorRef) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_listenerCallable + .nativeFunction + .cast(), + (SecTrustRef arg0, bool arg1, CFErrorRef arg2) => fn(arg0, arg1, arg2)); + final wrapper = _wrapListenerBlock_1458n52(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer<__SecTrust>, ffi.Bool, + ffi.Pointer<__CFError>)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, ffi.Bool, ffi.Pointer<__CFError>)>`. +extension ObjCBlock_ffiVoid_SecTrustRef_bool_CFErrorRef_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer<__SecTrust>, ffi.Bool, ffi.Pointer<__CFError>)> { + void call(SecTrustRef arg0, bool arg1, CFErrorRef arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + SecTrustRef arg0, ffi.Bool arg1, CFErrorRef arg2)>>() + .asFunction< + void Function(ffi.Pointer, SecTrustRef, bool, + CFErrorRef)>()(ref.pointer, arg0, arg1, arg2); } -class NSNetService extends _ObjCWrapper { - NSNetService._(ffi.Pointer id, NativeCupertinoHttp 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( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSNetService._(other, lib, retain: retain, release: release); - } +typedef SecKeyRef = ffi.Pointer<__SecKey>; +typedef SecCertificateRef = ffi.Pointer<__SecCertificate>; - /// 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); - } +enum SecTrustOptionFlags { + kSecTrustOptionAllowExpired(1), + kSecTrustOptionLeafIsCA(2), + kSecTrustOptionFetchIssuerFromNet(4), + kSecTrustOptionAllowExpiredRoot(8), + kSecTrustOptionRequireRevPerCert(16), + kSecTrustOptionUseTrustSettings(32), + kSecTrustOptionImplicitAnchors(64); + + final int value; + const SecTrustOptionFlags(this.value); + + static SecTrustOptionFlags fromValue(int value) => switch (value) { + 1 => kSecTrustOptionAllowExpired, + 2 => kSecTrustOptionLeafIsCA, + 4 => kSecTrustOptionFetchIssuerFromNet, + 8 => kSecTrustOptionAllowExpiredRoot, + 16 => kSecTrustOptionRequireRevPerCert, + 32 => kSecTrustOptionUseTrustSettings, + 64 => kSecTrustOptionImplicitAnchors, + _ => + throw ArgumentError("Unknown value for SecTrustOptionFlags: $value"), + }; } -/// A WebSocket task can be created with a ws or wss url. A client can also provide -/// a list of protocols it wishes to advertise during the WebSocket handshake phase. -/// Once the handshake is successfully completed the client will be notified through an optional delegate. -/// All reads and writes enqueued before the completion of the handshake will be queued up and -/// executed once the handshake succeeds. Before the handshake completes, the client can be called to handle -/// redirection or authentication using the same delegates as NSURLSessionTask. WebSocket task will also provide -/// support for cookies and will store cookies to the cookie storage on the session and will attach cookies to -/// outgoing HTTP handshake requests. -class NSURLSessionWebSocketTask extends NSURLSessionTask { - NSURLSessionWebSocketTask._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +typedef CSSM_TP_VERIFY_CONTEXT_RESULT_PTR + = ffi.Pointer; +typedef SecKeychainRef = ffi.Pointer<__SecKeychain>; +typedef SecIdentityRef = ffi.Pointer<__SecIdentity>; +typedef SSLCipherSuite = ffi.Uint16; +typedef DartSSLCipherSuite = int; - /// 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); - } +/// OS_sec_trust +abstract final class OS_sec_trust { + /// Builds an object that implements the OS_sec_trust protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - /// Returns a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. - static NSURLSessionWebSocketTask castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionWebSocketTask._(other, lib, - retain: retain, release: release); + return builder.build(); } - /// 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); - } + /// Adds the implementation of the OS_sec_trust protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} - /// Sends a WebSocket message. If an error occurs, any outstanding work will also fail. - /// Note that invocation of the completion handler does not - /// guarantee that the remote side has received all the bytes, only - /// that they have been written to the kernel. - void sendMessage_completionHandler_(NSURLSessionWebSocketMessage message, - ObjCBlock_ffiVoid_NSError completionHandler) { - _lib._objc_msgSend_473(_id, _lib._sel_sendMessage_completionHandler_1, - message._id, completionHandler._id); - } +late final _protocol_OS_sec_trust = objc.getProtocol("OS_sec_trust"); - /// Reads a WebSocket message once all the frames of the message are available. - /// If the maximumMessage size is hit while buffering the frames, the receiveMessage call will error out - /// and all outstanding work will also fail resulting in the end of the task. - void receiveMessageWithCompletionHandler_( - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError - completionHandler) { - _lib._objc_msgSend_474(_id, _lib._sel_receiveMessageWithCompletionHandler_1, - completionHandler._id); - } +/// OS_sec_identity +abstract final class OS_sec_identity { + /// Builds an object that implements the OS_sec_identity protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - /// Sends a ping frame from the client side. The pongReceiveHandler is invoked when the client - /// receives a pong from the server endpoint. If a connection is lost or an error occurs before receiving - /// the pong from the endpoint, the pongReceiveHandler block will be invoked with an error. - /// Note - the pongReceiveHandler will always be called in the order in which the pings were sent. - void sendPingWithPongReceiveHandler_( - ObjCBlock_ffiVoid_NSError pongReceiveHandler) { - _lib._objc_msgSend_475(_id, _lib._sel_sendPingWithPongReceiveHandler_1, - pongReceiveHandler._id); + return builder.build(); } - /// Sends a close frame with the given closeCode. An optional reason can be provided while sending the close frame. - /// Simply calling cancel on the task will result in a cancellation frame being sent without any reason. - void cancelWithCloseCode_reason_(int closeCode, NSData? reason) { - _lib._objc_msgSend_476(_id, _lib._sel_cancelWithCloseCode_reason_1, - closeCode, reason?._id ?? ffi.nullptr); - } + /// Adds the implementation of the OS_sec_identity protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} - /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached - DartNSInteger get maximumMessageSize { - return _lib._objc_msgSend_86(_id, _lib._sel_maximumMessageSize1); - } +late final _protocol_OS_sec_identity = objc.getProtocol("OS_sec_identity"); - /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached - set maximumMessageSize(DartNSInteger value) { - return _lib._objc_msgSend_416( - _id, _lib._sel_setMaximumMessageSize_1, value); - } +/// OS_sec_certificate +abstract final class OS_sec_certificate { + /// Builds an object that implements the OS_sec_certificate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); - /// A task can be queried for it's close code at any point. When the task is not closed, it will be set to NSURLSessionWebSocketCloseCodeInvalid - int get closeCode { - return _lib._objc_msgSend_477(_id, _lib._sel_closeCode1); + return builder.build(); } - /// A task can be queried for it's close reason at any point. A nil value indicates no closeReason or that the task is still running - NSData? get closeReason { - final _ret = _lib._objc_msgSend_348(_id, _lib._sel_closeReason1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, release: true); - } + /// Adds the implementation of the OS_sec_certificate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} - @override - NSURLSessionWebSocketTask init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionWebSocketTask._(_ret, _lib, retain: true, release: true); - } +late final _protocol_OS_sec_certificate = + objc.getProtocol("OS_sec_certificate"); +typedef sec_trust_t = ffi.Pointer; +typedef Dartsec_trust_t = objc.NSObject; +typedef sec_identity_t = ffi.Pointer; +typedef Dartsec_identity_t = objc.NSObject; +void _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline( + ffi.Pointer block, sec_certificate_t arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, sec_certificate_t)>( + _ObjCBlock_ffiVoid_seccertificatet_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline( + ffi.Pointer block, sec_certificate_t arg0) => + (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_seccertificatet_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, sec_certificate_t)>( + _ObjCBlock_ffiVoid_seccertificatet_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline( + ffi.Pointer block, sec_certificate_t arg0) { + (objc.getBlockClosure(block) as void Function(sec_certificate_t))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, sec_certificate_t)> + _ObjCBlock_ffiVoid_seccertificatet_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, sec_certificate_t)>.listener( + _ObjCBlock_ffiVoid_seccertificatet_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_seccertificatet { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - static NSURLSessionWebSocketTask new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketTask1, _lib._sel_new1); - return NSURLSessionWebSocketTask._(_ret, _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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_seccertificatet_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSURLSessionWebSocketTask allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionWebSocketTask1, - _lib._sel_allocWithZone_1, zone); - return NSURLSessionWebSocketTask._(_ret, _lib, - retain: false, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(Dartsec_certificate_t) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_seccertificatet_closureCallable, + (sec_certificate_t arg0) => fn(objc.NSObject.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); - static NSURLSessionWebSocketTask alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketTask1, _lib._sel_alloc1); - return NSURLSessionWebSocketTask._(_ret, _lib, + /// 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. + static objc.ObjCBlock listener( + void Function(Dartsec_certificate_t) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_seccertificatet_listenerCallable.nativeFunction + .cast(), + (sec_certificate_t arg0) => fn( + objc.NSObject.castFromPointer(arg0, retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, retain: false, release: true); } } -/// The client can create a WebSocket message object that will be passed to the send calls -/// and will be delivered from the receive calls. The message can be initialized with data or string. -/// If initialized with data, the string property will be nil and vice versa. -class NSURLSessionWebSocketMessage extends NSObject { - NSURLSessionWebSocketMessage._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_seccertificatet_CallExtension + on objc.ObjCBlock { + void call(Dartsec_certificate_t arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + sec_certificate_t arg0)>>() + .asFunction< + void Function(ffi.Pointer, + sec_certificate_t)>()(ref.pointer, arg0.ref.pointer); +} + +typedef sec_certificate_t = ffi.Pointer; +typedef Dartsec_certificate_t = objc.NSObject; + +/// OS_sec_protocol_metadata +abstract final class OS_sec_protocol_metadata { + /// Builds an object that implements the OS_sec_protocol_metadata protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); + } + + /// Adds the implementation of the OS_sec_protocol_metadata protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} + +late final _protocol_OS_sec_protocol_metadata = + objc.getProtocol("OS_sec_protocol_metadata"); +typedef sec_protocol_metadata_t = ffi.Pointer; +typedef Dartsec_protocol_metadata_t = objc.NSObject; + +enum tls_protocol_version_t { + tls_protocol_version_TLSv10(769), + tls_protocol_version_TLSv11(770), + tls_protocol_version_TLSv12(771), + tls_protocol_version_TLSv13(772), + tls_protocol_version_DTLSv10(-257), + tls_protocol_version_DTLSv12(-259); + + final int value; + const tls_protocol_version_t(this.value); + + static tls_protocol_version_t fromValue(int value) => switch (value) { + 769 => tls_protocol_version_TLSv10, + 770 => tls_protocol_version_TLSv11, + 771 => tls_protocol_version_TLSv12, + 772 => tls_protocol_version_TLSv13, + -257 => tls_protocol_version_DTLSv10, + -259 => tls_protocol_version_DTLSv12, + _ => throw ArgumentError( + "Unknown value for tls_protocol_version_t: $value"), + }; +} + +enum SSLProtocol { + kSSLProtocolUnknown(0), + kTLSProtocol1(4), + kTLSProtocol11(7), + kTLSProtocol12(8), + kDTLSProtocol1(9), + kTLSProtocol13(10), + kDTLSProtocol12(11), + kTLSProtocolMaxSupported(999), + kSSLProtocol2(1), + kSSLProtocol3(2), + kSSLProtocol3Only(3), + kTLSProtocol1Only(5), + kSSLProtocolAll(6); + + final int value; + const SSLProtocol(this.value); + + static SSLProtocol fromValue(int value) => switch (value) { + 0 => kSSLProtocolUnknown, + 4 => kTLSProtocol1, + 7 => kTLSProtocol11, + 8 => kTLSProtocol12, + 9 => kDTLSProtocol1, + 10 => kTLSProtocol13, + 11 => kDTLSProtocol12, + 999 => kTLSProtocolMaxSupported, + 1 => kSSLProtocol2, + 2 => kSSLProtocol3, + 3 => kSSLProtocol3Only, + 5 => kTLSProtocol1Only, + 6 => kSSLProtocolAll, + _ => throw ArgumentError("Unknown value for SSLProtocol: $value"), + }; +} + +enum tls_ciphersuite_t { + tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA(10), + tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA(47), + tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA(53), + tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256(156), + tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384(157), + tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256(60), + tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256(61), + tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA(-16376), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA(-16375), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA(-16374), + tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA(-16366), + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA(-16365), + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA(-16364), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256(-16349), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384(-16348), + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256(-16345), + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384(-16344), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256(-16341), + tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384(-16340), + tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256(-16337), + tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384(-16336), + tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256(-13144), + tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256(-13143), + tls_ciphersuite_AES_128_GCM_SHA256(4865), + tls_ciphersuite_AES_256_GCM_SHA384(4866), + tls_ciphersuite_CHACHA20_POLY1305_SHA256(4867); + + final int value; + const tls_ciphersuite_t(this.value); + + static tls_ciphersuite_t fromValue(int value) => switch (value) { + 10 => tls_ciphersuite_RSA_WITH_3DES_EDE_CBC_SHA, + 47 => tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA, + 53 => tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA, + 156 => tls_ciphersuite_RSA_WITH_AES_128_GCM_SHA256, + 157 => tls_ciphersuite_RSA_WITH_AES_256_GCM_SHA384, + 60 => tls_ciphersuite_RSA_WITH_AES_128_CBC_SHA256, + 61 => tls_ciphersuite_RSA_WITH_AES_256_CBC_SHA256, + -16376 => tls_ciphersuite_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, + -16375 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + -16374 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, + -16366 => tls_ciphersuite_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, + -16365 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA, + -16364 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA, + -16349 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, + -16348 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, + -16345 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_CBC_SHA256, + -16344 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_CBC_SHA384, + -16341 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + -16340 => tls_ciphersuite_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + -16337 => tls_ciphersuite_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + -16336 => tls_ciphersuite_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + -13144 => tls_ciphersuite_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, + -13143 => tls_ciphersuite_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, + 4865 => tls_ciphersuite_AES_128_GCM_SHA256, + 4866 => tls_ciphersuite_AES_256_GCM_SHA384, + 4867 => tls_ciphersuite_CHACHA20_POLY1305_SHA256, + _ => throw ArgumentError("Unknown value for tls_ciphersuite_t: $value"), + }; +} - /// 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); - } +void _ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_Uint16_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint16)>(_ObjCBlock_ffiVoid_Uint16_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_Uint16_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_Uint16_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Uint16)>(_ObjCBlock_ffiVoid_Uint16_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_Uint16_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, ffi.Uint16)> + _ObjCBlock_ffiVoid_Uint16_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Uint16)>.listener(_ObjCBlock_ffiVoid_Uint16_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_Uint16 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - /// Returns a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. - static NSURLSessionWebSocketMessage castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionWebSocketMessage._(other, lib, - retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_Uint16_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// 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); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(int) fn) => + objc.ObjCBlock( + objc.newClosureBlock(_ObjCBlock_ffiVoid_Uint16_closureCallable, + (int arg0) => fn(arg0)), + retain: false, + release: true); - /// Create a message with data type - NSURLSessionWebSocketMessage initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_228(_id, _lib._sel_initWithData_1, data._id); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: true, release: true); + /// 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. + static objc.ObjCBlock listener( + void Function(int) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_Uint16_listenerCallable.nativeFunction.cast(), + (int arg0) => fn(arg0)); + final wrapper = _wrapListenerBlock_yo3tv0(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - /// Create a message with string type - NSURLSessionWebSocketMessage initWithString_(NSString string) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithString_1, string._id); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_Uint16_CallExtension + on objc.ObjCBlock { + void call(int arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Uint16 arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0); +} - int get type { - return _lib._objc_msgSend_472(_id, _lib._sel_type1); - } +void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + dispatch_data_t arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + dispatch_data_t arg0, dispatch_data_t arg1)>>() + .asFunction()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + dispatch_data_t, dispatch_data_t)>( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + dispatch_data_t arg1) => + (objc.getBlockClosure(block) as void Function( + dispatch_data_t, dispatch_data_t))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + dispatch_data_t, dispatch_data_t)>( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline( + ffi.Pointer block, + dispatch_data_t arg0, + dispatch_data_t arg1) { + (objc.getBlockClosure(block) as void Function( + dispatch_data_t, dispatch_data_t))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, dispatch_data_t, dispatch_data_t)> + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, dispatch_data_t, + dispatch_data_t)>.listener( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); - NSData? get data { - final _ret = _lib._objc_msgSend_348(_id, _lib._sel_data1); - return _ret.address == 0 - ? null - : NSData._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject)> fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - NSString? get string { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_string1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_closureCallable, + (dispatch_data_t arg0, dispatch_data_t arg1) => fn( + objc.NSObject.castFromPointer(arg0, + retain: true, release: true), + objc.NSObject.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); - @override - NSURLSessionWebSocketMessage init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: true, release: true); + /// 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. + static objc.ObjCBlock + listener(void Function(Dartdispatch_data_t, Dartdispatch_data_t) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_listenerCallable + .nativeFunction + .cast(), + (dispatch_data_t arg0, dispatch_data_t arg1) => fn( + objc.NSObject.castFromPointer(arg0, retain: false, release: true), + objc.NSObject.castFromPointer(arg1, retain: false, release: true))); + final wrapper = _wrapListenerBlock_1tjlcwl(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); } +} - static NSURLSessionWebSocketMessage new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_new1); - return NSURLSessionWebSocketMessage._(_ret, _lib, - retain: false, release: true); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_dispatchdatat_dispatchdatat_CallExtension + on objc.ObjCBlock { + void call(Dartdispatch_data_t arg0, Dartdispatch_data_t arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + dispatch_data_t arg0, dispatch_data_t arg1)>>() + .asFunction< + void Function(ffi.Pointer, + dispatch_data_t, dispatch_data_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); +} + +/// OS_sec_protocol_options +abstract final class OS_sec_protocol_options { + /// Builds an object that implements the OS_sec_protocol_options protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement() { + final builder = objc.ObjCProtocolBuilder(); + + return builder.build(); + } + + /// Adds the implementation of the OS_sec_protocol_options protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder( + objc.ObjCProtocolBuilder builder, + ) {} +} + +late final _protocol_OS_sec_protocol_options = + objc.getProtocol("OS_sec_protocol_options"); +typedef sec_protocol_options_t = ffi.Pointer; +typedef Dartsec_protocol_options_t = objc.NSObject; + +enum tls_ciphersuite_group_t { + tls_ciphersuite_group_default(0), + tls_ciphersuite_group_compatibility(1), + tls_ciphersuite_group_legacy(2), + tls_ciphersuite_group_ats(3), + tls_ciphersuite_group_ats_compatibility(4); + + final int value; + const tls_ciphersuite_group_t(this.value); + + static tls_ciphersuite_group_t fromValue(int value) => switch (value) { + 0 => tls_ciphersuite_group_default, + 1 => tls_ciphersuite_group_compatibility, + 2 => tls_ciphersuite_group_legacy, + 3 => tls_ciphersuite_group_ats, + 4 => tls_ciphersuite_group_ats_compatibility, + _ => throw ArgumentError( + "Unknown value for tls_ciphersuite_group_t: $value"), + }; +} + +enum SSLCiphersuiteGroup { + kSSLCiphersuiteGroupDefault(0), + kSSLCiphersuiteGroupCompatibility(1), + kSSLCiphersuiteGroupLegacy(2), + kSSLCiphersuiteGroupATS(3), + kSSLCiphersuiteGroupATSCompatibility(4); + + final int value; + const SSLCiphersuiteGroup(this.value); + + static SSLCiphersuiteGroup fromValue(int value) => switch (value) { + 0 => kSSLCiphersuiteGroupDefault, + 1 => kSSLCiphersuiteGroupCompatibility, + 2 => kSSLCiphersuiteGroupLegacy, + 3 => kSSLCiphersuiteGroupATS, + 4 => kSSLCiphersuiteGroupATSCompatibility, + _ => + throw ArgumentError("Unknown value for SSLCiphersuiteGroup: $value"), + }; +} + +typedef sec_protocol_pre_shared_key_selection_t + = ffi.Pointer; +typedef Dartsec_protocol_pre_shared_key_selection_t = objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t + arg2)>>() + .asFunction< + void Function(sec_protocol_metadata_t, dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>()( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) => + (objc.getBlockClosure(block) as void Function( + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t))( + arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) { + (objc.getBlockClosure(block) as void Function( + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - static NSURLSessionWebSocketMessage allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3(_lib._class_NSURLSessionWebSocketMessage1, - _lib._sel_allocWithZone_1, zone); - return NSURLSessionWebSocketMessage._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t, Dartsec_protocol_pre_shared_key_selection_complete_t) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_closureCallable, + (sec_protocol_metadata_t arg0, dispatch_data_t arg1, sec_protocol_pre_shared_key_selection_complete_t arg2) => fn( + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + objc.NSObject.castFromPointer(arg1, retain: true, release: true), + ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - static NSURLSessionWebSocketMessage alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionWebSocketMessage1, _lib._sel_alloc1); - return NSURLSessionWebSocketMessage._(_ret, _lib, + /// 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. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> listener( + void Function(Dartsec_protocol_metadata_t, Dartdispatch_data_t, + Dartsec_protocol_pre_shared_key_selection_complete_t) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_listenerCallable + .nativeFunction + .cast(), + (sec_protocol_metadata_t arg0, dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t arg2) => + fn( + objc.NSObject.castFromPointer(arg0, + retain: false, release: true), + objc.NSObject.castFromPointer(arg1, + retain: false, release: true), + ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_10t0qpd(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>(wrapper, retain: false, release: true); } } -abstract class NSURLSessionWebSocketMessageType { - static const int NSURLSessionWebSocketMessageTypeData = 0; - static const int NSURLSessionWebSocketMessageTypeString = 1; +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_dispatchdatat_secprotocolpresharedkeyselectioncompletet_CallExtension + on objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> { + void + call(Dartsec_protocol_metadata_t arg0, Dartdispatch_data_t arg1, + Dartsec_protocol_pre_shared_key_selection_complete_t arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + dispatch_data_t arg1, + sec_protocol_pre_shared_key_selection_complete_t + arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + sec_protocol_metadata_t, + dispatch_data_t, + sec_protocol_pre_shared_key_selection_complete_t)>()( + ref.pointer, + arg0.ref.pointer, + arg1.ref.pointer, + arg2.ref.pointer); } -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistryIndex = - 0; +typedef sec_protocol_pre_shared_key_selection_complete_t + = ffi.Pointer; +typedef Dartsec_protocol_pre_shared_key_selection_complete_t + = objc.ObjCBlock; +typedef sec_protocol_key_update_t = ffi.Pointer; +typedef Dartsec_protocol_key_update_t = objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)>; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1)>>() + .asFunction< + void Function(sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>()(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = - ++_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry[id] = - fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_protocol_key_update_complete_t))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) { + (objc.getBlockClosure(block) as void Function( + sec_protocol_metadata_t, sec_protocol_key_update_complete_t))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + sec_protocol_metadata_t, sec_protocol_key_update_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); /// 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. - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.fromFunction( - NativeCupertinoHttp lib, - void Function(NSURLSessionWebSocketMessage?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 ? null : NSURLSessionWebSocketMessage._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + static objc.ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_key_update_complete_t) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_closureCallable, + (sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => + fn(objc.NSObject.castFromPointer(arg0, retain: true, release: true), + ObjCBlock_ffiVoid.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -84389,159 +56804,351 @@ class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError.listener( - NativeCupertinoHttp lib, - void Function(NSURLSessionWebSocketMessage?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSURLSessionWebSocketMessage._(arg0, lib, - retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURLSessionWebSocketMessage? arg0, NSError? arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -/// The WebSocket close codes follow the close codes given in the RFC -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; + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)> + listener( + void Function(Dartsec_protocol_metadata_t, + Dartsec_protocol_key_update_complete_t) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_listenerCallable + .nativeFunction + .cast(), + (sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1) => + fn( + objc.NSObject.castFromPointer(arg0, + retain: false, release: true), + ObjCBlock_ffiVoid.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_cmbt6k(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)>(wrapper, + retain: false, release: true); + } } -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolkeyupdatecompletet_CallExtension + on objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.ObjCBlock)> { + void call(Dartsec_protocol_metadata_t arg0, + Dartsec_protocol_key_update_complete_t arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_key_update_complete_t arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_key_update_complete_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); +} + +typedef sec_protocol_key_update_complete_t = ffi.Pointer; +typedef Dartsec_protocol_key_update_complete_t + = objc.ObjCBlock; +typedef sec_protocol_challenge_t = ffi.Pointer; +typedef Dartsec_protocol_challenge_t = objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)>; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1)>>() + .asFunction< + void Function(sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable = + ffi.Pointer.fromFunction< ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistryIndex = 0; + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) => + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_protocol_challenge_complete_t))(arg0, arg1); ffi.Pointer - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) { + (objc.getBlockClosure(block) as void Function( + sec_protocol_metadata_t, sec_protocol_challenge_complete_t))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + sec_protocol_metadata_t, sec_protocol_challenge_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, + objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); + + /// 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. + static objc + .ObjCBlock)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// 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. + static objc + .ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_protocol_challenge_complete_t) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_closureCallable, + (sec_protocol_metadata_t arg0, sec_protocol_challenge_complete_t arg1) => fn( + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)> + listener( + void Function(Dartsec_protocol_metadata_t, + Dartsec_protocol_challenge_complete_t) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_listenerCallable + .nativeFunction + .cast(), + (sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1) => + fn( + objc.NSObject.castFromPointer(arg0, + retain: false, release: true), + ObjCBlock_ffiVoid_seccertificatet.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_cmbt6k(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSObject, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); + } } -void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_secprotocolchallengecompletet_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + objc.NSObject, objc.ObjCBlock)> { + void call(Dartsec_protocol_metadata_t arg0, + Dartsec_protocol_challenge_complete_t arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_protocol_challenge_complete_t arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_protocol_challenge_complete_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer); +} + +typedef sec_protocol_challenge_complete_t = ffi.Pointer; +typedef Dartsec_protocol_challenge_complete_t + = objc.ObjCBlock; +typedef sec_protocol_verify_t = ffi.Pointer; +typedef Dartsec_protocol_verify_t = objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>; +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2)>>() + .asFunction< + void Function(sec_protocol_metadata_t, sec_trust_t, + sec_protocol_verify_complete_t)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) => + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_trust_t, sec_protocol_verify_complete_t))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) { + (objc.getBlockClosure(block) as void Function(sec_protocol_metadata_t, + sec_trust_t, sec_protocol_verify_complete_t))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)> + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>.listener( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); /// 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. - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer> ptr) => + objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.fromFunction( - NativeCupertinoHttp lib, - void Function(NSData?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + static objc + .ObjCBlock)> + fromFunction(void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, Dartsec_protocol_verify_complete_t) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_closureCallable, + (sec_protocol_metadata_t arg0, sec_trust_t arg1, sec_protocol_verify_complete_t arg2) => fn( + objc.NSObject.castFromPointer(arg0, retain: true, release: true), + objc.NSObject.castFromPointer(arg1, retain: true, release: true), + ObjCBlock_ffiVoid_bool.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -84552,150 +57159,127 @@ class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError.listener( - NativeCupertinoHttp lib, - void Function(NSData?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_registerClosure((ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSData? arg0, NSURLResponse? arg1, NSError? arg2) => _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>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - _id, - arg0?._id ?? ffi.nullptr, - arg1?._id ?? ffi.nullptr, - arg2?._id ?? ffi.nullptr); + static objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> listener( + void Function(Dartsec_protocol_metadata_t, Dartsec_trust_t, + Dartsec_protocol_verify_complete_t) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_listenerCallable + .nativeFunction + .cast(), + (sec_protocol_metadata_t arg0, sec_trust_t arg1, + sec_protocol_verify_complete_t arg2) => + fn( + objc.NSObject.castFromPointer(arg0, + retain: false, release: true), + objc.NSObject.castFromPointer(arg1, + retain: false, release: true), + ObjCBlock_ffiVoid_bool.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_10t0qpd(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); + } } -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry = , ffi.Pointer, - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_secprotocolmetadatat_sectrustt_secprotocolverifycompletet_CallExtension + on objc.ObjCBlock< + ffi.Void Function(objc.NSObject, objc.NSObject, + objc.ObjCBlock)> { + void call(Dartsec_protocol_metadata_t arg0, Dartsec_trust_t arg1, + Dartsec_protocol_verify_complete_t arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + sec_protocol_metadata_t arg0, + sec_trust_t arg1, + sec_protocol_verify_complete_t arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + sec_protocol_metadata_t, + sec_trust_t, + sec_protocol_verify_complete_t)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); } -void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +typedef sec_protocol_verify_complete_t = ffi.Pointer; +typedef Dartsec_protocol_verify_complete_t + = objc.ObjCBlock; +void _ObjCBlock_ffiVoid_bool_fnPtrTrampoline( + ffi.Pointer block, bool arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_bool_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>(_ObjCBlock_ffiVoid_bool_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_closureTrampoline( + ffi.Pointer block, bool arg0) => + (objc.getBlockClosure(block) as void Function(bool))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_bool_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>(_ObjCBlock_ffiVoid_bool_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_bool_listenerTrampoline( + ffi.Pointer block, bool arg0) { + (objc.getBlockClosure(block) as void Function(bool))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable, ffi.Bool)> + _ObjCBlock_ffiVoid_bool_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Bool)>.listener(_ObjCBlock_ffiVoid_bool_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_bool { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); /// 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. - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_bool_fnPtrCallable, ptr.cast()), + retain: false, + release: true); /// 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. - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.fromFunction( - NativeCupertinoHttp lib, - void Function(NSURL?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + static objc.ObjCBlock fromFunction( + void Function(bool) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_closureCallable, (bool arg0) => fn(arg0)), + retain: false, + release: true); /// Creates a listener block from a Dart function. /// @@ -84706,4570 +57290,6311 @@ class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError extends _ObjCBlockBase { /// /// Note that unlike the default behavior of NativeCallable.listener, listener /// blocks do not keep the isolate alive. - ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError.listener( - NativeCupertinoHttp lib, - void Function(NSURL?, NSURLResponse?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_registerClosure((ffi.Pointer arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSURLResponse._(arg1, lib, retain: true, release: true), - arg2.address == 0 ? null : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; + static objc.ObjCBlock listener( + void Function(bool) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_bool_listenerCallable.nativeFunction.cast(), + (bool arg0) => fn(arg0)); + final wrapper = _wrapListenerBlock_117qins(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } +} - void call(NSURL? arg0, NSURLResponse? arg1, NSError? arg2) => _id.ref.invoke +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_bool_CallExtension + on objc.ObjCBlock { + void call(bool arg0) => ref.pointer.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>, ffi.Pointer, - ffi.Pointer, ffi.Pointer)>()( - _id, - arg0?._id ?? ffi.nullptr, - arg1?._id ?? ffi.nullptr, - arg2?._id ?? ffi.nullptr); -} - -/// Disposition options for various delegate messages -abstract class NSURLSessionDelayedRequestDisposition { - /// Use the original request provided when the task was created; the request parameter is ignored. - static const int NSURLSessionDelayedRequestContinueLoading = 0; - - /// Use the specified request, which may not be nil. - static const int NSURLSessionDelayedRequestUseNewRequest = 1; - - /// Cancel the task; the request parameter is ignored. - static const int NSURLSessionDelayedRequestCancel = 2; -} - -abstract class NSURLSessionAuthChallengeDisposition { - /// Use the specified credential, which may be nil - static const int NSURLSessionAuthChallengeUseCredential = 0; - - /// Default handling for the challenge - as if this delegate were not implemented; the credential parameter is ignored. - static const int NSURLSessionAuthChallengePerformDefaultHandling = 1; - - /// The entire request will be canceled; the credential parameter is ignored. - static const int NSURLSessionAuthChallengeCancelAuthenticationChallenge = 2; - - /// This challenge is rejected and the next authentication protection space should be tried; the credential parameter is ignored. - static const int NSURLSessionAuthChallengeRejectProtectionSpace = 3; + ffi.Pointer block, ffi.Bool arg0)>>() + .asFunction, bool)>()( + ref.pointer, arg0); } -abstract class NSURLSessionResponseDisposition { - /// Cancel the load, this is the same as -[task cancel] - static const int NSURLSessionResponseCancel = 0; - - /// Allow the load to continue - static const int NSURLSessionResponseAllow = 1; +final class SSLContext extends ffi.Opaque {} - /// Turn this request into a download - static const int NSURLSessionResponseBecomeDownload = 2; +typedef SSLContextRef = ffi.Pointer; - /// Turn this task into a stream task - static const int NSURLSessionResponseBecomeStream = 3; +enum SSLProtocolSide { + kSSLServerSide(0), + kSSLClientSide(1); + + final int value; + const SSLProtocolSide(this.value); + + static SSLProtocolSide fromValue(int value) => switch (value) { + 0 => kSSLServerSide, + 1 => kSSLClientSide, + _ => throw ArgumentError("Unknown value for SSLProtocolSide: $value"), + }; +} + +enum SSLConnectionType { + kSSLStreamType(0), + kSSLDatagramType(1); + + final int value; + const SSLConnectionType(this.value); + + static SSLConnectionType fromValue(int value) => switch (value) { + 0 => kSSLStreamType, + 1 => kSSLDatagramType, + _ => throw ArgumentError("Unknown value for SSLConnectionType: $value"), + }; +} + +enum SSLSessionState { + kSSLIdle(0), + kSSLHandshake(1), + kSSLConnected(2), + kSSLClosed(3), + kSSLAborted(4); + + final int value; + const SSLSessionState(this.value); + + static SSLSessionState fromValue(int value) => switch (value) { + 0 => kSSLIdle, + 1 => kSSLHandshake, + 2 => kSSLConnected, + 3 => kSSLClosed, + 4 => kSSLAborted, + _ => throw ArgumentError("Unknown value for SSLSessionState: $value"), + }; +} + +enum SSLSessionOption { + kSSLSessionOptionBreakOnServerAuth(0), + kSSLSessionOptionBreakOnCertRequested(1), + kSSLSessionOptionBreakOnClientAuth(2), + kSSLSessionOptionFalseStart(3), + kSSLSessionOptionSendOneByteRecord(4), + kSSLSessionOptionAllowServerIdentityChange(5), + kSSLSessionOptionFallback(6), + kSSLSessionOptionBreakOnClientHello(7), + kSSLSessionOptionAllowRenegotiation(8), + kSSLSessionOptionEnableSessionTickets(9); + + final int value; + const SSLSessionOption(this.value); + + static SSLSessionOption fromValue(int value) => switch (value) { + 0 => kSSLSessionOptionBreakOnServerAuth, + 1 => kSSLSessionOptionBreakOnCertRequested, + 2 => kSSLSessionOptionBreakOnClientAuth, + 3 => kSSLSessionOptionFalseStart, + 4 => kSSLSessionOptionSendOneByteRecord, + 5 => kSSLSessionOptionAllowServerIdentityChange, + 6 => kSSLSessionOptionFallback, + 7 => kSSLSessionOptionBreakOnClientHello, + 8 => kSSLSessionOptionAllowRenegotiation, + 9 => kSSLSessionOptionEnableSessionTickets, + _ => throw ArgumentError("Unknown value for SSLSessionOption: $value"), + }; } -/// The resource fetch type. -abstract class NSURLSessionTaskMetricsResourceFetchType { - static const int NSURLSessionTaskMetricsResourceFetchTypeUnknown = 0; +typedef SSLReadFunc = ffi.Pointer>; +typedef SSLReadFuncFunction = OSStatus Function(SSLConnectionRef connection, + ffi.Pointer data, ffi.Pointer dataLength); +typedef DartSSLReadFuncFunction = DartSInt32 Function( + SSLConnectionRef connection, + ffi.Pointer data, + ffi.Pointer dataLength); +typedef SSLConnectionRef = ffi.Pointer; +typedef SSLWriteFunc = ffi.Pointer>; +typedef SSLWriteFuncFunction = OSStatus Function(SSLConnectionRef connection, + ffi.Pointer data, ffi.Pointer dataLength); +typedef DartSSLWriteFuncFunction = DartSInt32 Function( + SSLConnectionRef connection, + ffi.Pointer data, + ffi.Pointer dataLength); - /// The resource was loaded over the network. - static const int NSURLSessionTaskMetricsResourceFetchTypeNetworkLoad = 1; +enum SSLAuthenticate { + kNeverAuthenticate(0), + kAlwaysAuthenticate(1), + kTryAuthenticate(2); - /// The resource was pushed by the server to the client. - static const int NSURLSessionTaskMetricsResourceFetchTypeServerPush = 2; + final int value; + const SSLAuthenticate(this.value); - /// The resource was retrieved from the local storage. - static const int NSURLSessionTaskMetricsResourceFetchTypeLocalCache = 3; + static SSLAuthenticate fromValue(int value) => switch (value) { + 0 => kNeverAuthenticate, + 1 => kAlwaysAuthenticate, + 2 => kTryAuthenticate, + _ => throw ArgumentError("Unknown value for SSLAuthenticate: $value"), + }; } -/// DNS protocol used for domain resolution. -abstract class NSURLSessionTaskMetricsDomainResolutionProtocol { - static const int NSURLSessionTaskMetricsDomainResolutionProtocolUnknown = 0; - - /// Resolution used DNS over UDP. - static const int NSURLSessionTaskMetricsDomainResolutionProtocolUDP = 1; - - /// Resolution used DNS over TCP. - static const int NSURLSessionTaskMetricsDomainResolutionProtocolTCP = 2; +enum SSLClientCertificateState { + kSSLClientCertNone(0), + kSSLClientCertRequested(1), + kSSLClientCertSent(2), + kSSLClientCertRejected(3); - /// Resolution used DNS over TLS. - static const int NSURLSessionTaskMetricsDomainResolutionProtocolTLS = 3; + final int value; + const SSLClientCertificateState(this.value); - /// Resolution used DNS over HTTPS. - static const int NSURLSessionTaskMetricsDomainResolutionProtocolHTTPS = 4; + static SSLClientCertificateState fromValue(int value) => switch (value) { + 0 => kSSLClientCertNone, + 1 => kSSLClientCertRequested, + 2 => kSSLClientCertSent, + 3 => kSSLClientCertRejected, + _ => throw ArgumentError( + "Unknown value for SSLClientCertificateState: $value"), + }; } -/// This class defines the performance metrics collected for a request/response transaction during the task execution. -class NSURLSessionTaskTransactionMetrics extends NSObject { - NSURLSessionTaskTransactionMetrics._( - ffi.Pointer id, NativeCupertinoHttp lib, +/// NSURLSession is a replacement API for NSURLConnection. It provides +/// options that affect the policy of, and various aspects of the +/// mechanism by which NSURLRequest objects are retrieved from the +/// network. +/// +/// An NSURLSession may be bound to a delegate object. The delegate is +/// invoked for certain events during the lifetime of a session, such as +/// server authentication or determining whether a resource to be loaded +/// should be converted into a download. +/// +/// NSURLSession instances are thread-safe. +/// +/// The default NSURLSession uses a system provided delegate and is +/// appropriate to use in place of existing code that uses +/// +[NSURLConnection sendAsynchronousRequest:queue:completionHandler:] +/// +/// An NSURLSession creates NSURLSessionTask objects which represent the +/// action of a resource being loaded. These are analogous to +/// NSURLConnection objects but provide for more control and a unified +/// delegate model. +/// +/// NSURLSessionTask objects are always created in a suspended state and +/// must be sent the -resume message before they will execute. +/// +/// Subclasses of NSURLSessionTask are used to syntactically +/// differentiate between data and file downloads. +/// +/// An NSURLSessionDataTask receives the resource as a series of calls to +/// the URLSession:dataTask:didReceiveData: delegate method. This is type of +/// task most commonly associated with retrieving objects for immediate parsing +/// by the consumer. +/// +/// An NSURLSessionUploadTask differs from an NSURLSessionDataTask +/// in how its instance is constructed. Upload tasks are explicitly created +/// by referencing a file or data object to upload, or by utilizing the +/// -URLSession:task:needNewBodyStream: delegate message to supply an upload +/// body. +/// +/// An NSURLSessionDownloadTask will directly write the response data to +/// a temporary file. When completed, the delegate is sent +/// URLSession:downloadTask:didFinishDownloadingToURL: and given an opportunity +/// to move this file to a permanent location in its sandboxed container, or to +/// otherwise read the file. If canceled, an NSURLSessionDownloadTask can +/// produce a data blob that can be used to resume a download at a later +/// time. +/// +/// Beginning with iOS 9 and Mac OS X 10.11, NSURLSessionStream is +/// available as a task type. This allows for direct TCP/IP connection +/// to a given host and port with optional secure handshaking and +/// navigation of proxies. Data tasks may also be upgraded to a +/// NSURLSessionStream task via the HTTP Upgrade: header and appropriate +/// use of the pipelining option of NSURLSessionConfiguration. See RFC +/// 2817 and RFC 6455 for information about the Upgrade: header, and +/// comments below on turning data tasks into stream tasks. +/// +/// An NSURLSessionWebSocketTask is a task that allows clients to connect to servers supporting +/// WebSocket. The task will perform the HTTP handshake to upgrade the connection +/// and once the WebSocket handshake is successful, the client can read and write +/// messages that will be framed using the WebSocket protocol by the framework. +class NSURLSession extends objc.NSObject { + NSURLSession._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionTaskTransactionMetrics] that points to the same underlying object as [other]. - static NSURLSessionTaskTransactionMetrics castFrom( - T other) { - return NSURLSessionTaskTransactionMetrics._(other._id, other._lib, - retain: true, release: true); - } + : super.castFromPointer(pointer, retain: retain, release: release); - /// Returns a [NSURLSessionTaskTransactionMetrics] that wraps the given raw object pointer. - static NSURLSessionTaskTransactionMetrics castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionTaskTransactionMetrics._(other, lib, - retain: retain, release: release); - } + /// Constructs a [NSURLSession] that points to the same underlying object as [other]. + NSURLSession.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Returns whether [obj] is an instance of [NSURLSessionTaskTransactionMetrics]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionTaskTransactionMetrics1); - } + /// Constructs a [NSURLSession] that wraps the given raw object pointer. + NSURLSession.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - /// Represents the transaction request. - NSURLRequest get request { - final _ret = _lib._objc_msgSend_489(_id, _lib._sel_request1); - return NSURLRequest._(_ret, _lib, retain: true, release: true); + /// Returns whether [obj] is an instance of [NSURLSession]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSession); } - /// Represents the transaction response. Can be nil if error occurred and no response was generated. - NSURLResponse? get response { - final _ret = _lib._objc_msgSend_375(_id, _lib._sel_response1); - return _ret.address == 0 - ? null - : NSURLResponse._(_ret, _lib, retain: true, release: true); + /// The shared session uses the currently set global NSURLCache, + /// NSHTTPCookieStorage and NSURLCredentialStorage objects. + static NSURLSession getSharedSession() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSession, _sel_sharedSession); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); } - /// fetchStartDate returns the time when the user agent started fetching the resource, whether or not the resource was retrieved from the server or local resources. - /// - /// The following metrics will be set to nil, if a persistent connection was used or the resource was retrieved from local resources: - /// - /// domainLookupStartDate - /// domainLookupEndDate - /// connectStartDate - /// connectEndDate - /// secureConnectionStartDate - /// secureConnectionEndDate - NSDate? get fetchStartDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_fetchStartDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); + /// Customization of NSURLSession occurs during creation of a new session. + /// If you only need to use the convenience routines with custom + /// configuration options it is not necessary to specify a delegate. + /// If you do specify a delegate, the delegate will be retained until after + /// the delegate has been sent the URLSession:didBecomeInvalidWithError: message. + static NSURLSession sessionWithConfiguration_( + NSURLSessionConfiguration configuration) { + final _ret = _objc_msgSend_juohf7(_class_NSURLSession, + _sel_sessionWithConfiguration_, configuration.ref.pointer); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); } - /// domainLookupStartDate returns the time immediately before the user agent started the name lookup for the resource. - NSDate? get domainLookupStartDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_domainLookupStartDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); + /// sessionWithConfiguration:delegate:delegateQueue: + static NSURLSession sessionWithConfiguration_delegate_delegateQueue_( + NSURLSessionConfiguration configuration, + objc.ObjCObjectBase? delegate, + NSOperationQueue? queue) { + final _ret = _objc_msgSend_aud7dn( + _class_NSURLSession, + _sel_sessionWithConfiguration_delegate_delegateQueue_, + configuration.ref.pointer, + delegate?.ref.pointer ?? ffi.nullptr, + queue?.ref.pointer ?? ffi.nullptr); + return NSURLSession.castFromPointer(_ret, retain: true, release: true); } - /// domainLookupEndDate returns the time after the name lookup was completed. - NSDate? get domainLookupEndDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_domainLookupEndDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); + /// delegateQueue + NSOperationQueue get delegateQueue { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegateQueue); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } - /// connectStartDate is the time immediately before the user agent started establishing the connection to the server. - /// - /// For example, this would correspond to the time immediately before the user agent started trying to establish the TCP connection. - NSDate? get connectStartDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_connectStartDate1); + /// delegate + objc.ObjCObjectBase? get delegate { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_delegate); return _ret.address == 0 ? null - : NSDate._(_ret, _lib, retain: true, release: true); + : objc.ObjCObjectBase(_ret, retain: true, release: true); } - /// If an encrypted connection was used, secureConnectionStartDate is the time immediately before the user agent started the security handshake to secure the current connection. - /// - /// For example, this would correspond to the time immediately before the user agent started the TLS handshake. - /// - /// If an encrypted connection was not used, this attribute is set to nil. - NSDate? get secureConnectionStartDate { - final _ret = - _lib._objc_msgSend_393(_id, _lib._sel_secureConnectionStartDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); + /// configuration + NSURLSessionConfiguration get configuration { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_configuration); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } - /// If an encrypted connection was used, secureConnectionEndDate is the time immediately after the security handshake completed. - /// - /// If an encrypted connection was not used, this attribute is set to nil. - NSDate? get secureConnectionEndDate { + /// The sessionDescription property is available for the developer to + /// provide a descriptive label for the session. + objc.NSString? get sessionDescription { final _ret = - _lib._objc_msgSend_393(_id, _lib._sel_secureConnectionEndDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - /// connectEndDate is the time immediately after the user agent finished establishing the connection to the server, including completion of security-related and other handshakes. - NSDate? get connectEndDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_connectEndDate1); + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_sessionDescription); return _ret.address == 0 ? null - : NSDate._(_ret, _lib, retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// requestStartDate is the time immediately before the user agent started requesting the source, regardless of whether the resource was retrieved from the server or local resources. - /// - /// For example, this would correspond to the time immediately before the user agent sent an HTTP GET request. - NSDate? get requestStartDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_requestStartDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - /// requestEndDate is the time immediately after the user agent finished requesting the source, regardless of whether the resource was retrieved from the server or local resources. - /// - /// For example, this would correspond to the time immediately after the user agent finished sending the last byte of the request. - NSDate? get requestEndDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_requestEndDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - /// responseStartDate is the time immediately after the user agent received the first byte of the response from the server or from local resources. - /// - /// For example, this would correspond to the time immediately after the user agent received the first byte of an HTTP response. - NSDate? get responseStartDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_responseStartDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); - } - - /// responseEndDate is the time immediately after the user agent received the last byte of the resource. - NSDate? get responseEndDate { - final _ret = _lib._objc_msgSend_393(_id, _lib._sel_responseEndDate1); - return _ret.address == 0 - ? null - : NSDate._(_ret, _lib, retain: true, release: true); + /// The sessionDescription property is available for the developer to + /// provide a descriptive label for the session. + set sessionDescription(objc.NSString? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setSessionDescription_, + value?.ref.pointer ?? ffi.nullptr); } - /// The network protocol used to fetch the resource, as identified by the ALPN Protocol ID Identification Sequence [RFC7301]. - /// E.g., h3, h2, http/1.1. + /// -finishTasksAndInvalidate returns immediately and existing tasks will be allowed + /// to run to completion. New tasks may not be created. The session + /// will continue to make delegate callbacks until URLSession:didBecomeInvalidWithError: + /// has been issued. /// - /// When a proxy is configured AND a tunnel connection is established, then this attribute returns the value for the tunneled protocol. + /// -finishTasksAndInvalidate and -invalidateAndCancel do not + /// have any effect on the shared session singleton. /// - /// For example: - /// If no proxy were used, and HTTP/2 was negotiated, then h2 would be returned. - /// If HTTP/1.1 were used to the proxy, and the tunneled connection was HTTP/2, then h2 would be returned. - /// If HTTP/1.1 were used to the proxy, and there were no tunnel, then http/1.1 would be returned. - NSString? get networkProtocolName { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_networkProtocolName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - /// This property is set to YES if a proxy connection was used to fetch the resource. - bool get proxyConnection { - return _lib._objc_msgSend_11(_id, _lib._sel_isProxyConnection1); - } - - /// This property is set to YES if a persistent connection was used to fetch the resource. - bool get reusedConnection { - return _lib._objc_msgSend_11(_id, _lib._sel_isReusedConnection1); - } - - /// Indicates whether the resource was loaded, pushed or retrieved from the local cache. - int get resourceFetchType { - return _lib._objc_msgSend_490(_id, _lib._sel_resourceFetchType1); - } - - /// countOfRequestHeaderBytesSent is the number of bytes transferred for request header. - int get countOfRequestHeaderBytesSent { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfRequestHeaderBytesSent1); - } - - /// countOfRequestBodyBytesSent is the number of bytes transferred for request body. - /// It includes protocol-specific framing, transfer encoding, and content encoding. - int get countOfRequestBodyBytesSent { - return _lib._objc_msgSend_383(_id, _lib._sel_countOfRequestBodyBytesSent1); + /// When invalidating a background session, it is not safe to create another background + /// session with the same identifier until URLSession:didBecomeInvalidWithError: has + /// been issued. + void finishTasksAndInvalidate() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_finishTasksAndInvalidate); } - /// countOfRequestBodyBytesBeforeEncoding is the size of upload body data, file, or stream. - int get countOfRequestBodyBytesBeforeEncoding { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfRequestBodyBytesBeforeEncoding1); + /// -invalidateAndCancel acts as -finishTasksAndInvalidate, but issues + /// -cancel to all outstanding tasks for this session. Note task + /// cancellation is subject to the state of the task, and some tasks may + /// have already have completed at the time they are sent -cancel. + void invalidateAndCancel() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_invalidateAndCancel); } - /// countOfResponseHeaderBytesReceived is the number of bytes transferred for response header. - int get countOfResponseHeaderBytesReceived { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfResponseHeaderBytesReceived1); + /// empty all cookies, cache and credential stores, removes disk files, issues -flushWithCompletionHandler:. Invokes completionHandler() on the delegate queue. + void resetWithCompletionHandler_( + objc.ObjCBlock completionHandler) { + _objc_msgSend_4daxhl(this.ref.pointer, _sel_resetWithCompletionHandler_, + completionHandler.ref.pointer); } - /// countOfResponseBodyBytesReceived is the number of bytes transferred for response header. - /// It includes protocol-specific framing, transfer encoding, and content encoding. - int get countOfResponseBodyBytesReceived { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfResponseBodyBytesReceived1); + /// flush storage to disk and clear transient network caches. Invokes completionHandler() on the delegate queue. + void flushWithCompletionHandler_( + objc.ObjCBlock completionHandler) { + _objc_msgSend_4daxhl(this.ref.pointer, _sel_flushWithCompletionHandler_, + completionHandler.ref.pointer); } - /// countOfResponseBodyBytesAfterDecoding is the size of data delivered to your delegate or completion handler. - int get countOfResponseBodyBytesAfterDecoding { - return _lib._objc_msgSend_383( - _id, _lib._sel_countOfResponseBodyBytesAfterDecoding1); + /// invokes completionHandler with outstanding data, upload and download tasks. + void getTasksWithCompletionHandler_( + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + completionHandler) { + _objc_msgSend_4daxhl(this.ref.pointer, _sel_getTasksWithCompletionHandler_, + completionHandler.ref.pointer); } - /// localAddress is the IP address string of the local interface for the connection. - /// - /// For multipath protocols, this is the local address of the initial flow. - /// - /// If a connection was not used, this attribute is set to nil. - NSString? get localAddress { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_localAddress1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); + /// invokes completionHandler with all outstanding tasks. + void getAllTasksWithCompletionHandler_( + objc.ObjCBlock)> + completionHandler) { + _objc_msgSend_4daxhl(this.ref.pointer, + _sel_getAllTasksWithCompletionHandler_, completionHandler.ref.pointer); } - /// localPort is the port number of the local interface for the connection. - /// - /// For multipath protocols, this is the local port of the initial flow. - /// - /// If a connection was not used, this attribute is set to nil. - NSNumber? get localPort { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_localPort1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); + /// Creates a data task with the given request. The request may have a body stream. + NSURLSessionDataTask dataTaskWithRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_dataTaskWithRequest_, request.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, release: true); } - /// remoteAddress is the IP address string of the remote interface for the connection. - /// - /// For multipath protocols, this is the remote address of the initial flow. - /// - /// If a connection was not used, this attribute is set to nil. - NSString? get remoteAddress { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_remoteAddress1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); + /// Creates a data task to retrieve the contents of the given URL. + NSURLSessionDataTask dataTaskWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_dataTaskWithURL_, url.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, release: true); } - /// remotePort is the port number of the remote interface for the connection. - /// - /// For multipath protocols, this is the remote port of the initial flow. - /// - /// If a connection was not used, this attribute is set to nil. - NSNumber? get remotePort { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_remotePort1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); + /// Creates an upload task with the given request. The body of the request will be created from the file referenced by fileURL + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_( + NSURLRequest request, objc.NSURL fileURL) { + final _ret = _objc_msgSend_iq11qg( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromFile_, + request.ref.pointer, + fileURL.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); } - /// negotiatedTLSProtocolVersion is the TLS protocol version negotiated for the connection. - /// It is a 2-byte sequence in host byte order. - /// - /// Please refer to tls_protocol_version_t enum in Security/SecProtocolTypes.h - /// - /// If an encrypted connection was not used, this attribute is set to nil. - NSNumber? get negotiatedTLSProtocolVersion { - final _ret = - _lib._objc_msgSend_94(_id, _lib._sel_negotiatedTLSProtocolVersion1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); + /// Creates an upload task with the given request. The body of the request is provided from the bodyData. + NSURLSessionUploadTask uploadTaskWithRequest_fromData_( + NSURLRequest request, objc.NSData bodyData) { + final _ret = _objc_msgSend_iq11qg( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromData_, + request.ref.pointer, + bodyData.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); } - /// negotiatedTLSCipherSuite is the TLS cipher suite negotiated for the connection. - /// It is a 2-byte sequence in host byte order. - /// - /// Please refer to tls_ciphersuite_t enum in Security/SecProtocolTypes.h + /// Creates an upload task from a resume data blob. Requires the server to support the latest resumable uploads + /// Internet-Draft from the HTTP Working Group, found at + /// https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/ + /// If resuming from an upload file, the file must still exist and be unmodified. If the upload cannot be successfully + /// resumed, URLSession:task:didCompleteWithError: will be called. /// - /// If an encrypted connection was not used, this attribute is set to nil. - NSNumber? get negotiatedTLSCipherSuite { - final _ret = - _lib._objc_msgSend_94(_id, _lib._sel_negotiatedTLSCipherSuite1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } - - /// Whether the connection is established over a cellular interface. - bool get cellular { - return _lib._objc_msgSend_11(_id, _lib._sel_isCellular1); - } - - /// Whether the connection is established over an expensive interface. - bool get expensive { - return _lib._objc_msgSend_11(_id, _lib._sel_isExpensive1); - } - - /// Whether the connection is established over a constrained interface. - bool get constrained { - return _lib._objc_msgSend_11(_id, _lib._sel_isConstrained1); - } - - /// Whether a multipath protocol is successfully negotiated for the connection. - bool get multipath { - return _lib._objc_msgSend_11(_id, _lib._sel_isMultipath1); - } - - /// DNS protocol used for domain resolution. - int get domainResolutionProtocol { - return _lib._objc_msgSend_491(_id, _lib._sel_domainResolutionProtocol1); - } - - @override - NSURLSessionTaskTransactionMetrics init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionTaskTransactionMetrics._(_ret, _lib, + /// - Parameter resumeData: Resume data blob from an incomplete upload, such as data returned by the cancelByProducingResumeData: method. + /// - Returns: A new session upload task, or nil if the resumeData is invalid. + NSURLSessionUploadTask uploadTaskWithResumeData_(objc.NSData resumeData) { + final _ret = _objc_msgSend_juohf7(this.ref.pointer, + _sel_uploadTaskWithResumeData_, resumeData.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, retain: true, release: true); } - static NSURLSessionTaskTransactionMetrics new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionTaskTransactionMetrics1, _lib._sel_new1); - return NSURLSessionTaskTransactionMetrics._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionTaskTransactionMetrics allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionTaskTransactionMetrics1, - _lib._sel_allocWithZone_1, - zone); - return NSURLSessionTaskTransactionMetrics._(_ret, _lib, - retain: false, release: true); - } - - static NSURLSessionTaskTransactionMetrics alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionTaskTransactionMetrics1, _lib._sel_alloc1); - return NSURLSessionTaskTransactionMetrics._(_ret, _lib, - retain: false, release: true); - } -} - -class NSURLSessionTaskMetrics extends NSObject { - NSURLSessionTaskMetrics._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSURLSessionTaskMetrics] that points to the same underlying object as [other]. - static NSURLSessionTaskMetrics castFrom(T other) { - return NSURLSessionTaskMetrics._(other._id, other._lib, + /// Creates an upload task with the given request. The previously set body stream of the request (if any) is ignored and the URLSession:task:needNewBodyStream: delegate will be called when the body payload is required. + NSURLSessionUploadTask uploadTaskWithStreamedRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_juohf7(this.ref.pointer, + _sel_uploadTaskWithStreamedRequest_, request.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, retain: true, release: true); } - /// Returns a [NSURLSessionTaskMetrics] that wraps the given raw object pointer. - static NSURLSessionTaskMetrics castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLSessionTaskMetrics._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSURLSessionTaskMetrics]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLSessionTaskMetrics1); - } - - /// transactionMetrics array contains the metrics collected for every request/response transaction created during the task execution. - NSArray get transactionMetrics { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_transactionMetrics1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - /// Interval from the task creation time to the task completion time. - /// Task creation time is the time when the task was instantiated. - /// Task completion time is the time when the task is about to change its internal state to completed. - NSDateInterval get taskInterval { - final _ret = _lib._objc_msgSend_492(_id, _lib._sel_taskInterval1); - return NSDateInterval._(_ret, _lib, retain: true, release: true); - } - - /// redirectCount is the number of redirects that were recorded. - DartNSUInteger get redirectCount { - return _lib._objc_msgSend_12(_id, _lib._sel_redirectCount1); - } - - @override - NSURLSessionTaskMetrics init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLSessionTaskMetrics._(_ret, _lib, retain: true, release: true); - } - - static NSURLSessionTaskMetrics new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionTaskMetrics1, _lib._sel_new1); - return NSURLSessionTaskMetrics._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionTaskMetrics allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLSessionTaskMetrics1, _lib._sel_allocWithZone_1, zone); - return NSURLSessionTaskMetrics._(_ret, _lib, retain: false, release: true); - } - - static NSURLSessionTaskMetrics alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSURLSessionTaskMetrics1, _lib._sel_alloc1); - return NSURLSessionTaskMetrics._(_ret, _lib, retain: false, release: true); - } -} - -class NSDateInterval extends _ObjCWrapper { - NSDateInterval._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSDateInterval] that points to the same underlying object as [other]. - static NSDateInterval castFrom(T other) { - return NSDateInterval._(other._id, other._lib, retain: true, release: true); - } - - /// Returns a [NSDateInterval] that wraps the given raw object pointer. - static NSDateInterval castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSDateInterval._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSDateInterval]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSDateInterval1); - } -} - -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, NativeCupertinoHttp 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( - NativeCupertinoHttp 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, - ObjCBlock_NSProgress_ffiVoidNSDataNSError loadHandler) { - _lib._objc_msgSend_493( - _id, - _lib._sel_registerDataRepresentationForTypeIdentifier_visibility_loadHandler_1, - typeIdentifier._id, - visibility, - loadHandler._id); - } - - void - registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_( - NSString typeIdentifier, - int fileOptions, - int visibility, - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError loadHandler) { - _lib._objc_msgSend_494( - _id, - _lib._sel_registerFileRepresentationForTypeIdentifier_fileOptions_visibility_loadHandler_1, - typeIdentifier._id, - fileOptions, - visibility, - loadHandler._id); - } - - NSArray get registeredTypeIdentifiers { - final _ret = - _lib._objc_msgSend_169(_id, _lib._sel_registeredTypeIdentifiers1); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - NSArray registeredTypeIdentifiersWithFileOptions_(int fileOptions) { - final _ret = _lib._objc_msgSend_495( - _id, _lib._sel_registeredTypeIdentifiersWithFileOptions_1, fileOptions); - return NSArray._(_ret, _lib, retain: true, release: true); - } - - bool hasItemConformingToTypeIdentifier_(NSString typeIdentifier) { - return _lib._objc_msgSend_22( - _id, _lib._sel_hasItemConformingToTypeIdentifier_1, typeIdentifier._id); - } - - bool hasRepresentationConformingToTypeIdentifier_fileOptions_( - NSString typeIdentifier, int fileOptions) { - return _lib._objc_msgSend_496( - _id, - _lib._sel_hasRepresentationConformingToTypeIdentifier_fileOptions_1, - typeIdentifier._id, - fileOptions); - } - - NSProgress loadDataRepresentationForTypeIdentifier_completionHandler_( - NSString typeIdentifier, - ObjCBlock_ffiVoid_NSData_NSError completionHandler) { - final _ret = _lib._objc_msgSend_497( - _id, - _lib._sel_loadDataRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSProgress loadFileRepresentationForTypeIdentifier_completionHandler_( - NSString typeIdentifier, - ObjCBlock_ffiVoid_NSURL_NSError completionHandler) { - final _ret = _lib._objc_msgSend_498( - _id, - _lib._sel_loadFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSProgress loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_( - NSString typeIdentifier, - ObjCBlock_ffiVoid_NSURL_bool_NSError completionHandler) { - final _ret = _lib._objc_msgSend_499( - _id, - _lib._sel_loadInPlaceFileRepresentationForTypeIdentifier_completionHandler_1, - typeIdentifier._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSString? get suggestedName { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_suggestedName1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } - - set suggestedName(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setSuggestedName_1, value?._id ?? ffi.nullptr); - } - - NSItemProvider initWithObject_(NSObject object) { - final _ret = - _lib._objc_msgSend_149(_id, _lib._sel_initWithObject_1, object._id); - return NSItemProvider._(_ret, _lib, retain: true, release: true); - } - - void registerObject_visibility_(NSObject object, int visibility) { - _lib._objc_msgSend_500( - _id, _lib._sel_registerObject_visibility_1, object._id, visibility); - } - - void registerObjectOfClass_visibility_loadHandler_( - NSObject aClass, - int visibility, - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError loadHandler) { - _lib._objc_msgSend_501( - _id, - _lib._sel_registerObjectOfClass_visibility_loadHandler_1, - aClass._id, - visibility, - loadHandler._id); - } - - bool canLoadObjectOfClass_(NSObject aClass) { - return _lib._objc_msgSend_0( - _id, _lib._sel_canLoadObjectOfClass_1, aClass._id); - } - - NSProgress loadObjectOfClass_completionHandler_( - NSObject aClass, ObjCBlock_ffiVoid_ObjCObject_NSError completionHandler) { - final _ret = _lib._objc_msgSend_502( - _id, - _lib._sel_loadObjectOfClass_completionHandler_1, - aClass._id, - completionHandler._id); - return NSProgress._(_ret, _lib, retain: true, release: true); - } - - NSItemProvider initWithItem_typeIdentifier_( - NSObject? item, NSString? typeIdentifier) { - final _ret = _lib._objc_msgSend_503( - _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); - return _ret.address == 0 - ? null - : NSItemProvider._(_ret, _lib, retain: true, release: true); - } - - void registerItemForTypeIdentifier_loadHandler_( - NSString typeIdentifier, DartNSItemProviderLoadHandler loadHandler) { - _lib._objc_msgSend_504( - _id, - _lib._sel_registerItemForTypeIdentifier_loadHandler_1, - typeIdentifier._id, - loadHandler._id); - } - - void loadItemForTypeIdentifier_options_completionHandler_( - NSString typeIdentifier, - NSDictionary? options, - DartNSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_505( - _id, - _lib._sel_loadItemForTypeIdentifier_options_completionHandler_1, - typeIdentifier._id, - options?._id ?? ffi.nullptr, - completionHandler._id); - } - - DartNSItemProviderLoadHandler get previewImageHandler { - final _ret = _lib._objc_msgSend_506(_id, _lib._sel_previewImageHandler1); - return ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary - ._(_ret, _lib, retain: true, release: true); - } - - set previewImageHandler(DartNSItemProviderLoadHandler value) { - return _lib._objc_msgSend_507( - _id, _lib._sel_setPreviewImageHandler_1, value._id); - } - - void loadPreviewImageWithOptions_completionHandler_(NSDictionary options, - DartNSItemProviderCompletionHandler completionHandler) { - _lib._objc_msgSend_508( - _id, - _lib._sel_loadPreviewImageWithOptions_completionHandler_1, - options._id, - completionHandler._id); + /// Creates a download task with the given request. + NSURLSessionDownloadTask downloadTaskWithRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_downloadTaskWithRequest_, request.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); } - static NSItemProvider new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_new1); - return NSItemProvider._(_ret, _lib, retain: false, release: true); + /// Creates a download task to download the contents of the given URL. + NSURLSessionDownloadTask downloadTaskWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_downloadTaskWithURL_, url.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); } - static NSItemProvider allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSItemProvider1, _lib._sel_allocWithZone_1, zone); - return NSItemProvider._(_ret, _lib, retain: false, release: true); + /// Creates a download task with the resume data. If the download cannot be successfully resumed, URLSession:task:didCompleteWithError: will be called. + NSURLSessionDownloadTask downloadTaskWithResumeData_(objc.NSData resumeData) { + final _ret = _objc_msgSend_juohf7(this.ref.pointer, + _sel_downloadTaskWithResumeData_, resumeData.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); } - static NSItemProvider alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSItemProvider1, _lib._sel_alloc1); - return NSItemProvider._(_ret, _lib, retain: false, release: true); + /// Creates a bidirectional stream task to a given host and port. + NSURLSessionStreamTask streamTaskWithHostName_port_( + objc.NSString hostname, DartNSInteger port) { + final _ret = _objc_msgSend_spwp90(this.ref.pointer, + _sel_streamTaskWithHostName_port_, hostname.ref.pointer, port); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: true, release: true); } -} - -ffi.Pointer< - ObjCObject> _ObjCBlock_NSProgress_ffiVoidNSDataNSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>)>()(arg0); -final _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry = - Function(ffi.Pointer<_ObjCBlock>)>{}; -int _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_registerClosure( - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>) fn) { - final id = ++_ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistryIndex; - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSProgress_ffiVoidNSDataNSError extends _ObjCBlockBase { - ObjCBlock_NSProgress_ffiVoidNSDataNSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_NSProgress_ffiVoidNSDataNSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_NSProgress_ffiVoidNSDataNSError.fromFunction( - NativeCupertinoHttp lib, - NSProgress? Function(ObjCBlock_ffiVoid_NSData_NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_closureTrampoline) - .cast(), - _ObjCBlock_NSProgress_ffiVoidNSDataNSError_registerClosure((ffi - .Pointer<_ObjCBlock> - arg0) => - fn(ObjCBlock_ffiVoid_NSData_NSError._(arg0, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSProgress? call(ObjCBlock_ffiVoid_NSData_NSError arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>() - (_id, arg0._id) - .address == - 0 - ? null - : NSProgress._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} - -void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSData_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSData_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSData_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_NSData_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSData_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_ffiVoid_NSData_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_ffiVoid_NSData_NSError.fromFunction( - NativeCupertinoHttp lib, void Function(NSData?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSData_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - /// 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. - ObjCBlock_ffiVoid_NSData_NSError.listener( - NativeCupertinoHttp lib, void Function(NSData?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSData_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSData._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, - retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSData? arg0, NSError? arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>)>()(arg0); -final _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry = - Function(ffi.Pointer<_ObjCBlock>)>{}; -int _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_registerClosure( - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>) fn) { - final id = - ++_ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistryIndex; - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSProgress_ffiVoidNSURLboolNSError extends _ObjCBlockBase { - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); - - /// 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. - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _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. - ObjCBlock_NSProgress_ffiVoidNSURLboolNSError.fromFunction( - NativeCupertinoHttp lib, - NSProgress? Function(ObjCBlock_ffiVoid_NSURL_bool_NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_closureTrampoline) - .cast(), - _ObjCBlock_NSProgress_ffiVoidNSURLboolNSError_registerClosure( - (ffi.Pointer<_ObjCBlock> arg0) => - fn(ObjCBlock_ffiVoid_NSURL_bool_NSError._(arg0, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSProgress? call(ObjCBlock_ffiVoid_NSURL_bool_NSError arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>() - (_id, arg0._id) - .address == - 0 - ? null - : NSProgress._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>()(_id, arg0._id), - _lib, - retain: false, - release: true); -} + /// Creates a bidirectional stream task with an NSNetService to identify the endpoint. + /// The NSNetService will be resolved before any IO completes. + NSURLSessionStreamTask streamTaskWithNetService_(NSNetService service) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_streamTaskWithNetService_, service.ref.pointer); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: true, release: true); + } -void _ObjCBlock_ffiVoid_NSURL_bool_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function(ffi.Pointer, bool, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry = , bool, ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure( - void Function(ffi.Pointer, bool, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - bool arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); + /// Creates a WebSocket task given the url. The given url must have a ws or wss scheme. + NSURLSessionWebSocketTask webSocketTaskWithURL_(objc.NSURL url) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_webSocketTaskWithURL_, url.ref.pointer); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); + } -class ObjCBlock_ffiVoid_NSURL_bool_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURL_bool_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + /// Creates a WebSocket task given the url and an array of protocols. The protocols will be used in the WebSocket handshake to + /// negotiate a preferred protocol with the server + /// Note - The protocol will not affect the WebSocket framing. More details on the protocol can be found by reading the WebSocket RFC + NSURLSessionWebSocketTask webSocketTaskWithURL_protocols_( + objc.NSURL url, objc.ObjCObjectBase protocols) { + final _ret = _objc_msgSend_iq11qg( + this.ref.pointer, + _sel_webSocketTaskWithURL_protocols_, + url.ref.pointer, + protocols.ref.pointer); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, 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. - ObjCBlock_ffiVoid_NSURL_bool_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, ffi.Bool arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Bool, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_bool_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + /// Creates a WebSocket task given the request. The request properties can be modified and will be used by the task during the HTTP handshake phase. + /// Clients who want to add custom protocols can do so by directly adding headers with the key Sec-WebSocket-Protocol + /// and a comma separated list of protocols they wish to negotiate with the server. The custom HTTP headers provided by the client will remain unchanged for the handshake with the server. + NSURLSessionWebSocketTask webSocketTaskWithRequest_(NSURLRequest request) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_webSocketTaskWithRequest_, request.ref.pointer); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: true, release: true); + } - /// 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. - ObjCBlock_ffiVoid_NSURL_bool_NSError.fromFunction( - NativeCupertinoHttp lib, void Function(NSURL?, bool, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Bool, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1, - arg2.address == 0 - ? null - : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + /// init + NSURLSession init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } - /// 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. - ObjCBlock_ffiVoid_NSURL_bool_NSError.listener( - NativeCupertinoHttp lib, void Function(NSURL?, bool, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Bool, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURL_bool_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURL_bool_NSError_registerClosure( - (ffi.Pointer arg0, bool arg1, ffi.Pointer arg2) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1, - arg2.address == 0 - ? null - : NSError._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Bool, ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURL? arg0, bool arg1, NSError? arg2) => _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>, ffi.Pointer, - bool, ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1, arg2?._id ?? ffi.nullptr); -} + /// new + static NSURLSession new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSession, _sel_new); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } -void _ObjCBlock_ffiVoid_NSURL_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_NSURL_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_NSURL_NSError_closureRegistry[block.ref.target.address]!( - arg0, arg1); + /// dataTaskWithRequest:completionHandler: + NSURLSessionDataTask dataTaskWithRequest_completionHandler_( + NSURLRequest request, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_1kkhn3j( + this.ref.pointer, + _sel_dataTaskWithRequest_completionHandler_, + request.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, release: true); + } -class ObjCBlock_ffiVoid_NSURL_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSURL_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + /// dataTaskWithURL:completionHandler: + NSURLSessionDataTask dataTaskWithURL_completionHandler_( + objc.NSURL url, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_1kkhn3j( + this.ref.pointer, + _sel_dataTaskWithURL_completionHandler_, + url.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDataTask.castFromPointer(_ret, + retain: true, 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. - ObjCBlock_ffiVoid_NSURL_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + /// uploadTaskWithRequest:fromFile:completionHandler: + NSURLSessionUploadTask uploadTaskWithRequest_fromFile_completionHandler_( + NSURLRequest request, + objc.NSURL fileURL, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_37obke( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromFile_completionHandler_, + request.ref.pointer, + fileURL.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// 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. - ObjCBlock_ffiVoid_NSURL_NSError.fromFunction( - NativeCupertinoHttp lib, void Function(NSURL?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + /// uploadTaskWithRequest:fromData:completionHandler: + NSURLSessionUploadTask uploadTaskWithRequest_fromData_completionHandler_( + NSURLRequest request, + objc.NSData? bodyData, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_37obke( + this.ref.pointer, + _sel_uploadTaskWithRequest_fromData_completionHandler_, + request.ref.pointer, + bodyData?.ref.pointer ?? ffi.nullptr, + completionHandler.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// 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. - ObjCBlock_ffiVoid_NSURL_NSError.listener( - NativeCupertinoHttp lib, void Function(NSURL?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSURL_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSURL_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSURL._(arg0, lib, retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, - retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSURL? arg0, NSError? arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} + /// uploadTaskWithResumeData:completionHandler: + NSURLSessionUploadTask uploadTaskWithResumeData_completionHandler_( + objc.NSData resumeData, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_1kkhn3j( + this.ref.pointer, + _sel_uploadTaskWithResumeData_completionHandler_, + resumeData.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: true, release: true); + } -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>)>()(arg0); -final _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry = - Function(ffi.Pointer<_ObjCBlock>)>{}; -int _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistryIndex = 0; -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_registerClosure( - ffi.Pointer Function(ffi.Pointer<_ObjCBlock>) fn) { - final id = - ++_ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistryIndex; - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -ffi.Pointer - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0) => - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureRegistry[ - block.ref.target.address]!(arg0); - -class ObjCBlock_NSProgress_ffiVoidObjCObjectNSError extends _ObjCBlockBase { - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + /// downloadTaskWithRequest:completionHandler: + NSURLSessionDownloadTask downloadTaskWithRequest_completionHandler_( + NSURLRequest request, + objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_1kkhn3j( + this.ref.pointer, + _sel_downloadTaskWithRequest_completionHandler_, + request.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, 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. - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> arg0)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + /// downloadTaskWithURL:completionHandler: + NSURLSessionDownloadTask downloadTaskWithURL_completionHandler_( + objc.NSURL url, + objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_1kkhn3j( + this.ref.pointer, + _sel_downloadTaskWithURL_completionHandler_, + url.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } - /// 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. - ObjCBlock_NSProgress_ffiVoidObjCObjectNSError.fromFunction( - NativeCupertinoHttp lib, - NSProgress? Function(ObjCBlock_ffiVoid_ObjCObject_NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer<_ObjCBlock>)>( - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_closureTrampoline) - .cast(), - _ObjCBlock_NSProgress_ffiVoidObjCObjectNSError_registerClosure( - (ffi.Pointer<_ObjCBlock> arg0) => - fn(ObjCBlock_ffiVoid_ObjCObject_NSError._(arg0, lib, retain: true, release: true)) - ?._retainAndReturnId() ?? - ffi.nullptr)), - lib); - static ffi.Pointer? _dartFuncTrampoline; - - NSProgress? call(ObjCBlock_ffiVoid_ObjCObject_NSError arg0) => _id.ref.invoke - .cast< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>() - (_id, arg0._id) - .address == - 0 - ? null - : NSProgress._( - _id.ref.invoke - .cast Function(ffi.Pointer<_ObjCBlock> block, ffi.Pointer<_ObjCBlock> arg0)>>() - .asFunction Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer<_ObjCBlock>)>()(_id, arg0._id), - _lib, - retain: false, - release: true); + /// downloadTaskWithResumeData:completionHandler: + NSURLSessionDownloadTask downloadTaskWithResumeData_completionHandler_( + objc.NSData resumeData, + objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, objc.NSError?)> + completionHandler) { + final _ret = _objc_msgSend_1kkhn3j( + this.ref.pointer, + _sel_downloadTaskWithResumeData_completionHandler_, + resumeData.ref.pointer, + completionHandler.ref.pointer); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: true, release: true); + } + + /// allocWithZone: + static NSURLSession allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSURLSession, _sel_allocWithZone_, zone); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSURLSession alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSession, _sel_alloc); + return NSURLSession.castFromPointer(_ret, retain: false, release: true); + } } -void _ObjCBlock_ffiVoid_ObjCObject_NSError_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ObjCObject_NSError extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_NSError._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); +late final _class_NSURLSession = objc.getClass("NSURLSession"); +late final _sel_sharedSession = objc.registerName("sharedSession"); - /// 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. - ObjCBlock_ffiVoid_ObjCObject_NSError.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; +/// Configuration options for an NSURLSession. When a session is +/// created, a copy of the configuration object is made - you cannot +/// modify the configuration of a session after it has been created. +/// +/// The shared session uses the global singleton credential, cache +/// and cookie storage objects. +/// +/// An ephemeral session has no persistent disk storage for cookies, +/// cache or credentials. +/// +/// A background session can be used to perform networking operations +/// on behalf of a suspended application, within certain constraints. +class NSURLSessionConfiguration extends objc.NSObject { + NSURLSessionConfiguration._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - /// 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. - ObjCBlock_ffiVoid_ObjCObject_NSError.fromFunction( - NativeCupertinoHttp lib, void Function(NSObject?, NSError?) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 ? null : NSObject._(arg0, lib, retain: true, release: true), - arg1.address == 0 ? null : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + /// Constructs a [NSURLSessionConfiguration] that points to the same underlying object as [other]. + NSURLSessionConfiguration.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// 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. - ObjCBlock_ffiVoid_ObjCObject_NSError.listener( - NativeCupertinoHttp lib, void Function(NSObject?, NSError?) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= - ffi.NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_NSError_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSObject._(arg0, lib, - retain: true, release: true), - arg1.address == 0 - ? null - : NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject? arg0, NSError? arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1?._id ?? ffi.nullptr); -} + /// Constructs a [NSURLSessionConfiguration] that wraps the given raw object pointer. + NSURLSessionConfiguration.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); -typedef NSItemProviderLoadHandler = ffi.Pointer<_ObjCBlock>; -typedef DartNSItemProviderLoadHandler - = ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary; -void - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>>() - .asFunction< - void Function( - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)>()(arg0, arg1, arg2); -final _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureRegistry = - , - ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureRegistryIndex = - 0; -ffi.Pointer - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_registerClosure( - void Function(NSItemProviderCompletionHandler, ffi.Pointer, - ffi.Pointer) - fn) { - final id = - ++_ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureRegistryIndex; - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureRegistry[ - id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureRegistry[ - block.ref.target.address]!(arg0, arg1, arg2); - -class ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary - extends _ObjCBlockBase { - ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + /// Returns whether [obj] is an instance of [NSURLSessionConfiguration]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionConfiguration); + } - /// 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. - ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function( - NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + /// defaultSessionConfiguration + static NSURLSessionConfiguration getDefaultSessionConfiguration() { + final _ret = _objc_msgSend_1unuoxw( + _class_NSURLSessionConfiguration, _sel_defaultSessionConfiguration); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); + } - /// 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. - ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary.fromFunction( - NativeCupertinoHttp lib, - void Function(DartNSItemProviderCompletionHandler, NSObject, NSDictionary) - fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= - ffi.Pointer.fromFunction, NSItemProviderCompletionHandler, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_registerClosure( - (NSItemProviderCompletionHandler arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( - ObjCBlock_ffiVoid_ObjCObject_NSError1._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - NSDictionary._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + /// ephemeralSessionConfiguration + static NSURLSessionConfiguration getEphemeralSessionConfiguration() { + final _ret = _objc_msgSend_1unuoxw( + _class_NSURLSessionConfiguration, _sel_ephemeralSessionConfiguration); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); + } - /// 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. - ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary.listener( - NativeCupertinoHttp lib, - void Function(DartNSItemProviderCompletionHandler, NSObject, NSDictionary) - fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi.NativeCallable, NSItemProviderCompletionHandler, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_NSItemProviderCompletionHandler_ObjCObject_NSDictionary_registerClosure( - (NSItemProviderCompletionHandler arg0, - ffi.Pointer arg1, - ffi.Pointer arg2) => - fn( - ObjCBlock_ffiVoid_ObjCObject_NSError1._(arg0, lib, retain: true, release: true), - NSObject._(arg1, lib, retain: true, release: true), - NSDictionary._(arg2, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(DartNSItemProviderCompletionHandler arg0, NSObject arg1, - NSDictionary arg2) => - _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>, - NSItemProviderCompletionHandler, - ffi.Pointer, - ffi.Pointer)>()( - _id, arg0._id, arg1._id, arg2._id); -} - -typedef NSItemProviderCompletionHandler = ffi.Pointer<_ObjCBlock>; -typedef DartNSItemProviderCompletionHandler - = ObjCBlock_ffiVoid_ObjCObject_NSError1; -void _ObjCBlock_ffiVoid_ObjCObject_NSError1_fnPtrTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - block.ref.target - .cast< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>>() - .asFunction< - void Function(ffi.Pointer, - ffi.Pointer)>()(arg0, arg1); -final _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistry = - , ffi.Pointer)>{}; -int _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistryIndex = 0; -ffi.Pointer _ObjCBlock_ffiVoid_ObjCObject_NSError1_registerClosure( - void Function(ffi.Pointer, ffi.Pointer) fn) { - final id = ++_ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistryIndex; - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistry[id] = fn; - return ffi.Pointer.fromAddress(id); -} - -void _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureTrampoline( - ffi.Pointer<_ObjCBlock> block, - ffi.Pointer arg0, - ffi.Pointer arg1) => - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureRegistry[ - block.ref.target.address]!(arg0, arg1); - -class ObjCBlock_ffiVoid_ObjCObject_NSError1 extends _ObjCBlockBase { - ObjCBlock_ffiVoid_ObjCObject_NSError1._( - ffi.Pointer<_ObjCBlock> id, NativeCupertinoHttp lib, - {bool retain = false, bool release = true}) - : super._(id, lib, retain: retain, release: release); + /// backgroundSessionConfigurationWithIdentifier: + static NSURLSessionConfiguration + backgroundSessionConfigurationWithIdentifier_(objc.NSString identifier) { + final _ret = _objc_msgSend_juohf7( + _class_NSURLSessionConfiguration, + _sel_backgroundSessionConfigurationWithIdentifier_, + identifier.ref.pointer); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, 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. - ObjCBlock_ffiVoid_ObjCObject_NSError1.fromFunctionPointer( - NativeCupertinoHttp lib, - ffi.Pointer< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer arg0, - ffi.Pointer arg1)>> - ptr) - : this._( - lib._newBlock1( - _cFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, - ffi.Pointer, - ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError1_fnPtrTrampoline) - .cast(), - ptr.cast()), - lib); - static ffi.Pointer? _cFuncTrampoline; + /// identifier for the background session configuration + objc.NSString? get identifier { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_identifier); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); + } - /// 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. - ObjCBlock_ffiVoid_ObjCObject_NSError1.fromFunction( - NativeCupertinoHttp lib, void Function(NSObject?, NSError) fn) - : this._( - lib._newBlock1( - _dartFuncTrampoline ??= ffi.Pointer.fromFunction< - ffi.Void Function( - ffi.Pointer<_ObjCBlock>, ffi.Pointer, ffi.Pointer)>( - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureTrampoline) - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError1_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 ? null : NSObject._(arg0, lib, retain: true, release: true), - NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.Pointer? _dartFuncTrampoline; + /// default cache policy for requests + NSURLRequestCachePolicy get requestCachePolicy { + final _ret = + _objc_msgSend_2xak1q(this.ref.pointer, _sel_requestCachePolicy); + return NSURLRequestCachePolicy.fromValue(_ret); + } - /// 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. - ObjCBlock_ffiVoid_ObjCObject_NSError1.listener( - NativeCupertinoHttp lib, void Function(NSObject?, NSError) fn) - : this._( - lib._newBlock1( - (_dartFuncListenerTrampoline ??= ffi - .NativeCallable, ffi.Pointer, ffi.Pointer)>.listener( - _ObjCBlock_ffiVoid_ObjCObject_NSError1_closureTrampoline) - ..keepIsolateAlive = false) - .nativeFunction - .cast(), - _ObjCBlock_ffiVoid_ObjCObject_NSError1_registerClosure( - (ffi.Pointer arg0, ffi.Pointer arg1) => fn( - arg0.address == 0 - ? null - : NSObject._(arg0, lib, retain: true, release: true), - NSError._(arg1, lib, retain: true, release: true)))), - lib); - static ffi.NativeCallable< - ffi.Void Function(ffi.Pointer<_ObjCBlock>, ffi.Pointer, - ffi.Pointer)>? _dartFuncListenerTrampoline; - - void call(NSObject? arg0, NSError arg1) => _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>, ffi.Pointer, - ffi.Pointer)>()( - _id, arg0?._id ?? ffi.nullptr, arg1._id); -} + /// default cache policy for requests + set requestCachePolicy(NSURLRequestCachePolicy value) { + return _objc_msgSend_12vaadl( + this.ref.pointer, _sel_setRequestCachePolicy_, value.value); + } -abstract class NSItemProviderErrorCode { - static const int NSItemProviderUnknownError = -1; - static const int NSItemProviderItemUnavailableError = -1000; - static const int NSItemProviderUnexpectedValueClassError = -1100; - static const int NSItemProviderUnavailableCoercionError = -1200; -} + /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. + DartNSTimeInterval get timeoutIntervalForRequest { + return _objc_msgSend_10noklm( + this.ref.pointer, _sel_timeoutIntervalForRequest); + } -typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; -typedef DartNSStringEncodingDetectionOptionsKey = NSString; + /// default timeout for requests. This will cause a timeout if no data is transmitted for the given timeout value, and is reset whenever data is transmitted. + set timeoutIntervalForRequest(DartNSTimeInterval value) { + return _objc_msgSend_suh039( + this.ref.pointer, _sel_setTimeoutIntervalForRequest_, value); + } -class NSMutableString extends NSString { - NSMutableString._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. + DartNSTimeInterval get timeoutIntervalForResource { + return _objc_msgSend_10noklm( + this.ref.pointer, _sel_timeoutIntervalForResource); + } - /// 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); + /// default timeout for requests. This will cause a timeout if a resource is not able to be retrieved within a given timeout. + set timeoutIntervalForResource(DartNSTimeInterval value) { + return _objc_msgSend_suh039( + this.ref.pointer, _sel_setTimeoutIntervalForResource_, value); + } + + /// type of service for requests. + NSURLRequestNetworkServiceType get networkServiceType { + final _ret = + _objc_msgSend_ttt73t(this.ref.pointer, _sel_networkServiceType); + return NSURLRequestNetworkServiceType.fromValue(_ret); } - /// Returns a [NSMutableString] that wraps the given raw object pointer. - static NSMutableString castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableString._(other, lib, retain: retain, release: release); + /// type of service for requests. + set networkServiceType(NSURLRequestNetworkServiceType value) { + return _objc_msgSend_br89tg( + this.ref.pointer, _sel_setNetworkServiceType_, value.value); } - /// 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); + /// allow request to route over cellular. + bool get allowsCellularAccess { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_allowsCellularAccess); } - void replaceCharactersInRange_withString_(NSRange range, NSString aString) { - _lib._objc_msgSend_509(_id, _lib._sel_replaceCharactersInRange_withString_1, - range, aString._id); + /// allow request to route over cellular. + set allowsCellularAccess(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setAllowsCellularAccess_, value); } - void insertString_atIndex_(NSString aString, DartNSUInteger loc) { - _lib._objc_msgSend_510( - _id, _lib._sel_insertString_atIndex_1, aString._id, loc); + /// allow request to route over expensive networks. Defaults to YES. + bool get allowsExpensiveNetworkAccess { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_allowsExpensiveNetworkAccess); } - void deleteCharactersInRange_(NSRange range) { - _lib._objc_msgSend_304(_id, _lib._sel_deleteCharactersInRange_1, range); + /// allow request to route over expensive networks. Defaults to YES. + set allowsExpensiveNetworkAccess(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setAllowsExpensiveNetworkAccess_, value); } - void appendString_(NSString aString) { - _lib._objc_msgSend_195(_id, _lib._sel_appendString_1, aString._id); + /// allow request to route over networks in constrained mode. Defaults to YES. + bool get allowsConstrainedNetworkAccess { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_allowsConstrainedNetworkAccess); } - void appendFormat_(NSString format) { - _lib._objc_msgSend_195(_id, _lib._sel_appendFormat_1, format._id); + /// allow request to route over networks in constrained mode. Defaults to YES. + set allowsConstrainedNetworkAccess(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setAllowsConstrainedNetworkAccess_, value); } - void setString_(NSString aString) { - _lib._objc_msgSend_195(_id, _lib._sel_setString_1, aString._id); + /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. + bool get requiresDNSSECValidation { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_requiresDNSSECValidation); } - DartNSUInteger replaceOccurrencesOfString_withString_options_range_( - NSString target, NSString replacement, int options, NSRange searchRange) { - return _lib._objc_msgSend_511( - _id, - _lib._sel_replaceOccurrencesOfString_withString_options_range_1, - target._id, - replacement._id, - options, - searchRange); + /// requires requests from the session to be made with DNSSEC validation enabled. Defaults to NO. + set requiresDNSSECValidation(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setRequiresDNSSECValidation_, value); } - bool applyTransform_reverse_range_updatedRange_( - DartNSStringTransform transform, - bool reverse, - NSRange range, - NSRangePointer resultingRange) { - return _lib._objc_msgSend_512( - _id, - _lib._sel_applyTransform_reverse_range_updatedRange_1, - transform._id, - reverse, - range, - resultingRange); + /// Causes tasks to wait for network connectivity to become available, rather + /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) + /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest + /// property does not apply, but the timeoutIntervalForResource property does. + /// + /// Unsatisfactory connectivity (that requires waiting) includes cases where the + /// device has limited or insufficient connectivity for a task (e.g., only has a + /// cellular connection but the allowsCellularAccess property is NO, or requires + /// a VPN connection in order to reach the desired host). + /// + /// Default value is NO. Ignored by background sessions, as background sessions + /// always wait for connectivity. + bool get waitsForConnectivity { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_waitsForConnectivity); } - NSMutableString initWithCapacity_(DartNSUInteger capacity) { - final _ret = - _lib._objc_msgSend_513(_id, _lib._sel_initWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// Causes tasks to wait for network connectivity to become available, rather + /// than immediately failing with an error (such as NSURLErrorNotConnectedToInternet) + /// when it is not. When waiting for connectivity, the timeoutIntervalForRequest + /// property does not apply, but the timeoutIntervalForResource property does. + /// + /// Unsatisfactory connectivity (that requires waiting) includes cases where the + /// device has limited or insufficient connectivity for a task (e.g., only has a + /// cellular connection but the allowsCellularAccess property is NO, or requires + /// a VPN connection in order to reach the desired host). + /// + /// Default value is NO. Ignored by background sessions, as background sessions + /// always wait for connectivity. + set waitsForConnectivity(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setWaitsForConnectivity_, value); } - static NSMutableString stringWithCapacity_( - NativeCupertinoHttp _lib, DartNSUInteger capacity) { - final _ret = _lib._objc_msgSend_513( - _lib._class_NSMutableString1, _lib._sel_stringWithCapacity_1, capacity); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// allows background tasks to be scheduled at the discretion of the system for optimal performance. + bool get discretionary { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isDiscretionary); } - @override - NSMutableString init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// allows background tasks to be scheduled at the discretion of the system for optimal performance. + set discretionary(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setDiscretionary_, value); } - @override - NSMutableString? initWithCoder_(NSCoder coder) { + /// The identifier of the shared data container into which files in background sessions should be downloaded. + /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or + /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. + objc.NSString? get sharedContainerIdentifier { final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_sharedContainerIdentifier); return _ret.address == 0 ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - static ffi.Pointer getAvailableStringEncodings( - NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_255( - _lib._class_NSMutableString1, _lib._sel_availableStringEncodings1); + /// The identifier of the shared data container into which files in background sessions should be downloaded. + /// App extensions wishing to use background sessions *must* set this property to a valid container identifier, or + /// all transfers in that session will fail with NSURLErrorBackgroundSessionRequiresSharedContainer. + set sharedContainerIdentifier(objc.NSString? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, + _sel_setSharedContainerIdentifier_, value?.ref.pointer ?? ffi.nullptr); } - static NSString localizedNameOfStringEncoding_( - NativeCupertinoHttp _lib, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_15(_lib._class_NSMutableString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib, retain: true, release: true); + /// Allows the app to be resumed or launched in the background when tasks in background sessions complete + /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: + /// and the default value is YES. + /// + /// NOTE: macOS apps based on AppKit do not support background launch. + bool get sessionSendsLaunchEvents { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_sessionSendsLaunchEvents); } - static DartNSUInteger getDefaultCStringEncoding(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSMutableString1, _lib._sel_defaultCStringEncoding1); + /// Allows the app to be resumed or launched in the background when tasks in background sessions complete + /// or when auth is required. This only applies to configurations created with +backgroundSessionConfigurationWithIdentifier: + /// and the default value is YES. + /// + /// NOTE: macOS apps based on AppKit do not support background launch. + set sessionSendsLaunchEvents(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setSessionSendsLaunchEvents_, value); } - @override - NSMutableString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, DartNSUInteger length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_267( - _id, - _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, - characters, - length, - freeBuffer); - return NSMutableString._(_ret, _lib, retain: false, release: true); + /// The proxy dictionary, as described by + objc.NSDictionary? get connectionProxyDictionary { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_connectionProxyDictionary); + return _ret.address == 0 + ? null + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - @override - NSMutableString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, - DartNSUInteger len, - ObjCBlock_ffiVoid_unichar_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_268( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib, retain: false, release: true); + /// The proxy dictionary, as described by + set connectionProxyDictionary(objc.NSDictionary? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, + _sel_setConnectionProxyDictionary_, value?.ref.pointer ?? ffi.nullptr); } - @override - NSMutableString initWithCharacters_length_( - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269( - _id, _lib._sel_initWithCharacters_length_1, characters, length); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The minimum allowable versions of the TLS protocol, from + SSLProtocol get TLSMinimumSupportedProtocol { + final _ret = _objc_msgSend_ewo6ux( + this.ref.pointer, _sel_TLSMinimumSupportedProtocol); + return SSLProtocol.fromValue(_ret); } - @override - NSMutableString? initWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_270( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// The minimum allowable versions of the TLS protocol, from + set TLSMinimumSupportedProtocol(SSLProtocol value) { + return _objc_msgSend_hcgw10( + this.ref.pointer, _sel_setTLSMinimumSupportedProtocol_, value.value); } - @override - NSMutableString initWithString_(NSString aString) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithString_1, aString._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The maximum allowable versions of the TLS protocol, from + SSLProtocol get TLSMaximumSupportedProtocol { + final _ret = _objc_msgSend_ewo6ux( + this.ref.pointer, _sel_TLSMaximumSupportedProtocol); + return SSLProtocol.fromValue(_ret); } - @override - NSMutableString initWithFormat_(NSString format) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithFormat_1, format._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The maximum allowable versions of the TLS protocol, from + set TLSMaximumSupportedProtocol(SSLProtocol value) { + return _objc_msgSend_hcgw10( + this.ref.pointer, _sel_setTLSMaximumSupportedProtocol_, value.value); } - @override - NSMutableString initWithFormat_arguments_(NSString format, va_list argList) { - final _ret = _lib._objc_msgSend_271( - _id, _lib._sel_initWithFormat_arguments_1, format._id, argList); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The minimum allowable versions of the TLS protocol, from + tls_protocol_version_t get TLSMinimumSupportedProtocolVersion { + final _ret = _objc_msgSend_a6qtz( + this.ref.pointer, _sel_TLSMinimumSupportedProtocolVersion); + return tls_protocol_version_t.fromValue(_ret); } - @override - NSMutableString initWithFormat_locale_(NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_272(_id, _lib._sel_initWithFormat_locale_1, - format._id, locale?._id ?? ffi.nullptr); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The minimum allowable versions of the TLS protocol, from + set TLSMinimumSupportedProtocolVersion(tls_protocol_version_t value) { + return _objc_msgSend_yb8bfm(this.ref.pointer, + _sel_setTLSMinimumSupportedProtocolVersion_, value.value); } - @override - NSMutableString initWithFormat_locale_arguments_( - NSString format, NSObject? locale, va_list argList) { - final _ret = _lib._objc_msgSend_273( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format._id, - locale?._id ?? ffi.nullptr, - argList); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The maximum allowable versions of the TLS protocol, from + tls_protocol_version_t get TLSMaximumSupportedProtocolVersion { + final _ret = _objc_msgSend_a6qtz( + this.ref.pointer, _sel_TLSMaximumSupportedProtocolVersion); + return tls_protocol_version_t.fromValue(_ret); } - @override - NSMutableString? initWithValidatedFormat_validFormatSpecifiers_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// The maximum allowable versions of the TLS protocol, from + set TLSMaximumSupportedProtocolVersion(tls_protocol_version_t value) { + return _objc_msgSend_yb8bfm(this.ref.pointer, + _sel_setTLSMaximumSupportedProtocolVersion_, value.value); } - @override - NSMutableString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_275( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// Allow the use of HTTP pipelining + bool get HTTPShouldUsePipelining { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldUsePipelining); } - @override - NSMutableString? - initWithValidatedFormat_validFormatSpecifiers_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_276( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, - format._id, - validFormatSpecifiers._id, - argList, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// Allow the use of HTTP pipelining + set HTTPShouldUsePipelining(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setHTTPShouldUsePipelining_, value); } - @override - NSMutableString? - initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_277( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - argList, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// Allow the session to set cookies on requests + bool get HTTPShouldSetCookies { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_HTTPShouldSetCookies); } - @override - NSMutableString? initWithData_encoding_( - NSData data, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_278( - _id, _lib._sel_initWithData_encoding_1, data._id, encoding); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// Allow the session to set cookies on requests + set HTTPShouldSetCookies(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setHTTPShouldSetCookies_, value); } - @override - NSMutableString? initWithBytes_length_encoding_(ffi.Pointer bytes, - DartNSUInteger len, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_279( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. + NSHTTPCookieAcceptPolicy get HTTPCookieAcceptPolicy { + final _ret = + _objc_msgSend_1jpuqgg(this.ref.pointer, _sel_HTTPCookieAcceptPolicy); + return NSHTTPCookieAcceptPolicy.fromValue(_ret); } - @override - NSMutableString? initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - bool freeBuffer) { - final _ret = _lib._objc_msgSend_280( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: false, release: true); + /// Policy for accepting cookies. This overrides the policy otherwise specified by the cookie storage. + set HTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy value) { + return _objc_msgSend_199e8fv( + this.ref.pointer, _sel_setHTTPCookieAcceptPolicy_, value.value); } - @override - NSMutableString? initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - ObjCBlock_ffiVoid_ffiVoid_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_281( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator?._id ?? ffi.nullptr); + /// Specifies additional headers which will be set on outgoing requests. + /// Note that these headers are added to the request only if not already present. + objc.NSDictionary? get HTTPAdditionalHeaders { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPAdditionalHeaders); return _ret.address == 0 ? null - : NSMutableString._(_ret, _lib, retain: false, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - static NSMutableString string(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_string1); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// Specifies additional headers which will be set on outgoing requests. + /// Note that these headers are added to the request only if not already present. + set HTTPAdditionalHeaders(objc.NSDictionary? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, + _sel_setHTTPAdditionalHeaders_, value?.ref.pointer ?? ffi.nullptr); } - static NSMutableString stringWithString_( - NativeCupertinoHttp _lib, NSString string) { - final _ret = _lib._objc_msgSend_42( - _lib._class_NSMutableString1, _lib._sel_stringWithString_1, string._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The maximum number of simultaneous persistent connections per host + DartNSInteger get HTTPMaximumConnectionsPerHost { + return _objc_msgSend_z1fx1b( + this.ref.pointer, _sel_HTTPMaximumConnectionsPerHost); } - static NSMutableString stringWithCharacters_length_(NativeCupertinoHttp _lib, - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269(_lib._class_NSMutableString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSMutableString._(_ret, _lib, retain: true, release: true); + /// The maximum number of simultaneous persistent connections per host + set HTTPMaximumConnectionsPerHost(DartNSInteger value) { + return _objc_msgSend_ke7qz2( + this.ref.pointer, _sel_setHTTPMaximumConnectionsPerHost_, value); } - static NSMutableString? stringWithUTF8String_( - NativeCupertinoHttp _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_270(_lib._class_NSMutableString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString stringWithFormat_( - NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42( - _lib._class_NSMutableString1, _lib._sel_stringWithFormat_1, format._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString localizedStringWithFormat_( - NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42(_lib._class_NSMutableString1, - _lib._sel_localizedStringWithFormat_1, format._id); - return NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? - stringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSMutableString1, - _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? - localizedStringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSMutableString1, - _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); + /// The cookie storage object to use, or nil to indicate that no cookies should be handled + NSHTTPCookieStorage? get HTTPCookieStorage { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_HTTPCookieStorage); return _ret.address == 0 ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + : NSHTTPCookieStorage.castFromPointer(_ret, + retain: true, release: true); } - @override - NSMutableString? initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_282(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// The cookie storage object to use, or nil to indicate that no cookies should be handled + set HTTPCookieStorage(NSHTTPCookieStorage? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setHTTPCookieStorage_, + value?.ref.pointer ?? ffi.nullptr); } - static NSMutableString? stringWithCString_encoding_(NativeCupertinoHttp _lib, - ffi.Pointer cString, DartNSUInteger enc) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); + /// The credential storage object, or nil to indicate that no credential storage is to be used + NSURLCredentialStorage? get URLCredentialStorage { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URLCredentialStorage); return _ret.address == 0 ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + : NSURLCredentialStorage.castFromPointer(_ret, + retain: true, release: true); } - @override - NSMutableString? initWithContentsOfURL_encoding_error_(NSURL url, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283(_id, - _lib._sel_initWithContentsOfURL_encoding_error_1, url._id, enc, error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// The credential storage object, or nil to indicate that no credential storage is to be used + set URLCredentialStorage(NSURLCredentialStorage? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setURLCredentialStorage_, + value?.ref.pointer ?? ffi.nullptr); } - @override - NSMutableString? initWithContentsOfFile_encoding_error_(NSString path, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfURL_encoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfFile_encoding_error_( - NativeCupertinoHttp _lib, - NSString path, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); + /// The URL resource cache, or nil to indicate that no caching is to be performed + NSURLCache? get URLCache { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_URLCache); return _ret.address == 0 ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + : NSURLCache.castFromPointer(_ret, retain: true, release: true); } - @override - NSMutableString? initWithContentsOfURL_usedEncoding_error_( - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); + /// The URL resource cache, or nil to indicate that no caching is to be performed + set URLCache(NSURLCache? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setURLCache_, value?.ref.pointer ?? ffi.nullptr); } - @override - NSMutableString? initWithContentsOfFile_usedEncoding_error_( - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfURL_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static NSMutableString? stringWithContentsOfFile_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSMutableString._(_ret, _lib, retain: true, release: true); - } - - static DartNSUInteger - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - NativeCupertinoHttp _lib, - NSData data, - NSDictionary? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_287( - _lib._class_NSMutableString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data._id, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject? stringWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open + /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) + bool get shouldUseExtendedBackgroundIdleMode { + return _objc_msgSend_olxnu1( + this.ref.pointer, _sel_shouldUseExtendedBackgroundIdleMode); } - static NSObject? stringWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226(_lib._class_NSMutableString1, - _lib._sel_stringWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// Enable extended background idle mode for any tcp sockets created. Enabling this mode asks the system to keep the socket open + /// and delay reclaiming it when the process moves to the background (see https://developer.apple.com/library/ios/technotes/tn2277/_index.html) + set shouldUseExtendedBackgroundIdleMode(bool value) { + return _objc_msgSend_117qins( + this.ref.pointer, _sel_setShouldUseExtendedBackgroundIdleMode_, value); } - static NSObject? stringWithCString_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSMutableString1, - _lib._sel_stringWithCString_length_1, bytes, length); + /// An optional array of Class objects which subclass NSURLProtocol. + /// The Class will be sent +canInitWithRequest: when determining if + /// an instance of the class can be used for a given URL scheme. + /// You should not use +[NSURLProtocol registerClass:], as that + /// method will register your class with the default session rather + /// than with an instance of NSURLSession. + /// Custom NSURLProtocol subclasses are not available to background + /// sessions. + objc.ObjCObjectBase? get protocolClasses { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_protocolClasses); return _ret.address == 0 ? null - : NSObject._(_ret, _lib, retain: true, release: true); + : objc.ObjCObjectBase(_ret, retain: true, release: true); } - static NSObject? stringWithCString_( - NativeCupertinoHttp _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_270( - _lib._class_NSMutableString1, _lib._sel_stringWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// An optional array of Class objects which subclass NSURLProtocol. + /// The Class will be sent +canInitWithRequest: when determining if + /// an instance of the class can be used for a given URL scheme. + /// You should not use +[NSURLProtocol registerClass:], as that + /// method will register your class with the default session rather + /// than with an instance of NSURLSession. + /// Custom NSURLProtocol subclasses are not available to background + /// sessions. + set protocolClasses(objc.ObjCObjectBase? value) { + return _objc_msgSend_ukcdfq(this.ref.pointer, _sel_setProtocolClasses_, + value?.ref.pointer ?? ffi.nullptr); + } + + /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone + NSURLSessionMultipathServiceType get multipathServiceType { + final _ret = + _objc_msgSend_zqvllq(this.ref.pointer, _sel_multipathServiceType); + return NSURLSessionMultipathServiceType.fromValue(_ret); + } + + /// multipath service type to use for connections. The default is NSURLSessionMultipathServiceTypeNone + set multipathServiceType(NSURLSessionMultipathServiceType value) { + return _objc_msgSend_1ngj1qh( + this.ref.pointer, _sel_setMultipathServiceType_, value.value); + } + + /// init + NSURLSessionConfiguration init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: false, release: true); } - static NSMutableString new1(NativeCupertinoHttp _lib) { + /// new + static NSURLSessionConfiguration new1() { final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_new1); - return NSMutableString._(_ret, _lib, retain: false, release: true); + _objc_msgSend_1unuoxw(_class_NSURLSessionConfiguration, _sel_new); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: false, release: true); + } + + /// backgroundSessionConfiguration: + static NSURLSessionConfiguration backgroundSessionConfiguration_( + objc.NSString identifier) { + final _ret = _objc_msgSend_juohf7(_class_NSURLSessionConfiguration, + _sel_backgroundSessionConfiguration_, identifier.ref.pointer); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: true, release: true); } - static NSMutableString allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableString1, _lib._sel_allocWithZone_1, zone); - return NSMutableString._(_ret, _lib, retain: false, release: true); + /// allocWithZone: + static NSURLSessionConfiguration allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionConfiguration, _sel_allocWithZone_, zone); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: false, release: true); } - static NSMutableString alloc(NativeCupertinoHttp _lib) { + /// alloc + static NSURLSessionConfiguration alloc() { final _ret = - _lib._objc_msgSend_2(_lib._class_NSMutableString1, _lib._sel_alloc1); - return NSMutableString._(_ret, _lib, retain: false, release: true); + _objc_msgSend_1unuoxw(_class_NSURLSessionConfiguration, _sel_alloc); + return NSURLSessionConfiguration.castFromPointer(_ret, + retain: false, release: true); } } -typedef NSExceptionName = ffi.Pointer; -typedef DartNSExceptionName = NSString; +late final _class_NSURLSessionConfiguration = + objc.getClass("NSURLSessionConfiguration"); +late final _sel_defaultSessionConfiguration = + objc.registerName("defaultSessionConfiguration"); +late final _sel_ephemeralSessionConfiguration = + objc.registerName("ephemeralSessionConfiguration"); +late final _sel_backgroundSessionConfigurationWithIdentifier_ = + objc.registerName("backgroundSessionConfigurationWithIdentifier:"); +late final _sel_identifier = objc.registerName("identifier"); +late final _sel_requestCachePolicy = objc.registerName("requestCachePolicy"); +late final _sel_setRequestCachePolicy_ = + objc.registerName("setRequestCachePolicy:"); +late final _sel_timeoutIntervalForRequest = + objc.registerName("timeoutIntervalForRequest"); +late final _sel_setTimeoutIntervalForRequest_ = + objc.registerName("setTimeoutIntervalForRequest:"); +late final _sel_timeoutIntervalForResource = + objc.registerName("timeoutIntervalForResource"); +late final _sel_setTimeoutIntervalForResource_ = + objc.registerName("setTimeoutIntervalForResource:"); +late final _sel_waitsForConnectivity = + objc.registerName("waitsForConnectivity"); +late final _sel_setWaitsForConnectivity_ = + objc.registerName("setWaitsForConnectivity:"); +late final _sel_isDiscretionary = objc.registerName("isDiscretionary"); +late final _sel_setDiscretionary_ = objc.registerName("setDiscretionary:"); +late final _sel_sharedContainerIdentifier = + objc.registerName("sharedContainerIdentifier"); +late final _sel_setSharedContainerIdentifier_ = + objc.registerName("setSharedContainerIdentifier:"); +late final _sel_sessionSendsLaunchEvents = + objc.registerName("sessionSendsLaunchEvents"); +late final _sel_setSessionSendsLaunchEvents_ = + objc.registerName("setSessionSendsLaunchEvents:"); +late final _sel_connectionProxyDictionary = + objc.registerName("connectionProxyDictionary"); +late final _sel_setConnectionProxyDictionary_ = + objc.registerName("setConnectionProxyDictionary:"); +late final _sel_TLSMinimumSupportedProtocol = + objc.registerName("TLSMinimumSupportedProtocol"); +final _objc_msgSend_ewo6ux = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.UnsignedInt Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setTLSMinimumSupportedProtocol_ = + objc.registerName("setTLSMinimumSupportedProtocol:"); +final _objc_msgSend_hcgw10 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.UnsignedInt)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_TLSMaximumSupportedProtocol = + objc.registerName("TLSMaximumSupportedProtocol"); +late final _sel_setTLSMaximumSupportedProtocol_ = + objc.registerName("setTLSMaximumSupportedProtocol:"); +late final _sel_TLSMinimumSupportedProtocolVersion = + objc.registerName("TLSMinimumSupportedProtocolVersion"); +final _objc_msgSend_a6qtz = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Uint16 Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setTLSMinimumSupportedProtocolVersion_ = + objc.registerName("setTLSMinimumSupportedProtocolVersion:"); +final _objc_msgSend_yb8bfm = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Uint16)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_TLSMaximumSupportedProtocolVersion = + objc.registerName("TLSMaximumSupportedProtocolVersion"); +late final _sel_setTLSMaximumSupportedProtocolVersion_ = + objc.registerName("setTLSMaximumSupportedProtocolVersion:"); +late final _sel_HTTPShouldSetCookies = + objc.registerName("HTTPShouldSetCookies"); +late final _sel_setHTTPShouldSetCookies_ = + objc.registerName("setHTTPShouldSetCookies:"); +late final _sel_HTTPCookieAcceptPolicy = + objc.registerName("HTTPCookieAcceptPolicy"); +late final _sel_setHTTPCookieAcceptPolicy_ = + objc.registerName("setHTTPCookieAcceptPolicy:"); +late final _sel_HTTPAdditionalHeaders = + objc.registerName("HTTPAdditionalHeaders"); +late final _sel_setHTTPAdditionalHeaders_ = + objc.registerName("setHTTPAdditionalHeaders:"); +late final _sel_HTTPMaximumConnectionsPerHost = + objc.registerName("HTTPMaximumConnectionsPerHost"); +final _objc_msgSend_z1fx1b = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setHTTPMaximumConnectionsPerHost_ = + objc.registerName("setHTTPMaximumConnectionsPerHost:"); +final _objc_msgSend_ke7qz2 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_HTTPCookieStorage = objc.registerName("HTTPCookieStorage"); +late final _sel_setHTTPCookieStorage_ = + objc.registerName("setHTTPCookieStorage:"); + +/// NSURLCredentialStorage +class NSURLCredentialStorage extends objc.ObjCObjectBase { + NSURLCredentialStorage._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); + + /// Constructs a [NSURLCredentialStorage] that points to the same underlying object as [other]. + NSURLCredentialStorage.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -class NSSimpleCString extends NSString { - NSSimpleCString._(ffi.Pointer id, NativeCupertinoHttp lib, + /// Constructs a [NSURLCredentialStorage] that wraps the given raw object pointer. + NSURLCredentialStorage.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + : this._(other, retain: retain, release: release); - /// Returns a [NSSimpleCString] that points to the same underlying object as [other]. - static NSSimpleCString castFrom(T other) { - return NSSimpleCString._(other._id, other._lib, - retain: true, release: true); - } + /// Returns whether [obj] is an instance of [NSURLCredentialStorage]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCredentialStorage); + } +} + +late final _class_NSURLCredentialStorage = + objc.getClass("NSURLCredentialStorage"); +late final _sel_URLCredentialStorage = + objc.registerName("URLCredentialStorage"); +late final _sel_setURLCredentialStorage_ = + objc.registerName("setURLCredentialStorage:"); +late final _sel_URLCache = objc.registerName("URLCache"); +late final _sel_setURLCache_ = objc.registerName("setURLCache:"); +late final _sel_shouldUseExtendedBackgroundIdleMode = + objc.registerName("shouldUseExtendedBackgroundIdleMode"); +late final _sel_setShouldUseExtendedBackgroundIdleMode_ = + objc.registerName("setShouldUseExtendedBackgroundIdleMode:"); +late final _sel_protocolClasses = objc.registerName("protocolClasses"); +late final _sel_setProtocolClasses_ = objc.registerName("setProtocolClasses:"); - /// Returns a [NSSimpleCString] that wraps the given raw object pointer. - static NSSimpleCString castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSSimpleCString._(other, lib, retain: retain, release: release); - } +/// ! +/// @enum NSURLSessionMultipathServiceType +/// +/// @discussion The NSURLSessionMultipathServiceType enum defines constants that +/// can be used to specify the multipath service type to associate an NSURLSession. The +/// multipath service type determines whether multipath TCP should be attempted and the conditions +/// for creating and switching between subflows. Using these service types requires the appropriate entitlement. Any connection attempt will fail if the process does not have the required entitlement. +/// A primary interface is a generally less expensive interface in terms of both cost and power (such as WiFi or ethernet). A secondary interface is more expensive (such as 3G or LTE). +/// +/// @constant NSURLSessionMultipathServiceTypeNone Specifies that multipath tcp should not be used. Connections will use a single flow. +/// This is the default value. No entitlement is required to set this value. +/// +/// @constant NSURLSessionMultipathServiceTypeHandover Specifies that a secondary subflow should only be used +/// when the primary subflow is not performing adequately. Requires the com.apple.developer.networking.multipath entitlement. +/// +/// @constant NSURLSessionMultipathServiceTypeInteractive Specifies that a secondary subflow should be used if the +/// primary subflow is not performing adequately (packet loss, high round trip times, bandwidth issues). The secondary +/// subflow will be created more aggressively than with NSURLSessionMultipathServiceTypeHandover. Requires the com.apple.developer.networking.multipath entitlement. +/// +/// @constant NSURLSessionMultipathServiceTypeAggregate Specifies that multiple subflows across multiple interfaces should be +/// used for better bandwidth. This mode is only available for experimentation on devices configured for development use. +/// It can be enabled in the Developer section of the Settings app. +enum NSURLSessionMultipathServiceType { + /// None - no multipath (default) + NSURLSessionMultipathServiceTypeNone(0), - /// Returns whether [obj] is an instance of [NSSimpleCString]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSSimpleCString1); - } + /// Handover - secondary flows brought up when primary flow is not performing adequately. + NSURLSessionMultipathServiceTypeHandover(1), - @override - NSSimpleCString init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); - } + /// Interactive - secondary flows created more aggressively. + NSURLSessionMultipathServiceTypeInteractive(2), - @override - NSSimpleCString? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } + /// Aggregate - multiple subflows used for greater bandwidth. + NSURLSessionMultipathServiceTypeAggregate(3); + + final int value; + const NSURLSessionMultipathServiceType(this.value); + + static NSURLSessionMultipathServiceType fromValue(int value) => + switch (value) { + 0 => NSURLSessionMultipathServiceTypeNone, + 1 => NSURLSessionMultipathServiceTypeHandover, + 2 => NSURLSessionMultipathServiceTypeInteractive, + 3 => NSURLSessionMultipathServiceTypeAggregate, + _ => throw ArgumentError( + "Unknown value for NSURLSessionMultipathServiceType: $value"), + }; +} + +late final _sel_multipathServiceType = + objc.registerName("multipathServiceType"); +final _objc_msgSend_zqvllq = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setMultipathServiceType_ = + objc.registerName("setMultipathServiceType:"); +final _objc_msgSend_1ngj1qh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_backgroundSessionConfiguration_ = + objc.registerName("backgroundSessionConfiguration:"); +late final _sel_sessionWithConfiguration_ = + objc.registerName("sessionWithConfiguration:"); + +/// NSOperationQueue +class NSOperationQueue extends objc.NSObject { + NSOperationQueue._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - static ffi.Pointer getAvailableStringEncodings( - NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_255( - _lib._class_NSSimpleCString1, _lib._sel_availableStringEncodings1); - } + /// Constructs a [NSOperationQueue] that points to the same underlying object as [other]. + NSOperationQueue.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - static NSString localizedNameOfStringEncoding_( - NativeCupertinoHttp _lib, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_15(_lib._class_NSSimpleCString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib, retain: true, release: true); - } + /// Constructs a [NSOperationQueue] that wraps the given raw object pointer. + NSOperationQueue.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - static DartNSUInteger getDefaultCStringEncoding(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSSimpleCString1, _lib._sel_defaultCStringEncoding1); + /// Returns whether [obj] is an instance of [NSOperationQueue]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSOperationQueue); } - @override - NSSimpleCString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, DartNSUInteger length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_267( - _id, - _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, - characters, - length, - freeBuffer); - return NSSimpleCString._(_ret, _lib, retain: false, release: true); + /// @property progress + /// @discussion The `progress` property represents a total progress of the operations executed in the queue. By default NSOperationQueue + /// does not report progress until the `totalUnitCount` of the progress is set. When the `totalUnitCount` property of the progress is set the + /// queue then opts into participating in progress reporting. When enabled, each operation will contribute 1 unit of completion to the + /// overall progress of the queue for operations that are finished by the end of main (operations that override start and do not invoke super + /// will not contribute to progress). Special attention to race conditions should be made when updating the `totalUnitCount` of the progress + /// as well as care should be taken to avoid 'backwards progress'. For example; when a NSOperationQueue's progress is 5/10, representing 50% + /// completed, and there are 90 more operations about to be added and the `totalUnitCount` that would then make the progress report as 5/100 + /// which represents 5%. In this example it would mean that any progress bar would jump from displaying 50% back to 5%, which might not be + /// desirable. In the cases where the `totalUnitCount` needs to be adjusted it is suggested to do this for thread-safety in a barrier by + /// using the `addBarrierBlock:` API. This ensures that no un-expected execution state occurs adjusting into a potentially backwards moving + /// progress scenario. + /// + /// @example + /// NSOperationQueue *queue = [[NSOperationQueue alloc] init]; + /// queue.progress.totalUnitCount = 10; + NSProgress get progress { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_progress); + return NSProgress.castFromPointer(_ret, retain: true, release: true); } - @override - NSSimpleCString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, - DartNSUInteger len, - ObjCBlock_ffiVoid_unichar_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_268( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator?._id ?? ffi.nullptr); - return NSSimpleCString._(_ret, _lib, retain: false, release: true); + /// addOperation: + void addOperation_(NSOperation op) { + _objc_msgSend_ukcdfq(this.ref.pointer, _sel_addOperation_, op.ref.pointer); } - @override - NSSimpleCString initWithCharacters_length_( - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269( - _id, _lib._sel_initWithCharacters_length_1, characters, length); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// addOperations:waitUntilFinished: + void addOperations_waitUntilFinished_(objc.NSArray ops, bool wait) { + _objc_msgSend_1n1qwdd(this.ref.pointer, + _sel_addOperations_waitUntilFinished_, ops.ref.pointer, wait); } - @override - NSSimpleCString? initWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_270( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// addOperationWithBlock: + void addOperationWithBlock_(objc.ObjCBlock block) { + _objc_msgSend_4daxhl( + this.ref.pointer, _sel_addOperationWithBlock_, block.ref.pointer); } - @override - NSSimpleCString initWithString_(NSString aString) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithString_1, aString._id); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// @method addBarrierBlock: + /// @param barrier A block to execute + /// @discussion The `addBarrierBlock:` method executes the block when the NSOperationQueue has finished all enqueued operations and + /// prevents any subsequent operations to be executed until the barrier has been completed. This acts similarly to the + /// `dispatch_barrier_async` function. + void addBarrierBlock_(objc.ObjCBlock barrier) { + _objc_msgSend_4daxhl( + this.ref.pointer, _sel_addBarrierBlock_, barrier.ref.pointer); } - @override - NSSimpleCString initWithFormat_(NSString format) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithFormat_1, format._id); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// maxConcurrentOperationCount + DartNSInteger get maxConcurrentOperationCount { + return _objc_msgSend_z1fx1b( + this.ref.pointer, _sel_maxConcurrentOperationCount); } - @override - NSSimpleCString initWithFormat_arguments_(NSString format, va_list argList) { - final _ret = _lib._objc_msgSend_271( - _id, _lib._sel_initWithFormat_arguments_1, format._id, argList); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// setMaxConcurrentOperationCount: + set maxConcurrentOperationCount(DartNSInteger value) { + return _objc_msgSend_ke7qz2( + this.ref.pointer, _sel_setMaxConcurrentOperationCount_, value); } - @override - NSSimpleCString initWithFormat_locale_(NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_272(_id, _lib._sel_initWithFormat_locale_1, - format._id, locale?._id ?? ffi.nullptr); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// isSuspended + bool get suspended { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isSuspended); } - @override - NSSimpleCString initWithFormat_locale_arguments_( - NSString format, NSObject? locale, va_list argList) { - final _ret = _lib._objc_msgSend_273( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format._id, - locale?._id ?? ffi.nullptr, - argList); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// setSuspended: + set suspended(bool value) { + return _objc_msgSend_117qins(this.ref.pointer, _sel_setSuspended_, value); } - @override - NSSimpleCString? initWithValidatedFormat_validFormatSpecifiers_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); + /// name + objc.NSString? get name { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); return _ret.address == 0 ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - @override - NSSimpleCString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_275( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// setName: + set name(objc.NSString? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); } - @override - NSSimpleCString? - initWithValidatedFormat_validFormatSpecifiers_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_276( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, - format._id, - validFormatSpecifiers._id, - argList, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// qualityOfService + NSQualityOfService get qualityOfService { + final _ret = _objc_msgSend_17dnyeh(this.ref.pointer, _sel_qualityOfService); + return NSQualityOfService.fromValue(_ret); } - @override - NSSimpleCString? - initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_277( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - argList, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// setQualityOfService: + set qualityOfService(NSQualityOfService value) { + return _objc_msgSend_1fcr8u4( + this.ref.pointer, _sel_setQualityOfService_, value.value); } - @override - NSSimpleCString? initWithData_encoding_( - NSData data, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_278( - _id, _lib._sel_initWithData_encoding_1, data._id, encoding); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// actually retain + Dartdispatch_queue_t get underlyingQueue { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_underlyingQueue); + return objc.NSObject.castFromPointer(_ret, retain: true, release: true); } - @override - NSSimpleCString? initWithBytes_length_encoding_(ffi.Pointer bytes, - DartNSUInteger len, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_279( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// actually retain + set underlyingQueue(Dartdispatch_queue_t value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setUnderlyingQueue_, value.ref.pointer); } - @override - NSSimpleCString? initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - bool freeBuffer) { - final _ret = _lib._objc_msgSend_280( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: false, release: true); + /// cancelAllOperations + void cancelAllOperations() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancelAllOperations); } - @override - NSSimpleCString? initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - ObjCBlock_ffiVoid_ffiVoid_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_281( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: false, release: true); + /// waitUntilAllOperationsAreFinished + void waitUntilAllOperationsAreFinished() { + _objc_msgSend_ksby9f( + this.ref.pointer, _sel_waitUntilAllOperationsAreFinished); } - static NSSimpleCString string(NativeCupertinoHttp _lib) { + /// currentQueue + static NSOperationQueue? getCurrentQueue() { final _ret = - _lib._objc_msgSend_2(_lib._class_NSSimpleCString1, _lib._sel_string1); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_currentQueue); + return _ret.address == 0 + ? null + : NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } - static NSSimpleCString stringWithString_( - NativeCupertinoHttp _lib, NSString string) { - final _ret = _lib._objc_msgSend_42( - _lib._class_NSSimpleCString1, _lib._sel_stringWithString_1, string._id); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// mainQueue + static NSOperationQueue getMainQueue() { + final _ret = _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_mainQueue); + return NSOperationQueue.castFromPointer(_ret, retain: true, release: true); } - static NSSimpleCString stringWithCharacters_length_(NativeCupertinoHttp _lib, - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269(_lib._class_NSSimpleCString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// These two functions are inherently a race condition and should be avoided if possible + objc.NSArray get operations { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_operations); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } - static NSSimpleCString? stringWithUTF8String_( - NativeCupertinoHttp _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_270(_lib._class_NSSimpleCString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString stringWithFormat_( - NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42( - _lib._class_NSSimpleCString1, _lib._sel_stringWithFormat_1, format._id); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString localizedStringWithFormat_( - NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42(_lib._class_NSSimpleCString1, - _lib._sel_localizedStringWithFormat_1, format._id); - return NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString? - stringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString? - localizedStringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSSimpleCString1, - _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// operationCount + DartNSUInteger get operationCount { + return _objc_msgSend_eldhrq(this.ref.pointer, _sel_operationCount); } - @override - NSSimpleCString? initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_282(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// init + NSOperationQueue init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); } - static NSSimpleCString? stringWithCString_encoding_(NativeCupertinoHttp _lib, - ffi.Pointer cString, DartNSUInteger enc) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSSimpleCString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// new + static NSOperationQueue new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_new); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); } - @override - NSSimpleCString? initWithContentsOfURL_encoding_error_(NSURL url, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283(_id, - _lib._sel_initWithContentsOfURL_encoding_error_1, url._id, enc, error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// allocWithZone: + static NSOperationQueue allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSOperationQueue, _sel_allocWithZone_, zone); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); } - @override - NSSimpleCString? initWithContentsOfFile_encoding_error_(NSString path, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString? stringWithContentsOfURL_encoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString? stringWithContentsOfFile_encoding_error_( - NativeCupertinoHttp _lib, - NSString path, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); + /// alloc + static NSOperationQueue alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSOperationQueue, _sel_alloc); + return NSOperationQueue.castFromPointer(_ret, retain: false, release: true); } +} - @override - NSSimpleCString? initWithContentsOfURL_usedEncoding_error_( - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } +late final _class_NSOperationQueue = objc.getClass("NSOperationQueue"); - @override - NSSimpleCString? initWithContentsOfFile_usedEncoding_error_( - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString? stringWithContentsOfURL_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static NSSimpleCString? stringWithContentsOfFile_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSSimpleCString._(_ret, _lib, retain: true, release: true); - } - - static DartNSUInteger - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - NativeCupertinoHttp _lib, - NSData data, - NSDictionary? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_287( - _lib._class_NSSimpleCString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data._id, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject? stringWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } +/// NSOperation +class NSOperation extends objc.NSObject { + NSOperation._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - static NSObject? stringWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226(_lib._class_NSSimpleCString1, - _lib._sel_stringWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } + /// Constructs a [NSOperation] that points to the same underlying object as [other]. + NSOperation.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - static NSObject? stringWithCString_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSSimpleCString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); - } + /// Constructs a [NSOperation] that wraps the given raw object pointer. + NSOperation.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - static NSObject? stringWithCString_( - NativeCupertinoHttp _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_270( - _lib._class_NSSimpleCString1, _lib._sel_stringWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// Returns whether [obj] is an instance of [NSOperation]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSOperation); } - static NSSimpleCString new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSSimpleCString1, _lib._sel_new1); - return NSSimpleCString._(_ret, _lib, retain: false, release: true); + /// start + void start() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_start); } - static NSSimpleCString allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSSimpleCString1, _lib._sel_allocWithZone_1, zone); - return NSSimpleCString._(_ret, _lib, retain: false, release: true); + /// main + void main() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_main); } - static NSSimpleCString alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSSimpleCString1, _lib._sel_alloc1); - return NSSimpleCString._(_ret, _lib, retain: false, release: true); + /// isCancelled + bool get cancelled { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isCancelled); } -} - -class NSConstantString extends NSSimpleCString { - NSConstantString._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - /// Returns a [NSConstantString] that points to the same underlying object as [other]. - static NSConstantString castFrom(T other) { - return NSConstantString._(other._id, other._lib, - retain: true, release: true); + /// cancel + void cancel() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_cancel); } - /// Returns a [NSConstantString] that wraps the given raw object pointer. - static NSConstantString castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSConstantString._(other, lib, retain: retain, release: release); + /// isExecuting + bool get executing { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isExecuting); } - /// Returns whether [obj] is an instance of [NSConstantString]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSConstantString1); + /// isFinished + bool get finished { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isFinished); } - @override - NSConstantString init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// To be deprecated; use and override 'asynchronous' below + bool get concurrent { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isConcurrent); } - @override - NSConstantString? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + /// isAsynchronous + bool get asynchronous { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isAsynchronous); } - static ffi.Pointer getAvailableStringEncodings( - NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_255( - _lib._class_NSConstantString1, _lib._sel_availableStringEncodings1); + /// isReady + bool get ready { + return _objc_msgSend_olxnu1(this.ref.pointer, _sel_isReady); } - static NSString localizedNameOfStringEncoding_( - NativeCupertinoHttp _lib, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_15(_lib._class_NSConstantString1, - _lib._sel_localizedNameOfStringEncoding_1, encoding); - return NSString._(_ret, _lib, retain: true, release: true); + /// addDependency: + void addDependency_(NSOperation op) { + _objc_msgSend_ukcdfq(this.ref.pointer, _sel_addDependency_, op.ref.pointer); } - static DartNSUInteger getDefaultCStringEncoding(NativeCupertinoHttp _lib) { - return _lib._objc_msgSend_12( - _lib._class_NSConstantString1, _lib._sel_defaultCStringEncoding1); + /// removeDependency: + void removeDependency_(NSOperation op) { + _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_removeDependency_, op.ref.pointer); } - @override - NSConstantString initWithCharactersNoCopy_length_freeWhenDone_( - ffi.Pointer characters, DartNSUInteger length, bool freeBuffer) { - final _ret = _lib._objc_msgSend_267( - _id, - _lib._sel_initWithCharactersNoCopy_length_freeWhenDone_1, - characters, - length, - freeBuffer); - return NSConstantString._(_ret, _lib, retain: false, release: true); + /// dependencies + objc.NSArray get dependencies { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_dependencies); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } - @override - NSConstantString initWithCharactersNoCopy_length_deallocator_( - ffi.Pointer chars, - DartNSUInteger len, - ObjCBlock_ffiVoid_unichar_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_268( - _id, - _lib._sel_initWithCharactersNoCopy_length_deallocator_1, - chars, - len, - deallocator?._id ?? ffi.nullptr); - return NSConstantString._(_ret, _lib, retain: false, release: true); + /// queuePriority + NSOperationQueuePriority get queuePriority { + final _ret = _objc_msgSend_10n15g8(this.ref.pointer, _sel_queuePriority); + return NSOperationQueuePriority.fromValue(_ret); } - @override - NSConstantString initWithCharacters_length_( - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269( - _id, _lib._sel_initWithCharacters_length_1, characters, length); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// setQueuePriority: + set queuePriority(NSOperationQueuePriority value) { + return _objc_msgSend_d8yjnr( + this.ref.pointer, _sel_setQueuePriority_, value.value); } - @override - NSConstantString? initWithUTF8String_( - ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_270( - _id, _lib._sel_initWithUTF8String_1, nullTerminatedCString); + /// completionBlock + objc.ObjCBlock? get completionBlock { + final _ret = _objc_msgSend_2osec1(this.ref.pointer, _sel_completionBlock); return _ret.address == 0 ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + : ObjCBlock_ffiVoid.castFromPointer(_ret, retain: true, release: true); } - @override - NSConstantString initWithString_(NSString aString) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithString_1, aString._id); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// setCompletionBlock: + set completionBlock(objc.ObjCBlock? value) { + return _objc_msgSend_4daxhl(this.ref.pointer, _sel_setCompletionBlock_, + value?.ref.pointer ?? ffi.nullptr); } - @override - NSConstantString initWithFormat_(NSString format) { - final _ret = - _lib._objc_msgSend_42(_id, _lib._sel_initWithFormat_1, format._id); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// waitUntilFinished + void waitUntilFinished() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_waitUntilFinished); } - @override - NSConstantString initWithFormat_arguments_(NSString format, va_list argList) { - final _ret = _lib._objc_msgSend_271( - _id, _lib._sel_initWithFormat_arguments_1, format._id, argList); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// threadPriority + double get threadPriority { + return _objc_msgSend_10noklm(this.ref.pointer, _sel_threadPriority); } - @override - NSConstantString initWithFormat_locale_(NSString format, NSObject? locale) { - final _ret = _lib._objc_msgSend_272(_id, _lib._sel_initWithFormat_locale_1, - format._id, locale?._id ?? ffi.nullptr); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// setThreadPriority: + set threadPriority(double value) { + return _objc_msgSend_suh039( + this.ref.pointer, _sel_setThreadPriority_, value); } - @override - NSConstantString initWithFormat_locale_arguments_( - NSString format, NSObject? locale, va_list argList) { - final _ret = _lib._objc_msgSend_273( - _id, - _lib._sel_initWithFormat_locale_arguments_1, - format._id, - locale?._id ?? ffi.nullptr, - argList); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// qualityOfService + NSQualityOfService get qualityOfService { + final _ret = _objc_msgSend_17dnyeh(this.ref.pointer, _sel_qualityOfService); + return NSQualityOfService.fromValue(_ret); } - @override - NSConstantString? initWithValidatedFormat_validFormatSpecifiers_error_( - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + /// setQualityOfService: + set qualityOfService(NSQualityOfService value) { + return _objc_msgSend_1fcr8u4( + this.ref.pointer, _sel_setQualityOfService_, value.value); } - @override - NSConstantString? initWithValidatedFormat_validFormatSpecifiers_locale_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_275( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - error); + /// name + objc.NSString? get name { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); return _ret.address == 0 ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - @override - NSConstantString? - initWithValidatedFormat_validFormatSpecifiers_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_276( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_arguments_error_1, - format._id, - validFormatSpecifiers._id, - argList, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + /// setName: + set name(objc.NSString? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); } - @override - NSConstantString? - initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_( - NSString format, - NSString validFormatSpecifiers, - NSObject? locale, - va_list argList, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_277( - _id, - _lib._sel_initWithValidatedFormat_validFormatSpecifiers_locale_arguments_error_1, - format._id, - validFormatSpecifiers._id, - locale?._id ?? ffi.nullptr, - argList, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + /// init + NSOperation init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSOperation.castFromPointer(_ret, retain: false, release: true); } - @override - NSConstantString? initWithData_encoding_( - NSData data, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_278( - _id, _lib._sel_initWithData_encoding_1, data._id, encoding); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + /// new + static NSOperation new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSOperation, _sel_new); + return NSOperation.castFromPointer(_ret, retain: false, release: true); } - @override - NSConstantString? initWithBytes_length_encoding_(ffi.Pointer bytes, - DartNSUInteger len, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_279( - _id, _lib._sel_initWithBytes_length_encoding_1, bytes, len, encoding); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } + /// allocWithZone: + static NSOperation allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSOperation, _sel_allocWithZone_, zone); + return NSOperation.castFromPointer(_ret, retain: false, release: true); + } + + /// alloc + static NSOperation alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSOperation, _sel_alloc); + return NSOperation.castFromPointer(_ret, retain: false, release: true); + } +} + +late final _class_NSOperation = objc.getClass("NSOperation"); +late final _sel_start = objc.registerName("start"); +late final _sel_main = objc.registerName("main"); +late final _sel_isExecuting = objc.registerName("isExecuting"); +late final _sel_isConcurrent = objc.registerName("isConcurrent"); +late final _sel_isAsynchronous = objc.registerName("isAsynchronous"); +late final _sel_isReady = objc.registerName("isReady"); +late final _sel_addDependency_ = objc.registerName("addDependency:"); +late final _sel_removeDependency_ = objc.registerName("removeDependency:"); +late final _sel_dependencies = objc.registerName("dependencies"); + +enum NSOperationQueuePriority { + NSOperationQueuePriorityVeryLow(-8), + NSOperationQueuePriorityLow(-4), + NSOperationQueuePriorityNormal(0), + NSOperationQueuePriorityHigh(4), + NSOperationQueuePriorityVeryHigh(8); + + final int value; + const NSOperationQueuePriority(this.value); + + static NSOperationQueuePriority fromValue(int value) => switch (value) { + -8 => NSOperationQueuePriorityVeryLow, + -4 => NSOperationQueuePriorityLow, + 0 => NSOperationQueuePriorityNormal, + 4 => NSOperationQueuePriorityHigh, + 8 => NSOperationQueuePriorityVeryHigh, + _ => throw ArgumentError( + "Unknown value for NSOperationQueuePriority: $value"), + }; +} + +late final _sel_queuePriority = objc.registerName("queuePriority"); +final _objc_msgSend_10n15g8 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setQueuePriority_ = objc.registerName("setQueuePriority:"); +final _objc_msgSend_d8yjnr = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_completionBlock = objc.registerName("completionBlock"); +late final _sel_setCompletionBlock_ = objc.registerName("setCompletionBlock:"); +late final _sel_waitUntilFinished = objc.registerName("waitUntilFinished"); +late final _sel_threadPriority = objc.registerName("threadPriority"); +late final _sel_setThreadPriority_ = objc.registerName("setThreadPriority:"); + +enum NSQualityOfService { + NSQualityOfServiceUserInteractive(33), + NSQualityOfServiceUserInitiated(25), + NSQualityOfServiceUtility(17), + NSQualityOfServiceBackground(9), + NSQualityOfServiceDefault(-1); + + final int value; + const NSQualityOfService(this.value); + + static NSQualityOfService fromValue(int value) => switch (value) { + 33 => NSQualityOfServiceUserInteractive, + 25 => NSQualityOfServiceUserInitiated, + 17 => NSQualityOfServiceUtility, + 9 => NSQualityOfServiceBackground, + -1 => NSQualityOfServiceDefault, + _ => + throw ArgumentError("Unknown value for NSQualityOfService: $value"), + }; +} + +late final _sel_qualityOfService = objc.registerName("qualityOfService"); +final _objc_msgSend_17dnyeh = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_setQualityOfService_ = + objc.registerName("setQualityOfService:"); +final _objc_msgSend_1fcr8u4 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, int)>(); +late final _sel_name = objc.registerName("name"); +late final _sel_setName_ = objc.registerName("setName:"); +late final _sel_addOperation_ = objc.registerName("addOperation:"); +late final _sel_addOperations_waitUntilFinished_ = + objc.registerName("addOperations:waitUntilFinished:"); +final _objc_msgSend_1n1qwdd = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Bool)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + bool)>(); +late final _sel_addOperationWithBlock_ = + objc.registerName("addOperationWithBlock:"); +late final _sel_addBarrierBlock_ = objc.registerName("addBarrierBlock:"); +late final _sel_maxConcurrentOperationCount = + objc.registerName("maxConcurrentOperationCount"); +late final _sel_setMaxConcurrentOperationCount_ = + objc.registerName("setMaxConcurrentOperationCount:"); +late final _sel_isSuspended = objc.registerName("isSuspended"); +late final _sel_setSuspended_ = objc.registerName("setSuspended:"); +late final _sel_underlyingQueue = objc.registerName("underlyingQueue"); +late final _sel_setUnderlyingQueue_ = objc.registerName("setUnderlyingQueue:"); +late final _sel_cancelAllOperations = objc.registerName("cancelAllOperations"); +late final _sel_waitUntilAllOperationsAreFinished = + objc.registerName("waitUntilAllOperationsAreFinished"); +late final _sel_currentQueue = objc.registerName("currentQueue"); +late final _sel_mainQueue = objc.registerName("mainQueue"); +late final _sel_operations = objc.registerName("operations"); +late final _sel_operationCount = objc.registerName("operationCount"); +late final _sel_sessionWithConfiguration_delegate_delegateQueue_ = + objc.registerName("sessionWithConfiguration:delegate:delegateQueue:"); +final _objc_msgSend_aud7dn = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_delegateQueue = objc.registerName("delegateQueue"); +late final _sel_configuration = objc.registerName("configuration"); +late final _sel_sessionDescription = objc.registerName("sessionDescription"); +late final _sel_setSessionDescription_ = + objc.registerName("setSessionDescription:"); +late final _sel_finishTasksAndInvalidate = + objc.registerName("finishTasksAndInvalidate"); +late final _sel_invalidateAndCancel = objc.registerName("invalidateAndCancel"); +late final _sel_resetWithCompletionHandler_ = + objc.registerName("resetWithCompletionHandler:"); +late final _sel_flushWithCompletionHandler_ = + objc.registerName("flushWithCompletionHandler:"); +void + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(pointer, + retain: retain, release: release); - @override - NSConstantString? initWithBytesNoCopy_length_encoding_freeWhenDone_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - bool freeBuffer) { - final _ret = _lib._objc_msgSend_280( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_freeWhenDone_1, - bytes, - len, - encoding, - freeBuffer); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - @override - NSConstantString? initWithBytesNoCopy_length_encoding_deallocator_( - ffi.Pointer bytes, - DartNSUInteger len, - DartNSUInteger encoding, - ObjCBlock_ffiVoid_ffiVoid_NSUInteger? deallocator) { - final _ret = _lib._objc_msgSend_281( - _id, - _lib._sel_initWithBytesNoCopy_length_encoding_deallocator_1, - bytes, - len, - encoding, - deallocator?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc + .ObjCBlock, ffi.Pointer, ffi.Pointer)> + fromFunction(void Function(objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) fn) => + objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true), + objc.ObjCObjectBase(arg1, retain: true, release: true), + objc.ObjCObjectBase(arg2, retain: true, release: true))), + retain: false, + release: true); - static NSConstantString string(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSConstantString1, _lib._sel_string1); - return NSConstantString._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> listener( + void Function( + objc.ObjCObjectBase, objc.ObjCObjectBase, objc.ObjCObjectBase) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + objc.ObjCObjectBase(arg0, retain: false, release: true), + objc.ObjCObjectBase(arg1, retain: false, release: true), + objc.ObjCObjectBase(arg2, retain: false, release: true))); + final wrapper = _wrapListenerBlock_tenbla(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(wrapper, + retain: false, release: true); } +} - static NSConstantString stringWithString_( - NativeCupertinoHttp _lib, NSString string) { - final _ret = _lib._objc_msgSend_42(_lib._class_NSConstantString1, - _lib._sel_stringWithString_1, string._id); - return NSConstantString._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock, ffi.Pointer, ffi.Pointer)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_objcObjCObject_objcObjCObject_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> { + void call(objc.ObjCObjectBase arg0, objc.ObjCObjectBase arg1, + objc.ObjCObjectBase arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1.ref.pointer, arg2.ref.pointer); +} + +late final _sel_getTasksWithCompletionHandler_ = + objc.registerName("getTasksWithCompletionHandler:"); +void _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_objcObjCObject_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_objcObjCObject_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_objcObjCObject_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_objcObjCObject { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>( + pointer, + retain: retain, + release: release); - static NSConstantString stringWithCharacters_length_(NativeCupertinoHttp _lib, - ffi.Pointer characters, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_269(_lib._class_NSConstantString1, - _lib._sel_stringWithCharacters_length_1, characters, length); - return NSConstantString._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_objcObjCObject_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSConstantString? stringWithUTF8String_( - NativeCupertinoHttp _lib, ffi.Pointer nullTerminatedCString) { - final _ret = _lib._objc_msgSend_270(_lib._class_NSConstantString1, - _lib._sel_stringWithUTF8String_1, nullTerminatedCString); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString stringWithFormat_( - NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42(_lib._class_NSConstantString1, - _lib._sel_stringWithFormat_1, format._id); - return NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString localizedStringWithFormat_( - NativeCupertinoHttp _lib, NSString format) { - final _ret = _lib._objc_msgSend_42(_lib._class_NSConstantString1, - _lib._sel_localizedStringWithFormat_1, format._id); - return NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString? - stringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSConstantString1, - _lib._sel_stringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString? - localizedStringWithValidatedFormat_validFormatSpecifiers_error_( - NativeCupertinoHttp _lib, - NSString format, - NSString validFormatSpecifiers, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_274( - _lib._class_NSConstantString1, - _lib._sel_localizedStringWithValidatedFormat_validFormatSpecifiers_error_1, - format._id, - validFormatSpecifiers._id, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock)> + fromFunction(void Function(objc.ObjCObjectBase) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_closureCallable, + (ffi.Pointer arg0) => fn( + objc.ObjCObjectBase(arg0, retain: true, release: true))), + retain: false, + release: true); - @override - NSConstantString? initWithCString_encoding_( - ffi.Pointer nullTerminatedCString, DartNSUInteger encoding) { - final _ret = _lib._objc_msgSend_282(_id, - _lib._sel_initWithCString_encoding_1, nullTerminatedCString, encoding); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock)> + listener(void Function(objc.ObjCObjectBase) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_objcObjCObject_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0) => + fn(objc.ObjCObjectBase(arg0, retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); } +} - static NSConstantString? stringWithCString_encoding_(NativeCupertinoHttp _lib, - ffi.Pointer cString, DartNSUInteger enc) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSConstantString1, - _lib._sel_stringWithCString_encoding_1, cString, enc); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_objcObjCObject_CallExtension + on objc.ObjCBlock)> { + void call(objc.ObjCObjectBase arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0.ref.pointer); +} - @override - NSConstantString? initWithContentsOfURL_encoding_error_(NSURL url, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283(_id, - _lib._sel_initWithContentsOfURL_encoding_error_1, url._id, enc, error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } +late final _sel_getAllTasksWithCompletionHandler_ = + objc.registerName("getAllTasksWithCompletionHandler:"); +late final _sel_dataTaskWithRequest_ = + objc.registerName("dataTaskWithRequest:"); +late final _sel_dataTaskWithURL_ = objc.registerName("dataTaskWithURL:"); - @override - NSConstantString? initWithContentsOfFile_encoding_error_(NSString path, - DartNSUInteger enc, ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _id, - _lib._sel_initWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString? stringWithContentsOfURL_encoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_283( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfURL_encoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString? stringWithContentsOfFile_encoding_error_( - NativeCupertinoHttp _lib, - NSString path, - DartNSUInteger enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_284( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfFile_encoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } +/// An NSURLSessionUploadTask does not currently provide any additional +/// functionality over an NSURLSessionDataTask. All delegate messages +/// that may be sent referencing an NSURLSessionDataTask equally apply +/// to NSURLSessionUploadTasks. +class NSURLSessionUploadTask extends NSURLSessionDataTask { + NSURLSessionUploadTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - @override - NSConstantString? initWithContentsOfURL_usedEncoding_error_( - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _id, - _lib._sel_initWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); + /// Constructs a [NSURLSessionUploadTask] that points to the same underlying object as [other]. + NSURLSessionUploadTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionUploadTask] that wraps the given raw object pointer. + NSURLSessionUploadTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionUploadTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionUploadTask); } - @override - NSConstantString? initWithContentsOfFile_usedEncoding_error_( - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _id, - _lib._sel_initWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString? stringWithContentsOfURL_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSURL url, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_285( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfURL_usedEncoding_error_1, - url._id, - enc, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static NSConstantString? stringWithContentsOfFile_usedEncoding_error_( - NativeCupertinoHttp _lib, - NSString path, - ffi.Pointer enc, - ffi.Pointer> error) { - final _ret = _lib._objc_msgSend_286( - _lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfFile_usedEncoding_error_1, - path._id, - enc, - error); - return _ret.address == 0 - ? null - : NSConstantString._(_ret, _lib, retain: true, release: true); - } - - static DartNSUInteger - stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_( - NativeCupertinoHttp _lib, - NSData data, - NSDictionary? opts, - ffi.Pointer> string, - ffi.Pointer usedLossyConversion) { - return _lib._objc_msgSend_287( - _lib._class_NSConstantString1, - _lib._sel_stringEncodingForData_encodingOptions_convertedString_usedLossyConversion_1, - data._id, - opts?._id ?? ffi.nullptr, - string, - usedLossyConversion); - } - - static NSObject? stringWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfFile_1, path._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// init + NSURLSessionUploadTask init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: false, release: true); } - static NSObject? stringWithContentsOfURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226(_lib._class_NSConstantString1, - _lib._sel_stringWithContentsOfURL_1, url._id); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// new + static NSURLSessionUploadTask new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionUploadTask, _sel_new); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: false, release: true); } - static NSObject? stringWithCString_length_(NativeCupertinoHttp _lib, - ffi.Pointer bytes, DartNSUInteger length) { - final _ret = _lib._objc_msgSend_282(_lib._class_NSConstantString1, - _lib._sel_stringWithCString_length_1, bytes, length); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// Cancels an upload and calls the completion handler with resume data for later use. + /// resumeData will be nil if the server does not support the latest resumable uploads + /// Internet-Draft from the HTTP Working Group, found at + /// https://datatracker.ietf.org/doc/draft-ietf-httpbis-resumable-upload/ + /// + /// - Parameter completionHandler: The completion handler to call when the upload has been successfully canceled. + void cancelByProducingResumeData_( + objc.ObjCBlock completionHandler) { + _objc_msgSend_4daxhl(this.ref.pointer, _sel_cancelByProducingResumeData_, + completionHandler.ref.pointer); } - static NSObject? stringWithCString_( - NativeCupertinoHttp _lib, ffi.Pointer bytes) { - final _ret = _lib._objc_msgSend_270( - _lib._class_NSConstantString1, _lib._sel_stringWithCString_1, bytes); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// allocWithZone: + static NSURLSessionUploadTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionUploadTask, _sel_allocWithZone_, zone); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: false, release: true); } - static NSConstantString new1(NativeCupertinoHttp _lib) { + /// alloc + static NSURLSessionUploadTask alloc() { final _ret = - _lib._objc_msgSend_2(_lib._class_NSConstantString1, _lib._sel_new1); - return NSConstantString._(_ret, _lib, retain: false, release: true); + _objc_msgSend_1unuoxw(_class_NSURLSessionUploadTask, _sel_alloc); + return NSURLSessionUploadTask.castFromPointer(_ret, + retain: false, release: true); } +} - static NSConstantString allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSConstantString1, _lib._sel_allocWithZone_1, zone); - return NSConstantString._(_ret, _lib, retain: false, release: true); - } +late final _class_NSURLSessionUploadTask = + objc.getClass("NSURLSessionUploadTask"); +void _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - static NSConstantString alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSConstantString1, _lib._sel_alloc1); - return NSConstantString._(_ret, _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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSData_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock listener( + void Function(objc.NSData?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } } -class NSMutableCharacterSet extends NSCharacterSet { - NSMutableCharacterSet._(ffi.Pointer id, NativeCupertinoHttp lib, +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_CallExtension + on objc.ObjCBlock { + void call(objc.NSData? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_cancelByProducingResumeData_ = + objc.registerName("cancelByProducingResumeData:"); +late final _sel_uploadTaskWithRequest_fromFile_ = + objc.registerName("uploadTaskWithRequest:fromFile:"); +late final _sel_uploadTaskWithRequest_fromData_ = + objc.registerName("uploadTaskWithRequest:fromData:"); +late final _sel_uploadTaskWithResumeData_ = + objc.registerName("uploadTaskWithResumeData:"); +late final _sel_uploadTaskWithStreamedRequest_ = + objc.registerName("uploadTaskWithStreamedRequest:"); + +/// NSURLSessionDownloadTask is a task that represents a download to +/// local storage. +class NSURLSessionDownloadTask extends NSURLSessionTask { + NSURLSessionDownloadTask._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release); - /// Returns a [NSMutableCharacterSet] that points to the same underlying object as [other]. - static NSMutableCharacterSet castFrom(T other) { - return NSMutableCharacterSet._(other._id, other._lib, - retain: true, release: true); - } + /// Constructs a [NSURLSessionDownloadTask] that points to the same underlying object as [other]. + NSURLSessionDownloadTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Returns a [NSMutableCharacterSet] that wraps the given raw object pointer. - static NSMutableCharacterSet castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSMutableCharacterSet._(other, lib, - retain: retain, release: release); - } + /// Constructs a [NSURLSessionDownloadTask] that wraps the given raw object pointer. + NSURLSessionDownloadTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - /// Returns whether [obj] is an instance of [NSMutableCharacterSet]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSMutableCharacterSet1); + /// Returns whether [obj] is an instance of [NSURLSessionDownloadTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionDownloadTask); } - void addCharactersInRange_(NSRange aRange) { - _lib._objc_msgSend_304(_id, _lib._sel_addCharactersInRange_1, aRange); + /// Cancel the download (and calls the superclass -cancel). If + /// conditions will allow for resuming the download in the future, the + /// callback will be called with an opaque data blob, which may be used + /// with -downloadTaskWithResumeData: to attempt to resume the download. + /// If resume data cannot be created, the completion handler will be + /// called with nil resumeData. + void cancelByProducingResumeData_( + objc.ObjCBlock completionHandler) { + _objc_msgSend_4daxhl(this.ref.pointer, _sel_cancelByProducingResumeData_, + completionHandler.ref.pointer); } - void removeCharactersInRange_(NSRange aRange) { - _lib._objc_msgSend_304(_id, _lib._sel_removeCharactersInRange_1, aRange); + /// init + NSURLSessionDownloadTask init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); } - void addCharactersInString_(NSString aString) { - _lib._objc_msgSend_195(_id, _lib._sel_addCharactersInString_1, aString._id); + /// new + static NSURLSessionDownloadTask new1() { + final _ret = + _objc_msgSend_1unuoxw(_class_NSURLSessionDownloadTask, _sel_new); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); } - void removeCharactersInString_(NSString aString) { - _lib._objc_msgSend_195( - _id, _lib._sel_removeCharactersInString_1, aString._id); + /// allocWithZone: + static NSURLSessionDownloadTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionDownloadTask, _sel_allocWithZone_, zone); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); } - void formUnionWithCharacterSet_(NSCharacterSet otherSet) { - _lib._objc_msgSend_514( - _id, _lib._sel_formUnionWithCharacterSet_1, otherSet._id); + /// alloc + static NSURLSessionDownloadTask alloc() { + final _ret = + _objc_msgSend_1unuoxw(_class_NSURLSessionDownloadTask, _sel_alloc); + return NSURLSessionDownloadTask.castFromPointer(_ret, + retain: false, release: true); } +} - void formIntersectionWithCharacterSet_(NSCharacterSet otherSet) { - _lib._objc_msgSend_514( - _id, _lib._sel_formIntersectionWithCharacterSet_1, otherSet._id); - } +late final _class_NSURLSessionDownloadTask = + objc.getClass("NSURLSessionDownloadTask"); +late final _sel_downloadTaskWithRequest_ = + objc.registerName("downloadTaskWithRequest:"); +late final _sel_downloadTaskWithURL_ = + objc.registerName("downloadTaskWithURL:"); +late final _sel_downloadTaskWithResumeData_ = + objc.registerName("downloadTaskWithResumeData:"); - void invert() { - _lib._objc_msgSend_1(_id, _lib._sel_invert1); - } +/// An NSURLSessionStreamTask provides an interface to perform reads +/// and writes to a TCP/IP stream created via NSURLSession. This task +/// may be explicitly created from an NSURLSession, or created as a +/// result of the appropriate disposition response to a +/// -URLSession:dataTask:didReceiveResponse: delegate message. +/// +/// NSURLSessionStreamTask can be used to perform asynchronous reads +/// and writes. Reads and writes are enqueued and executed serially, +/// with the completion handler being invoked on the sessions delegate +/// queue. If an error occurs, or the task is canceled, all +/// outstanding read and write calls will have their completion +/// handlers invoked with an appropriate error. +/// +/// It is also possible to create NSInputStream and NSOutputStream +/// instances from an NSURLSessionTask by sending +/// -captureStreams to the task. All outstanding reads and writes are +/// completed before the streams are created. Once the streams are +/// delivered to the session delegate, the task is considered complete +/// and will receive no more messages. These streams are +/// disassociated from the underlying session. +class NSURLSessionStreamTask extends NSURLSessionTask { + NSURLSessionStreamTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); + + /// Constructs a [NSURLSessionStreamTask] that points to the same underlying object as [other]. + NSURLSessionStreamTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionStreamTask] that wraps the given raw object pointer. + NSURLSessionStreamTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - static NSCharacterSet getControlCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_controlCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Returns whether [obj] is an instance of [NSURLSessionStreamTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionStreamTask); } - static NSCharacterSet getWhitespaceCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_whitespaceCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Read minBytes, or at most maxBytes bytes and invoke the completion + /// handler on the sessions delegate queue with the data or an error. + /// If an error occurs, any outstanding reads will also fail, and new + /// read requests will error out immediately. + void readDataOfMinLength_maxLength_timeout_completionHandler_( + DartNSUInteger minBytes, + DartNSUInteger maxBytes, + DartNSTimeInterval timeout, + objc.ObjCBlock + completionHandler) { + _objc_msgSend_15i4521( + this.ref.pointer, + _sel_readDataOfMinLength_maxLength_timeout_completionHandler_, + minBytes, + maxBytes, + timeout, + completionHandler.ref.pointer); } - static NSCharacterSet getWhitespaceAndNewlineCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_whitespaceAndNewlineCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Write the data completely to the underlying socket. If all the + /// bytes have not been written by the timeout, a timeout error will + /// occur. Note that invocation of the completion handler does not + /// guarantee that the remote side has received all the bytes, only + /// that they have been written to the kernel. + void writeData_timeout_completionHandler_( + objc.NSData data, + DartNSTimeInterval timeout, + objc.ObjCBlock completionHandler) { + _objc_msgSend_5qmwfe( + this.ref.pointer, + _sel_writeData_timeout_completionHandler_, + data.ref.pointer, + timeout, + completionHandler.ref.pointer); } - static NSCharacterSet getDecimalDigitCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_decimalDigitCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// -captureStreams completes any already enqueued reads + /// and writes, and then invokes the + /// URLSession:streamTask:didBecomeInputStream:outputStream: delegate + /// message. When that message is received, the task object is + /// considered completed and will not receive any more delegate + /// messages. + void captureStreams() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_captureStreams); } - static NSCharacterSet getLetterCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_letterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Enqueue a request to close the write end of the underlying socket. + /// All outstanding IO will complete before the write side of the + /// socket is closed. The server, however, may continue to write bytes + /// back to the client, so best practice is to continue reading from + /// the server until you receive EOF. + void closeWrite() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_closeWrite); } - static NSCharacterSet getLowercaseLetterCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_lowercaseLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Enqueue a request to close the read side of the underlying socket. + /// All outstanding IO will complete before the read side is closed. + /// You may continue writing to the server. + void closeRead() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_closeRead); } - static NSCharacterSet getUppercaseLetterCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_uppercaseLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Begin encrypted handshake. The handshake begins after all pending + /// IO has completed. TLS authentication callbacks are sent to the + /// session's -URLSession:task:didReceiveChallenge:completionHandler: + void startSecureConnection() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_startSecureConnection); } - static NSCharacterSet getNonBaseCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_nonBaseCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Cleanly close a secure connection after all pending secure IO has + /// completed. + /// + /// @warning This API is non-functional. + void stopSecureConnection() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_stopSecureConnection); } - static NSCharacterSet getAlphanumericCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_alphanumericCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// init + NSURLSessionStreamTask init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: false, release: true); } - static NSCharacterSet getDecomposableCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_decomposableCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// new + static NSURLSessionStreamTask new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSURLSessionStreamTask, _sel_new); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: false, release: true); } - static NSCharacterSet getIllegalCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_illegalCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// allocWithZone: + static NSURLSessionStreamTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionStreamTask, _sel_allocWithZone_, zone); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: false, release: true); } - static NSCharacterSet getPunctuationCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_punctuationCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// alloc + static NSURLSessionStreamTask alloc() { + final _ret = + _objc_msgSend_1unuoxw(_class_NSURLSessionStreamTask, _sel_alloc); + return NSURLSessionStreamTask.castFromPointer(_ret, + retain: false, release: true); } +} - static NSCharacterSet getCapitalizedLetterCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_capitalizedLetterCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } +late final _class_NSURLSessionStreamTask = + objc.getClass("NSURLSessionStreamTask"); +void _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Bool arg1, ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, bool, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + bool, ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_bool_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_bool_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + bool arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + bool, ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Bool, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData_bool_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSData, ffi.Bool, + objc.NSError?)>(pointer, retain: retain, release: release); - static NSCharacterSet getSymbolCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_symbolCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Bool arg1, ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_bool_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSCharacterSet getNewlineCharacterSet(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28( - _lib._class_NSMutableCharacterSet1, _lib._sel_newlineCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock + fromFunction(void Function(objc.NSData, bool, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_bool_NSError_closureCallable, + (ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) => + fn( + objc.NSData.castFromPointer(arg0, retain: true, release: true), + arg1, + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - static NSMutableCharacterSet characterSetWithRange_( - NativeCupertinoHttp _lib, NSRange aRange) { - final _ret = _lib._objc_msgSend_515(_lib._class_NSMutableCharacterSet1, - _lib._sel_characterSetWithRange_1, aRange); - return NSMutableCharacterSet._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock + listener(void Function(objc.NSData, bool, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_bool_NSError_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, bool arg1, + ffi.Pointer arg2) => + fn( + objc.NSData.castFromPointer(arg0, retain: false, release: true), + arg1, + arg2.address == 0 + ? null + : objc.NSError.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_hfhq9m(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSData, ffi.Bool, objc.NSError?)>(wrapper, + retain: false, release: true); } +} - static NSMutableCharacterSet characterSetWithCharactersInString_( - NativeCupertinoHttp _lib, NSString aString) { - final _ret = _lib._objc_msgSend_516(_lib._class_NSMutableCharacterSet1, - _lib._sel_characterSetWithCharactersInString_1, aString._id); - return NSMutableCharacterSet._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_bool_NSError_CallExtension + on objc.ObjCBlock { + void call(objc.NSData arg0, bool arg1, objc.NSError? arg2) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Bool arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + bool, + ffi.Pointer)>()( + ref.pointer, arg0.ref.pointer, arg1, arg2?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_readDataOfMinLength_maxLength_timeout_completionHandler_ = objc + .registerName("readDataOfMinLength:maxLength:timeout:completionHandler:"); +final _objc_msgSend_15i4521 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSUInteger, + NSUInteger, + NSTimeInterval, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + double, + ffi.Pointer)>(); +void _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSError_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSError_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - static NSMutableCharacterSet characterSetWithBitmapRepresentation_( - NativeCupertinoHttp _lib, NSData data) { - final _ret = _lib._objc_msgSend_517(_lib._class_NSMutableCharacterSet1, - _lib._sel_characterSetWithBitmapRepresentation_1, data._id); - return NSMutableCharacterSet._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSMutableCharacterSet? characterSetWithContentsOfFile_( - NativeCupertinoHttp _lib, NSString fName) { - final _ret = _lib._objc_msgSend_518(_lib._class_NSMutableCharacterSet1, - _lib._sel_characterSetWithContentsOfFile_1, fName._id); - return _ret.address == 0 - ? null - : NSMutableCharacterSet._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSError_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSError.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); - @override - NSMutableCharacterSet initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_236(_id, _lib._sel_initWithCoder_1, coder._id); - return NSMutableCharacterSet._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock listener( + void Function(objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSError_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSError.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - /// Returns a character set containing the characters allowed in a URL's user subcomponent. - static NSCharacterSet getURLUserAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_URLUserAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSError_CallExtension + on objc.ObjCBlock { + void call(objc.NSError? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_writeData_timeout_completionHandler_ = + objc.registerName("writeData:timeout:completionHandler:"); +final _objc_msgSend_5qmwfe = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSTimeInterval, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + double, + ffi.Pointer)>(); +late final _sel_captureStreams = objc.registerName("captureStreams"); +late final _sel_closeWrite = objc.registerName("closeWrite"); +late final _sel_closeRead = objc.registerName("closeRead"); +late final _sel_startSecureConnection = + objc.registerName("startSecureConnection"); +late final _sel_stopSecureConnection = + objc.registerName("stopSecureConnection"); +late final _sel_streamTaskWithHostName_port_ = + objc.registerName("streamTaskWithHostName:port:"); +final _objc_msgSend_spwp90 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int)>(); + +/// NSNetService +class NSNetService extends objc.ObjCObjectBase { + NSNetService._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - /// Returns a character set containing the characters allowed in a URL's password subcomponent. - static NSCharacterSet getURLPasswordAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_URLPasswordAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } + /// Constructs a [NSNetService] that points to the same underlying object as [other]. + NSNetService.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Returns a character set containing the characters allowed in a URL's host subcomponent. - static NSCharacterSet getURLHostAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_URLHostAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } + /// Constructs a [NSNetService] that wraps the given raw object pointer. + NSNetService.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - /// Returns a character set containing the characters allowed in a URL's path component. ';' is a legal path character, but it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet). - static NSCharacterSet getURLPathAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_URLPathAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); + /// Returns whether [obj] is an instance of [NSNetService]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSNetService); } +} - /// Returns a character set containing the characters allowed in a URL's query component. - static NSCharacterSet getURLQueryAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_URLQueryAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } +late final _class_NSNetService = objc.getClass("NSNetService"); +late final _sel_streamTaskWithNetService_ = + objc.registerName("streamTaskWithNetService:"); - /// Returns a character set containing the characters allowed in a URL's fragment component. - static NSCharacterSet getURLFragmentAllowedCharacterSet( - NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_28(_lib._class_NSMutableCharacterSet1, - _lib._sel_URLFragmentAllowedCharacterSet1); - return NSCharacterSet._(_ret, _lib, retain: true, release: true); - } +/// A WebSocket task can be created with a ws or wss url. A client can also provide +/// a list of protocols it wishes to advertise during the WebSocket handshake phase. +/// Once the handshake is successfully completed the client will be notified through an optional delegate. +/// All reads and writes enqueued before the completion of the handshake will be queued up and +/// executed once the handshake succeeds. Before the handshake completes, the client can be called to handle +/// redirection or authentication using the same delegates as NSURLSessionTask. WebSocket task will also provide +/// support for cookies and will store cookies to the cookie storage on the session and will attach cookies to +/// outgoing HTTP handshake requests. +class NSURLSessionWebSocketTask extends NSURLSessionTask { + NSURLSessionWebSocketTask._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - @override - NSMutableCharacterSet init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSMutableCharacterSet._(_ret, _lib, retain: true, release: true); - } + /// Constructs a [NSURLSessionWebSocketTask] that points to the same underlying object as [other]. + NSURLSessionWebSocketTask.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - static NSMutableCharacterSet new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableCharacterSet1, _lib._sel_new1); - return NSMutableCharacterSet._(_ret, _lib, retain: false, release: true); - } + /// Constructs a [NSURLSessionWebSocketTask] that wraps the given raw object pointer. + NSURLSessionWebSocketTask.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - static NSMutableCharacterSet allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSMutableCharacterSet1, _lib._sel_allocWithZone_1, zone); - return NSMutableCharacterSet._(_ret, _lib, retain: false, release: true); + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketTask]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionWebSocketTask); } - static NSMutableCharacterSet alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSMutableCharacterSet1, _lib._sel_alloc1); - return NSMutableCharacterSet._(_ret, _lib, retain: false, release: true); + /// Sends a WebSocket message. If an error occurs, any outstanding work will also fail. + /// Note that invocation of the completion handler does not + /// guarantee that the remote side has received all the bytes, only + /// that they have been written to the kernel. + void sendMessage_completionHandler_(NSURLSessionWebSocketMessage message, + objc.ObjCBlock completionHandler) { + _objc_msgSend_cmbt6k(this.ref.pointer, _sel_sendMessage_completionHandler_, + message.ref.pointer, completionHandler.ref.pointer); } -} - -typedef NSURLFileResourceType = ffi.Pointer; -typedef DartNSURLFileResourceType = NSString; -typedef NSURLThumbnailDictionaryItem = ffi.Pointer; -typedef DartNSURLThumbnailDictionaryItem = NSString; -typedef NSURLFileProtectionType = ffi.Pointer; -typedef DartNSURLFileProtectionType = NSString; -typedef NSURLUbiquitousItemDownloadingStatus = ffi.Pointer; -typedef DartNSURLUbiquitousItemDownloadingStatus = NSString; -typedef NSURLUbiquitousSharedItemRole = ffi.Pointer; -typedef DartNSURLUbiquitousSharedItemRole = NSString; -typedef NSURLUbiquitousSharedItemPermissions = ffi.Pointer; -typedef DartNSURLUbiquitousSharedItemPermissions = NSString; - -/// NSURLQueryItem encapsulates a single query name-value pair. The name and value strings of a query name-value pair are not percent encoded. For use with the NSURLComponents queryItems property. -class NSURLQueryItem extends NSObject { - NSURLQueryItem._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - /// Returns a [NSURLQueryItem] that points to the same underlying object as [other]. - static NSURLQueryItem castFrom(T other) { - return NSURLQueryItem._(other._id, other._lib, retain: true, release: true); + /// Reads a WebSocket message once all the frames of the message are available. + /// If the maximumMessage size is hit while buffering the frames, the receiveMessage call will error out + /// and all outstanding work will also fail resulting in the end of the task. + void receiveMessageWithCompletionHandler_( + objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> + completionHandler) { + _objc_msgSend_4daxhl( + this.ref.pointer, + _sel_receiveMessageWithCompletionHandler_, + completionHandler.ref.pointer); } - /// Returns a [NSURLQueryItem] that wraps the given raw object pointer. - static NSURLQueryItem castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLQueryItem._(other, lib, retain: retain, release: release); + /// Sends a ping frame from the client side. The pongReceiveHandler is invoked when the client + /// receives a pong from the server endpoint. If a connection is lost or an error occurs before receiving + /// the pong from the endpoint, the pongReceiveHandler block will be invoked with an error. + /// Note - the pongReceiveHandler will always be called in the order in which the pings were sent. + void sendPingWithPongReceiveHandler_( + objc.ObjCBlock pongReceiveHandler) { + _objc_msgSend_4daxhl(this.ref.pointer, _sel_sendPingWithPongReceiveHandler_, + pongReceiveHandler.ref.pointer); } - /// Returns whether [obj] is an instance of [NSURLQueryItem]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLQueryItem1); + /// Sends a close frame with the given closeCode. An optional reason can be provided while sending the close frame. + /// Simply calling cancel on the task will result in a cancellation frame being sent without any reason. + void cancelWithCloseCode_reason_( + DartNSInteger closeCode, objc.NSData? reason) { + _objc_msgSend_18im7ej(this.ref.pointer, _sel_cancelWithCloseCode_reason_, + closeCode, reason?.ref.pointer ?? ffi.nullptr); } - NSURLQueryItem initWithName_value_(NSString name, NSString? value) { - final _ret = _lib._objc_msgSend_519(_id, _lib._sel_initWithName_value_1, - name._id, value?._id ?? ffi.nullptr); - return NSURLQueryItem._(_ret, _lib, retain: true, release: true); + /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached + DartNSInteger get maximumMessageSize { + return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_maximumMessageSize); } - static NSURLQueryItem queryItemWithName_value_( - NativeCupertinoHttp _lib, NSString name, NSString? value) { - final _ret = _lib._objc_msgSend_519( - _lib._class_NSURLQueryItem1, - _lib._sel_queryItemWithName_value_1, - name._id, - value?._id ?? ffi.nullptr); - return NSURLQueryItem._(_ret, _lib, retain: true, release: true); + /// The maximum number of bytes to be buffered before erroring out. This includes the sum of all bytes from continuation frames. Receive calls will error out if this value is reached + set maximumMessageSize(DartNSInteger value) { + return _objc_msgSend_ke7qz2( + this.ref.pointer, _sel_setMaximumMessageSize_, value); } - NSString get name { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); + /// A task can be queried for it's close code at any point. When the task is not closed, it will be set to NSURLSessionWebSocketCloseCodeInvalid + DartNSInteger get closeCode { + return _objc_msgSend_a13zbl(this.ref.pointer, _sel_closeCode); } - NSString? get value { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_value1); + /// A task can be queried for it's close reason at any point. A nil value indicates no closeReason or that the task is still running + objc.NSData? get closeReason { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_closeReason); return _ret.address == 0 ? null - : NSString._(_ret, _lib, retain: true, release: true); + : objc.NSData.castFromPointer(_ret, retain: true, release: true); } - @override - NSURLQueryItem init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLQueryItem._(_ret, _lib, retain: true, release: true); + /// init + NSURLSessionWebSocketTask init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); } - static NSURLQueryItem new1(NativeCupertinoHttp _lib) { + /// new + static NSURLSessionWebSocketTask new1() { final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLQueryItem1, _lib._sel_new1); - return NSURLQueryItem._(_ret, _lib, retain: false, release: true); + _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketTask, _sel_new); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); } - static NSURLQueryItem allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLQueryItem1, _lib._sel_allocWithZone_1, zone); - return NSURLQueryItem._(_ret, _lib, retain: false, release: true); + /// allocWithZone: + static NSURLSessionWebSocketTask allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionWebSocketTask, _sel_allocWithZone_, zone); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); } - static NSURLQueryItem alloc(NativeCupertinoHttp _lib) { + /// alloc + static NSURLSessionWebSocketTask alloc() { final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLQueryItem1, _lib._sel_alloc1); - return NSURLQueryItem._(_ret, _lib, retain: false, release: true); + _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketTask, _sel_alloc); + return NSURLSessionWebSocketTask.castFromPointer(_ret, + retain: false, release: true); } } -class NSURLComponents extends NSObject { - NSURLComponents._(ffi.Pointer id, NativeCupertinoHttp lib, +late final _class_NSURLSessionWebSocketTask = + objc.getClass("NSURLSessionWebSocketTask"); + +/// The client can create a WebSocket message object that will be passed to the send calls +/// and will be delivered from the receive calls. The message can be initialized with data or string. +/// If initialized with data, the string property will be nil and vice versa. +class NSURLSessionWebSocketMessage extends objc.NSObject { + NSURLSessionWebSocketMessage._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release); - /// Returns a [NSURLComponents] that points to the same underlying object as [other]. - static NSURLComponents castFrom(T other) { - return NSURLComponents._(other._id, other._lib, - retain: true, release: true); + /// Constructs a [NSURLSessionWebSocketMessage] that points to the same underlying object as [other]. + NSURLSessionWebSocketMessage.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); + + /// Constructs a [NSURLSessionWebSocketMessage] that wraps the given raw object pointer. + NSURLSessionWebSocketMessage.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); + + /// Returns whether [obj] is an instance of [NSURLSessionWebSocketMessage]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg(obj.ref.pointer, _sel_isKindOfClass_, + _class_NSURLSessionWebSocketMessage); } - /// Returns a [NSURLComponents] that wraps the given raw object pointer. - static NSURLComponents castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSURLComponents._(other, lib, retain: retain, release: release); + /// Create a message with data type + NSURLSessionWebSocketMessage initWithData_(objc.NSData data) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithData_, data.ref.pointer); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); } - /// Returns whether [obj] is an instance of [NSURLComponents]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSURLComponents1); + /// Create a message with string type + NSURLSessionWebSocketMessage initWithString_(objc.NSString string) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithString_, string.ref.pointer); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); } - /// Initialize a NSURLComponents with all components undefined. Designated initializer. - @override - NSURLComponents init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSURLComponents._(_ret, _lib, retain: true, release: true); + /// type + NSURLSessionWebSocketMessageType get type { + final _ret = _objc_msgSend_1kew1r(this.ref.pointer, _sel_type); + return NSURLSessionWebSocketMessageType.fromValue(_ret); } - /// Initialize a NSURLComponents with the components of a URL. If resolvingAgainstBaseURL is YES and url is a relative URL, the components of [url absoluteURL] are used. If the url string from the NSURL is malformed, nil is returned. - NSURLComponents? initWithURL_resolvingAgainstBaseURL_( - NSURL url, bool resolve) { - final _ret = _lib._objc_msgSend_356( - _id, _lib._sel_initWithURL_resolvingAgainstBaseURL_1, url._id, resolve); + /// data + objc.NSData? get data { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_data); return _ret.address == 0 ? null - : NSURLComponents._(_ret, _lib, retain: true, release: true); + : objc.NSData.castFromPointer(_ret, retain: true, release: true); } - /// Initializes and returns a newly created NSURLComponents with the components of a URL. If resolvingAgainstBaseURL is YES and url is a relative URL, the components of [url absoluteURL] are used. If the url string from the NSURL is malformed, nil is returned. - static NSURLComponents? componentsWithURL_resolvingAgainstBaseURL_( - NativeCupertinoHttp _lib, NSURL url, bool resolve) { - final _ret = _lib._objc_msgSend_356( - _lib._class_NSURLComponents1, - _lib._sel_componentsWithURL_resolvingAgainstBaseURL_1, - url._id, - resolve); + /// string + objc.NSString? get string { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_string); return _ret.address == 0 ? null - : NSURLComponents._(_ret, _lib, retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - /// Initialize a NSURLComponents with a URL string. If the URLString is malformed, nil is returned. - NSURLComponents? initWithString_(NSString URLString) { + /// init + NSURLSessionWebSocketMessage init() { final _ret = - _lib._objc_msgSend_49(_id, _lib._sel_initWithString_1, URLString._id); - return _ret.address == 0 - ? null - : NSURLComponents._(_ret, _lib, retain: true, release: true); + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); } - /// Initializes and returns a newly created NSURLComponents with a URL string. If the URLString is malformed, nil is returned. - static NSURLComponents? componentsWithString_( - NativeCupertinoHttp _lib, NSString URLString) { - final _ret = _lib._objc_msgSend_49(_lib._class_NSURLComponents1, - _lib._sel_componentsWithString_1, URLString._id); - return _ret.address == 0 - ? null - : NSURLComponents._(_ret, _lib, retain: true, release: true); + /// new + static NSURLSessionWebSocketMessage new1() { + final _ret = + _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketMessage, _sel_new); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); } - /// Initializes an `NSURLComponents` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters. - /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned. - /// If `encodingInvalidCharacters` is true, `NSURLComponents` will try to encode the string to create a valid URL. - /// If the URL string is still invalid after encoding, `nil` is returned. - /// - /// - Parameter URLString: The URL string. - /// - Parameter encodingInvalidCharacters: True if `NSURLComponents` should try to encode an invalid URL string, false otherwise. - /// - Returns: An `NSURLComponents` instance for a valid URL, or `nil` if the URL is invalid. - NSURLComponents? initWithString_encodingInvalidCharacters_( - NSString URLString, bool encodingInvalidCharacters) { - final _ret = _lib._objc_msgSend_51( - _id, - _lib._sel_initWithString_encodingInvalidCharacters_1, - URLString._id, - encodingInvalidCharacters); - return _ret.address == 0 - ? null - : NSURLComponents._(_ret, _lib, retain: true, release: true); + /// allocWithZone: + static NSURLSessionWebSocketMessage allocWithZone_( + ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionWebSocketMessage, _sel_allocWithZone_, zone); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); } - /// Initializes and returns a newly created `NSURLComponents` with a URL string and the option to add (or skip) IDNA- and percent-encoding of invalid characters. - /// If `encodingInvalidCharacters` is false, and the URL string is invalid according to RFC 3986, `nil` is returned. - /// If `encodingInvalidCharacters` is true, `NSURLComponents` will try to encode the string to create a valid URL. - /// If the URL string is still invalid after encoding, nil is returned. - /// - /// - Parameter URLString: The URL string. - /// - Parameter encodingInvalidCharacters: True if `NSURLComponents` should try to encode an invalid URL string, false otherwise. - /// - Returns: An `NSURLComponents` instance for a valid URL, or `nil` if the URL is invalid. - static NSURLComponents? componentsWithString_encodingInvalidCharacters_( - NativeCupertinoHttp _lib, - NSString URLString, - bool encodingInvalidCharacters) { - final _ret = _lib._objc_msgSend_51( - _lib._class_NSURLComponents1, - _lib._sel_componentsWithString_encodingInvalidCharacters_1, - URLString._id, - encodingInvalidCharacters); - return _ret.address == 0 - ? null - : NSURLComponents._(_ret, _lib, retain: true, release: true); + /// alloc + static NSURLSessionWebSocketMessage alloc() { + final _ret = + _objc_msgSend_1unuoxw(_class_NSURLSessionWebSocketMessage, _sel_alloc); + return NSURLSessionWebSocketMessage.castFromPointer(_ret, + retain: false, release: true); } +} - /// Returns a URL created from the NSURLComponents. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned. - NSURL? get URL { - final _ret = _lib._objc_msgSend_56(_id, _lib._sel_URL1); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, release: true); - } +late final _class_NSURLSessionWebSocketMessage = + objc.getClass("NSURLSessionWebSocketMessage"); +late final _sel_initWithData_ = objc.registerName("initWithData:"); +late final _sel_initWithString_ = objc.registerName("initWithString:"); + +enum NSURLSessionWebSocketMessageType { + NSURLSessionWebSocketMessageTypeData(0), + NSURLSessionWebSocketMessageTypeString(1); + + final int value; + const NSURLSessionWebSocketMessageType(this.value); + + static NSURLSessionWebSocketMessageType fromValue(int value) => + switch (value) { + 0 => NSURLSessionWebSocketMessageTypeData, + 1 => NSURLSessionWebSocketMessageTypeString, + _ => throw ArgumentError( + "Unknown value for NSURLSessionWebSocketMessageType: $value"), + }; +} + +late final _sel_type = objc.registerName("type"); +final _objc_msgSend_1kew1r = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_string = objc.registerName("string"); +late final _sel_sendMessage_completionHandler_ = + objc.registerName("sendMessage:completionHandler:"); +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, + objc.NSError?)>(pointer, retain: retain, release: release); - /// Returns a URL created from the NSURLComponents relative to a base URL. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned. - NSURL? URLRelativeToURL_(NSURL? baseURL) { - final _ret = _lib._objc_msgSend_520( - _id, _lib._sel_URLRelativeToURL_1, baseURL?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSURL._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns a URL string created from the NSURLComponents. If the NSURLComponents has an authority component (user, password, host or port) and a path component, then the path must either begin with "/" or be an empty string. If the NSURLComponents does not have an authority component (user, password, host or port) and has a path component, the path component must not start with "//". If those requirements are not met, nil is returned. - NSString? get string { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_string1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); - /// Attempting to set the scheme with an invalid scheme string will cause an exception. - NSString? get scheme { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_scheme1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> + listener(void Function(NSURLSessionWebSocketMessage?, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1) => + fn( + arg0.address == 0 + ? null + : NSURLSessionWebSocketMessage.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : objc.NSError.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1tjlcwl(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, + objc.NSError?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionWebSocketMessage_NSError_CallExtension + on objc.ObjCBlock< + ffi.Void Function(NSURLSessionWebSocketMessage?, objc.NSError?)> { + void call(NSURLSessionWebSocketMessage? arg0, objc.NSError? arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); +} - /// Attempting to set the scheme with an invalid scheme string will cause an exception. - set scheme(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setScheme_1, value?._id ?? ffi.nullptr); - } +late final _sel_receiveMessageWithCompletionHandler_ = + objc.registerName("receiveMessageWithCompletionHandler:"); +late final _sel_sendPingWithPongReceiveHandler_ = + objc.registerName("sendPingWithPongReceiveHandler:"); - NSString? get user { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_user1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } +/// The WebSocket close codes follow the close codes given in the RFC +sealed class NSURLSessionWebSocketCloseCode { + static const NSURLSessionWebSocketCloseCodeInvalid = 0; + static const NSURLSessionWebSocketCloseCodeNormalClosure = 1000; + static const NSURLSessionWebSocketCloseCodeGoingAway = 1001; + static const NSURLSessionWebSocketCloseCodeProtocolError = 1002; + static const NSURLSessionWebSocketCloseCodeUnsupportedData = 1003; + static const NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005; + static const NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006; + static const NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007; + static const NSURLSessionWebSocketCloseCodePolicyViolation = 1008; + static const NSURLSessionWebSocketCloseCodeMessageTooBig = 1009; + static const NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = 1010; + static const NSURLSessionWebSocketCloseCodeInternalServerError = 1011; + static const NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015; +} + +late final _sel_cancelWithCloseCode_reason_ = + objc.registerName("cancelWithCloseCode:reason:"); +final _objc_msgSend_18im7ej = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>(); +late final _sel_maximumMessageSize = objc.registerName("maximumMessageSize"); +late final _sel_setMaximumMessageSize_ = + objc.registerName("setMaximumMessageSize:"); +late final _sel_closeCode = objc.registerName("closeCode"); +final _objc_msgSend_a13zbl = objc.msgSendPointer + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + int Function( + ffi.Pointer, ffi.Pointer)>(); +late final _sel_closeReason = objc.registerName("closeReason"); +late final _sel_webSocketTaskWithURL_ = + objc.registerName("webSocketTaskWithURL:"); +late final _sel_webSocketTaskWithURL_protocols_ = + objc.registerName("webSocketTaskWithURL:protocols:"); +late final _sel_webSocketTaskWithRequest_ = + objc.registerName("webSocketTaskWithRequest:"); +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, + objc.NSError?)>(pointer, retain: retain, release: release); - set user(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setUser_1, value?._id ?? ffi.nullptr); - } + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - NSString? get password { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_password1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0.address == 0 ? null : objc.NSData.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - set password(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPassword_1, value?._id ?? ffi.nullptr); - } + /// 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. + static objc + .ObjCBlock + listener(void Function(objc.NSData?, NSURLResponse?, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.castFromPointer(arg1, + retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_tenbla(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSData?, NSURLResponse?, + objc.NSError?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_NSURLResponse_NSError_CallExtension on objc + .ObjCBlock { + void call(objc.NSData? arg0, NSURLResponse? arg1, objc.NSError? arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, + arg1?.ref.pointer ?? ffi.nullptr, + arg2?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_dataTaskWithRequest_completionHandler_ = + objc.registerName("dataTaskWithRequest:completionHandler:"); +late final _sel_dataTaskWithURL_completionHandler_ = + objc.registerName("dataTaskWithURL:completionHandler:"); +late final _sel_uploadTaskWithRequest_fromFile_completionHandler_ = + objc.registerName("uploadTaskWithRequest:fromFile:completionHandler:"); +final _objc_msgSend_37obke = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_uploadTaskWithRequest_fromData_completionHandler_ = + objc.registerName("uploadTaskWithRequest:fromData:completionHandler:"); +late final _sel_uploadTaskWithResumeData_completionHandler_ = + objc.registerName("uploadTaskWithResumeData:completionHandler:"); +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, + objc.NSError?)>(pointer, retain: retain, release: release); - NSString? get host { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_host1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - set host(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setHost_1, value?._id ?? ffi.nullptr); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0.address == 0 ? null : objc.NSURL.castFromPointer(arg0, retain: true, release: true), + arg1.address == 0 ? null : NSURLResponse.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - /// Attempting to set a negative port number will cause an exception. - NSNumber? get port { - final _ret = _lib._objc_msgSend_94(_id, _lib._sel_port1); - return _ret.address == 0 - ? null - : NSNumber._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc + .ObjCBlock + listener(void Function(objc.NSURL?, NSURLResponse?, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0.address == 0 + ? null + : objc.NSURL + .castFromPointer(arg0, retain: false, release: true), + arg1.address == 0 + ? null + : NSURLResponse.castFromPointer(arg1, + retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_tenbla(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(objc.NSURL?, NSURLResponse?, + objc.NSError?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURL_NSURLResponse_NSError_CallExtension on objc + .ObjCBlock { + void call(objc.NSURL? arg0, NSURLResponse? arg1, objc.NSError? arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, + arg1?.ref.pointer ?? ffi.nullptr, + arg2?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_downloadTaskWithRequest_completionHandler_ = + objc.registerName("downloadTaskWithRequest:completionHandler:"); +late final _sel_downloadTaskWithURL_completionHandler_ = + objc.registerName("downloadTaskWithURL:completionHandler:"); +late final _sel_downloadTaskWithResumeData_completionHandler_ = + objc.registerName("downloadTaskWithResumeData:completionHandler:"); + +enum NSURLSessionResponseDisposition { + /// Cancel the load, this is the same as -[task cancel] + NSURLSessionResponseCancel(0), - /// Attempting to set a negative port number will cause an exception. - set port(NSNumber? value) { - return _lib._objc_msgSend_389( - _id, _lib._sel_setPort_1, value?._id ?? ffi.nullptr); - } + /// Allow the load to continue + NSURLSessionResponseAllow(1), - NSString? get path { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_path1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// Turn this request into a download + NSURLSessionResponseBecomeDownload(2), - set path(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPath_1, value?._id ?? ffi.nullptr); - } + /// Turn this task into a stream task + NSURLSessionResponseBecomeStream(3); + + final int value; + const NSURLSessionResponseDisposition(this.value); + + static NSURLSessionResponseDisposition fromValue(int value) => + switch (value) { + 0 => NSURLSessionResponseCancel, + 1 => NSURLSessionResponseAllow, + 2 => NSURLSessionResponseBecomeDownload, + 3 => NSURLSessionResponseBecomeStream, + _ => throw ArgumentError( + "Unknown value for NSURLSessionResponseDisposition: $value"), + }; +} + +/// Messages related to the URL session as a whole +abstract final class NSURLSessionDelegate { + /// Builds an object that implements the NSURLSessionDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, objc.NSError?)? + URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? + URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionDelegate = + objc.getProtocol("NSURLSessionDelegate"); +late final _sel_URLSession_didBecomeInvalidWithError_ = + objc.registerName("URLSession:didBecomeInvalidWithError:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + objc.NSError?)>(pointer, retain: retain, release: release); - NSString? get query { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_query1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, 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. + static objc + .ObjCBlock, NSURLSession, objc.NSError?)> + fromFunctionPointer( + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, objc.NSError?)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - set query(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setQuery_1, value?._id ?? ffi.nullptr); - } + /// 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. + static objc + .ObjCBlock, NSURLSession, objc.NSError?)> + fromFunction(void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) => + objc.ObjCBlock, NSURLSession, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + arg2.address == 0 ? null : objc.NSError.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - NSString? get fragment { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_fragment1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, objc.NSError?)> listener( + void Function(ffi.Pointer, NSURLSession, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + arg2.address == 0 + ? null + : objc.NSError.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_tm2na8(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + objc.NSError?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, objc.NSError?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, objc.NSError?)> { + void call( + ffi.Pointer arg0, NSURLSession arg1, objc.NSError? arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2?.ref.pointer ?? ffi.nullptr); +} - set fragment(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setFragment_1, value?._id ?? ffi.nullptr); - } +/// NSURLAuthenticationChallenge +class NSURLAuthenticationChallenge extends objc.ObjCObjectBase { + NSURLAuthenticationChallenge._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - /// Getting these properties retains any percent encoding these components may have. Setting these properties assumes the component string is already correctly percent encoded. Attempting to set an incorrectly percent encoded string will cause an exception. Although ';' is a legal path character, it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet). - NSString? get percentEncodedUser { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_percentEncodedUser1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// Constructs a [NSURLAuthenticationChallenge] that points to the same underlying object as [other]. + NSURLAuthenticationChallenge.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Getting these properties retains any percent encoding these components may have. Setting these properties assumes the component string is already correctly percent encoded. Attempting to set an incorrectly percent encoded string will cause an exception. Although ';' is a legal path character, it is recommended that it be percent-encoded for best compatibility with NSURL (-stringByAddingPercentEncodingWithAllowedCharacters: will percent-encode any ';' characters if you pass the URLPathAllowedCharacterSet). - set percentEncodedUser(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPercentEncodedUser_1, value?._id ?? ffi.nullptr); - } + /// Constructs a [NSURLAuthenticationChallenge] that wraps the given raw object pointer. + NSURLAuthenticationChallenge.castFromPointer( + ffi.Pointer other, + {bool retain = false, + bool release = false}) + : this._(other, retain: retain, release: release); - NSString? get percentEncodedPassword { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_percentEncodedPassword1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); + /// Returns whether [obj] is an instance of [NSURLAuthenticationChallenge]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg(obj.ref.pointer, _sel_isKindOfClass_, + _class_NSURLAuthenticationChallenge); } +} - set percentEncodedPassword(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPercentEncodedPassword_1, value?._id ?? ffi.nullptr); - } +late final _class_NSURLAuthenticationChallenge = + objc.getClass("NSURLAuthenticationChallenge"); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSInteger arg0, + ffi.Pointer arg1)>>() + .asFunction)>()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); - NSString? get percentEncodedHost { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_percentEncodedHost1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> fromFunctionPointer( + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - set percentEncodedHost(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPercentEncodedHost_1, value?._id ?? ffi.nullptr); - } + /// 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. + static objc.ObjCBlock + fromFunction(void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_closureCallable, + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionAuthChallengeDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLCredential.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); - NSString? get percentEncodedPath { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_percentEncodedPath1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock + listener( + void Function(NSURLSessionAuthChallengeDisposition, NSURLCredential?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_listenerCallable + .nativeFunction + .cast(), + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionAuthChallengeDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLCredential.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1najo2h(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); } +} - set percentEncodedPath(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPercentEncodedPath_1, value?._id ?? ffi.nullptr); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionAuthChallengeDisposition arg0, NSURLCredential? arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + NSInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, int, + ffi.Pointer)>()( + ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); +} - NSString? get percentEncodedQuery { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_percentEncodedQuery1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } +enum NSURLSessionAuthChallengeDisposition { + /// Use the specified credential, which may be nil + NSURLSessionAuthChallengeUseCredential(0), - set percentEncodedQuery(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPercentEncodedQuery_1, value?._id ?? ffi.nullptr); - } + /// Default handling for the challenge - as if this delegate were not implemented; the credential parameter is ignored. + NSURLSessionAuthChallengePerformDefaultHandling(1), - NSString? get percentEncodedFragment { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_percentEncodedFragment1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + /// The entire request will be canceled; the credential parameter is ignored. + NSURLSessionAuthChallengeCancelAuthenticationChallenge(2), - set percentEncodedFragment(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setPercentEncodedFragment_1, value?._id ?? ffi.nullptr); - } + /// This challenge is rejected and the next authentication protection space should be tried; the credential parameter is ignored. + NSURLSessionAuthChallengeRejectProtectionSpace(3); - NSString? get encodedHost { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_encodedHost1); - return _ret.address == 0 - ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + final int value; + const NSURLSessionAuthChallengeDisposition(this.value); - set encodedHost(NSString? value) { - return _lib._objc_msgSend_395( - _id, _lib._sel_setEncodedHost_1, value?._id ?? ffi.nullptr); - } + static NSURLSessionAuthChallengeDisposition fromValue(int value) => + switch (value) { + 0 => NSURLSessionAuthChallengeUseCredential, + 1 => NSURLSessionAuthChallengePerformDefaultHandling, + 2 => NSURLSessionAuthChallengeCancelAuthenticationChallenge, + 3 => NSURLSessionAuthChallengeRejectProtectionSpace, + _ => throw ArgumentError( + "Unknown value for NSURLSessionAuthChallengeDisposition: $value"), + }; +} - /// These properties return the character range of a component in the URL string returned by -[NSURLComponents string]. If the component does not exist in the NSURLComponents object, {NSNotFound, 0} is returned. Note: Zero length components are legal. For example, the URL string "scheme://:@/?#" has a zero length user, password, host, query and fragment; the URL strings "scheme:" and "" both have a zero length path. - NSRange get rangeOfScheme { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfScheme1); - } +/// NSURLCredential +class NSURLCredential extends objc.ObjCObjectBase { + NSURLCredential._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - NSRange get rangeOfUser { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfUser1); - } + /// Constructs a [NSURLCredential] that points to the same underlying object as [other]. + NSURLCredential.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - NSRange get rangeOfPassword { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfPassword1); - } + /// Constructs a [NSURLCredential] that wraps the given raw object pointer. + NSURLCredential.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - NSRange get rangeOfHost { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfHost1); + /// Returns whether [obj] is an instance of [NSURLCredential]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLCredential); } +} - NSRange get rangeOfPort { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfPort1); - } +late final _class_NSURLCredential = objc.getClass("NSURLCredential"); +late final _sel_URLSession_didReceiveChallenge_completionHandler_ = + objc.registerName("URLSession:didReceiveChallenge:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - NSRange get rangeOfPath { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfPath1); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLAuthenticationChallenge.castFromPointer(arg2, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - NSRange get rangeOfQuery { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfQuery1); + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLAuthenticationChallenge.castFromPointer(arg2, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _wrapListenerBlock_1wmulza(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, + retain: false, release: true); } +} - NSRange get rangeOfFragment { - return _lib._objc_msgSend_66(_id, _lib._sel_rangeOfFragment1); - } +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock + arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.registerName("URLSessionDidFinishEventsForBackgroundURLSession:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock, NSURLSession)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + NSURLSession)>(pointer, retain: retain, release: release); - /// The query component as an array of NSURLQueryItems for this NSURLComponents. - /// - /// Each NSURLQueryItem represents a single key-value pair, + /// Creates a block from a C function pointer. /// - /// Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the NSURLComponents has an empty query component, returns an empty array. If the NSURLComponents has no query component, returns nil. + /// 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. + static objc.ObjCBlock, NSURLSession)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, NSURLSession)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. /// - /// The queryItems getter returns an array of NSURLQueryItems in the order in which they appear in the original query string. Any percent-encoding in a NSURLQueryItem name or value is removed. + /// 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. + static objc.ObjCBlock, NSURLSession)> + fromFunction(void Function(ffi.Pointer, NSURLSession) fn) => + objc.ObjCBlock, NSURLSession)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. /// - /// The queryItems setter combines an array containing any number of NSURLQueryItems, each of which represents a single key-value pair, into a query string and sets the NSURLComponents query property. If the NSURLQueryItems name or value strings contain any characters not allowed in a URL's query component, those characters are percent-encoded. In addition, any '&' and '=' characters in a NSURLQueryItem name are percent-encoded. Passing an empty array sets the query component of the NSURLComponents to an empty string. Passing nil removes the query component of the NSURLComponents. + /// 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: If a NSURLQueryItem name-value pair is empty (i.e. the query string starts with '&', ends with '&', or has "&&" within it), you get a NSURLQueryItem with a zero-length name and a nil value. If a NSURLQueryItem name-value pair has nothing before the equals sign, you get a zero-length name. If a NSURLQueryItem name-value pair has nothing after the equals sign, you get a zero-length value. If a NSURLQueryItem name-value pair has no equals sign, the NSURLQueryItem name-value pair string is the name and you get a nil value. - NSArray? get queryItems { - final _ret = _lib._objc_msgSend_188(_id, _lib._sel_queryItems1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock, NSURLSession)> + listener(void Function(ffi.Pointer, NSURLSession) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: false, release: true))); + final wrapper = _wrapListenerBlock_sjfpmz(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession)>(wrapper, + retain: false, release: true); } +} - /// The query component as an array of NSURLQueryItems for this NSURLComponents. - /// - /// Each NSURLQueryItem represents a single key-value pair, +/// Call operator for `objc.ObjCBlock, NSURLSession)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_CallExtension + on objc.ObjCBlock, NSURLSession)> { + void call(ffi.Pointer arg0, NSURLSession arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} + +/// Messages related to the operation of a specific task. +abstract final class NSURLSessionTaskDelegate { + /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function( + NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionTaskDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function( + NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionTaskDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)? + URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionTaskDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionTaskDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionTaskDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionTaskDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionTaskDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionTaskDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionTaskDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionTaskDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionTaskDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionTaskDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionTaskDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionTaskDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionTaskDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionTaskDelegate = + objc.getProtocol("NSURLSessionTaskDelegate"); +late final _sel_URLSession_didCreateTask_ = + objc.registerName("URLSession:didCreateTask:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask)>(pointer, retain: retain, release: release); + + /// Creates a block from a C function pointer. /// - /// Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the NSURLComponents has an empty query component, returns an empty array. If the NSURLComponents has no query component, returns nil. + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// Creates a block from a Dart function. /// - /// The queryItems getter returns an array of NSURLQueryItems in the order in which they appear in the original query string. Any percent-encoding in a NSURLQueryItem name or value is removed. + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); + + /// Creates a listener block from a Dart function. /// - /// The queryItems setter combines an array containing any number of NSURLQueryItems, each of which represents a single key-value pair, into a query string and sets the NSURLComponents query property. If the NSURLQueryItems name or value strings contain any characters not allowed in a URL's query component, those characters are percent-encoded. In addition, any '&' and '=' characters in a NSURLQueryItem name are percent-encoded. Passing an empty array sets the query component of the NSURLComponents to an empty string. Passing nil removes the query component of the NSURLComponents. + /// 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: If a NSURLQueryItem name-value pair is empty (i.e. the query string starts with '&', ends with '&', or has "&&" within it), you get a NSURLQueryItem with a zero-length name and a nil value. If a NSURLQueryItem name-value pair has nothing before the equals sign, you get a zero-length name. If a NSURLQueryItem name-value pair has nothing after the equals sign, you get a zero-length value. If a NSURLQueryItem name-value pair has no equals sign, the NSURLQueryItem name-value pair string is the name and you get a nil value. - set queryItems(NSArray? value) { - return _lib._objc_msgSend_451( - _id, _lib._sel_setQueryItems_1, value?._id ?? ffi.nullptr); - } + /// Note that unlike the default behavior of NativeCallable.listener, listener + /// blocks do not keep the isolate alive. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_tm2na8(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); +} - /// The percentEncodedQueryItems getter returns an array of NSURLQueryItems in the order in which they appear in the original query string. Any percent-encoding in a NSURLQueryItem name or value is retained. - /// - /// The percentEncodedQueryItems setter combines an array containing any number of NSURLQueryItems, each of which represents a single key-value pair, into a query string and sets the NSURLComponents query property. This property assumes the NSURLQueryItem names and values are already correctly percent-encoded, and that the NSURLQueryItem names do not contain the query item delimiter characters '&' and '='. Attempting to set an incorrectly percent-encoded NSURLQueryItem or a NSURLQueryItem name with the query item delimiter characters '&' and '=' will cause an exception. - NSArray? get percentEncodedQueryItems { - final _ret = - _lib._objc_msgSend_188(_id, _lib._sel_percentEncodedQueryItems1); - return _ret.address == 0 - ? null - : NSArray._(_ret, _lib, retain: true, release: true); - } +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(NSInteger arg0, + ffi.Pointer arg1)>>() + .asFunction)>()( + arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline( + ffi.Pointer block, + int arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + int, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable = + ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - /// The percentEncodedQueryItems getter returns an array of NSURLQueryItems in the order in which they appear in the original query string. Any percent-encoding in a NSURLQueryItem name or value is retained. + /// Creates a block from a C function pointer. /// - /// The percentEncodedQueryItems setter combines an array containing any number of NSURLQueryItems, each of which represents a single key-value pair, into a query string and sets the NSURLComponents query property. This property assumes the NSURLQueryItem names and values are already correctly percent-encoded, and that the NSURLQueryItem names do not contain the query item delimiter characters '&' and '='. Attempting to set an incorrectly percent-encoded NSURLQueryItem or a NSURLQueryItem name with the query item delimiter characters '&' and '=' will cause an exception. - set percentEncodedQueryItems(NSArray? value) { - return _lib._objc_msgSend_451(_id, _lib._sel_setPercentEncodedQueryItems_1, - value?._id ?? ffi.nullptr); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLRequest?)> fromFunctionPointer( + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - static NSURLComponents new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLComponents1, _lib._sel_new1); - return NSURLComponents._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock + fromFunction(void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_closureCallable, + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); - static NSURLComponents allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSURLComponents1, _lib._sel_allocWithZone_1, zone); - return NSURLComponents._(_ret, _lib, retain: false, release: true); + /// 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. + static objc.ObjCBlock listener( + void Function(NSURLSessionDelayedRequestDisposition, NSURLRequest?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_listenerCallable + .nativeFunction + .cast(), + (int arg0, ffi.Pointer arg1) => fn( + NSURLSessionDelayedRequestDisposition.fromValue(arg0), + arg1.address == 0 + ? null + : NSURLRequest.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_wnmjgj(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - static NSURLComponents alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSURLComponents1, _lib._sel_alloc1); - return NSURLComponents._(_ret, _lib, retain: false, release: true); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionDelayedRequestDisposition arg0, NSURLRequest? arg1) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + NSInteger arg0, ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, int, + ffi.Pointer)>()( + ref.pointer, arg0.value, arg1?.ref.pointer ?? ffi.nullptr); } -/// NSFileSecurity encapsulates a file system object's security information. NSFileSecurity and CFFileSecurity are toll-free bridged. Use the CFFileSecurity API for access to the low-level file security properties encapsulated by NSFileSecurity. -class NSFileSecurity extends NSObject { - NSFileSecurity._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); +/// Disposition options for various delegate messages +enum NSURLSessionDelayedRequestDisposition { + /// Use the original request provided when the task was created; the request parameter is ignored. + NSURLSessionDelayedRequestContinueLoading(0), - /// Returns a [NSFileSecurity] that points to the same underlying object as [other]. - static NSFileSecurity castFrom(T other) { - return NSFileSecurity._(other._id, other._lib, retain: true, release: true); - } + /// Use the specified request, which may not be nil. + NSURLSessionDelayedRequestUseNewRequest(1), - /// Returns a [NSFileSecurity] that wraps the given raw object pointer. - static NSFileSecurity castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSFileSecurity._(other, lib, retain: retain, release: release); - } + /// Cancel the task; the request parameter is ignored. + NSURLSessionDelayedRequestCancel(2); - /// Returns whether [obj] is an instance of [NSFileSecurity]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSFileSecurity1); - } + final int value; + const NSURLSessionDelayedRequestDisposition(this.value); - NSFileSecurity? initWithCoder_(NSCoder coder) { - final _ret = - _lib._objc_msgSend_14(_id, _lib._sel_initWithCoder_1, coder._id); - return _ret.address == 0 - ? null - : NSFileSecurity._(_ret, _lib, retain: true, release: true); - } + static NSURLSessionDelayedRequestDisposition fromValue(int value) => + switch (value) { + 0 => NSURLSessionDelayedRequestContinueLoading, + 1 => NSURLSessionDelayedRequestUseNewRequest, + 2 => NSURLSessionDelayedRequestCancel, + _ => throw ArgumentError( + "Unknown value for NSURLSessionDelayedRequestDisposition: $value"), + }; +} - @override - NSFileSecurity init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSFileSecurity._(_ret, _lib, retain: true, release: true); - } +late final _sel_URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.registerName( + "URLSession:task:willBeginDelayedRequest:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)>(pointer, retain: retain, release: release); - static NSFileSecurity new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileSecurity1, _lib._sel_new1); - return NSFileSecurity._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static NSFileSecurity allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSFileSecurity1, _lib._sel_allocWithZone_1, zone); - return NSFileSecurity._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLRequest.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); - static NSFileSecurity alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSFileSecurity1, _lib._sel_alloc1); - return NSFileSecurity._(_ret, _lib, retain: false, release: true); + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> + listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSURLRequest.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionDelayedRequestDisposition_NSURLRequest + .castFromPointer(arg4, retain: false, release: true))); + final wrapper = _wrapListenerBlock_1nnj9ov(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); } } -/// ! -/// @class NSHTTPURLResponse -/// -/// @abstract An NSHTTPURLResponse object represents a response to an -/// HTTP URL load. It is a specialization of NSURLResponse which -/// provides conveniences for accessing information specific to HTTP -/// protocol responses. +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLRequest, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +late final _sel_URLSession_taskIsWaitingForConnectivity_ = + objc.registerName("URLSession:taskIsWaitingForConnectivity:"); + +/// NSHTTPURLResponse class NSHTTPURLResponse extends NSURLResponse { - NSHTTPURLResponse._(ffi.Pointer id, NativeCupertinoHttp lib, + NSHTTPURLResponse._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release); - /// Returns a [NSHTTPURLResponse] that points to the same underlying object as [other]. - static NSHTTPURLResponse castFrom(T other) { - return NSHTTPURLResponse._(other._id, other._lib, - retain: true, release: true); - } + /// Constructs a [NSHTTPURLResponse] that points to the same underlying object as [other]. + NSHTTPURLResponse.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Returns a [NSHTTPURLResponse] that wraps the given raw object pointer. - static NSHTTPURLResponse castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSHTTPURLResponse._(other, lib, retain: retain, release: release); - } + /// Constructs a [NSHTTPURLResponse] that wraps the given raw object pointer. + NSHTTPURLResponse.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); /// Returns whether [obj] is an instance of [NSHTTPURLResponse]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSHTTPURLResponse1); + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSHTTPURLResponse); } /// ! @@ -89282,27 +63607,27 @@ class NSHTTPURLResponse extends NSURLResponse { /// @result the instance of the object, or NULL if an error occurred during initialization. /// @discussion This API was introduced in Mac OS X 10.7.2 and iOS 5.0 and is not available prior to those releases. NSHTTPURLResponse? initWithURL_statusCode_HTTPVersion_headerFields_( - NSURL url, + objc.NSURL url, DartNSInteger statusCode, - NSString? HTTPVersion, - NSDictionary? headerFields) { - final _ret = _lib._objc_msgSend_521( - _id, - _lib._sel_initWithURL_statusCode_HTTPVersion_headerFields_1, - url._id, + objc.NSString? HTTPVersion, + objc.NSDictionary? headerFields) { + final _ret = _objc_msgSend_1j5aquk( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_statusCode_HTTPVersion_headerFields_, + url.ref.pointer, statusCode, - HTTPVersion?._id ?? ffi.nullptr, - headerFields?._id ?? ffi.nullptr); + HTTPVersion?.ref.pointer ?? ffi.nullptr, + headerFields?.ref.pointer ?? ffi.nullptr); return _ret.address == 0 ? null - : NSHTTPURLResponse._(_ret, _lib, retain: true, release: true); + : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); } /// ! /// @abstract Returns the HTTP status code of the receiver. /// @result The HTTP status code of the receiver. DartNSInteger get statusCode { - return _lib._objc_msgSend_86(_id, _lib._sel_statusCode1); + return _objc_msgSend_z1fx1b(this.ref.pointer, _sel_statusCode); } /// ! @@ -89314,9 +63639,9 @@ class NSHTTPURLResponse extends NSURLResponse { /// sophisticated or special-purpose HTTP clients. /// @result A dictionary containing all the HTTP header fields of the /// receiver. - NSDictionary get allHeaderFields { - final _ret = _lib._objc_msgSend_187(_id, _lib._sel_allHeaderFields1); - return NSDictionary._(_ret, _lib, retain: true, release: true); + objc.NSDictionary get allHeaderFields { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_allHeaderFields); + return objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } /// ! @@ -89328,12 +63653,12 @@ class NSHTTPURLResponse extends NSURLResponse { /// (case-insensitive). /// @result the value associated with the given header field, or nil if /// there is no value associated with the given header field. - NSString? valueForHTTPHeaderField_(NSString field) { - final _ret = _lib._objc_msgSend_347( - _id, _lib._sel_valueForHTTPHeaderField_1, field._id); + objc.NSString? valueForHTTPHeaderField_(objc.NSString field) { + final _ret = _objc_msgSend_juohf7( + this.ref.pointer, _sel_valueForHTTPHeaderField_, field.ref.pointer); return _ret.address == 0 ? null - : NSString._(_ret, _lib, retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// ! @@ -89342,11 +63667,10 @@ class NSHTTPURLResponse extends NSURLResponse { /// corresponding to the status code for this response. /// @param statusCode the status code to use to produce a localized string. /// @result A localized string corresponding to the given status code. - static NSString localizedStringForStatusCode_( - NativeCupertinoHttp _lib, DartNSInteger statusCode) { - final _ret = _lib._objc_msgSend_522(_lib._class_NSHTTPURLResponse1, - _lib._sel_localizedStringForStatusCode_1, statusCode); - return NSString._(_ret, _lib, retain: true, release: true); + static objc.NSString localizedStringForStatusCode_(DartNSInteger statusCode) { + final _ret = _objc_msgSend_crtxa9(_class_NSHTTPURLResponse, + _sel_localizedStringForStatusCode_, statusCode); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } /// ! @@ -89358,2458 +63682,11037 @@ class NSHTTPURLResponse extends NSURLResponse { /// @param name the name of the text encoding for the associated data, if applicable, else nil /// @result The initialized NSURLResponse. /// @discussion This is the designated initializer for NSURLResponse. - @override NSHTTPURLResponse initWithURL_MIMEType_expectedContentLength_textEncodingName_( - NSURL URL, NSString? MIMEType, DartNSInteger length, NSString? name) { - final _ret = _lib._objc_msgSend_334( - _id, - _lib._sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_1, - URL._id, - MIMEType?._id ?? ffi.nullptr, + objc.NSURL URL, + objc.NSString? MIMEType, + DartNSInteger length, + objc.NSString? name) { + final _ret = _objc_msgSend_eyseqq( + this.ref.retainAndReturnPointer(), + _sel_initWithURL_MIMEType_expectedContentLength_textEncodingName_, + URL.ref.pointer, + MIMEType?.ref.pointer ?? ffi.nullptr, length, - name?._id ?? ffi.nullptr); - return NSHTTPURLResponse._(_ret, _lib, retain: true, release: true); + name?.ref.pointer ?? ffi.nullptr); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); } - @override + /// init NSHTTPURLResponse init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSHTTPURLResponse._(_ret, _lib, retain: true, release: true); - } - - static NSHTTPURLResponse new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSHTTPURLResponse1, _lib._sel_new1); - return NSHTTPURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSHTTPURLResponse allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSHTTPURLResponse1, _lib._sel_allocWithZone_1, zone); - return NSHTTPURLResponse._(_ret, _lib, retain: false, release: true); - } - - static NSHTTPURLResponse alloc(NativeCupertinoHttp _lib) { final _ret = - _lib._objc_msgSend_2(_lib._class_NSHTTPURLResponse1, _lib._sel_alloc1); - return NSHTTPURLResponse._(_ret, _lib, retain: false, release: true); - } -} - -class NSException extends NSObject { - NSException._(ffi.Pointer id, NativeCupertinoHttp 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); + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); } - /// Returns a [NSException] that wraps the given raw object pointer. - static NSException castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSException._(other, lib, retain: retain, release: release); + /// new + static NSHTTPURLResponse new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPURLResponse, _sel_new); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); } - /// 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); + /// allocWithZone: + static NSHTTPURLResponse allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSHTTPURLResponse, _sel_allocWithZone_, zone); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); } - static NSException exceptionWithName_reason_userInfo_( - NativeCupertinoHttp _lib, - DartNSExceptionName name, - NSString? reason, - NSDictionary? userInfo) { - final _ret = _lib._objc_msgSend_523( - _lib._class_NSException1, - _lib._sel_exceptionWithName_reason_userInfo_1, - name._id, - reason?._id ?? ffi.nullptr, - userInfo?._id ?? ffi.nullptr); - return NSException._(_ret, _lib, retain: true, release: true); - } - - NSException initWithName_reason_userInfo_( - DartNSExceptionName aName, NSString? aReason, NSDictionary? aUserInfo) { - final _ret = _lib._objc_msgSend_524( - _id, - _lib._sel_initWithName_reason_userInfo_1, - aName._id, - aReason?._id ?? ffi.nullptr, - aUserInfo?._id ?? ffi.nullptr); - return NSException._(_ret, _lib, retain: true, release: true); + /// alloc + static NSHTTPURLResponse alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSHTTPURLResponse, _sel_alloc); + return NSHTTPURLResponse.castFromPointer(_ret, + retain: false, release: true); } - DartNSExceptionName get name { - final _ret = _lib._objc_msgSend_32(_id, _lib._sel_name1); - return NSString._(_ret, _lib, retain: true, release: true); + /// supportsSecureCoding + static bool supportsSecureCoding() { + return _objc_msgSend_olxnu1( + _class_NSHTTPURLResponse, _sel_supportsSecureCoding); } - NSString? get reason { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_reason1); + /// initWithCoder: + NSHTTPURLResponse? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); return _ret.address == 0 ? null - : NSString._(_ret, _lib, retain: true, release: true); - } + : NSHTTPURLResponse.castFromPointer(_ret, retain: false, release: true); + } +} + +late final _class_NSHTTPURLResponse = objc.getClass("NSHTTPURLResponse"); +late final _sel_initWithURL_statusCode_HTTPVersion_headerFields_ = + objc.registerName("initWithURL:statusCode:HTTPVersion:headerFields:"); +final _objc_msgSend_1j5aquk = objc.msgSendPointer + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer, + ffi.Pointer)>(); +late final _sel_statusCode = objc.registerName("statusCode"); +late final _sel_allHeaderFields = objc.registerName("allHeaderFields"); +late final _sel_localizedStringForStatusCode_ = + objc.registerName("localizedStringForStatusCode:"); +final _objc_msgSend_crtxa9 = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, NSInteger)>>() + .asFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, int)>(); +void _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLRequest_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSURLRequest_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSURLRequest_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSURLRequest_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLRequest { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - NSDictionary? get userInfo { - final _ret = _lib._objc_msgSend_288(_id, _lib._sel_userInfo1); - return _ret.address == 0 - ? null - : NSDictionary._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLRequest_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - NSArray get callStackReturnAddresses { - final _ret = - _lib._objc_msgSend_169(_id, _lib._sel_callStackReturnAddresses1); - return NSArray._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(NSURLRequest?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLRequest_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSURLRequest.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); - NSArray get callStackSymbols { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_callStackSymbols1); - return NSArray._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock listener( + void Function(NSURLRequest?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLRequest_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : NSURLRequest.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - void raise() { - _lib._objc_msgSend_1(_id, _lib._sel_raise1); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLRequest_CallExtension + on objc.ObjCBlock { + void call(NSURLRequest? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} - static void raise_format_( - NativeCupertinoHttp _lib, DartNSExceptionName name, NSString format) { - _lib._objc_msgSend_427(_lib._class_NSException1, _lib._sel_raise_format_1, - name._id, format._id); - } +late final _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.registerName( + "URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))( + arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)>(pointer, retain: retain, release: release); - static void raise_format_arguments_(NativeCupertinoHttp _lib, - DartNSExceptionName name, NSString format, va_list argList) { - _lib._objc_msgSend_525(_lib._class_NSException1, - _lib._sel_raise_format_arguments_1, name._id, format._id, argList); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - @override - NSException init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSException._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4, ffi.Pointer arg5) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true), + NSURLRequest.castFromPointer(arg4, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, retain: true, release: true))), + retain: false, + release: true); - static NSException new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_new1); - return NSException._(_ret, _lib, retain: false, release: true); + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSHTTPURLResponse.castFromPointer(arg3, + retain: false, release: true), + NSURLRequest.castFromPointer(arg4, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLRequest.castFromPointer(arg5, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_dmve6(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); } +} - static NSException allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSException1, _lib._sel_allocWithZone_1, zone); - return NSException._(_ret, _lib, retain: false, release: true); - } +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse, NSURLRequest, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSHTTPURLResponse, + NSURLRequest, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4, + ffi.Pointer arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer, + arg5.ref.pointer); +} + +late final _sel_URLSession_task_didReceiveChallenge_completionHandler_ = + objc.registerName("URLSession:task:didReceiveChallenge:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>(pointer, retain: retain, release: release); - static NSException alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSException1, _lib._sel_alloc1); - return NSException._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_fnPtrCallable, ptr.cast()), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLAuthenticationChallenge.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); + + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSURLAuthenticationChallenge.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionAuthChallengeDisposition_NSURLCredential + .castFromPointer(arg4, retain: false, release: true))); + final wrapper = _wrapListenerBlock_1nnj9ov(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)>)>(wrapper, + retain: false, release: true); } } -typedef NSUncaughtExceptionHandler - = ffi.NativeFunction exception)>; +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock + arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer, arg4.ref.pointer); +} + +void _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>>() + .asFunction)>()(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSInputStream_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSInputStream_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_ffiVoid_NSInputStream_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSInputStream_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline( + ffi.Pointer block, ffi.Pointer arg0) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSInputStream_listenerCallable = ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSInputStream_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSInputStream { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); -class NSAssertionHandler extends NSObject { - NSAssertionHandler._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSInputStream_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns a [NSAssertionHandler] that points to the same underlying object as [other]. - static NSAssertionHandler castFrom(T other) { - return NSAssertionHandler._(other._id, other._lib, - retain: true, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(objc.NSInputStream?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSInputStream_closureCallable, + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSInputStream.castFromPointer(arg0, + retain: true, release: true))), + retain: false, + release: true); - /// Returns a [NSAssertionHandler] that wraps the given raw object pointer. - static NSAssertionHandler castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSAssertionHandler._(other, lib, retain: retain, release: release); + /// 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. + static objc.ObjCBlock listener( + void Function(objc.NSInputStream?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSInputStream_listenerCallable.nativeFunction.cast(), + (ffi.Pointer arg0) => fn(arg0.address == 0 + ? null + : objc.NSInputStream.castFromPointer(arg0, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_ukcdfq(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); } +} - /// Returns whether [obj] is an instance of [NSAssertionHandler]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSAssertionHandler1); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSInputStream_CallExtension + on objc.ObjCBlock { + void call(objc.NSInputStream? arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0?.ref.pointer ?? ffi.nullptr); +} - static NSAssertionHandler getCurrentHandler(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_526( - _lib._class_NSAssertionHandler1, _lib._sel_currentHandler1); - return NSAssertionHandler._(_ret, _lib, retain: true, release: true); - } +late final _sel_URLSession_task_needNewBodyStream_ = + objc.registerName("URLSession:task:needNewBodyStream:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - void handleFailureInMethod_object_file_lineNumber_description_( - ffi.Pointer selector, - NSObject object, - NSString fileName, - DartNSInteger line, - NSString? format) { - _lib._objc_msgSend_527( - _id, - _lib._sel_handleFailureInMethod_object_file_lineNumber_description_1, - selector, - object._id, - fileName._id, - line, - format?._id ?? ffi.nullptr); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - void handleFailureInFunction_file_lineNumber_description_( - NSString functionName, - NSString fileName, - DartNSInteger line, - NSString? format) { - _lib._objc_msgSend_528( - _id, - _lib._sel_handleFailureInFunction_file_lineNumber_description_1, - functionName._id, - fileName._id, - line, - format?._id ?? ffi.nullptr); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - @override - NSAssertionHandler init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSAssertionHandler._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.ObjCBlock)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1wmulza(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} + +late final _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.registerName( + "URLSession:task:needNewBodyStreamFromOffset:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)>(pointer, retain: retain, release: release); - static NSAssertionHandler new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSAssertionHandler1, _lib._sel_new1); - return NSAssertionHandler._(_ret, _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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - static NSAssertionHandler allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSAssertionHandler1, _lib._sel_allocWithZone_1, zone); - return NSAssertionHandler._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + arg3, + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); - static NSAssertionHandler alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSAssertionHandler1, _lib._sel_alloc1); - return NSAssertionHandler._(_ret, _lib, retain: false, release: true); + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + ObjCBlock_ffiVoid_NSInputStream.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_qxeqyf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); } } -class NSBlockOperation extends NSOperation { - NSBlockOperation._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSBlockOperation] that points to the same underlying object as [other]. - static NSBlockOperation castFrom(T other) { - return NSBlockOperation._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [NSBlockOperation] that wraps the given raw object pointer. - static NSBlockOperation castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSBlockOperation._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [NSBlockOperation]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSBlockOperation1); - } - - static NSBlockOperation blockOperationWithBlock_( - NativeCupertinoHttp _lib, ObjCBlock_ffiVoid block) { - final _ret = _lib._objc_msgSend_529(_lib._class_NSBlockOperation1, - _lib._sel_blockOperationWithBlock_1, block._id); - return NSBlockOperation._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3, arg4.ref.pointer); +} + +late final _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.registerName( + "URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); - void addExecutionBlock_(ObjCBlock_ffiVoid block) { - _lib._objc_msgSend_415(_id, _lib._sel_addExecutionBlock_1, block._id); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - NSArray get executionBlocks { - final _ret = _lib._objc_msgSend_169(_id, _lib._sel_executionBlocks1); - return NSArray._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4, + arg5)), + retain: false, + release: true); - @override - NSBlockOperation init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSBlockOperation._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + ffi.Int64, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, int, + int, int) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4, + arg5)); + final wrapper = _wrapListenerBlock_jzggzf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + ffi.Int64, ffi.Int64, ffi.Int64)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(ref.pointer, arg0, arg1.ref.pointer, + arg2.ref.pointer, arg3, arg4, arg5); +} + +late final _sel_URLSession_task_didReceiveInformationalResponse_ = + objc.registerName("URLSession:task:didReceiveInformationalResponse:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSHTTPURLResponse)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSHTTPURLResponse)>(pointer, + retain: retain, release: release); - static NSBlockOperation new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSBlockOperation1, _lib._sel_new1); - return NSBlockOperation._(_ret, _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. + static objc + .ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSHTTPURLResponse)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - static NSBlockOperation allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSBlockOperation1, _lib._sel_allocWithZone_1, zone); - return NSBlockOperation._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSHTTPURLResponse) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSHTTPURLResponse.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - static NSBlockOperation alloc(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_NSBlockOperation1, _lib._sel_alloc1); - return NSBlockOperation._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSHTTPURLResponse.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSHTTPURLResponse)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -class NSInvocationOperation extends NSOperation { - NSInvocationOperation._(ffi.Pointer id, NativeCupertinoHttp lib, +/// NSURLSessionTaskMetrics +class NSURLSessionTaskMetrics extends objc.NSObject { + NSURLSessionTaskMetrics._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSInvocationOperation] that points to the same underlying object as [other]. - static NSInvocationOperation castFrom(T other) { - return NSInvocationOperation._(other._id, other._lib, - retain: true, release: true); - } + : super.castFromPointer(pointer, retain: retain, release: release); - /// Returns a [NSInvocationOperation] that wraps the given raw object pointer. - static NSInvocationOperation castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSInvocationOperation._(other, lib, - retain: retain, release: release); - } + /// Constructs a [NSURLSessionTaskMetrics] that points to the same underlying object as [other]. + NSURLSessionTaskMetrics.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - /// Returns whether [obj] is an instance of [NSInvocationOperation]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_NSInvocationOperation1); - } + /// Constructs a [NSURLSessionTaskMetrics] that wraps the given raw object pointer. + NSURLSessionTaskMetrics.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - NSInvocationOperation? initWithTarget_selector_object_( - NSObject target, ffi.Pointer sel, NSObject? arg) { - final _ret = _lib._objc_msgSend_530( - _id, - _lib._sel_initWithTarget_selector_object_1, - target._id, - sel, - arg?._id ?? ffi.nullptr); - return _ret.address == 0 - ? null - : NSInvocationOperation._(_ret, _lib, retain: true, release: true); + /// Returns whether [obj] is an instance of [NSURLSessionTaskMetrics]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSURLSessionTaskMetrics); } - NSInvocationOperation initWithInvocation_(NSInvocation inv) { + /// transactionMetrics array contains the metrics collected for every request/response transaction created during the task execution. + objc.ObjCObjectBase get transactionMetrics { final _ret = - _lib._objc_msgSend_531(_id, _lib._sel_initWithInvocation_1, inv._id); - return NSInvocationOperation._(_ret, _lib, retain: true, release: true); + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_transactionMetrics); + return objc.ObjCObjectBase(_ret, retain: true, release: true); } - NSInvocation get invocation { - final _ret = _lib._objc_msgSend_532(_id, _lib._sel_invocation1); - return NSInvocation._(_ret, _lib, retain: true, release: true); + /// Interval from the task creation time to the task completion time. + /// Task creation time is the time when the task was instantiated. + /// Task completion time is the time when the task is about to change its internal state to completed. + NSDateInterval get taskInterval { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_taskInterval); + return NSDateInterval.castFromPointer(_ret, retain: true, release: true); } - NSObject? get result { - final _ret = _lib._objc_msgSend_61(_id, _lib._sel_result1); - return _ret.address == 0 - ? null - : NSObject._(_ret, _lib, retain: true, release: true); + /// redirectCount is the number of redirects that were recorded. + DartNSUInteger get redirectCount { + return _objc_msgSend_eldhrq(this.ref.pointer, _sel_redirectCount); } - @override - NSInvocationOperation init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return NSInvocationOperation._(_ret, _lib, retain: true, release: true); + /// init + NSURLSessionTaskMetrics init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSURLSessionTaskMetrics.castFromPointer(_ret, + retain: false, release: true); } - static NSInvocationOperation new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSInvocationOperation1, _lib._sel_new1); - return NSInvocationOperation._(_ret, _lib, retain: false, release: true); + /// new + static NSURLSessionTaskMetrics new1() { + final _ret = + _objc_msgSend_1unuoxw(_class_NSURLSessionTaskMetrics, _sel_new); + return NSURLSessionTaskMetrics.castFromPointer(_ret, + retain: false, release: true); } - static NSInvocationOperation allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_NSInvocationOperation1, _lib._sel_allocWithZone_1, zone); - return NSInvocationOperation._(_ret, _lib, retain: false, release: true); + /// allocWithZone: + static NSURLSessionTaskMetrics allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = _objc_msgSend_1b3ihd0( + _class_NSURLSessionTaskMetrics, _sel_allocWithZone_, zone); + return NSURLSessionTaskMetrics.castFromPointer(_ret, + retain: false, release: true); } - static NSInvocationOperation alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_NSInvocationOperation1, _lib._sel_alloc1); - return NSInvocationOperation._(_ret, _lib, retain: false, release: true); + /// alloc + static NSURLSessionTaskMetrics alloc() { + final _ret = + _objc_msgSend_1unuoxw(_class_NSURLSessionTaskMetrics, _sel_alloc); + return NSURLSessionTaskMetrics.castFromPointer(_ret, + retain: false, release: true); } } -final class _Dart_Isolate extends ffi.Opaque {} - -final class _Dart_IsolateGroup extends ffi.Opaque {} - -final class _Dart_Handle extends ffi.Opaque {} - -final class _Dart_WeakPersistentHandle extends ffi.Opaque {} - -final class _Dart_FinalizableHandle extends ffi.Opaque {} - -typedef Dart_WeakPersistentHandle = ffi.Pointer<_Dart_WeakPersistentHandle>; - -/// These structs are versioned by DART_API_DL_MAJOR_VERSION, bump the -/// version when changing this struct. -typedef Dart_HandleFinalizer - = ffi.Pointer>; -typedef Dart_HandleFinalizerFunction = ffi.Void Function( - ffi.Pointer isolate_callback_data, ffi.Pointer peer); -typedef DartDart_HandleFinalizerFunction = void Function( - ffi.Pointer isolate_callback_data, ffi.Pointer peer); -typedef Dart_FinalizableHandle = ffi.Pointer<_Dart_FinalizableHandle>; - -final class Dart_IsolateFlags extends ffi.Struct { - @ffi.Int32() - external int version; - - @ffi.Bool() - external bool enable_asserts; - - @ffi.Bool() - external bool use_field_guards; - - @ffi.Bool() - external bool use_osr; - - @ffi.Bool() - external bool obfuscate; - - @ffi.Bool() - external bool load_vmservice_library; - - @ffi.Bool() - external bool copy_parent_code; - - @ffi.Bool() - external bool null_safety; - - @ffi.Bool() - external bool is_system_isolate; -} - -/// Forward declaration -final class Dart_CodeObserver extends ffi.Struct { - external ffi.Pointer data; - - external Dart_OnNewCodeCallback on_new_code; -} - -/// Callback provided by the embedder that is used by the VM to notify on code -/// object creation, *before* it is invoked the first time. -/// This is useful for embedders wanting to e.g. keep track of PCs beyond -/// the lifetime of the garbage collected code objects. -/// Note that an address range may be used by more than one code object over the -/// lifecycle of a process. Clients of this function should record timestamps for -/// these compilation events and when collecting PCs to disambiguate reused -/// address ranges. -typedef Dart_OnNewCodeCallback - = ffi.Pointer>; -typedef Dart_OnNewCodeCallbackFunction = ffi.Void Function( - ffi.Pointer observer, - ffi.Pointer name, - ffi.UintPtr base, - ffi.UintPtr size); -typedef DartDart_OnNewCodeCallbackFunction = void Function( - ffi.Pointer observer, - ffi.Pointer name, - int base, - int size); - -/// Describes how to initialize the VM. Used with Dart_Initialize. -/// -/// \param version Identifies the version of the struct used by the client. -/// should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION. -/// \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate -/// or NULL if no snapshot is provided. If provided, the buffer must remain -/// valid until Dart_Cleanup returns. -/// \param instructions_snapshot A buffer containing a snapshot of precompiled -/// instructions, or NULL if no snapshot is provided. If provided, the buffer -/// must remain valid until Dart_Cleanup returns. -/// \param initialize_isolate A function to be called during isolate -/// initialization inside an existing isolate group. -/// See Dart_InitializeIsolateCallback. -/// \param create_group A function to be called during isolate group creation. -/// See Dart_IsolateGroupCreateCallback. -/// \param shutdown A function to be called right before an isolate is shutdown. -/// See Dart_IsolateShutdownCallback. -/// \param cleanup A function to be called after an isolate was shutdown. -/// See Dart_IsolateCleanupCallback. -/// \param cleanup_group A function to be called after an isolate group is shutdown. -/// See Dart_IsolateGroupCleanupCallback. -/// \param get_service_assets A function to be called by the service isolate when -/// it requires the vmservice assets archive. -/// See Dart_GetVMServiceAssetsArchive. -/// \param code_observer An external code observer callback function. -/// The observer can be invoked as early as during the Dart_Initialize() call. -final class Dart_InitializeParams extends ffi.Struct { - @ffi.Int32() - external int version; - - external ffi.Pointer vm_snapshot_data; - - external ffi.Pointer vm_snapshot_instructions; - - external Dart_IsolateGroupCreateCallback create_group; - - external Dart_InitializeIsolateCallback initialize_isolate; - - external Dart_IsolateShutdownCallback shutdown_isolate; - - external Dart_IsolateCleanupCallback cleanup_isolate; - - external Dart_IsolateGroupCleanupCallback cleanup_group; - - external Dart_ThreadExitCallback thread_exit; - - external Dart_FileOpenCallback file_open; - - external Dart_FileReadCallback file_read; - - external Dart_FileWriteCallback file_write; - - external Dart_FileCloseCallback file_close; - - external Dart_EntropySource entropy_source; - - external Dart_GetVMServiceAssetsArchive get_service_assets; - - @ffi.Bool() - external bool start_kernel_isolate; - - external ffi.Pointer code_observer; -} - -/// An isolate creation and initialization callback function. -/// -/// This callback, provided by the embedder, is called when the VM -/// needs to create an isolate. The callback should create an isolate -/// by calling Dart_CreateIsolateGroup and load any scripts required for -/// execution. -/// -/// This callback may be called on a different thread than the one -/// running the parent isolate. -/// -/// When the function returns NULL, it is the responsibility of this -/// function to ensure that Dart_ShutdownIsolate has been called if -/// required (for example, if the isolate was created successfully by -/// Dart_CreateIsolateGroup() but the root library fails to load -/// successfully, then the function should call Dart_ShutdownIsolate -/// before returning). -/// -/// When the function returns NULL, the function should set *error to -/// a malloc-allocated buffer containing a useful error message. The -/// caller of this function (the VM) will make sure that the buffer is -/// freed. -/// -/// \param script_uri The uri of the main source file or snapshot to load. -/// Either the URI of the parent isolate set in Dart_CreateIsolateGroup for -/// Isolate.spawn, or the argument to Isolate.spawnUri canonicalized by the -/// library tag handler of the parent isolate. -/// The callback is responsible for loading the program by a call to -/// Dart_LoadScriptFromKernel. -/// \param main The name of the main entry point this isolate will -/// eventually run. This is provided for advisory purposes only to -/// improve debugging messages. The main function is not invoked by -/// this function. -/// \param package_root Ignored. -/// \param package_config Uri of the package configuration file (either in format -/// of .packages or .dart_tool/package_config.json) for this isolate -/// to resolve package imports against. If this parameter is not passed the -/// package resolution of the parent isolate should be used. -/// \param flags Default flags for this isolate being spawned. Either inherited -/// from the spawning isolate or passed as parameters when spawning the -/// isolate from Dart code. -/// \param isolate_data The isolate data which was passed to the -/// parent isolate when it was created by calling Dart_CreateIsolateGroup(). -/// \param error A structure into which the embedder can place a -/// C string containing an error message in the case of failures. -/// -/// \return The embedder returns NULL if the creation and -/// initialization was not successful and the isolate if successful. -typedef Dart_IsolateGroupCreateCallback - = ffi.Pointer>; -typedef Dart_IsolateGroupCreateCallbackFunction = Dart_Isolate Function( - ffi.Pointer script_uri, - ffi.Pointer main, - ffi.Pointer package_root, - ffi.Pointer package_config, - ffi.Pointer flags, - ffi.Pointer isolate_data, - ffi.Pointer> error); - -/// An isolate is the unit of concurrency in Dart. Each isolate has -/// its own memory and thread of control. No state is shared between -/// isolates. Instead, isolates communicate by message passing. -/// -/// Each thread keeps track of its current isolate, which is the -/// isolate which is ready to execute on the current thread. The -/// current isolate may be NULL, in which case no isolate is ready to -/// execute. Most of the Dart apis require there to be a current -/// isolate in order to function without error. The current isolate is -/// set by any call to Dart_CreateIsolateGroup or Dart_EnterIsolate. -typedef Dart_Isolate = ffi.Pointer<_Dart_Isolate>; - -/// An isolate initialization callback function. -/// -/// This callback, provided by the embedder, is called when the VM has created an -/// isolate within an existing isolate group (i.e. from the same source as an -/// existing isolate). -/// -/// The callback should setup native resolvers and might want to set a custom -/// message handler via [Dart_SetMessageNotifyCallback] and mark the isolate as -/// runnable. -/// -/// This callback may be called on a different thread than the one -/// running the parent isolate. -/// -/// When the function returns `false`, it is the responsibility of this -/// function to ensure that `Dart_ShutdownIsolate` has been called. -/// -/// When the function returns `false`, the function should set *error to -/// a malloc-allocated buffer containing a useful error message. The -/// caller of this function (the VM) will make sure that the buffer is -/// freed. -/// -/// \param child_isolate_data The callback data to associate with the new -/// child isolate. -/// \param error A structure into which the embedder can place a -/// C string containing an error message in the case the initialization fails. -/// -/// \return The embedder returns true if the initialization was successful and -/// false otherwise (in which case the VM will terminate the isolate). -typedef Dart_InitializeIsolateCallback - = ffi.Pointer>; -typedef Dart_InitializeIsolateCallbackFunction = ffi.Bool Function( - ffi.Pointer> child_isolate_data, - ffi.Pointer> error); -typedef DartDart_InitializeIsolateCallbackFunction = bool Function( - ffi.Pointer> child_isolate_data, - ffi.Pointer> error); - -/// An isolate shutdown callback function. -/// -/// This callback, provided by the embedder, is called before the vm -/// shuts down an isolate. The isolate being shutdown will be the current -/// isolate. It is safe to run Dart code. -/// -/// This function should be used to dispose of native resources that -/// are allocated to an isolate in order to avoid leaks. -/// -/// \param isolate_group_data The same callback data which was passed to the -/// isolate group when it was created. -/// \param isolate_data The same callback data which was passed to the isolate -/// when it was created. -typedef Dart_IsolateShutdownCallback - = ffi.Pointer>; -typedef Dart_IsolateShutdownCallbackFunction = ffi.Void Function( - ffi.Pointer isolate_group_data, - ffi.Pointer isolate_data); -typedef DartDart_IsolateShutdownCallbackFunction = void Function( - ffi.Pointer isolate_group_data, - ffi.Pointer isolate_data); - -/// An isolate cleanup callback function. -/// -/// This callback, provided by the embedder, is called after the vm -/// shuts down an isolate. There will be no current isolate and it is *not* -/// safe to run Dart code. -/// -/// This function should be used to dispose of native resources that -/// are allocated to an isolate in order to avoid leaks. -/// -/// \param isolate_group_data The same callback data which was passed to the -/// isolate group when it was created. -/// \param isolate_data The same callback data which was passed to the isolate -/// when it was created. -typedef Dart_IsolateCleanupCallback - = ffi.Pointer>; -typedef Dart_IsolateCleanupCallbackFunction = ffi.Void Function( - ffi.Pointer isolate_group_data, - ffi.Pointer isolate_data); -typedef DartDart_IsolateCleanupCallbackFunction = void Function( - ffi.Pointer isolate_group_data, - ffi.Pointer isolate_data); - -/// An isolate group cleanup callback function. -/// -/// This callback, provided by the embedder, is called after the vm -/// shuts down an isolate group. -/// -/// This function should be used to dispose of native resources that -/// are allocated to an isolate in order to avoid leaks. -/// -/// \param isolate_group_data The same callback data which was passed to the -/// isolate group when it was created. -typedef Dart_IsolateGroupCleanupCallback - = ffi.Pointer>; -typedef Dart_IsolateGroupCleanupCallbackFunction = ffi.Void Function( - ffi.Pointer isolate_group_data); -typedef DartDart_IsolateGroupCleanupCallbackFunction = void Function( - ffi.Pointer isolate_group_data); - -/// A thread death callback function. -/// This callback, provided by the embedder, is called before a thread in the -/// vm thread pool exits. -/// This function could be used to dispose of native resources that -/// are associated and attached to the thread, in order to avoid leaks. -typedef Dart_ThreadExitCallback - = ffi.Pointer>; -typedef Dart_ThreadExitCallbackFunction = ffi.Void Function(); -typedef DartDart_ThreadExitCallbackFunction = void Function(); - -/// Callbacks provided by the embedder for file operations. If the -/// embedder does not allow file operations these callbacks can be -/// NULL. -/// -/// Dart_FileOpenCallback - opens a file for reading or writing. -/// \param name The name of the file to open. -/// \param write A boolean variable which indicates if the file is to -/// opened for writing. If there is an existing file it needs to truncated. -/// -/// Dart_FileReadCallback - Read contents of file. -/// \param data Buffer allocated in the callback into which the contents -/// of the file are read into. It is the responsibility of the caller to -/// free this buffer. -/// \param file_length A variable into which the length of the file is returned. -/// In the case of an error this value would be -1. -/// \param stream Handle to the opened file. -/// -/// Dart_FileWriteCallback - Write data into file. -/// \param data Buffer which needs to be written into the file. -/// \param length Length of the buffer. -/// \param stream Handle to the opened file. -/// -/// Dart_FileCloseCallback - Closes the opened file. -/// \param stream Handle to the opened file. -typedef Dart_FileOpenCallback - = ffi.Pointer>; -typedef Dart_FileOpenCallbackFunction = ffi.Pointer Function( - ffi.Pointer name, ffi.Bool write); -typedef DartDart_FileOpenCallbackFunction = ffi.Pointer Function( - ffi.Pointer name, bool write); -typedef Dart_FileReadCallback - = ffi.Pointer>; -typedef Dart_FileReadCallbackFunction = ffi.Void Function( - ffi.Pointer> data, - ffi.Pointer file_length, - ffi.Pointer stream); -typedef DartDart_FileReadCallbackFunction = void Function( - ffi.Pointer> data, - ffi.Pointer file_length, - ffi.Pointer stream); -typedef Dart_FileWriteCallback - = ffi.Pointer>; -typedef Dart_FileWriteCallbackFunction = ffi.Void Function( - ffi.Pointer data, - ffi.IntPtr length, - ffi.Pointer stream); -typedef DartDart_FileWriteCallbackFunction = void Function( - ffi.Pointer data, int length, ffi.Pointer stream); -typedef Dart_FileCloseCallback - = ffi.Pointer>; -typedef Dart_FileCloseCallbackFunction = ffi.Void Function( - ffi.Pointer stream); -typedef DartDart_FileCloseCallbackFunction = void Function( - ffi.Pointer stream); -typedef Dart_EntropySource - = ffi.Pointer>; -typedef Dart_EntropySourceFunction = ffi.Bool Function( - ffi.Pointer buffer, ffi.IntPtr length); -typedef DartDart_EntropySourceFunction = bool Function( - ffi.Pointer buffer, int length); - -/// Callback provided by the embedder that is used by the vmservice isolate -/// to request the asset archive. The asset archive must be an uncompressed tar -/// archive that is stored in a Uint8List. -/// -/// If the embedder has no vmservice isolate assets, the callback can be NULL. -/// -/// \return The embedder must return a handle to a Uint8List containing an -/// uncompressed tar archive or null. -typedef Dart_GetVMServiceAssetsArchive - = ffi.Pointer>; -typedef Dart_GetVMServiceAssetsArchiveFunction = ffi.Handle Function(); -typedef DartDart_GetVMServiceAssetsArchiveFunction = Object Function(); -typedef Dart_IsolateGroup = ffi.Pointer<_Dart_IsolateGroup>; - -/// A message notification callback. -/// -/// This callback allows the embedder to provide an alternate wakeup -/// mechanism for the delivery of inter-isolate messages. It is the -/// responsibility of the embedder to call Dart_HandleMessage to -/// process the message. -typedef Dart_MessageNotifyCallback - = ffi.Pointer>; -typedef Dart_MessageNotifyCallbackFunction = ffi.Void Function( - Dart_Isolate dest_isolate); -typedef DartDart_MessageNotifyCallbackFunction = void Function( - Dart_Isolate dest_isolate); - -/// A port is used to send or receive inter-isolate messages -typedef Dart_Port = ffi.Int64; -typedef DartDart_Port = int; - -abstract class Dart_CoreType_Id { - static const int Dart_CoreType_Dynamic = 0; - static const int Dart_CoreType_Int = 1; - static const int Dart_CoreType_String = 2; -} - -/// ========== -/// Typed Data -/// ========== -abstract class Dart_TypedData_Type { - static const int Dart_TypedData_kByteData = 0; - static const int Dart_TypedData_kInt8 = 1; - static const int Dart_TypedData_kUint8 = 2; - static const int Dart_TypedData_kUint8Clamped = 3; - static const int Dart_TypedData_kInt16 = 4; - static const int Dart_TypedData_kUint16 = 5; - static const int Dart_TypedData_kInt32 = 6; - static const int Dart_TypedData_kUint32 = 7; - static const int Dart_TypedData_kInt64 = 8; - static const int Dart_TypedData_kUint64 = 9; - static const int Dart_TypedData_kFloat32 = 10; - static const int Dart_TypedData_kFloat64 = 11; - static const int Dart_TypedData_kInt32x4 = 12; - static const int Dart_TypedData_kFloat32x4 = 13; - static const int Dart_TypedData_kFloat64x2 = 14; - static const int Dart_TypedData_kInvalid = 15; -} - -final class _Dart_NativeArguments extends ffi.Opaque {} - -/// The arguments to a native function. -/// -/// This object is passed to a native function to represent its -/// arguments and return value. It allows access to the arguments to a -/// native function by index. It also allows the return value of a -/// native function to be set. -typedef Dart_NativeArguments = ffi.Pointer<_Dart_NativeArguments>; - -abstract class Dart_NativeArgument_Type { - static const int Dart_NativeArgument_kBool = 0; - static const int Dart_NativeArgument_kInt32 = 1; - static const int Dart_NativeArgument_kUint32 = 2; - static const int Dart_NativeArgument_kInt64 = 3; - static const int Dart_NativeArgument_kUint64 = 4; - static const int Dart_NativeArgument_kDouble = 5; - static const int Dart_NativeArgument_kString = 6; - static const int Dart_NativeArgument_kInstance = 7; - static const int Dart_NativeArgument_kNativeFields = 8; -} - -final class _Dart_NativeArgument_Descriptor extends ffi.Struct { - @ffi.Uint8() - external int type; - - @ffi.Uint8() - external int index; -} - -final class _Dart_NativeArgument_Value extends ffi.Opaque {} +late final _class_NSURLSessionTaskMetrics = + objc.getClass("NSURLSessionTaskMetrics"); +late final _sel_transactionMetrics = objc.registerName("transactionMetrics"); -typedef Dart_NativeArgument_Descriptor = _Dart_NativeArgument_Descriptor; -typedef Dart_NativeArgument_Value = _Dart_NativeArgument_Value; - -/// An environment lookup callback function. -/// -/// \param name The name of the value to lookup in the environment. -/// -/// \return A valid handle to a string if the name exists in the -/// current environment or Dart_Null() if not. -typedef Dart_EnvironmentCallback - = ffi.Pointer>; -typedef Dart_EnvironmentCallbackFunction = ffi.Handle Function(ffi.Handle name); -typedef DartDart_EnvironmentCallbackFunction = Object Function(Object name); - -/// Native entry resolution callback. -/// -/// For libraries and scripts which have native functions, the embedder -/// can provide a native entry resolver. This callback is used to map a -/// name/arity to a Dart_NativeFunction. If no function is found, the -/// callback should return NULL. -/// -/// The parameters to the native resolver function are: -/// \param name a Dart string which is the name of the native function. -/// \param num_of_arguments is the number of arguments expected by the -/// native function. -/// \param auto_setup_scope is a boolean flag that can be set by the resolver -/// to indicate if this function needs a Dart API scope (see Dart_EnterScope/ -/// Dart_ExitScope) to be setup automatically by the VM before calling into -/// the native function. By default most native functions would require this -/// to be true but some light weight native functions which do not call back -/// into the VM through the Dart API may not require a Dart scope to be -/// setup automatically. -/// -/// \return A valid Dart_NativeFunction which resolves to a native entry point -/// for the native function. -/// -/// See Dart_SetNativeResolver. -typedef Dart_NativeEntryResolver - = ffi.Pointer>; -typedef Dart_NativeEntryResolverFunction = Dart_NativeFunction Function( - ffi.Handle name, - ffi.Int num_of_arguments, - ffi.Pointer auto_setup_scope); -typedef DartDart_NativeEntryResolverFunction = Dart_NativeFunction Function( - Object name, int num_of_arguments, ffi.Pointer auto_setup_scope); - -/// A native function. -typedef Dart_NativeFunction - = ffi.Pointer>; -typedef Dart_NativeFunctionFunction = ffi.Void Function( - Dart_NativeArguments arguments); -typedef DartDart_NativeFunctionFunction = void Function( - Dart_NativeArguments arguments); - -/// Native entry symbol lookup callback. -/// -/// For libraries and scripts which have native functions, the embedder -/// can provide a callback for mapping a native entry to a symbol. This callback -/// maps a native function entry PC to the native function name. If no native -/// entry symbol can be found, the callback should return NULL. -/// -/// The parameters to the native reverse resolver function are: -/// \param nf A Dart_NativeFunction. -/// -/// \return A const UTF-8 string containing the symbol name or NULL. -/// -/// See Dart_SetNativeResolver. -typedef Dart_NativeEntrySymbol - = ffi.Pointer>; -typedef Dart_NativeEntrySymbolFunction = ffi.Pointer Function( - Dart_NativeFunction nf); - -/// FFI Native C function pointer resolver callback. -/// -/// See Dart_SetFfiNativeResolver. -typedef Dart_FfiNativeResolver - = ffi.Pointer>; -typedef Dart_FfiNativeResolverFunction = ffi.Pointer Function( - ffi.Pointer name, ffi.UintPtr args_n); -typedef DartDart_FfiNativeResolverFunction = ffi.Pointer Function( - ffi.Pointer name, int args_n); - -/// ===================== -/// Scripts and Libraries -/// ===================== -abstract class Dart_LibraryTag { - static const int Dart_kCanonicalizeUrl = 0; - static const int Dart_kImportTag = 1; - static const int Dart_kKernelTag = 2; -} - -/// The library tag handler is a multi-purpose callback provided by the -/// embedder to the Dart VM. The embedder implements the tag handler to -/// provide the ability to load Dart scripts and imports. -/// -/// -- TAGS -- -/// -/// Dart_kCanonicalizeUrl -/// -/// This tag indicates that the embedder should canonicalize 'url' with -/// respect to 'library'. For most embedders, the -/// Dart_DefaultCanonicalizeUrl function is a sufficient implementation -/// of this tag. The return value should be a string holding the -/// canonicalized url. -/// -/// Dart_kImportTag -/// -/// This tag is used to load a library from IsolateMirror.loadUri. The embedder -/// should call Dart_LoadLibraryFromKernel to provide the library to the VM. The -/// return value should be an error or library (the result from -/// Dart_LoadLibraryFromKernel). -/// -/// Dart_kKernelTag -/// -/// This tag is used to load the intermediate file (kernel) generated by -/// the Dart front end. This tag is typically used when a 'hot-reload' -/// of an application is needed and the VM is 'use dart front end' mode. -/// The dart front end typically compiles all the scripts, imports and part -/// files into one intermediate file hence we don't use the source/import or -/// script tags. The return value should be an error or a TypedData containing -/// the kernel bytes. -typedef Dart_LibraryTagHandler - = ffi.Pointer>; -typedef Dart_LibraryTagHandlerFunction = ffi.Handle Function( - ffi.Int32 tag, ffi.Handle library_or_package_map_url, ffi.Handle url); -typedef DartDart_LibraryTagHandlerFunction = Object Function( - int tag, Object library_or_package_map_url, Object url); - -/// Handles deferred loading requests. When this handler is invoked, it should -/// eventually load the deferred loading unit with the given id and call -/// Dart_DeferredLoadComplete or Dart_DeferredLoadCompleteError. It is -/// recommended that the loading occur asynchronously, but it is permitted to -/// call Dart_DeferredLoadComplete or Dart_DeferredLoadCompleteError before the -/// handler returns. -/// -/// If an error is returned, it will be propogated through -/// `prefix.loadLibrary()`. This is useful for synchronous -/// implementations, which must propogate any unwind errors from -/// Dart_DeferredLoadComplete or Dart_DeferredLoadComplete. Otherwise the handler -/// should return a non-error such as `Dart_Null()`. -typedef Dart_DeferredLoadHandler - = ffi.Pointer>; -typedef Dart_DeferredLoadHandlerFunction = ffi.Handle Function( - ffi.IntPtr loading_unit_id); -typedef DartDart_DeferredLoadHandlerFunction = Object Function( - int loading_unit_id); - -/// TODO(33433): Remove kernel service from the embedding API. -abstract class Dart_KernelCompilationStatus { - static const int Dart_KernelCompilationStatus_Unknown = -1; - static const int Dart_KernelCompilationStatus_Ok = 0; - static const int Dart_KernelCompilationStatus_Error = 1; - static const int Dart_KernelCompilationStatus_Crash = 2; - static const int Dart_KernelCompilationStatus_MsgFailed = 3; -} - -final class Dart_KernelCompilationResult extends ffi.Struct { - @ffi.Int32() - external int status; - - @ffi.Bool() - external bool null_safety; - - external ffi.Pointer error; - - external ffi.Pointer kernel; - - @ffi.IntPtr() - external int kernel_size; -} - -abstract class Dart_KernelCompilationVerbosityLevel { - static const int Dart_KernelCompilationVerbosityLevel_Error = 0; - static const int Dart_KernelCompilationVerbosityLevel_Warning = 1; - static const int Dart_KernelCompilationVerbosityLevel_Info = 2; - static const int Dart_KernelCompilationVerbosityLevel_All = 3; -} - -final class Dart_SourceFile extends ffi.Struct { - external ffi.Pointer uri; - - external ffi.Pointer source; -} - -typedef Dart_StreamingWriteCallback - = ffi.Pointer>; -typedef Dart_StreamingWriteCallbackFunction = ffi.Void Function( - ffi.Pointer callback_data, - ffi.Pointer buffer, - ffi.IntPtr size); -typedef DartDart_StreamingWriteCallbackFunction = void Function( - ffi.Pointer callback_data, - ffi.Pointer buffer, - int size); -typedef Dart_CreateLoadingUnitCallback - = ffi.Pointer>; -typedef Dart_CreateLoadingUnitCallbackFunction = ffi.Void Function( - ffi.Pointer callback_data, - ffi.IntPtr loading_unit_id, - ffi.Pointer> write_callback_data, - ffi.Pointer> write_debug_callback_data); -typedef DartDart_CreateLoadingUnitCallbackFunction = void Function( - ffi.Pointer callback_data, - int loading_unit_id, - ffi.Pointer> write_callback_data, - ffi.Pointer> write_debug_callback_data); -typedef Dart_StreamingCloseCallback - = ffi.Pointer>; -typedef Dart_StreamingCloseCallbackFunction = ffi.Void Function( - ffi.Pointer callback_data); -typedef DartDart_StreamingCloseCallbackFunction = void Function( - ffi.Pointer callback_data); - -/// A Dart_CObject is used for representing Dart objects as native C -/// data outside the Dart heap. These objects are totally detached from -/// the Dart heap. Only a subset of the Dart objects have a -/// representation as a Dart_CObject. -/// -/// The string encoding in the 'value.as_string' is UTF-8. -/// -/// All the different types from dart:typed_data are exposed as type -/// kTypedData. The specific type from dart:typed_data is in the type -/// field of the as_typed_data structure. The length in the -/// as_typed_data structure is always in bytes. -/// -/// The data for kTypedData is copied on message send and ownership remains with -/// the caller. The ownership of data for kExternalTyped is passed to the VM on -/// message send and returned when the VM invokes the -/// Dart_HandleFinalizer callback; a non-NULL callback must be provided. -abstract class Dart_CObject_Type { - static const int Dart_CObject_kNull = 0; - static const int Dart_CObject_kBool = 1; - static const int Dart_CObject_kInt32 = 2; - static const int Dart_CObject_kInt64 = 3; - static const int Dart_CObject_kDouble = 4; - static const int Dart_CObject_kString = 5; - static const int Dart_CObject_kArray = 6; - static const int Dart_CObject_kTypedData = 7; - static const int Dart_CObject_kExternalTypedData = 8; - static const int Dart_CObject_kSendPort = 9; - static const int Dart_CObject_kCapability = 10; - static const int Dart_CObject_kNativePointer = 11; - static const int Dart_CObject_kUnsupported = 12; - static const int Dart_CObject_kNumberOfTypes = 13; -} - -final class _Dart_CObject extends ffi.Struct { - @ffi.Int32() - external int type; - - external UnnamedUnion6 value; -} - -final class UnnamedUnion6 extends ffi.Union { - @ffi.Bool() - external bool as_bool; - - @ffi.Int32() - external int as_int32; - - @ffi.Int64() - external int as_int64; - - @ffi.Double() - external double as_double; - - external ffi.Pointer as_string; - - external UnnamedStruct5 as_send_port; - - external UnnamedStruct6 as_capability; - - external UnnamedStruct7 as_array; +/// NSDateInterval +class NSDateInterval extends objc.ObjCObjectBase { + NSDateInterval._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super(pointer, retain: retain, release: release); - external UnnamedStruct8 as_typed_data; + /// Constructs a [NSDateInterval] that points to the same underlying object as [other]. + NSDateInterval.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - external UnnamedStruct9 as_external_typed_data; + /// Constructs a [NSDateInterval] that wraps the given raw object pointer. + NSDateInterval.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - external UnnamedStruct10 as_native_pointer; + /// Returns whether [obj] is an instance of [NSDateInterval]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSDateInterval); + } } -final class UnnamedStruct5 extends ffi.Struct { - @Dart_Port() - external int id; - - @Dart_Port() - external int origin_id; -} +late final _class_NSDateInterval = objc.getClass("NSDateInterval"); +late final _sel_taskInterval = objc.registerName("taskInterval"); +late final _sel_redirectCount = objc.registerName("redirectCount"); +late final _sel_URLSession_task_didFinishCollectingMetrics_ = + objc.registerName("URLSession:task:didFinishCollectingMetrics:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)>(pointer, + retain: retain, release: release); -final class UnnamedStruct6 extends ffi.Struct { - @ffi.Int64() - external int id; -} + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, NSURLSessionTaskMetrics)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -final class UnnamedStruct7 extends ffi.Struct { - @ffi.IntPtr() - external int length; + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionTaskMetrics.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - external ffi.Pointer> values; + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionTaskMetrics.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + NSURLSessionTaskMetrics)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -final class UnnamedStruct8 extends ffi.Struct { - @ffi.Int32() - external int type; - - /// in elements, not bytes - @ffi.IntPtr() - external int length; +late final _sel_URLSession_task_didCompleteWithError_ = + objc.registerName("URLSession:task:didCompleteWithError:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionTask, + objc.NSError?)>(pointer, retain: retain, release: release); - external ffi.Pointer values; -} + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionTask, objc.NSError?)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -final class UnnamedStruct9 extends ffi.Struct { - @ffi.Int32() - external int type; + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, objc.NSError?) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionTask.castFromPointer(arg2, retain: true, release: true), + arg3.address == 0 ? null : objc.NSError.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - /// in elements, not bytes - @ffi.IntPtr() - external int length; + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionTask.castFromPointer(arg2, + retain: false, release: true), + arg3.address == 0 + ? null + : objc.NSError.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionTask, objc.NSError?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, NSURLSessionTask, + objc.NSError?)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); +} + +/// Messages related to the operation of a task that delivers data +/// directly to the delegate. +abstract final class NSURLSessionDataDelegate { + /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implement(builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_.implement( + builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_.implement( + builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implement( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_.implement( + builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionDataDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implementAsListener( + builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ + .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ + .implementAsListener(builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDataDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)? + URLSession_dataTask_didReceiveResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)? + URLSession_dataTask_didBecomeDownloadTask_, + void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)? + URLSession_dataTask_didBecomeStreamTask_, + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)? + URLSession_dataTask_didReceiveData_, + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)? + URLSession_dataTask_willCacheResponse_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, objc.ObjCBlock)? URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDataDelegate + .URLSession_dataTask_didReceiveResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_didReceiveResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeDownloadTask_ + .implementAsListener( + builder, URLSession_dataTask_didBecomeDownloadTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didBecomeStreamTask_ + .implementAsListener(builder, URLSession_dataTask_didBecomeStreamTask_); + NSURLSessionDataDelegate.URLSession_dataTask_didReceiveData_ + .implementAsListener(builder, URLSession_dataTask_didReceiveData_); + NSURLSessionDataDelegate + .URLSession_dataTask_willCacheResponse_completionHandler_ + .implementAsListener( + builder, URLSession_dataTask_willCacheResponse_completionHandler_); + NSURLSessionDataDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDataDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDataDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDataDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDataDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDataDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDataDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDataDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDataDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDataDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDataDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDataDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// The task has received a response and no further messages will be + /// received until the completion block is called. The disposition + /// allows you to cancel a request or to turn a data task into a + /// download task. This delegate message is optional - if you do not + /// implement it, you can get the response as a property of the task. + /// + /// This method will not be called for background upload tasks (which cannot be converted to download tasks). + static final URLSession_dataTask_didReceiveResponse_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock)>( + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveResponse_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a data task has become a download task. No + /// future messages will be sent to the data task. + static final URLSession_dataTask_didBecomeDownloadTask_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( + _sel_URLSession_dataTask_didBecomeDownloadTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeDownloadTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + func(arg1, arg2, arg3)), + ); + + /// Notification that a data task has become a bidirectional stream + /// task. No future messages will be sent to the data task. The newly + /// created streamTask will carry the original request and response as + /// properties. + /// + /// For requests that were pipelined, the stream object will only allow + /// reading, and the object will immediately issue a + /// -URLSession:writeClosedForStream:. Pipelining can be disabled for + /// all requests in a session, or by the NSURLRequest + /// HTTPShouldUsePipelining property. + /// + /// The underlying connection is no longer considered part of the HTTP + /// connection cache and won't count against the total number of + /// connections per host. + static final URLSession_dataTask_didBecomeStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( + _sel_URLSession_dataTask_didBecomeStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didBecomeStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when data is available for the delegate to consume. As the + /// data may be discontiguous, you should use + /// [NSData enumerateByteRangesUsingBlock:] to access it. + static final URLSession_dataTask_didReceiveData_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDataTask, objc.NSData)>( + _sel_URLSession_dataTask_didReceiveData_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_didReceiveData_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDataTask, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + func(arg1, arg2, arg3)), + ); + + /// Invoke the completion routine with a valid NSCachedURLResponse to + /// allow the resulting data to be cached, or pass nil to prevent + /// caching. Note that there is no guarantee that caching will be + /// attempted for a given resource, and you should not rely on this + /// message to receive the resource data. + static final URLSession_dataTask_willCacheResponse_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock)>( + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_dataTask_willCacheResponse_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDataDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionDataDelegate = + objc.getProtocol("NSURLSessionDataDelegate"); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline( + ffi.Pointer block, int arg0) => + block.ref.target + .cast>() + .asFunction()(arg0); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger)>( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline( + ffi.Pointer block, int arg0) => + (objc.getBlockClosure(block) as void Function(int))(arg0); +ffi.Pointer + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, NSInteger)>( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline( + ffi.Pointer block, int arg0) { + (objc.getBlockClosure(block) as void Function(int))(arg0); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, NSInteger)> + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, NSInteger)>.listener( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSURLSessionResponseDisposition { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock(pointer, + retain: retain, release: release); - external ffi.Pointer data; + /// 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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - external ffi.Pointer peer; + /// 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. + static objc.ObjCBlock fromFunction( + void Function(NSURLSessionResponseDisposition) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_closureCallable, + (int arg0) => + fn(NSURLSessionResponseDisposition.fromValue(arg0))), + retain: false, + release: true); - external Dart_HandleFinalizer callback; + /// 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. + static objc.ObjCBlock listener( + void Function(NSURLSessionResponseDisposition) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_listenerCallable + .nativeFunction + .cast(), + (int arg0) => fn(NSURLSessionResponseDisposition.fromValue(arg0))); + final wrapper = _wrapListenerBlock_ci81hw(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock(wrapper, + retain: false, release: true); + } } -final class UnnamedStruct10 extends ffi.Struct { - @ffi.IntPtr() - external int ptr; - - @ffi.IntPtr() - external int size; - - external Dart_HandleFinalizer callback; +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSURLSessionResponseDisposition_CallExtension + on objc.ObjCBlock { + void call(NSURLSessionResponseDisposition arg0) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, NSInteger arg0)>>() + .asFunction, int)>()( + ref.pointer, arg0.value); } -typedef Dart_CObject = _Dart_CObject; - -/// A native message handler. -/// -/// This handler is associated with a native port by calling -/// Dart_NewNativePort. -/// -/// The message received is decoded into the message structure. The -/// lifetime of the message data is controlled by the caller. All the -/// data references from the message are allocated by the caller and -/// will be reclaimed when returning to it. -typedef Dart_NativeMessageHandler - = ffi.Pointer>; -typedef Dart_NativeMessageHandlerFunction = ffi.Void Function( - Dart_Port dest_port_id, ffi.Pointer message); -typedef DartDart_NativeMessageHandlerFunction = void Function( - DartDart_Port dest_port_id, ffi.Pointer message); -typedef Dart_PostCObject_Type - = ffi.Pointer>; -typedef Dart_PostCObject_TypeFunction = ffi.Bool Function( - Dart_Port_DL port_id, ffi.Pointer message); -typedef DartDart_PostCObject_TypeFunction = bool Function( - DartDart_Port_DL port_id, ffi.Pointer message); - -/// ============================================================================ -/// IMPORTANT! Never update these signatures without properly updating -/// DART_API_DL_MAJOR_VERSION and DART_API_DL_MINOR_VERSION. -/// -/// Verbatim copy of `dart_native_api.h` and `dart_api.h` symbol names and types -/// to trigger compile-time errors if the sybols in those files are updated -/// without updating these. -/// -/// Function return and argument types, and typedefs are carbon copied. Structs -/// are typechecked nominally in C/C++, so they are not copied, instead a -/// comment is added to their definition. -typedef Dart_Port_DL = ffi.Int64; -typedef DartDart_Port_DL = int; -typedef Dart_PostInteger_Type - = ffi.Pointer>; -typedef Dart_PostInteger_TypeFunction = ffi.Bool Function( - Dart_Port_DL port_id, ffi.Int64 message); -typedef DartDart_PostInteger_TypeFunction = bool Function( - DartDart_Port_DL port_id, int message); -typedef Dart_NewNativePort_Type - = ffi.Pointer>; -typedef Dart_NewNativePort_TypeFunction = Dart_Port_DL Function( - ffi.Pointer name, - Dart_NativeMessageHandler_DL handler, - ffi.Bool handle_concurrently); -typedef DartDart_NewNativePort_TypeFunction = DartDart_Port_DL Function( - ffi.Pointer name, - Dart_NativeMessageHandler_DL handler, - bool handle_concurrently); -typedef Dart_NativeMessageHandler_DL - = ffi.Pointer>; -typedef Dart_NativeMessageHandler_DLFunction = ffi.Void Function( - Dart_Port_DL dest_port_id, ffi.Pointer message); -typedef DartDart_NativeMessageHandler_DLFunction = void Function( - DartDart_Port_DL dest_port_id, ffi.Pointer message); -typedef Dart_CloseNativePort_Type - = ffi.Pointer>; -typedef Dart_CloseNativePort_TypeFunction = ffi.Bool Function( - Dart_Port_DL native_port_id); -typedef DartDart_CloseNativePort_TypeFunction = bool Function( - DartDart_Port_DL native_port_id); -typedef Dart_IsError_Type - = ffi.Pointer>; -typedef Dart_IsError_TypeFunction = ffi.Bool Function(ffi.Handle handle); -typedef DartDart_IsError_TypeFunction = bool Function(Object handle); -typedef Dart_IsApiError_Type - = ffi.Pointer>; -typedef Dart_IsApiError_TypeFunction = ffi.Bool Function(ffi.Handle handle); -typedef DartDart_IsApiError_TypeFunction = bool Function(Object handle); -typedef Dart_IsUnhandledExceptionError_Type = ffi - .Pointer>; -typedef Dart_IsUnhandledExceptionError_TypeFunction = ffi.Bool Function( - ffi.Handle handle); -typedef DartDart_IsUnhandledExceptionError_TypeFunction = bool Function( - Object handle); -typedef Dart_IsCompilationError_Type - = ffi.Pointer>; -typedef Dart_IsCompilationError_TypeFunction = ffi.Bool Function( - ffi.Handle handle); -typedef DartDart_IsCompilationError_TypeFunction = bool Function(Object handle); -typedef Dart_IsFatalError_Type - = ffi.Pointer>; -typedef Dart_IsFatalError_TypeFunction = ffi.Bool Function(ffi.Handle handle); -typedef DartDart_IsFatalError_TypeFunction = bool Function(Object handle); -typedef Dart_GetError_Type - = ffi.Pointer>; -typedef Dart_GetError_TypeFunction = ffi.Pointer Function( - ffi.Handle handle); -typedef DartDart_GetError_TypeFunction = ffi.Pointer Function( - Object handle); -typedef Dart_ErrorHasException_Type - = ffi.Pointer>; -typedef Dart_ErrorHasException_TypeFunction = ffi.Bool Function( - ffi.Handle handle); -typedef DartDart_ErrorHasException_TypeFunction = bool Function(Object handle); -typedef Dart_ErrorGetException_Type - = ffi.Pointer>; -typedef Dart_ErrorGetException_TypeFunction = ffi.Handle Function( - ffi.Handle handle); -typedef DartDart_ErrorGetException_TypeFunction = Object Function( - Object handle); -typedef Dart_ErrorGetStackTrace_Type - = ffi.Pointer>; -typedef Dart_ErrorGetStackTrace_TypeFunction = ffi.Handle Function( - ffi.Handle handle); -typedef DartDart_ErrorGetStackTrace_TypeFunction = Object Function( - Object handle); -typedef Dart_NewApiError_Type - = ffi.Pointer>; -typedef Dart_NewApiError_TypeFunction = ffi.Handle Function( - ffi.Pointer error); -typedef DartDart_NewApiError_TypeFunction = Object Function( - ffi.Pointer error); -typedef Dart_NewCompilationError_Type - = ffi.Pointer>; -typedef Dart_NewCompilationError_TypeFunction = ffi.Handle Function( - ffi.Pointer error); -typedef DartDart_NewCompilationError_TypeFunction = Object Function( - ffi.Pointer error); -typedef Dart_NewUnhandledExceptionError_Type = ffi - .Pointer>; -typedef Dart_NewUnhandledExceptionError_TypeFunction = ffi.Handle Function( - ffi.Handle exception); -typedef DartDart_NewUnhandledExceptionError_TypeFunction = Object Function( - Object exception); -typedef Dart_PropagateError_Type - = ffi.Pointer>; -typedef Dart_PropagateError_TypeFunction = ffi.Void Function(ffi.Handle handle); -typedef DartDart_PropagateError_TypeFunction = void Function(Object handle); -typedef Dart_HandleFromPersistent_Type - = ffi.Pointer>; -typedef Dart_HandleFromPersistent_TypeFunction = ffi.Handle Function( - ffi.Handle object); -typedef DartDart_HandleFromPersistent_TypeFunction = Object Function( - Object object); -typedef Dart_HandleFromWeakPersistent_Type = ffi - .Pointer>; -typedef Dart_HandleFromWeakPersistent_TypeFunction = ffi.Handle Function( - Dart_WeakPersistentHandle object); -typedef DartDart_HandleFromWeakPersistent_TypeFunction = Object Function( - Dart_WeakPersistentHandle object); -typedef Dart_NewPersistentHandle_Type - = ffi.Pointer>; -typedef Dart_NewPersistentHandle_TypeFunction = ffi.Handle Function( - ffi.Handle object); -typedef DartDart_NewPersistentHandle_TypeFunction = Object Function( - Object object); -typedef Dart_SetPersistentHandle_Type - = ffi.Pointer>; -typedef Dart_SetPersistentHandle_TypeFunction = ffi.Void Function( - ffi.Handle obj1, ffi.Handle obj2); -typedef DartDart_SetPersistentHandle_TypeFunction = void Function( - Object obj1, Object obj2); -typedef Dart_DeletePersistentHandle_Type - = ffi.Pointer>; -typedef Dart_DeletePersistentHandle_TypeFunction = ffi.Void Function( - ffi.Handle object); -typedef DartDart_DeletePersistentHandle_TypeFunction = void Function( - Object object); -typedef Dart_NewWeakPersistentHandle_Type = ffi - .Pointer>; -typedef Dart_NewWeakPersistentHandle_TypeFunction - = Dart_WeakPersistentHandle Function( - ffi.Handle object, - ffi.Pointer peer, - ffi.IntPtr external_allocation_size, - Dart_HandleFinalizer callback); -typedef DartDart_NewWeakPersistentHandle_TypeFunction - = Dart_WeakPersistentHandle Function( - Object object, - ffi.Pointer peer, - int external_allocation_size, - Dart_HandleFinalizer callback); -typedef Dart_DeleteWeakPersistentHandle_Type = ffi - .Pointer>; -typedef Dart_DeleteWeakPersistentHandle_TypeFunction = ffi.Void Function( - Dart_WeakPersistentHandle object); -typedef DartDart_DeleteWeakPersistentHandle_TypeFunction = void Function( - Dart_WeakPersistentHandle object); -typedef Dart_UpdateExternalSize_Type - = ffi.Pointer>; -typedef Dart_UpdateExternalSize_TypeFunction = ffi.Void Function( - Dart_WeakPersistentHandle object, ffi.IntPtr external_allocation_size); -typedef DartDart_UpdateExternalSize_TypeFunction = void Function( - Dart_WeakPersistentHandle object, int external_allocation_size); -typedef Dart_NewFinalizableHandle_Type - = ffi.Pointer>; -typedef Dart_NewFinalizableHandle_TypeFunction - = Dart_FinalizableHandle Function( - ffi.Handle object, - ffi.Pointer peer, - ffi.IntPtr external_allocation_size, - Dart_HandleFinalizer callback); -typedef DartDart_NewFinalizableHandle_TypeFunction - = Dart_FinalizableHandle Function(Object object, ffi.Pointer peer, - int external_allocation_size, Dart_HandleFinalizer callback); -typedef Dart_DeleteFinalizableHandle_Type = ffi - .Pointer>; -typedef Dart_DeleteFinalizableHandle_TypeFunction = ffi.Void Function( - Dart_FinalizableHandle object, ffi.Handle strong_ref_to_object); -typedef DartDart_DeleteFinalizableHandle_TypeFunction = void Function( - Dart_FinalizableHandle object, Object strong_ref_to_object); -typedef Dart_UpdateFinalizableExternalSize_Type = ffi.Pointer< - ffi.NativeFunction>; -typedef Dart_UpdateFinalizableExternalSize_TypeFunction = ffi.Void Function( - Dart_FinalizableHandle object, - ffi.Handle strong_ref_to_object, - ffi.IntPtr external_allocation_size); -typedef DartDart_UpdateFinalizableExternalSize_TypeFunction = void Function( - Dart_FinalizableHandle object, - Object strong_ref_to_object, - int external_allocation_size); -typedef Dart_Post_Type - = ffi.Pointer>; -typedef Dart_Post_TypeFunction = ffi.Bool Function( - Dart_Port_DL port_id, ffi.Handle object); -typedef DartDart_Post_TypeFunction = bool Function( - DartDart_Port_DL port_id, Object object); -typedef Dart_NewSendPort_Type - = ffi.Pointer>; -typedef Dart_NewSendPort_TypeFunction = ffi.Handle Function( - Dart_Port_DL port_id); -typedef DartDart_NewSendPort_TypeFunction = Object Function( - DartDart_Port_DL port_id); -typedef Dart_SendPortGetId_Type - = ffi.Pointer>; -typedef Dart_SendPortGetId_TypeFunction = ffi.Handle Function( - ffi.Handle port, ffi.Pointer port_id); -typedef DartDart_SendPortGetId_TypeFunction = Object Function( - Object port, ffi.Pointer port_id); -typedef Dart_EnterScope_Type - = ffi.Pointer>; -typedef Dart_EnterScope_TypeFunction = ffi.Void Function(); -typedef DartDart_EnterScope_TypeFunction = void Function(); -typedef Dart_ExitScope_Type - = ffi.Pointer>; -typedef Dart_ExitScope_TypeFunction = ffi.Void Function(); -typedef DartDart_ExitScope_TypeFunction = void Function(); - -/// The type of message being sent to a Dart port. See CUPHTTPClientDelegate. -abstract class MessageType { - static const int ResponseMessage = 0; - static const int DataMessage = 1; - static const int CompletedMessage = 2; - static const int RedirectMessage = 3; - static const int FinishedDownloading = 4; - static const int WebSocketOpened = 5; - static const int WebSocketClosed = 6; -} - -/// The configuration associated with a NSURLSessionTask. -/// See CUPHTTPClientDelegate. -class CUPHTTPTaskConfiguration extends NSObject { - CUPHTTPTaskConfiguration._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [CUPHTTPTaskConfiguration] that points to the same underlying object as [other]. - static CUPHTTPTaskConfiguration castFrom(T other) { - return CUPHTTPTaskConfiguration._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [CUPHTTPTaskConfiguration] that wraps the given raw object pointer. - static CUPHTTPTaskConfiguration castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPTaskConfiguration._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [CUPHTTPTaskConfiguration]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPTaskConfiguration1); - } - - NSObject initWithPort_(DartDart_Port sendPort) { - final _ret = - _lib._objc_msgSend_533(_id, _lib._sel_initWithPort_1, sendPort); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - DartDart_Port get sendPort { - return _lib._objc_msgSend_383(_id, _lib._sel_sendPort1); - } - - @override - CUPHTTPTaskConfiguration init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPTaskConfiguration._(_ret, _lib, retain: true, release: true); - } - - static CUPHTTPTaskConfiguration new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPTaskConfiguration1, _lib._sel_new1); - return CUPHTTPTaskConfiguration._(_ret, _lib, retain: false, release: true); - } - - static CUPHTTPTaskConfiguration allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPTaskConfiguration1, _lib._sel_allocWithZone_1, zone); - return CUPHTTPTaskConfiguration._(_ret, _lib, retain: false, release: true); - } +late final _sel_URLSession_dataTask_didReceiveResponse_completionHandler_ = objc + .registerName("URLSession:dataTask:didReceiveResponse:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>(pointer, retain: retain, release: release); - static CUPHTTPTaskConfiguration alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPTaskConfiguration1, _lib._sel_alloc1); - return CUPHTTPTaskConfiguration._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_fnPtrCallable, ptr.cast()), + retain: false, + release: true); -/// A delegate for NSURLSession that forwards events for registered -/// NSURLSessionTasks and forwards them to a port for consumption in Dart. -/// -/// The messages sent to the port are contained in a List with one of 3 -/// possible formats: -/// -/// 1. When the delegate receives a HTTP redirect response: -/// [MessageType::RedirectMessage, ] -/// -/// 2. When the delegate receives a HTTP response: -/// [MessageType::ResponseMessage, ] -/// -/// 3. When the delegate receives some HTTP data: -/// [MessageType::DataMessage, ] -/// -/// 4. When the delegate is informed that the response is complete: -/// [MessageType::CompletedMessage, ] -class CUPHTTPClientDelegate extends NSObject { - CUPHTTPClientDelegate._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLResponse.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); - /// Returns a [CUPHTTPClientDelegate] that points to the same underlying object as [other]. - static CUPHTTPClientDelegate castFrom(T other) { - return CUPHTTPClientDelegate._(other._id, other._lib, - retain: true, release: true); + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLResponse, objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLResponse.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSURLSessionResponseDisposition + .castFromPointer(arg4, retain: false, release: true))); + final wrapper = _wrapListenerBlock_1nnj9ov(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)>(wrapper, + retain: false, release: true); } +} - /// Returns a [CUPHTTPClientDelegate] that wraps the given raw object pointer. - static CUPHTTPClientDelegate castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPClientDelegate._(other, lib, - retain: retain, release: release); - } +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLResponse, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLResponse_ffiVoidNSURLSessionResponseDisposition_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLResponse, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSURLResponse arg3, + objc.ObjCBlock arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +late final _sel_URLSession_dataTask_didBecomeDownloadTask_ = + objc.registerName("URLSession:dataTask:didBecomeDownloadTask:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)>(pointer, + retain: retain, release: release); - /// Returns whether [obj] is an instance of [CUPHTTPClientDelegate]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPClientDelegate1); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Instruct the delegate to forward events for the given task to the port - /// specified in the configuration. - void registerTask_withConfiguration_( - NSURLSessionTask task, CUPHTTPTaskConfiguration config) { - _lib._objc_msgSend_534( - _id, _lib._sel_registerTask_withConfiguration_1, task._id, config._id); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - @override - CUPHTTPClientDelegate init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPClientDelegate._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLSessionDownloadTask) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLSessionDownloadTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionDownloadTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionDownloadTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionDownloadTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionDownloadTask arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} - static CUPHTTPClientDelegate new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPClientDelegate1, _lib._sel_new1); - return CUPHTTPClientDelegate._(_ret, _lib, retain: false, release: true); - } +late final _sel_URLSession_dataTask_didBecomeStreamTask_ = + objc.registerName("URLSession:dataTask:didBecomeStreamTask:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)>(pointer, + retain: retain, release: release); - static CUPHTTPClientDelegate allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPClientDelegate1, _lib._sel_allocWithZone_1, zone); - return CUPHTTPClientDelegate._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static CUPHTTPClientDelegate alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPClientDelegate1, _lib._sel_alloc1); - return CUPHTTPClientDelegate._(_ret, _lib, retain: false, release: true); - } -} + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSURLSessionStreamTask.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); -/// An object used to communicate redirect information to Dart code. -/// -/// The flow is: -/// 1. CUPHTTPClientDelegate receives a message from the URL Loading System. -/// 2. CUPHTTPClientDelegate creates a new CUPHTTPForwardedDelegate subclass. -/// 3. CUPHTTPClientDelegate sends the CUPHTTPForwardedDelegate to the -/// configured Dart_Port. -/// 4. CUPHTTPClientDelegate waits on CUPHTTPForwardedDelegate.lock -/// 5. When the Dart code is done process the message received on the port, -/// it calls [CUPHTTPForwardedDelegate finish*], which releases the lock. -/// 6. CUPHTTPClientDelegate continues running. -class CUPHTTPForwardedDelegate extends NSObject { - CUPHTTPForwardedDelegate._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + NSURLSessionStreamTask) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSURLSessionStreamTask.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSURLSessionStreamTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSURLSessionStreamTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSURLSessionStreamTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, NSURLSessionStreamTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, NSURLSessionStreamTask arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} - /// Returns a [CUPHTTPForwardedDelegate] that points to the same underlying object as [other]. - static CUPHTTPForwardedDelegate castFrom(T other) { - return CUPHTTPForwardedDelegate._(other._id, other._lib, - retain: true, release: true); - } +late final _sel_URLSession_dataTask_didReceiveData_ = + objc.registerName("URLSession:dataTask:didReceiveData:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + objc.NSData)>(pointer, retain: retain, release: release); - /// Returns a [CUPHTTPForwardedDelegate] that wraps the given raw object pointer. - static CUPHTTPForwardedDelegate castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedDelegate._(other, lib, - retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns whether [obj] is an instance of [CUPHTTPForwardedDelegate]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedDelegate1); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, objc.NSData) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + objc.NSData.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - NSObject initWithSession_task_(NSURLSession session, NSURLSessionTask task) { - final _ret = _lib._objc_msgSend_535( - _id, _lib._sel_initWithSession_task_1, session._id, task._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, + objc.NSData) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSData.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + objc.NSData)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, objc.NSData)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSData_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDataTask, objc.NSData)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDataTask arg2, objc.NSData arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); +} - /// Indicates that the task should continue executing using the given request. - void finish() { - _lib._objc_msgSend_1(_id, _lib._sel_finish1); - } +late final _sel_URLSession_dataTask_willCacheResponse_completionHandler_ = objc + .registerName("URLSession:dataTask:willCacheResponse:completionHandler:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>(pointer, retain: retain, release: release); - NSURLSession get session { - final _ret = _lib._objc_msgSend_438(_id, _lib._sel_session1); - return NSURLSession._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - NSURLSessionTask get task { - final _ret = _lib._objc_msgSend_536(_id, _lib._sel_task1); - return NSURLSessionTask._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDataTask.castFromPointer(arg2, retain: true, release: true), + NSCachedURLResponse.castFromPointer(arg3, retain: true, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); - /// This property is meant to be used only by CUPHTTPClientDelegate. - NSLock get lock { - final _ret = _lib._objc_msgSend_537(_id, _lib._sel_lock1); - return NSLock._(_ret, _lib, retain: true, release: true); + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> listener( + void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDataTask.castFromPointer(arg2, + retain: false, release: true), + NSCachedURLResponse.castFromPointer(arg3, + retain: false, release: true), + ObjCBlock_ffiVoid_NSCachedURLResponse.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1nnj9ov(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)>( + wrapper, + retain: false, + release: true); } +} - @override - CUPHTTPForwardedDelegate init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedDelegate._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDataTask, NSCachedURLResponse, objc.ObjCBlock)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDataTask_NSCachedURLResponse_ffiVoidNSCachedURLResponse_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDataTask, + NSCachedURLResponse, + objc.ObjCBlock)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionDataTask arg2, + NSCachedURLResponse arg3, + objc.ObjCBlock arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +/// Messages related to the operation of a task that writes data to a +/// file and notifies the delegate upon completion. +abstract final class NSURLSessionDownloadDelegate { + /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implement(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implement(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implement(builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implement(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implement(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionDownloadDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implementAsListener( + builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implementAsListener(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implementAsListener(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionDownloadDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + URLSession_downloadTask_didFinishDownloadingToURL_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)? + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)? + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didFinishDownloadingToURL_ + .implementAsListener( + builder, URLSession_downloadTask_didFinishDownloadingToURL_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ + .implementAsListener(builder, + URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_); + NSURLSessionDownloadDelegate + .URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ + .implementAsListener(builder, + URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_); + NSURLSessionDownloadDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionDownloadDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionDownloadDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionDownloadDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionDownloadDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionDownloadDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionDownloadDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionDownloadDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionDownloadDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionDownloadDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionDownloadDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Sent when a download task that has completed a download. The delegate should + /// copy or move the file at the given location to a new location as it will be + /// removed when the delegate message returns. URLSession:task:didCompleteWithError: will + /// still be called. + static final URLSession_downloadTask_didFinishDownloadingToURL_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didFinishDownloadingToURL_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionDownloadTask, objc.NSURL) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent periodically to notify the delegate of download progress. + static final URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int)>( + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int, int) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionDownloadTask arg2, + int arg3, + int arg4, + int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent when a download has been resumed. If a download failed with an + /// error, the -userInfo dictionary of the error will contain an + /// NSURLSessionDownloadTaskResumeData key, whose value is the resume + /// data. + static final URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionDownloadTask, int, int)>( + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionDownloadTask, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionDownloadDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionDownloadDelegate = + objc.getProtocol("NSURLSessionDownloadDelegate"); +late final _sel_URLSession_downloadTask_didFinishDownloadingToURL_ = + objc.registerName("URLSession:downloadTask:didFinishDownloadingToURL:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(pointer, retain: retain, release: release); - static CUPHTTPForwardedDelegate new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedDelegate1, _lib._sel_new1); - return CUPHTTPForwardedDelegate._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static CUPHTTPForwardedDelegate allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedDelegate1, _lib._sel_allocWithZone_1, zone); - return CUPHTTPForwardedDelegate._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + objc.NSURL.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - static CUPHTTPForwardedDelegate alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedDelegate1, _lib._sel_alloc1); - return CUPHTTPForwardedDelegate._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSURL + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, objc.NSURL arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3.ref.pointer); } -class NSLock extends _ObjCWrapper { - NSLock._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [NSLock] that points to the same underlying object as [other]. - static NSLock castFrom(T other) { - return NSLock._(other._id, other._lib, retain: true, release: true); - } +late final _sel_URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_ = + objc.registerName( + "URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int))(arg0, arg1, arg2, arg3, arg4, arg5); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); - /// Returns a [NSLock] that wraps the given raw object pointer. - static NSLock castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return NSLock._(other, lib, retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)> fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4, ffi.Int64 arg5)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns whether [obj] is an instance of [NSLock]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0( - obj._id, obj._lib._sel_isKindOfClass_1, obj._lib._class_NSLock1); - } -} + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4, + arg5)), + retain: false, + release: true); -class CUPHTTPForwardedRedirect extends CUPHTTPForwardedDelegate { - CUPHTTPForwardedRedirect._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, int, int, int) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4, + int arg5) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4, + arg5)); + final wrapper = _wrapListenerBlock_jzggzf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_Int64_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64, ffi.Int64)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4, int arg5) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4, + ffi.Int64 arg5)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int, + int)>()(ref.pointer, arg0, arg1.ref.pointer, + arg2.ref.pointer, arg3, arg4, arg5); +} + +late final _sel_URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_ = + objc.registerName( + "URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int)>()(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + int arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Int64, + ffi.Int64)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64 { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64)>(pointer, retain: retain, release: release); - /// Returns a [CUPHTTPForwardedRedirect] that points to the same underlying object as [other]. - static CUPHTTPForwardedRedirect castFrom(T other) { - return CUPHTTPForwardedRedirect._(other._id, other._lib, - retain: true, 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Int64 arg3, ffi.Int64 arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns a [CUPHTTPForwardedRedirect] that wraps the given raw object pointer. - static CUPHTTPForwardedRedirect castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedRedirect._(other, lib, - retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionDownloadTask, int, int) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, int arg3, int arg4) => fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4)), + retain: false, + release: true); - /// Returns whether [obj] is an instance of [CUPHTTPForwardedRedirect]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedRedirect1); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, int, int) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2, int arg3, int arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4)); + final wrapper = _wrapListenerBlock_1wl7fts(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionDownloadTask, + ffi.Int64, + ffi.Int64)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionDownloadTask_Int64_Int64_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, ffi.Int64, ffi.Int64)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionDownloadTask arg2, int arg3, int arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Int64 arg3, + ffi.Int64 arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + int)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3, arg4); +} + +/// NSURLSessionStreamDelegate +abstract final class NSURLSessionStreamDelegate { + /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( + builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( + builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implement( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_.implement( + builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_.implement( + builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implement(builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implement( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_.implement( + builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_.implement( + builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionStreamDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ + .implementAsListener(builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ + .implementAsListener(builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implementAsListener( + builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implementAsListener( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionStreamDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_readClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_writeClosedForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask)? + URLSession_betterRouteDiscoveredForStreamTask_, + void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)? + URLSession_streamTask_didBecomeInputStream_outputStream_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionStreamDelegate.URLSession_readClosedForStreamTask_ + .implementAsListener(builder, URLSession_readClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_writeClosedForStreamTask_ + .implementAsListener(builder, URLSession_writeClosedForStreamTask_); + NSURLSessionStreamDelegate.URLSession_betterRouteDiscoveredForStreamTask_ + .implementAsListener( + builder, URLSession_betterRouteDiscoveredForStreamTask_); + NSURLSessionStreamDelegate + .URLSession_streamTask_didBecomeInputStream_outputStream_ + .implementAsListener( + builder, URLSession_streamTask_didBecomeInputStream_outputStream_); + NSURLSessionStreamDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionStreamDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionStreamDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionStreamDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionStreamDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionStreamDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionStreamDelegate.URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionStreamDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionStreamDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionStreamDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionStreamDelegate.URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionStreamDelegate.URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Indicates that the read side of a connection has been closed. Any + /// outstanding reads complete, but future reads will immediately fail. + /// This may be sent even when no reads are in progress. However, when + /// this delegate message is received, there may still be bytes + /// available. You only know that no more bytes are available when you + /// are able to read until EOF. + static final URLSession_readClosedForStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask)>( + _sel_URLSession_readClosedForStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_readClosedForStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + ); + + /// Indicates that the write side of a connection has been closed. + /// Any outstanding writes complete, but future writes will immediately + /// fail. + static final URLSession_writeClosedForStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask)>( + _sel_URLSession_writeClosedForStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_writeClosedForStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + ); + + /// A notification that the system has determined that a better route + /// to the host has been detected (eg, a wi-fi interface becoming + /// available.) This is a hint to the delegate that it may be + /// desirable to create a new task for subsequent work. Note that + /// there is no guarantee that the future task will be able to connect + /// to the host, so callers should should be prepared for failure of + /// reads and writes over any new interface. + static final URLSession_betterRouteDiscoveredForStreamTask_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask)>( + _sel_URLSession_betterRouteDiscoveredForStreamTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_betterRouteDiscoveredForStreamTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionStreamTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + func(arg1, arg2)), + ); + + /// The given task has been completed, and unopened NSInputStream and + /// NSOutputStream objects are created from the underlying network + /// connection. This will only be invoked after all enqueued IO has + /// completed (including any necessary handshakes.) The streamTask + /// will not receive any further delegate messages. + static final URLSession_streamTask_didBecomeInputStream_outputStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionStreamTask, + objc.NSInputStream, objc.NSOutputStream)>( + _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_streamTask_didBecomeInputStream_outputStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, + objc.NSOutputStream) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionStreamTask arg2, + objc.NSInputStream arg3, + objc.NSOutputStream arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, + objc.NSOutputStream) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionStreamTask arg2, + objc.NSInputStream arg3, + objc.NSOutputStream arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionStreamDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionStreamDelegate = + objc.getProtocol("NSURLSessionStreamDelegate"); +late final _sel_URLSession_readClosedForStreamTask_ = + objc.registerName("URLSession:readClosedForStreamTask:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask)>(pointer, + retain: retain, release: release); - NSObject initWithSession_task_response_request_(NSURLSession session, - NSURLSessionTask task, NSHTTPURLResponse response, NSURLRequest request) { - final _ret = _lib._objc_msgSend_538( - _id, - _lib._sel_initWithSession_task_response_request_1, - session._id, - task._id, - response._id, - request._id); - return NSObject._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Indicates that the task should continue executing using the given request. - /// If the request is NIL then the redirect is not followed and the task is - /// complete. - void finishWithRequest_(NSURLRequest? request) { - _lib._objc_msgSend_539( - _id, _lib._sel_finishWithRequest_1, request?._id ?? ffi.nullptr); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)> + fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - NSHTTPURLResponse get response { - final _ret = _lib._objc_msgSend_540(_id, _lib._sel_response1); - return NSHTTPURLResponse._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_tm2na8(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, NSURLSession, NSURLSessionStreamTask)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionStreamTask arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); +} + +late final _sel_URLSession_writeClosedForStreamTask_ = + objc.registerName("URLSession:writeClosedForStreamTask:"); +late final _sel_URLSession_betterRouteDiscoveredForStreamTask_ = + objc.registerName("URLSession:betterRouteDiscoveredForStreamTask:"); +late final _sel_URLSession_streamTask_didBecomeInputStream_outputStream_ = objc + .registerName("URLSession:streamTask:didBecomeInputStream:outputStream:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)>(pointer, retain: retain, release: release); - NSURLRequest get request { - final _ret = _lib._objc_msgSend_489(_id, _lib._sel_request1); - return NSURLRequest._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// This property is meant to be used only by CUPHTTPClientDelegate. - NSURLRequest get redirectRequest { - final _ret = _lib._objc_msgSend_489(_id, _lib._sel_redirectRequest1); - return NSURLRequest._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, retain: true, release: true), + objc.NSInputStream.castFromPointer(arg3, retain: true, release: true), + objc.NSOutputStream.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); - @override - CUPHTTPForwardedRedirect init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedRedirect._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)> listener( + void Function(ffi.Pointer, NSURLSession, NSURLSessionStreamTask, + objc.NSInputStream, objc.NSOutputStream) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionStreamTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSInputStream.castFromPointer(arg3, + retain: false, release: true), + objc.NSOutputStream.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_no6pyg(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionStreamTask, + objc.NSInputStream, + objc.NSOutputStream)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionStreamTask_NSInputStream_NSOutputStream_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionStreamTask, objc.NSInputStream, objc.NSOutputStream)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionStreamTask arg2, + objc.NSInputStream arg3, + objc.NSOutputStream arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer, + arg4.ref.pointer); +} + +/// NSURLSessionWebSocketDelegate +abstract final class NSURLSessionWebSocketDelegate { + /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implement(builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implement(builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implement( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implement(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implement(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implement(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implement( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_.implement( + builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implement(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implement(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implement(builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implement(builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implement(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implement(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implement(builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implement(builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Builds an object that implements the NSURLSessionWebSocketDelegate protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implementAsListener( + builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implementAsListener( + builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + return builder.build(); + } + + /// Adds the implementation of the NSURLSessionWebSocketDelegate protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)? + URLSession_webSocketTask_didOpenWithProtocol_, + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?)? + URLSession_webSocketTask_didCloseWithCode_reason_, + void Function(NSURLSession, NSURLSessionTask)? URLSession_didCreateTask_, + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)? + URLSession_task_willBeginDelayedRequest_completionHandler_, + void Function(NSURLSession, NSURLSessionTask)? + URLSession_taskIsWaitingForConnectivity_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)? + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)? + URLSession_task_didReceiveChallenge_completionHandler_, + void Function( + NSURLSession, NSURLSessionTask, objc.ObjCBlock)? + URLSession_task_needNewBodyStream_, + void Function(NSURLSession, NSURLSessionTask, int, objc.ObjCBlock)? URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + void Function(NSURLSession, NSURLSessionTask, int, int, int)? URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)? URLSession_task_didReceiveInformationalResponse_, + void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)? URLSession_task_didFinishCollectingMetrics_, + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)? URLSession_task_didCompleteWithError_, + void Function(NSURLSession, objc.NSError?)? URLSession_didBecomeInvalidWithError_, + void Function(NSURLSession, NSURLAuthenticationChallenge, objc.ObjCBlock)? URLSession_didReceiveChallenge_completionHandler_, + void Function(NSURLSession)? URLSessionDidFinishEventsForBackgroundURLSession_}) { + NSURLSessionWebSocketDelegate.URLSession_webSocketTask_didOpenWithProtocol_ + .implementAsListener( + builder, URLSession_webSocketTask_didOpenWithProtocol_); + NSURLSessionWebSocketDelegate + .URLSession_webSocketTask_didCloseWithCode_reason_ + .implementAsListener( + builder, URLSession_webSocketTask_didCloseWithCode_reason_); + NSURLSessionWebSocketDelegate.URLSession_didCreateTask_.implementAsListener( + builder, URLSession_didCreateTask_); + NSURLSessionWebSocketDelegate + .URLSession_task_willBeginDelayedRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willBeginDelayedRequest_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_taskIsWaitingForConnectivity_ + .implementAsListener(builder, URLSession_taskIsWaitingForConnectivity_); + NSURLSessionWebSocketDelegate + .URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ + .implementAsListener(builder, + URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_task_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate.URLSession_task_needNewBodyStream_ + .implementAsListener(builder, URLSession_task_needNewBodyStream_); + NSURLSessionWebSocketDelegate + .URLSession_task_needNewBodyStreamFromOffset_completionHandler_ + .implementAsListener(builder, + URLSession_task_needNewBodyStreamFromOffset_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ + .implementAsListener(builder, + URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_); + NSURLSessionWebSocketDelegate + .URLSession_task_didReceiveInformationalResponse_ + .implementAsListener( + builder, URLSession_task_didReceiveInformationalResponse_); + NSURLSessionWebSocketDelegate.URLSession_task_didFinishCollectingMetrics_ + .implementAsListener( + builder, URLSession_task_didFinishCollectingMetrics_); + NSURLSessionWebSocketDelegate.URLSession_task_didCompleteWithError_ + .implementAsListener(builder, URLSession_task_didCompleteWithError_); + NSURLSessionWebSocketDelegate.URLSession_didBecomeInvalidWithError_ + .implementAsListener(builder, URLSession_didBecomeInvalidWithError_); + NSURLSessionWebSocketDelegate + .URLSession_didReceiveChallenge_completionHandler_ + .implementAsListener( + builder, URLSession_didReceiveChallenge_completionHandler_); + NSURLSessionWebSocketDelegate + .URLSessionDidFinishEventsForBackgroundURLSession_ + .implementAsListener( + builder, URLSessionDidFinishEventsForBackgroundURLSession_); + } + + /// Indicates that the WebSocket handshake was successful and the connection has been upgraded to webSockets. + /// It will also provide the protocol that is picked in the handshake. If the handshake fails, this delegate will not be invoked. + static final URLSession_webSocketTask_didOpenWithProtocol_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( + _sel_URLSession_webSocketTask_didOpenWithProtocol_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_webSocketTask_didOpenWithProtocol_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => + func(arg1, arg2, arg3)), + ); + + /// Indicates that the WebSocket has received a close frame from the server endpoint. + /// The close code and the close reason may be provided by the delegate if the server elects to send + /// this information in the close frame + static final URLSession_webSocketTask_didCloseWithCode_reason_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, + objc.NSData?)>( + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_webSocketTask_didCloseWithCode_reason_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, + objc.NSData?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, + objc.NSData?) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Notification that a task has been created. This method is the first message + /// a task sends, providing a place to configure the task before it is resumed. + /// + /// This delegate callback is *NOT* dispatched to the delegate queue. It is + /// invoked synchronously before the task creation method returns. + static final URLSession_didCreateTask_ = objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_didCreateTask_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didCreateTask_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// Sent when the system is ready to begin work for a task with a delayed start + /// time set (using the earliestBeginDate property). The completionHandler must + /// be invoked in order for loading to proceed. The disposition provided to the + /// completion handler continues the load with the original request provided to + /// the task, replaces the request with the specified task, or cancels the task. + /// If this delegate is not implemented, loading will proceed with the original + /// request. + /// + /// Recommendation: only implement this delegate if tasks that have the + /// earliestBeginDate property set may become stale and require alteration prior + /// to starting the network load. + /// + /// If a new request is specified, the allowsExpensiveNetworkAccess, + /// allowsConstrainedNetworkAccess, and allowsCellularAccess properties + /// from the new request will not be used; the properties from the + /// original request will continue to be used. + /// + /// Canceling the task is equivalent to calling the task's cancel method; the + /// URLSession:task:didCompleteWithError: task delegate will be called with error + /// NSURLErrorCancelled. + static final URLSession_task_willBeginDelayedRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock)>( + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_willBeginDelayedRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLRequest, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLRequest_ffiVoidNSURLSessionDelayedRequestDispositionNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLRequest arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent when a task cannot start the network loading process because the current + /// network connectivity is not available or sufficient for the task's request. + /// + /// This delegate will be called at most one time per task, and is only called if + /// the waitsForConnectivity property in the NSURLSessionConfiguration has been + /// set to YES. + /// + /// This delegate callback will never be called for background sessions, because + /// the waitForConnectivity property is ignored by those sessions. + static final URLSession_taskIsWaitingForConnectivity_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask)>( + _sel_URLSession_taskIsWaitingForConnectivity_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_taskIsWaitingForConnectivity_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.fromFunction( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, NSURLSessionTask) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask.listener( + (ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2) => + func(arg1, arg2)), + ); + + /// An HTTP request is attempting to perform a redirection to a different + /// URL. You must invoke the completion routine to allow the + /// redirection, allow the redirection with a modified request, or + /// pass nil to the completionHandler to cause the body of the redirection + /// response to be delivered as the payload of this request. The default + /// is to follow redirections. + /// + /// For tasks in background sessions, redirections will always be followed and this method will not be called. + static final URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock)>( + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_willPerformHTTPRedirection_newRequest_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse, + NSURLRequest, objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse_NSURLRequest_ffiVoidNSURLRequest + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSHTTPURLResponse arg3, + NSURLRequest arg4, + objc.ObjCBlock arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// The task has received a request specific authentication challenge. + /// If this delegate is not implemented, the session specific authentication challenge + /// will *NOT* be called and the behavior will be the same as using the default handling + /// disposition. + static final URLSession_task_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, + NSURLSessionTask, + NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + NSURLAuthenticationChallenge arg3, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent if a task requires a new, unopened body stream. This may be + /// necessary when authentication has failed for any request that + /// involves a body stream. + static final URLSession_task_needNewBodyStream_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStream_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_needNewBodyStream_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + objc.ObjCBlock + arg3) => + func(arg1, arg2, arg3)), + ); + + /// Tells the delegate if a task requires a new body stream starting from the given offset. This may be + /// necessary when resuming a failed upload task. + /// + /// - Parameter session: The session containing the task that needs a new body stream from the given offset. + /// - Parameter task: The task that needs a new body stream. + /// - Parameter offset: The starting offset required for the body stream. + /// - Parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + static final URLSession_task_needNewBodyStreamFromOffset_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock)>( + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_needNewBodyStreamFromOffset_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + (void Function(NSURLSession, NSURLSessionTask, int, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_ffiVoidNSInputStream + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLSessionTask arg2, + int arg3, + objc.ObjCBlock + arg4) => + func(arg1, arg2, arg3, arg4)), + ); + + /// Sent periodically to notify the delegate of upload progress. This + /// information is also available as properties of the task. + static final URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, int, int, int)>( + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didSendBodyData_totalBytesSent_totalBytesExpectedToSend_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + (void Function(NSURLSession, NSURLSessionTask, int, int, int) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_Int64_Int64_Int64 + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, int arg3, int arg4, int arg5) => + func(arg1, arg2, arg3, arg4, arg5)), + ); + + /// Sent for each informational response received except 101 switching protocols. + static final URLSession_task_didReceiveInformationalResponse_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse)>( + _sel_URLSession_task_didReceiveInformationalResponse_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didReceiveInformationalResponse_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSHTTPURLResponse) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSHTTPURLResponse + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSHTTPURLResponse arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent when complete statistics information has been collected for the task. + static final URLSession_task_didFinishCollectingMetrics_ = + objc.ObjCProtocolListenableMethod< + void Function( + NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics)>( + _sel_URLSession_task_didFinishCollectingMetrics_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didFinishCollectingMetrics_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, NSURLSessionTaskMetrics) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSURLSessionTaskMetrics + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, NSURLSessionTaskMetrics arg3) => + func(arg1, arg2, arg3)), + ); + + /// Sent as the last message related to a specific task. Error may be + /// nil, which implies that no error occurred and this task is complete. + static final URLSession_task_didCompleteWithError_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLSessionTask, objc.NSError?)>( + _sel_URLSession_task_didCompleteWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_task_didCompleteWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .fromFunction((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLSessionTask, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionTask_NSError + .listener((ffi.Pointer _, NSURLSession arg1, + NSURLSessionTask arg2, objc.NSError? arg3) => + func(arg1, arg2, arg3)), + ); + + /// The last message a session receives. A session will only become + /// invalid because of a systemic error or when it has been + /// explicitly invalidated, in which case the error parameter will be nil. + static final URLSession_didBecomeInvalidWithError_ = objc + .ObjCProtocolListenableMethod( + _sel_URLSession_didBecomeInvalidWithError_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didBecomeInvalidWithError_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.fromFunction( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + (void Function(NSURLSession, objc.NSError?) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSError.listener( + (ffi.Pointer _, NSURLSession arg1, objc.NSError? arg2) => + func(arg1, arg2)), + ); + + /// If implemented, when a connection level authentication challenge + /// has occurred, this delegate will be given the opportunity to + /// provide authentication credentials to the underlying + /// connection. Some types of authentication will apply to more than + /// one request on a given connection to a server (SSL Server Trust + /// challenges). If this delegate message is not implemented, the + /// behavior will be to use the default handling, which may involve user + /// interaction. + static final URLSession_didReceiveChallenge_completionHandler_ = + objc.ObjCProtocolListenableMethod< + void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock)>( + _sel_URLSession_didReceiveChallenge_completionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSession_didReceiveChallenge_completionHandler_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .fromFunction((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + (void Function(NSURLSession, NSURLAuthenticationChallenge, + objc.ObjCBlock) + func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLAuthenticationChallenge_ffiVoidNSURLSessionAuthChallengeDispositionNSURLCredential + .listener((ffi.Pointer _, + NSURLSession arg1, + NSURLAuthenticationChallenge arg2, + objc.ObjCBlock< + ffi.Void Function(NSInteger, NSURLCredential?)> + arg3) => + func(arg1, arg2, arg3)), + ); + + /// If an application has received an + /// -application:handleEventsForBackgroundURLSession:completionHandler: + /// message, the session delegate will receive this message to indicate + /// that all messages previously enqueued for this session have been + /// delivered. At this time it is safe to invoke the previously stored + /// completion handler, or to begin any internal updates that will + /// result in invoking the completion handler. + static final URLSessionDidFinishEventsForBackgroundURLSession_ = + objc.ObjCProtocolListenableMethod( + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + objc.getProtocolMethodSignature( + _protocol_NSURLSessionWebSocketDelegate, + _sel_URLSessionDidFinishEventsForBackgroundURLSession_, + isRequired: false, + isInstanceMethod: true, + ), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.fromFunction( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + (void Function(NSURLSession) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLSession.listener( + (ffi.Pointer _, NSURLSession arg1) => func(arg1)), + ); +} + +late final _protocol_NSURLSessionWebSocketDelegate = + objc.getProtocol("NSURLSessionWebSocketDelegate"); +late final _sel_URLSession_webSocketTask_didOpenWithProtocol_ = + objc.registerName("URLSession:webSocketTask:didOpenWithProtocol:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + objc.NSString?)>(pointer, retain: retain, release: release); - static CUPHTTPForwardedRedirect new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedRedirect1, _lib._sel_new1); - return CUPHTTPForwardedRedirect._(_ret, _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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static CUPHTTPForwardedRedirect allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedRedirect1, _lib._sel_allocWithZone_1, zone); - return CUPHTTPForwardedRedirect._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), + arg3.address == 0 ? null : objc.NSString.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); - static CUPHTTPForwardedRedirect alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedRedirect1, _lib._sel_alloc1); - return CUPHTTPForwardedRedirect._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, + retain: false, release: true), + arg3.address == 0 + ? null + : objc.NSString.castFromPointer(arg3, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1a6kixf(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + objc.NSString?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, objc.NSString?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSString_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, objc.NSString?)> { + void call(ffi.Pointer arg0, NSURLSession arg1, + NSURLSessionWebSocketTask arg2, objc.NSString? arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0, + arg1.ref.pointer, arg2.ref.pointer, arg3?.ref.pointer ?? ffi.nullptr); } -class CUPHTTPForwardedResponse extends CUPHTTPForwardedDelegate { - CUPHTTPForwardedResponse._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [CUPHTTPForwardedResponse] that points to the same underlying object as [other]. - static CUPHTTPForwardedResponse castFrom(T other) { - return CUPHTTPForwardedResponse._(other._id, other._lib, - retain: true, release: true); - } +late final _sel_URLSession_webSocketTask_didCloseWithCode_reason_ = + objc.registerName("URLSession:webSocketTask:didCloseWithCode:reason:"); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + NSInteger arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer))(arg0, arg1, arg2, arg3, arg4); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + NSInteger, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + NSInteger, + objc.NSData?)>(pointer, retain: retain, release: release); - /// Returns a [CUPHTTPForwardedResponse] that wraps the given raw object pointer. - static CUPHTTPForwardedResponse castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedResponse._(other, lib, - retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, NSInteger arg3, ffi.Pointer arg4)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns whether [obj] is an instance of [CUPHTTPForwardedResponse]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedResponse1); - } + /// 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. + static objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> fromFunction(void Function(ffi.Pointer, NSURLSession, NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) fn) => + objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, retain: true, release: true), + arg3, + arg4.address == 0 ? null : objc.NSData.castFromPointer(arg4, retain: true, release: true))), + retain: false, + release: true); - NSObject initWithSession_task_response_( - NSURLSession session, NSURLSessionTask task, NSURLResponse response) { - final _ret = _lib._objc_msgSend_541( - _id, - _lib._sel_initWithSession_task_response_1, - session._id, - task._id, - response._id); - return NSObject._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> listener( + void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, DartNSInteger, objc.NSData?) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + int arg3, + ffi.Pointer arg4) => + fn( + arg0, + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionWebSocketTask.castFromPointer(arg2, + retain: false, release: true), + arg3, + arg4.address == 0 + ? null + : objc.NSData.castFromPointer(arg4, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_10hgvcc(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, + NSURLSession, + NSURLSessionWebSocketTask, + NSInteger, + objc.NSData?)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, NSURLSession, NSURLSessionWebSocketTask, NSInteger, objc.NSData?)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLSession_NSURLSessionWebSocketTask_NSURLSessionWebSocketCloseCode_NSData_CallExtension + on objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionWebSocketTask, NSInteger, objc.NSData?)> { + void call( + ffi.Pointer arg0, + NSURLSession arg1, + NSURLSessionWebSocketTask arg2, + DartNSInteger arg3, + objc.NSData? arg4) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + NSInteger arg3, + ffi.Pointer arg4)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + int, + ffi.Pointer)>()( + ref.pointer, + arg0, + arg1.ref.pointer, + arg2.ref.pointer, + arg3, + arg4?.ref.pointer ?? ffi.nullptr); +} + +typedef NSRange = objc.NSRange; + +/// NSItemProviderWriting +abstract final class NSItemProviderWriting { + /// Builds an object that implements the NSItemProviderWriting protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? + itemProviderVisibilityForRepresentationWithTypeIdentifier_, + required NSProgress? Function(objc.NSString, + objc.ObjCBlock) + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + objc.NSArray Function()? writableTypeIdentifiersForItemProvider}) { + final builder = objc.ObjCProtocolBuilder(); + NSItemProviderWriting + .itemProviderVisibilityForRepresentationWithTypeIdentifier_ + .implement(builder, + itemProviderVisibilityForRepresentationWithTypeIdentifier_); + NSItemProviderWriting + .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ + .implement(builder, + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); + NSItemProviderWriting.writableTypeIdentifiersForItemProvider + .implement(builder, writableTypeIdentifiersForItemProvider); + return builder.build(); + } + + /// Adds the implementation of the NSItemProviderWriting protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {objc.NSItemProviderRepresentationVisibility Function(objc.NSString)? + itemProviderVisibilityForRepresentationWithTypeIdentifier_, + required NSProgress? Function(objc.NSString, + objc.ObjCBlock) + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + objc.NSArray Function()? writableTypeIdentifiersForItemProvider}) { + NSItemProviderWriting + .itemProviderVisibilityForRepresentationWithTypeIdentifier_ + .implement(builder, + itemProviderVisibilityForRepresentationWithTypeIdentifier_); + NSItemProviderWriting + .loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ + .implement(builder, + loadDataWithTypeIdentifier_forItemProviderCompletionHandler_); + NSItemProviderWriting.writableTypeIdentifiersForItemProvider + .implement(builder, writableTypeIdentifiersForItemProvider); + } + + /// itemProviderVisibilityForRepresentationWithTypeIdentifier: + static final itemProviderVisibilityForRepresentationWithTypeIdentifier_ = + objc.ObjCProtocolMethod< + objc.NSItemProviderRepresentationVisibility Function(objc.NSString)>( + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderWriting, + _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_, + isRequired: false, + isInstanceMethod: true, + ), + (objc.NSItemProviderRepresentationVisibility Function(objc.NSString) + func) => + ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString + .fromFunction( + (ffi.Pointer _, objc.NSString arg1) => func(arg1)), + ); + + /// loadDataWithTypeIdentifier:forItemProviderCompletionHandler: + static final loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = + objc.ObjCProtocolMethod< + NSProgress? Function(objc.NSString, + objc.ObjCBlock)>( + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderWriting, + _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_, + isRequired: true, + isInstanceMethod: true, + ), + (NSProgress? Function(objc.NSString, + objc.ObjCBlock) + func) => + ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError.fromFunction( + (ffi.Pointer _, + objc.NSString arg1, + objc.ObjCBlock< + ffi.Void Function(objc.NSData?, objc.NSError?)> + arg2) => + func(arg1, arg2)), + ); + + /// writableTypeIdentifiersForItemProvider + static final writableTypeIdentifiersForItemProvider = + objc.ObjCProtocolMethod( + _sel_writableTypeIdentifiersForItemProvider, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderWriting, + _sel_writableTypeIdentifiersForItemProvider, + isRequired: false, + isInstanceMethod: true, + ), + (objc.NSArray Function() func) => ObjCBlock_NSArray_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); +} + +late final _protocol_NSItemProviderWriting = + objc.getProtocol("NSItemProviderWriting"); +late final _sel_itemProviderVisibilityForRepresentationWithTypeIdentifier_ = + objc.registerName( + "itemProviderVisibilityForRepresentationWithTypeIdentifier:"); +int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + int Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable = + ffi.Pointer.fromFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrTrampoline, + 0) + .cast(); +int _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as int Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable = + ffi.Pointer.fromFunction< + NSInteger Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureTrampoline, + 0) + .cast(); + +/// Construction methods for `objc.ObjCBlock, objc.NSString)>`. +abstract final class ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + NSInteger Function(ffi.Pointer, objc.NSString)> castFromPointer( + ffi.Pointer pointer, + {bool retain = false, + bool release = false}) => + objc.ObjCBlock, objc.NSString)>( + pointer, + retain: retain, + release: release); - void finishWithDisposition_(int disposition) { - _lib._objc_msgSend_542(_id, _lib._sel_finishWithDisposition_1, disposition); - } + /// 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. + static objc.ObjCBlock, objc.NSString)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + NSInteger Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.NSString)>( + objc.newPointerBlock(_ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - NSURLResponse get response { - final _ret = _lib._objc_msgSend_337(_id, _lib._sel_response1); - return NSURLResponse._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock, objc.NSString)> fromFunction( + objc.NSItemProviderRepresentationVisibility Function( + ffi.Pointer, objc.NSString) + fn) => + objc.ObjCBlock, objc.NSString)>( + objc.newClosureBlock( + _ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true)) + .value), + retain: false, + release: true); +} - /// This property is meant to be used only by CUPHTTPClientDelegate. - int get disposition { - return _lib._objc_msgSend_543(_id, _lib._sel_disposition1); - } +/// Call operator for `objc.ObjCBlock, objc.NSString)>`. +extension ObjCBlock_NSItemProviderRepresentationVisibility_ffiVoid_NSString_CallExtension + on objc + .ObjCBlock, objc.NSString)> { + objc.NSItemProviderRepresentationVisibility call( + ffi.Pointer arg0, objc.NSString arg1) => + objc.NSItemProviderRepresentationVisibility.fromValue(ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + NSInteger Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction, ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer)); +} - @override - CUPHTTPForwardedResponse init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedResponse._(_ret, _lib, retain: true, release: true); - } +void _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSError_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function(ffi.Pointer, + ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_NSData_NSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSData_NSError_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable = ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSData_NSError_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSData_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock( + pointer, + retain: retain, + release: release); - static CUPHTTPForwardedResponse new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedResponse1, _lib._sel_new1); - return CUPHTTPForwardedResponse._(_ret, _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. + static objc.ObjCBlock fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock( + objc.newPointerBlock(_ObjCBlock_ffiVoid_NSData_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static CUPHTTPForwardedResponse allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedResponse1, _lib._sel_allocWithZone_1, zone); - return CUPHTTPForwardedResponse._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock fromFunction( + void Function(objc.NSData?, objc.NSError?) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSError_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: true, release: true), + arg1.address == 0 ? null : objc.NSError.castFromPointer(arg1, retain: true, release: true))), + retain: false, + release: true); - static CUPHTTPForwardedResponse alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedResponse1, _lib._sel_alloc1); - return CUPHTTPForwardedResponse._(_ret, _lib, retain: false, release: true); + /// 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. + static objc.ObjCBlock + listener(void Function(objc.NSData?, objc.NSError?) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSData_NSError_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1) => + fn( + arg0.address == 0 + ? null + : objc.NSData.castFromPointer(arg0, + retain: false, release: true), + arg1.address == 0 + ? null + : objc.NSError.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_1tjlcwl(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock( + wrapper, + retain: false, + release: true); } } -class CUPHTTPForwardedData extends CUPHTTPForwardedDelegate { - CUPHTTPForwardedData._(ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [CUPHTTPForwardedData] that points to the same underlying object as [other]. - static CUPHTTPForwardedData castFrom(T other) { - return CUPHTTPForwardedData._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [CUPHTTPForwardedData] that wraps the given raw object pointer. - static CUPHTTPForwardedData castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedData._(other, lib, retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [CUPHTTPForwardedData]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedData1); - } +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSData_NSError_CallExtension + on objc.ObjCBlock { + void call(objc.NSData? arg0, objc.NSError? arg1) => ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, + arg0?.ref.pointer ?? ffi.nullptr, arg1?.ref.pointer ?? ffi.nullptr); +} + +late final _sel_loadDataWithTypeIdentifier_forItemProviderCompletionHandler_ = + objc.registerName( + "loadDataWithTypeIdentifier:forItemProviderCompletionHandler:"); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrTrampoline) + .cast(); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - NSObject initWithSession_task_data_( - NSURLSession session, NSURLSessionTask task, NSData data) { - final _ret = _lib._objc_msgSend_544(_id, - _lib._sel_initWithSession_task_data_1, session._id, task._id, data._id); - return NSObject._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> + fromFunctionPointer(ffi.Pointer Function(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - NSData get data { - final _ret = _lib._objc_msgSend_54(_id, _lib._sel_data1); - return NSData._(_ret, _lib, retain: true, release: true); - } + /// 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. + static objc.ObjCBlock, objc.NSString, objc.ObjCBlock)> + fromFunction(NSProgress? Function(ffi.Pointer, objc.NSString, objc.ObjCBlock) fn) => + objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + fn(arg0, objc.NSString.castFromPointer(arg1, retain: true, release: true), ObjCBlock_ffiVoid_NSData_NSError.castFromPointer(arg2, retain: true, release: true)) + ?.ref + .retainAndAutorelease() ?? + ffi.nullptr), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock, objc.NSString, objc.ObjCBlock)>`. +extension ObjCBlock_NSProgress_ffiVoid_NSString_ffiVoidNSDataNSError_CallExtension + on objc.ObjCBlock< + NSProgress? Function(ffi.Pointer, objc.NSString, + objc.ObjCBlock)> { + NSProgress? call(ffi.Pointer arg0, objc.NSString arg1, objc.ObjCBlock arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>() + (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer) + .address == + 0 + ? null + : NSProgress.castFromPointer( + ref.pointer.ref.invoke.cast Function(ffi.Pointer block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>>().asFunction Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer), + retain: true, + release: true); +} + +late final _sel_writableTypeIdentifiersForItemProvider = + objc.registerName("writableTypeIdentifiersForItemProvider"); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer)>()(arg0); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSArray_ffiVoid_fnPtrTrampoline) + .cast(); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureTrampoline( + ffi.Pointer block, ffi.Pointer arg0) => + (objc.getBlockClosure(block) as ffi.Pointer Function( + ffi.Pointer))(arg0); +ffi.Pointer _ObjCBlock_NSArray_ffiVoid_closureCallable = + ffi.Pointer.fromFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_NSArray_ffiVoid_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock)>`. +abstract final class ObjCBlock_NSArray_ffiVoid { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock)>(pointer, + retain: retain, release: release); - @override - CUPHTTPForwardedData init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedData._(_ret, _lib, retain: true, 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. + static objc.ObjCBlock)> + fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer arg0)>> + ptr) => + objc.ObjCBlock)>( + objc.newPointerBlock(_ObjCBlock_NSArray_ffiVoid_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static CUPHTTPForwardedData new1(NativeCupertinoHttp _lib) { - final _ret = - _lib._objc_msgSend_2(_lib._class_CUPHTTPForwardedData1, _lib._sel_new1); - return CUPHTTPForwardedData._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock)> + fromFunction(objc.NSArray Function(ffi.Pointer) fn) => + objc.ObjCBlock)>( + objc.newClosureBlock( + _ObjCBlock_NSArray_ffiVoid_closureCallable, + (ffi.Pointer arg0) => + fn(arg0).ref.retainAndAutorelease()), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock)>`. +extension ObjCBlock_NSArray_ffiVoid_CallExtension + on objc.ObjCBlock)> { + objc.NSArray call(ffi.Pointer arg0) => objc.NSArray.castFromPointer( + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer block, + ffi.Pointer arg0)>>() + .asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer)>()(ref.pointer, arg0), + retain: true, + release: true); +} + +/// NSItemProviderReading +abstract final class NSItemProviderReading { + /// Builds an object that implements the NSItemProviderReading protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required Dartinstancetype? Function(objc.NSData, objc.NSString, + ffi.Pointer>) + objectWithItemProviderData_typeIdentifier_error_, + required objc.NSArray Function() + readableTypeIdentifiersForItemProvider}) { + final builder = objc.ObjCProtocolBuilder(); + NSItemProviderReading.objectWithItemProviderData_typeIdentifier_error_ + .implement(builder, objectWithItemProviderData_typeIdentifier_error_); + NSItemProviderReading.readableTypeIdentifiersForItemProvider + .implement(builder, readableTypeIdentifiersForItemProvider); + return builder.build(); + } + + /// Adds the implementation of the NSItemProviderReading protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required Dartinstancetype? Function(objc.NSData, objc.NSString, + ffi.Pointer>) + objectWithItemProviderData_typeIdentifier_error_, + required objc.NSArray Function() + readableTypeIdentifiersForItemProvider}) { + NSItemProviderReading.objectWithItemProviderData_typeIdentifier_error_ + .implement(builder, objectWithItemProviderData_typeIdentifier_error_); + NSItemProviderReading.readableTypeIdentifiersForItemProvider + .implement(builder, readableTypeIdentifiersForItemProvider); + } + + /// objectWithItemProviderData:typeIdentifier:error: + static final objectWithItemProviderData_typeIdentifier_error_ = + objc.ObjCProtocolMethod< + Dartinstancetype? Function(objc.NSData, objc.NSString, + ffi.Pointer>)>( + _sel_objectWithItemProviderData_typeIdentifier_error_, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderReading, + _sel_objectWithItemProviderData_typeIdentifier_error_, + isRequired: true, + isInstanceMethod: false, + ), + (Dartinstancetype? Function(objc.NSData, objc.NSString, + ffi.Pointer>) + func) => + ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError.fromFunction( + (ffi.Pointer _, objc.NSData arg1, objc.NSString arg2, + ffi.Pointer> arg3) => + func(arg1, arg2, arg3)), + ); + + /// readableTypeIdentifiersForItemProvider + static final readableTypeIdentifiersForItemProvider = + objc.ObjCProtocolMethod( + _sel_readableTypeIdentifiersForItemProvider, + objc.getProtocolMethodSignature( + _protocol_NSItemProviderReading, + _sel_readableTypeIdentifiersForItemProvider, + isRequired: true, + isInstanceMethod: false, + ), + (objc.NSArray Function() func) => ObjCBlock_NSArray_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + ); +} + +late final _protocol_NSItemProviderReading = + objc.getProtocol("NSItemProviderReading"); +late final _sel_objectWithItemProviderData_typeIdentifier_error_ = + objc.registerName("objectWithItemProviderData:typeIdentifier:error:"); +instancetype + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>()( + arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrTrampoline) + .cast(); +instancetype + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + (objc.getBlockClosure(block) as instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable = + ffi.Pointer.fromFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureTrampoline) + .cast(); + +/// Construction methods for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +abstract final class ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)>(pointer, retain: retain, release: release); - static CUPHTTPForwardedData allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedData1, _lib._sel_allocWithZone_1, zone); - return CUPHTTPForwardedData._(_ret, _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. + static objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>> ptr) => + objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)>( + objc.newPointerBlock(_ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - static CUPHTTPForwardedData alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedData1, _lib._sel_alloc1); - return CUPHTTPForwardedData._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)> + fromFunction(Dartinstancetype? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>) fn) => + objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>( + objc.newClosureBlock( + _ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3) => + fn(arg0, objc.NSData.castFromPointer(arg1, retain: true, release: true), objc.NSString.castFromPointer(arg2, retain: true, release: true), arg3)?.ref.retainAndAutorelease() ?? + ffi.nullptr), + retain: false, + release: true); +} + +/// Call operator for `objc.ObjCBlock? Function(ffi.Pointer, objc.NSData, objc.NSString, ffi.Pointer>)>`. +extension ObjCBlock_instancetype_ffiVoid_NSData_NSString_NSError_CallExtension + on objc.ObjCBlock< + ffi.Pointer? Function( + ffi.Pointer, + objc.NSData, + objc.NSString, + ffi.Pointer>)> { + Dartinstancetype? call(ffi.Pointer arg0, objc.NSData arg1, objc.NSString arg2, ffi.Pointer> arg3) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + instancetype Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer> arg3)>>() + .asFunction< + instancetype Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer>)>() + (ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3) + .address == + 0 + ? null + : objc.ObjCObjectBase( + ref.pointer.ref.invoke.cast block, ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer> arg3)>>().asFunction, ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer>)>()(ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer, arg3), + retain: true, + release: true); } -class CUPHTTPForwardedComplete extends CUPHTTPForwardedDelegate { - CUPHTTPForwardedComplete._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [CUPHTTPForwardedComplete] that points to the same underlying object as [other]. - static CUPHTTPForwardedComplete castFrom(T other) { - return CUPHTTPForwardedComplete._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [CUPHTTPForwardedComplete] that wraps the given raw object pointer. - static CUPHTTPForwardedComplete castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedComplete._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [CUPHTTPForwardedComplete]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedComplete1); - } - - NSObject initWithSession_task_error_( - NSURLSession session, NSURLSessionTask task, NSError? error) { - final _ret = _lib._objc_msgSend_545( - _id, - _lib._sel_initWithSession_task_error_1, - session._id, - task._id, - error?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); - } - - NSError? get error { - final _ret = _lib._objc_msgSend_353(_id, _lib._sel_error1); - return _ret.address == 0 - ? null - : NSError._(_ret, _lib, retain: true, release: true); - } - - @override - CUPHTTPForwardedComplete init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedComplete._(_ret, _lib, retain: true, release: true); - } +late final _sel_readableTypeIdentifiersForItemProvider = + objc.registerName("readableTypeIdentifiersForItemProvider"); +typedef NSStringEncoding = NSUInteger; +typedef NSStringTransform = ffi.Pointer; +typedef DartNSStringTransform = objc.NSString; +typedef NSStringEncodingDetectionOptionsKey = ffi.Pointer; +typedef DartNSStringEncodingDetectionOptionsKey = objc.NSString; +typedef NSExceptionName = ffi.Pointer; +typedef DartNSExceptionName = objc.NSString; + +/// NSURLHandleClient +abstract final class NSURLHandleClient { + /// Builds an object that implements the NSURLHandleClient protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( + builder, URLHandle_resourceDidFailLoadingWithReason_); + return builder.build(); + } + + /// Adds the implementation of the NSURLHandleClient protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_.implement( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implement( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implement( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implement( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_.implement( + builder, URLHandle_resourceDidFailLoadingWithReason_); + } + + /// Builds an object that implements the NSURLHandleClient protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + final builder = objc.ObjCProtocolBuilder(); + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ + .implementAsListener( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ + .implementAsListener( + builder, URLHandle_resourceDidFailLoadingWithReason_); + return builder.build(); + } + + /// Adds the implementation of the NSURLHandleClient protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function(objc.NSURLHandle, objc.NSData) + URLHandle_resourceDataDidBecomeAvailable_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidBeginLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidFinishLoading_, + required void Function(objc.NSURLHandle) + URLHandleResourceDidCancelLoading_, + required void Function(objc.NSURLHandle, objc.NSString) + URLHandle_resourceDidFailLoadingWithReason_}) { + NSURLHandleClient.URLHandle_resourceDataDidBecomeAvailable_ + .implementAsListener( + builder, URLHandle_resourceDataDidBecomeAvailable_); + NSURLHandleClient.URLHandleResourceDidBeginLoading_.implementAsListener( + builder, URLHandleResourceDidBeginLoading_); + NSURLHandleClient.URLHandleResourceDidFinishLoading_.implementAsListener( + builder, URLHandleResourceDidFinishLoading_); + NSURLHandleClient.URLHandleResourceDidCancelLoading_.implementAsListener( + builder, URLHandleResourceDidCancelLoading_); + NSURLHandleClient.URLHandle_resourceDidFailLoadingWithReason_ + .implementAsListener( + builder, URLHandle_resourceDidFailLoadingWithReason_); + } + + /// URLHandle:resourceDataDidBecomeAvailable: + static final URLHandle_resourceDataDidBecomeAvailable_ = + objc.ObjCProtocolListenableMethod< + void Function(objc.NSURLHandle, objc.NSData)>( + _sel_URLHandle_resourceDataDidBecomeAvailable_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandle_resourceDataDidBecomeAvailable_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSData arg2) => + func(arg1, arg2)), + (void Function(objc.NSURLHandle, objc.NSData) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData.listener( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSData arg2) => + func(arg1, arg2)), + ); + + /// URLHandleResourceDidBeginLoading: + static final URLHandleResourceDidBeginLoading_ = + objc.ObjCProtocolListenableMethod( + _sel_URLHandleResourceDidBeginLoading_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidBeginLoading_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + ); + + /// URLHandleResourceDidFinishLoading: + static final URLHandleResourceDidFinishLoading_ = + objc.ObjCProtocolListenableMethod( + _sel_URLHandleResourceDidFinishLoading_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidFinishLoading_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + ); + + /// URLHandleResourceDidCancelLoading: + static final URLHandleResourceDidCancelLoading_ = + objc.ObjCProtocolListenableMethod( + _sel_URLHandleResourceDidCancelLoading_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandleResourceDidCancelLoading_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + (void Function(objc.NSURLHandle) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle.listener( + (ffi.Pointer _, objc.NSURLHandle arg1) => func(arg1)), + ); + + /// URLHandle:resourceDidFailLoadingWithReason: + static final URLHandle_resourceDidFailLoadingWithReason_ = + objc.ObjCProtocolListenableMethod< + void Function(objc.NSURLHandle, objc.NSString)>( + _sel_URLHandle_resourceDidFailLoadingWithReason_, + objc.getProtocolMethodSignature( + _protocol_NSURLHandleClient, + _sel_URLHandle_resourceDidFailLoadingWithReason_, + isRequired: true, + isInstanceMethod: true, + ), + (void Function(objc.NSURLHandle, objc.NSString) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.fromFunction( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSString arg2) => + func(arg1, arg2)), + (void Function(objc.NSURLHandle, objc.NSString) func) => + ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString.listener( + (ffi.Pointer _, objc.NSURLHandle arg1, + objc.NSString arg2) => + func(arg1, arg2)), + ); +} + +late final _protocol_NSURLHandleClient = objc.getProtocol("NSURLHandleClient"); +late final _sel_URLHandle_resourceDataDidBecomeAvailable_ = + objc.registerName("URLHandle:resourceDataDidBecomeAvailable:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSData)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSData)>(pointer, retain: retain, release: release); - static CUPHTTPForwardedComplete new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedComplete1, _lib._sel_new1); - return CUPHTTPForwardedComplete._(_ret, _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. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSData)> + fromFunctionPointer( + ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> + ptr) => + objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - static CUPHTTPForwardedComplete allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedComplete1, _lib._sel_allocWithZone_1, zone); - return CUPHTTPForwardedComplete._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSData)> + fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) => + objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), + objc.NSData.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - static CUPHTTPForwardedComplete alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedComplete1, _lib._sel_alloc1); - return CUPHTTPForwardedComplete._(_ret, _lib, retain: false, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSData)> listener( + void Function(ffi.Pointer, objc.NSURLHandle, objc.NSData) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: false, release: true), + objc.NSData.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_tm2na8(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSData)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSData)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSData_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSData)> { + void call(ffi.Pointer arg0, objc.NSURLHandle arg1, + objc.NSData arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); } -class CUPHTTPForwardedFinishedDownloading extends CUPHTTPForwardedDelegate { - CUPHTTPForwardedFinishedDownloading._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [CUPHTTPForwardedFinishedDownloading] that points to the same underlying object as [other]. - static CUPHTTPForwardedFinishedDownloading castFrom( - T other) { - return CUPHTTPForwardedFinishedDownloading._(other._id, other._lib, - retain: true, release: true); - } +late final _sel_URLHandleResourceDidBeginLoading_ = + objc.registerName("URLHandleResourceDidBeginLoading:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer)>()(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); +ffi.Pointer _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, ffi.Pointer))(arg0, arg1); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable = ffi + .NativeCallable< + ffi.Void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle { + /// Returns a block that wraps the given raw block pointer. + static objc + .ObjCBlock, objc.NSURLHandle)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, + objc.NSURLHandle)>(pointer, retain: retain, release: release); - /// Returns a [CUPHTTPForwardedFinishedDownloading] that wraps the given raw object pointer. - static CUPHTTPForwardedFinishedDownloading castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedFinishedDownloading._(other, lib, - retain: retain, release: release); - } + /// 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. + static objc.ObjCBlock, objc.NSURLHandle)> fromFunctionPointer( + ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer arg0, + ffi.Pointer arg1)>> + ptr) => + objc.ObjCBlock, objc.NSURLHandle)>( + objc.newPointerBlock(_ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_fnPtrCallable, ptr.cast()), + retain: false, + release: true); - /// Returns whether [obj] is an instance of [CUPHTTPForwardedFinishedDownloading]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedFinishedDownloading1); - } + /// 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. + static objc.ObjCBlock, objc.NSURLHandle)> + fromFunction(void Function(ffi.Pointer, objc.NSURLHandle) fn) => + objc.ObjCBlock, objc.NSURLHandle)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: true, release: true))), + retain: false, + release: true); - NSObject initWithSession_downloadTask_url_(NSURLSession session, - NSURLSessionDownloadTask downloadTask, NSURL location) { - final _ret = _lib._objc_msgSend_546( - _id, - _lib._sel_initWithSession_downloadTask_url_1, - session._id, - downloadTask._id, - location._id); - return NSObject._(_ret, _lib, retain: true, release: true); + /// 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. + static objc + .ObjCBlock, objc.NSURLHandle)> + listener(void Function(ffi.Pointer, objc.NSURLHandle) fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_listenerCallable.nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_sjfpmz(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle)>(wrapper, + retain: false, release: true); } +} - NSURL get location { - final _ret = _lib._objc_msgSend_547(_id, _lib._sel_location1); - return NSURL._(_ret, _lib, retain: true, release: true); - } +/// Call operator for `objc.ObjCBlock, objc.NSURLHandle)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_CallExtension on objc + .ObjCBlock, objc.NSURLHandle)> { + void call(ffi.Pointer arg0, objc.NSURLHandle arg1) => ref + .pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1)>>() + .asFunction< + void Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer); +} + +late final _sel_URLHandleResourceDidFinishLoading_ = + objc.registerName("URLHandleResourceDidFinishLoading:"); +late final _sel_URLHandleResourceDidCancelLoading_ = + objc.registerName("URLHandleResourceDidCancelLoading:"); +late final _sel_URLHandle_resourceDidFailLoadingWithReason_ = + objc.registerName("URLHandle:resourceDidFailLoadingWithReason:"); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); +ffi.Pointer + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureTrampoline) + .cast(); +void _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable = ffi + .NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. +abstract final class ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSString)>(pointer, retain: retain, release: release); - @override - CUPHTTPForwardedFinishedDownloading init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedFinishedDownloading._(_ret, _lib, - retain: true, 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. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSString)> + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2)>> ptr) => + objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); - static CUPHTTPForwardedFinishedDownloading new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedFinishedDownloading1, _lib._sel_new1); - return CUPHTTPForwardedFinishedDownloading._(_ret, _lib, - retain: false, release: true); - } + /// 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. + static objc + .ObjCBlock, objc.NSURLHandle, objc.NSString)> + fromFunction(void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) fn) => + objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_closureCallable, + (ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2) => fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, retain: true, release: true), + objc.NSString.castFromPointer(arg2, retain: true, release: true))), + retain: false, + release: true); - static CUPHTTPForwardedFinishedDownloading allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedFinishedDownloading1, - _lib._sel_allocWithZone_1, - zone); - return CUPHTTPForwardedFinishedDownloading._(_ret, _lib, - retain: false, release: true); - } + /// 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. + static objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)> listener( + void Function(ffi.Pointer, objc.NSURLHandle, objc.NSString) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, ffi.Pointer arg1, + ffi.Pointer arg2) => + fn( + arg0, + objc.NSURLHandle.castFromPointer(arg1, + retain: false, release: true), + objc.NSString.castFromPointer(arg2, + retain: false, release: true))); + final wrapper = _wrapListenerBlock_tm2na8(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, objc.NSURLHandle, + objc.NSString)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock, objc.NSURLHandle, objc.NSString)>`. +extension ObjCBlock_ffiVoid_ffiVoid_NSURLHandle_NSString_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + ffi.Pointer, objc.NSURLHandle, objc.NSString)> { + void call(ffi.Pointer arg0, objc.NSURLHandle arg1, + objc.NSString arg2) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, arg0, arg1.ref.pointer, arg2.ref.pointer); +} + +typedef NSURLResourceKey = ffi.Pointer; +typedef DartNSURLResourceKey = objc.NSString; +typedef NSURLFileResourceType = ffi.Pointer; +typedef DartNSURLFileResourceType = objc.NSString; +typedef NSURLThumbnailDictionaryItem = ffi.Pointer; +typedef DartNSURLThumbnailDictionaryItem = objc.NSString; +typedef NSURLFileProtectionType = ffi.Pointer; +typedef DartNSURLFileProtectionType = objc.NSString; +typedef NSURLUbiquitousItemDownloadingStatus = ffi.Pointer; +typedef DartNSURLUbiquitousItemDownloadingStatus = objc.NSString; +typedef NSURLUbiquitousSharedItemRole = ffi.Pointer; +typedef DartNSURLUbiquitousSharedItemRole = objc.NSString; +typedef NSURLUbiquitousSharedItemPermissions = ffi.Pointer; +typedef DartNSURLUbiquitousSharedItemPermissions = objc.NSString; + +/// NSLocking +abstract final class NSLocking { + /// Builds an object that implements the NSLocking protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. + static objc.ObjCObjectBase implement( + {required void Function() lock, required void Function() unlock}) { + final builder = objc.ObjCProtocolBuilder(); + NSLocking.lock.implement(builder, lock); + NSLocking.unlock.implement(builder, unlock); + return builder.build(); + } + + /// Adds the implementation of the NSLocking protocol to an existing + /// [objc.ObjCProtocolBuilder]. + static void addToBuilder(objc.ObjCProtocolBuilder builder, + {required void Function() lock, required void Function() unlock}) { + NSLocking.lock.implement(builder, lock); + NSLocking.unlock.implement(builder, unlock); + } + + /// Builds an object that implements the NSLocking protocol. To implement + /// multiple protocols, use [addToBuilder] or [objc.ObjCProtocolBuilder] directly. All + /// methods that can be implemented as listeners will be. + static objc.ObjCObjectBase implementAsListener( + {required void Function() lock, required void Function() unlock}) { + final builder = objc.ObjCProtocolBuilder(); + NSLocking.lock.implementAsListener(builder, lock); + NSLocking.unlock.implementAsListener(builder, unlock); + return builder.build(); + } + + /// Adds the implementation of the NSLocking protocol to an existing + /// [objc.ObjCProtocolBuilder]. All methods that can be implemented as listeners will + /// be. + static void addToBuilderAsListener(objc.ObjCProtocolBuilder builder, + {required void Function() lock, required void Function() unlock}) { + NSLocking.lock.implementAsListener(builder, lock); + NSLocking.unlock.implementAsListener(builder, unlock); + } + + /// lock + static final lock = objc.ObjCProtocolListenableMethod( + _sel_lock, + objc.getProtocolMethodSignature( + _protocol_NSLocking, + _sel_lock, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); + + /// unlock + static final unlock = objc.ObjCProtocolListenableMethod( + _sel_unlock, + objc.getProtocolMethodSignature( + _protocol_NSLocking, + _sel_unlock, + isRequired: true, + isInstanceMethod: true, + ), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.fromFunction(( + ffi.Pointer _, + ) => + func()), + (void Function() func) => ObjCBlock_ffiVoid_ffiVoid.listener(( + ffi.Pointer _, + ) => + func()), + ); +} + +late final _protocol_NSLocking = objc.getProtocol("NSLocking"); +late final _sel_lock = objc.registerName("lock"); +late final _sel_unlock = objc.registerName("unlock"); + +/// NSException +class NSException extends objc.NSObject { + NSException._(ffi.Pointer pointer, + {bool retain = false, bool release = false}) + : super.castFromPointer(pointer, retain: retain, release: release); - static CUPHTTPForwardedFinishedDownloading alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedFinishedDownloading1, _lib._sel_alloc1); - return CUPHTTPForwardedFinishedDownloading._(_ret, _lib, - retain: false, release: true); - } -} + /// Constructs a [NSException] that points to the same underlying object as [other]. + NSException.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); -class CUPHTTPForwardedWebSocketOpened extends CUPHTTPForwardedDelegate { - CUPHTTPForwardedWebSocketOpened._( - ffi.Pointer id, NativeCupertinoHttp lib, + /// Constructs a [NSException] that wraps the given raw object pointer. + NSException.castFromPointer(ffi.Pointer other, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); - - /// Returns a [CUPHTTPForwardedWebSocketOpened] that points to the same underlying object as [other]. - static CUPHTTPForwardedWebSocketOpened castFrom( - T other) { - return CUPHTTPForwardedWebSocketOpened._(other._id, other._lib, - retain: true, release: true); - } + : this._(other, retain: retain, release: release); - /// Returns a [CUPHTTPForwardedWebSocketOpened] that wraps the given raw object pointer. - static CUPHTTPForwardedWebSocketOpened castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedWebSocketOpened._(other, lib, - retain: retain, release: release); + /// Returns whether [obj] is an instance of [NSException]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSException); } - /// Returns whether [obj] is an instance of [CUPHTTPForwardedWebSocketOpened]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedWebSocketOpened1); + /// exceptionWithName:reason:userInfo: + static NSException exceptionWithName_reason_userInfo_( + DartNSExceptionName name, + objc.NSString? reason, + objc.NSDictionary? userInfo) { + final _ret = _objc_msgSend_aud7dn( + _class_NSException, + _sel_exceptionWithName_reason_userInfo_, + name.ref.pointer, + reason?.ref.pointer ?? ffi.nullptr, + userInfo?.ref.pointer ?? ffi.nullptr); + return NSException.castFromPointer(_ret, retain: true, release: true); + } + + /// initWithName:reason:userInfo: + NSException initWithName_reason_userInfo_(DartNSExceptionName aName, + objc.NSString? aReason, objc.NSDictionary? aUserInfo) { + final _ret = _objc_msgSend_aud7dn( + this.ref.retainAndReturnPointer(), + _sel_initWithName_reason_userInfo_, + aName.ref.pointer, + aReason?.ref.pointer ?? ffi.nullptr, + aUserInfo?.ref.pointer ?? ffi.nullptr); + return NSException.castFromPointer(_ret, retain: false, release: true); + } + + /// name + DartNSExceptionName get name { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); + return objc.NSString.castFromPointer(_ret, retain: true, release: true); } - NSObject initWithSession_webSocketTask_didOpenWithProtocol_( - NSURLSession session, - NSURLSessionWebSocketTask webSocketTask, - NSString? protocol) { - final _ret = _lib._objc_msgSend_548( - _id, - _lib._sel_initWithSession_webSocketTask_didOpenWithProtocol_1, - session._id, - webSocketTask._id, - protocol?._id ?? ffi.nullptr); - return NSObject._(_ret, _lib, retain: true, release: true); + /// reason + objc.NSString? get reason { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_reason); + return _ret.address == 0 + ? null + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - NSString? get protocol { - final _ret = _lib._objc_msgSend_55(_id, _lib._sel_protocol1); + /// userInfo + objc.NSDictionary? get userInfo { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_userInfo); return _ret.address == 0 ? null - : NSString._(_ret, _lib, retain: true, release: true); + : objc.NSDictionary.castFromPointer(_ret, retain: true, release: true); } - @override - CUPHTTPForwardedWebSocketOpened init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedWebSocketOpened._(_ret, _lib, - retain: true, release: true); + /// callStackReturnAddresses + objc.NSArray get callStackReturnAddresses { + final _ret = + _objc_msgSend_1unuoxw(this.ref.pointer, _sel_callStackReturnAddresses); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } - static CUPHTTPForwardedWebSocketOpened new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedWebSocketOpened1, _lib._sel_new1); - return CUPHTTPForwardedWebSocketOpened._(_ret, _lib, - retain: false, release: true); + /// callStackSymbols + objc.NSArray get callStackSymbols { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_callStackSymbols); + return objc.NSArray.castFromPointer(_ret, retain: true, release: true); } - static CUPHTTPForwardedWebSocketOpened allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedWebSocketOpened1, - _lib._sel_allocWithZone_1, - zone); - return CUPHTTPForwardedWebSocketOpened._(_ret, _lib, - retain: false, release: true); + /// raise + void raise() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_raise); } - static CUPHTTPForwardedWebSocketOpened alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedWebSocketOpened1, _lib._sel_alloc1); - return CUPHTTPForwardedWebSocketOpened._(_ret, _lib, - retain: false, release: true); + /// raise:format: + static void raise_format_(DartNSExceptionName name, objc.NSString format) { + _objc_msgSend_1tjlcwl(_class_NSException, _sel_raise_format_, + name.ref.pointer, format.ref.pointer); } -} -class CUPHTTPForwardedWebSocketClosed extends CUPHTTPForwardedDelegate { - CUPHTTPForwardedWebSocketClosed._( - ffi.Pointer id, NativeCupertinoHttp lib, - {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + /// init + NSException init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSException.castFromPointer(_ret, retain: false, release: true); + } - /// Returns a [CUPHTTPForwardedWebSocketClosed] that points to the same underlying object as [other]. - static CUPHTTPForwardedWebSocketClosed castFrom( - T other) { - return CUPHTTPForwardedWebSocketClosed._(other._id, other._lib, - retain: true, release: true); + /// new + static NSException new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSException, _sel_new); + return NSException.castFromPointer(_ret, retain: false, release: true); } - /// Returns a [CUPHTTPForwardedWebSocketClosed] that wraps the given raw object pointer. - static CUPHTTPForwardedWebSocketClosed castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPForwardedWebSocketClosed._(other, lib, - retain: retain, release: release); + /// allocWithZone: + static NSException allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSException, _sel_allocWithZone_, zone); + return NSException.castFromPointer(_ret, retain: false, release: true); } - /// Returns whether [obj] is an instance of [CUPHTTPForwardedWebSocketClosed]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPForwardedWebSocketClosed1); + /// alloc + static NSException alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSException, _sel_alloc); + return NSException.castFromPointer(_ret, retain: false, release: true); } - NSObject initWithSession_webSocketTask_code_reason_(NSURLSession session, - NSURLSessionWebSocketTask webSocketTask, int closeCode, NSData reason) { - final _ret = _lib._objc_msgSend_549( - _id, - _lib._sel_initWithSession_webSocketTask_code_reason_1, - session._id, - webSocketTask._id, - closeCode, - reason._id); - return NSObject._(_ret, _lib, retain: true, release: true); + /// supportsSecureCoding + static bool supportsSecureCoding() { + return _objc_msgSend_olxnu1(_class_NSException, _sel_supportsSecureCoding); } - int get closeCode { - return _lib._objc_msgSend_477(_id, _lib._sel_closeCode1); + /// encodeWithCoder: + void encodeWithCoder_(objc.NSCoder coder) { + _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_encodeWithCoder_, coder.ref.pointer); } - NSData? get reason { - final _ret = _lib._objc_msgSend_348(_id, _lib._sel_reason1); + /// initWithCoder: + NSException? initWithCoder_(objc.NSCoder coder) { + final _ret = _objc_msgSend_juohf7(this.ref.retainAndReturnPointer(), + _sel_initWithCoder_, coder.ref.pointer); return _ret.address == 0 ? null - : NSData._(_ret, _lib, retain: true, release: true); - } - - @override - CUPHTTPForwardedWebSocketClosed init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPForwardedWebSocketClosed._(_ret, _lib, - retain: true, release: true); - } - - static CUPHTTPForwardedWebSocketClosed new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedWebSocketClosed1, _lib._sel_new1); - return CUPHTTPForwardedWebSocketClosed._(_ret, _lib, - retain: false, release: true); - } - - static CUPHTTPForwardedWebSocketClosed allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPForwardedWebSocketClosed1, - _lib._sel_allocWithZone_1, - zone); - return CUPHTTPForwardedWebSocketClosed._(_ret, _lib, - retain: false, release: true); - } - - static CUPHTTPForwardedWebSocketClosed alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPForwardedWebSocketClosed1, _lib._sel_alloc1); - return CUPHTTPForwardedWebSocketClosed._(_ret, _lib, - retain: false, release: true); - } -} + : NSException.castFromPointer(_ret, retain: false, release: true); + } +} + +late final _class_NSException = objc.getClass("NSException"); +late final _sel_exceptionWithName_reason_userInfo_ = + objc.registerName("exceptionWithName:reason:userInfo:"); +late final _sel_initWithName_reason_userInfo_ = + objc.registerName("initWithName:reason:userInfo:"); +late final _sel_reason = objc.registerName("reason"); +late final _sel_callStackReturnAddresses = + objc.registerName("callStackReturnAddresses"); +late final _sel_callStackSymbols = objc.registerName("callStackSymbols"); +late final _sel_raise = objc.registerName("raise"); +late final _sel_raise_format_ = objc.registerName("raise:format:"); +typedef NSUncaughtExceptionHandler = ffi + .NativeFunction exception)>; +typedef NSErrorDomain = ffi.Pointer; +typedef DartNSErrorDomain = objc.NSString; +typedef NSErrorUserInfoKey = ffi.Pointer; +typedef DartNSErrorUserInfoKey = objc.NSString; +typedef _DidFinish = ffi.Pointer; +typedef Dart_DidFinish = objc.ObjCBlock< + ffi.Void Function(ffi.Pointer, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)>; +typedef _DidFinishWithLock = ffi.Pointer; +typedef Dart_DidFinishWithLock = objc.ObjCBlock< + ffi.Void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)>; +void + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + block.ref.target + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); +ffi.Pointer + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable = + ffi.Pointer.fromFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureTrampoline) + .cast(); +void + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) { + (objc.getBlockClosure(block) as void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer))(arg0, arg1, arg2, arg3); + objc.objectRelease(block.cast()); +} + +ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)> + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable = + ffi.NativeCallable< + ffi.Void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>.listener( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerTrampoline) + ..keepIsolateAlive = false; + +/// Construction methods for `objc.ObjCBlock`. +abstract final class ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL { + /// Returns a block that wraps the given raw block pointer. + static objc.ObjCBlock< + ffi.Void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> + castFromPointer(ffi.Pointer pointer, + {bool retain = false, bool release = false}) => + objc.ObjCBlock< + ffi.Void Function( + NSCondition, + NSURLSession, + NSURLSessionDownloadTask, + objc.NSURL)>(pointer, retain: retain, release: release); -abstract class NSStreamEvent { - static const int NSStreamEventNone = 0; - static const int NSStreamEventOpenCompleted = 1; - static const int NSStreamEventHasBytesAvailable = 2; - static const int NSStreamEventHasSpaceAvailable = 4; - static const int NSStreamEventErrorOccurred = 8; - static const int NSStreamEventEndEncountered = 16; -} + /// 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. + static objc.ObjCBlock + fromFunctionPointer(ffi.Pointer arg0, ffi.Pointer arg1, ffi.Pointer arg2, ffi.Pointer arg3)>> ptr) => + objc.ObjCBlock< + ffi.Void Function(NSCondition, NSURLSession, + NSURLSessionDownloadTask, objc.NSURL)>( + objc.newPointerBlock( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_fnPtrCallable, + ptr.cast()), + retain: false, + release: true); -typedef NSStreamSocketSecurityLevel = ffi.Pointer; -typedef DartNSStreamSocketSecurityLevel = NSString; -typedef NSStreamSOCKSProxyConfiguration = ffi.Pointer; -typedef DartNSStreamSOCKSProxyConfiguration = NSString; -typedef NSStreamSOCKSProxyVersion = ffi.Pointer; -typedef DartNSStreamSOCKSProxyVersion = NSString; -typedef NSErrorDomain1 = ffi.Pointer; -typedef DartNSErrorDomain1 = NSString; -typedef NSStreamNetworkServiceTypeValue = ffi.Pointer; -typedef DartNSStreamNetworkServiceTypeValue = NSString; + /// 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. + static objc.ObjCBlock fromFunction(void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) fn) => + objc.ObjCBlock( + objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_closureCallable, + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + NSCondition.castFromPointer(arg0, retain: true, release: true), + NSURLSession.castFromPointer(arg1, retain: true, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, retain: true, release: true), + objc.NSURL.castFromPointer(arg3, retain: true, release: true))), + retain: false, + release: true); -/// A helper to convert a Dart Stream> into an Objective-C input stream. -class CUPHTTPStreamToNSInputStreamAdapter extends NSInputStream { - CUPHTTPStreamToNSInputStreamAdapter._( - ffi.Pointer id, NativeCupertinoHttp lib, + /// 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. + static objc.ObjCBlock< + ffi.Void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, + objc.NSURL)> listener( + void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL) + fn) { + final raw = objc.newClosureBlock( + _ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_listenerCallable + .nativeFunction + .cast(), + (ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3) => + fn( + NSCondition.castFromPointer(arg0, retain: false, release: true), + NSURLSession.castFromPointer(arg1, + retain: false, release: true), + NSURLSessionDownloadTask.castFromPointer(arg2, + retain: false, release: true), + objc.NSURL + .castFromPointer(arg3, retain: false, release: true))); + final wrapper = _wrapListenerBlock_19b8ge5(raw); + objc.objectRelease(raw.cast()); + return objc.ObjCBlock< + ffi.Void Function(NSCondition, NSURLSession, NSURLSessionDownloadTask, + objc.NSURL)>(wrapper, retain: false, release: true); + } +} + +/// Call operator for `objc.ObjCBlock`. +extension ObjCBlock_ffiVoid_NSCondition_NSURLSession_NSURLSessionDownloadTask_NSURL_CallExtension + on objc.ObjCBlock< + ffi.Void Function( + NSCondition, NSURLSession, NSURLSessionDownloadTask, objc.NSURL)> { + void call(NSCondition arg0, NSURLSession arg1, NSURLSessionDownloadTask arg2, + objc.NSURL arg3) => + ref.pointer.ref.invoke + .cast< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer block, + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, + ffi.Pointer arg3)>>() + .asFunction< + void Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>()( + ref.pointer, + arg0.ref.pointer, + arg1.ref.pointer, + arg2.ref.pointer, + arg3.ref.pointer); +} + +/// NSCondition +class NSCondition extends objc.NSObject { + NSCondition._(ffi.Pointer pointer, {bool retain = false, bool release = false}) - : super._(id, lib, retain: retain, release: release); + : super.castFromPointer(pointer, retain: retain, release: release); - /// Returns a [CUPHTTPStreamToNSInputStreamAdapter] that points to the same underlying object as [other]. - static CUPHTTPStreamToNSInputStreamAdapter castFrom( - T other) { - return CUPHTTPStreamToNSInputStreamAdapter._(other._id, other._lib, - retain: true, release: true); - } - - /// Returns a [CUPHTTPStreamToNSInputStreamAdapter] that wraps the given raw object pointer. - static CUPHTTPStreamToNSInputStreamAdapter castFromPointer( - NativeCupertinoHttp lib, ffi.Pointer other, - {bool retain = false, bool release = false}) { - return CUPHTTPStreamToNSInputStreamAdapter._(other, lib, - retain: retain, release: release); - } - - /// Returns whether [obj] is an instance of [CUPHTTPStreamToNSInputStreamAdapter]. - static bool isInstance(_ObjCWrapper obj) { - return obj._lib._objc_msgSend_0(obj._id, obj._lib._sel_isKindOfClass_1, - obj._lib._class_CUPHTTPStreamToNSInputStreamAdapter1); - } - - CUPHTTPStreamToNSInputStreamAdapter initWithPort_(DartDart_Port sendPort) { - final _ret = - _lib._objc_msgSend_533(_id, _lib._sel_initWithPort_1, sendPort); - return CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); - } + /// Constructs a [NSCondition] that points to the same underlying object as [other]. + NSCondition.castFrom(objc.ObjCObjectBase other) + : this._(other.ref.pointer, retain: true, release: true); - DartNSUInteger addData_(NSData data) { - return _lib._objc_msgSend_550(_id, _lib._sel_addData_1, data._id); - } + /// Constructs a [NSCondition] that wraps the given raw object pointer. + NSCondition.castFromPointer(ffi.Pointer other, + {bool retain = false, bool release = false}) + : this._(other, retain: retain, release: release); - void setDone() { - _lib._objc_msgSend_1(_id, _lib._sel_setDone1); + /// Returns whether [obj] is an instance of [NSCondition]. + static bool isInstance(objc.ObjCObjectBase obj) { + return _objc_msgSend_l8lotg( + obj.ref.pointer, _sel_isKindOfClass_, _class_NSCondition); } - void setError_(NSError error) { - _lib._objc_msgSend_551(_id, _lib._sel_setError_1, error._id); + /// wait + void wait1() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_wait); } - @override - CUPHTTPStreamToNSInputStreamAdapter initWithData_(NSData data) { - final _ret = - _lib._objc_msgSend_228(_id, _lib._sel_initWithData_1, data._id); - return CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); + /// waitUntilDate: + bool waitUntilDate_(objc.NSDate limit) { + return _objc_msgSend_l8lotg( + this.ref.pointer, _sel_waitUntilDate_, limit.ref.pointer); } - @override - CUPHTTPStreamToNSInputStreamAdapter? initWithURL_(NSURL url) { - final _ret = _lib._objc_msgSend_226(_id, _lib._sel_initWithURL_1, url._id); - return _ret.address == 0 - ? null - : CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); + /// signal + void signal() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_signal); } - @override - CUPHTTPStreamToNSInputStreamAdapter? initWithFileAtPath_(NSString path) { - final _ret = - _lib._objc_msgSend_49(_id, _lib._sel_initWithFileAtPath_1, path._id); - return _ret.address == 0 - ? null - : CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); + /// broadcast + void broadcast() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_broadcast); } - static CUPHTTPStreamToNSInputStreamAdapter? inputStreamWithData_( - NativeCupertinoHttp _lib, NSData data) { - final _ret = _lib._objc_msgSend_361( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, - _lib._sel_inputStreamWithData_1, - data._id); + /// name + objc.NSString? get name { + final _ret = _objc_msgSend_1unuoxw(this.ref.pointer, _sel_name); return _ret.address == 0 ? null - : CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); + : objc.NSString.castFromPointer(_ret, retain: true, release: true); } - static CUPHTTPStreamToNSInputStreamAdapter? inputStreamWithFileAtPath_( - NativeCupertinoHttp _lib, NSString path) { - final _ret = _lib._objc_msgSend_49( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, - _lib._sel_inputStreamWithFileAtPath_1, - path._id); - return _ret.address == 0 - ? null - : CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); + /// setName: + set name(objc.NSString? value) { + return _objc_msgSend_ukcdfq( + this.ref.pointer, _sel_setName_, value?.ref.pointer ?? ffi.nullptr); } - static CUPHTTPStreamToNSInputStreamAdapter? inputStreamWithURL_( - NativeCupertinoHttp _lib, NSURL url) { - final _ret = _lib._objc_msgSend_226( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, - _lib._sel_inputStreamWithURL_1, - url._id); - return _ret.address == 0 - ? null - : CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); + /// init + NSCondition init() { + final _ret = + _objc_msgSend_1unuoxw(this.ref.retainAndReturnPointer(), _sel_init); + return NSCondition.castFromPointer(_ret, retain: false, release: true); } - static void getStreamsToHostWithName_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSString hostname, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_357( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, - _lib._sel_getStreamsToHostWithName_port_inputStream_outputStream_1, - hostname._id, - port, - inputStream, - outputStream); - } - - static void getStreamsToHost_port_inputStream_outputStream_( - NativeCupertinoHttp _lib, - NSHost host, - DartNSInteger port, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_358( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, - _lib._sel_getStreamsToHost_port_inputStream_outputStream_1, - host._id, - port, - inputStream, - outputStream); - } - - static void getBoundStreamsWithBufferSize_inputStream_outputStream_( - NativeCupertinoHttp _lib, - DartNSUInteger bufferSize, - ffi.Pointer> inputStream, - ffi.Pointer> outputStream) { - _lib._objc_msgSend_359( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, - _lib._sel_getBoundStreamsWithBufferSize_inputStream_outputStream_1, - bufferSize, - inputStream, - outputStream); + /// new + static NSCondition new1() { + final _ret = _objc_msgSend_1unuoxw(_class_NSCondition, _sel_new); + return NSCondition.castFromPointer(_ret, retain: false, release: true); } - @override - CUPHTTPStreamToNSInputStreamAdapter init() { - final _ret = _lib._objc_msgSend_2(_id, _lib._sel_init1); - return CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: true, release: true); + /// allocWithZone: + static NSCondition allocWithZone_(ffi.Pointer<_NSZone> zone) { + final _ret = + _objc_msgSend_1b3ihd0(_class_NSCondition, _sel_allocWithZone_, zone); + return NSCondition.castFromPointer(_ret, retain: false, release: true); } - static CUPHTTPStreamToNSInputStreamAdapter new1(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, _lib._sel_new1); - return CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: false, release: true); + /// alloc + static NSCondition alloc() { + final _ret = _objc_msgSend_1unuoxw(_class_NSCondition, _sel_alloc); + return NSCondition.castFromPointer(_ret, retain: false, release: true); } - static CUPHTTPStreamToNSInputStreamAdapter allocWithZone_( - NativeCupertinoHttp _lib, ffi.Pointer<_NSZone> zone) { - final _ret = _lib._objc_msgSend_3( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, - _lib._sel_allocWithZone_1, - zone); - return CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: false, release: true); + /// lock + void lock() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_lock); } - static CUPHTTPStreamToNSInputStreamAdapter alloc(NativeCupertinoHttp _lib) { - final _ret = _lib._objc_msgSend_2( - _lib._class_CUPHTTPStreamToNSInputStreamAdapter1, _lib._sel_alloc1); - return CUPHTTPStreamToNSInputStreamAdapter._(_ret, _lib, - retain: false, release: true); + /// unlock + void unlock() { + _objc_msgSend_ksby9f(this.ref.pointer, _sel_unlock); } } +late final _class_NSCondition = objc.getClass("NSCondition"); +late final _sel_wait = objc.registerName("wait"); +late final _sel_waitUntilDate_ = objc.registerName("waitUntilDate:"); +final _objc_msgSend_l8lotg = objc.msgSendPointer + .cast< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>() + .asFunction< + bool Function(ffi.Pointer, + ffi.Pointer, ffi.Pointer)>(); +late final _sel_signal = objc.registerName("signal"); +late final _sel_broadcast = objc.registerName("broadcast"); + const int noErr = 0; const int kNilOptions = 0; @@ -95996,6 +78899,8 @@ const int CSSM_APPLE_PRIVATE_CSPDL_CODE_27 = 27; const int CSSM_APPLECSP_KEYDIGEST = 256; +const int CSSM_APPLECSP_PUBKEY = 257; + const int CSSM_KEYBLOB_WRAPPED_FORMAT_APPLE_CUSTOM = 100; const int CSSM_KEYBLOB_WRAPPED_FORMAT_OPENSSL = 101; @@ -96512,14 +79417,6 @@ const int NSProprietaryStringEncoding = 65536; const int NSOpenStepUnicodeReservedBase = 62464; -const int kNativeArgNumberPos = 0; - -const int kNativeArgNumberSize = 8; - -const int kNativeArgTypePos = 8; - -const int kNativeArgTypeSize = 8; - const int __API_TO_BE_DEPRECATED = 100000; const int __API_TO_BE_DEPRECATED_MACOS = 100000; @@ -96652,6 +79549,12 @@ const int __MAC_14_1 = 140100; const int __MAC_14_2 = 140200; +const int __MAC_14_3 = 140300; + +const int __MAC_14_4 = 140400; + +const int __MAC_14_5 = 140500; + const int __IPHONE_2_0 = 20000; const int __IPHONE_2_1 = 20100; @@ -96778,6 +79681,10 @@ const int __IPHONE_15_5 = 150500; const int __IPHONE_15_6 = 150600; +const int __IPHONE_15_7 = 150700; + +const int __IPHONE_15_8 = 150800; + const int __IPHONE_16_0 = 160000; const int __IPHONE_16_1 = 160100; @@ -96800,6 +79707,12 @@ const int __IPHONE_17_1 = 170100; const int __IPHONE_17_2 = 170200; +const int __IPHONE_17_3 = 170300; + +const int __IPHONE_17_4 = 170400; + +const int __IPHONE_17_5 = 170500; + const int __WATCHOS_1_0 = 10000; const int __WATCHOS_2_0 = 20000; @@ -96866,6 +79779,8 @@ const int __WATCHOS_8_6 = 80600; const int __WATCHOS_8_7 = 80700; +const int __WATCHOS_8_8 = 80800; + const int __WATCHOS_9_0 = 90000; const int __WATCHOS_9_1 = 90100; @@ -96886,6 +79801,12 @@ const int __WATCHOS_10_1 = 100100; const int __WATCHOS_10_2 = 100200; +const int __WATCHOS_10_3 = 100300; + +const int __WATCHOS_10_4 = 100400; + +const int __WATCHOS_10_5 = 100500; + const int __TVOS_9_0 = 90000; const int __TVOS_9_1 = 90100; @@ -96976,6 +79897,12 @@ const int __TVOS_17_1 = 170100; const int __TVOS_17_2 = 170200; +const int __TVOS_17_3 = 170300; + +const int __TVOS_17_4 = 170400; + +const int __TVOS_17_5 = 170500; + const int __BRIDGEOS_2_0 = 20000; const int __BRIDGEOS_3_0 = 30000; @@ -97022,6 +79949,12 @@ const int __BRIDGEOS_8_1 = 80100; const int __BRIDGEOS_8_2 = 80200; +const int __BRIDGEOS_8_3 = 80300; + +const int __BRIDGEOS_8_4 = 80400; + +const int __BRIDGEOS_8_5 = 80500; + const int __DRIVERKIT_19_0 = 190000; const int __DRIVERKIT_20_0 = 200000; @@ -97042,8 +79975,18 @@ const int __DRIVERKIT_23_1 = 230100; const int __DRIVERKIT_23_2 = 230200; +const int __DRIVERKIT_23_3 = 230300; + +const int __DRIVERKIT_23_4 = 230400; + +const int __DRIVERKIT_23_5 = 230500; + const int __VISIONOS_1_0 = 10000; +const int __VISIONOS_1_1 = 10100; + +const int __VISIONOS_1_2 = 10200; + const int MAC_OS_X_VERSION_10_0 = 1000; const int MAC_OS_X_VERSION_10_1 = 1010; @@ -97160,10 +80103,20 @@ const int MAC_OS_VERSION_14_1 = 140100; const int MAC_OS_VERSION_14_2 = 140200; -const int __MAC_OS_X_VERSION_MAX_ALLOWED = 140200; +const int MAC_OS_VERSION_14_3 = 140300; + +const int MAC_OS_VERSION_14_4 = 140400; + +const int MAC_OS_VERSION_14_5 = 140500; + +const int __MAC_OS_X_VERSION_MIN_REQUIRED = 140000; + +const int __MAC_OS_X_VERSION_MAX_ALLOWED = 140500; const int __ENABLE_LEGACY_MAC_AVAILABILITY = 1; +const int __has_safe_buffers = 1; + const int __DARWIN_ONLY_64_BIT_INO_T = 1; const int __DARWIN_ONLY_UNIX_CONFORMANCE = 1; @@ -97776,47 +80729,25 @@ const int EXIT_SUCCESS = 0; const int RAND_MAX = 2147483647; -const int DYNAMIC_TARGETS_ENABLED = 0; +const int MAC_OS_X_VERSION_MIN_REQUIRED = 140000; -const int TARGET_OS_WIN32 = 0; +const int MAC_OS_X_VERSION_MAX_ALLOWED = 140000; -const int TARGET_OS_WINDOWS = 0; +const int __AVAILABILITY_MACROS_USES_AVAILABILITY = 1; -const int TARGET_OS_UNIX = 0; - -const int TARGET_OS_LINUX = 0; - -const int TARGET_OS_MAC = 1; - -const int TARGET_OS_OSX = 1; - -const int TARGET_OS_IPHONE = 0; - -const int TARGET_OS_IOS = 0; - -const int TARGET_OS_WATCH = 0; - -const int TARGET_OS_TV = 0; - -const int TARGET_OS_MACCATALYST = 0; - -const int TARGET_OS_VISION = 0; - -const int TARGET_OS_UIKITFORMAC = 0; - -const int TARGET_OS_SIMULATOR = 0; +const int TARGET_OS_RTKIT = 0; -const int TARGET_OS_EMBEDDED = 0; +const int TARGET_RT_LITTLE_ENDIAN = 1; -const int TARGET_OS_RTKIT = 0; +const int TARGET_RT_BIG_ENDIAN = 0; -const int TARGET_OS_DRIVERKIT = 0; +const int TARGET_RT_64_BIT = 1; -const int TARGET_IPHONE_SIMULATOR = 0; +const int TARGET_RT_MAC_CFM = 0; -const int TARGET_OS_NANO = 0; +const int TARGET_RT_MAC_MACHO = 1; -const int TARGET_ABI_USES_IOS_VALUES = 1; +const int TARGET_CPU_ARM64 = 1; const int TARGET_CPU_PPC = 0; @@ -97830,23 +80761,13 @@ const int TARGET_CPU_X86_64 = 0; const int TARGET_CPU_ARM = 0; -const int TARGET_CPU_ARM64 = 1; - const int TARGET_CPU_MIPS = 0; const int TARGET_CPU_SPARC = 0; const int TARGET_CPU_ALPHA = 0; -const int TARGET_RT_MAC_CFM = 0; - -const int TARGET_RT_MAC_MACHO = 1; - -const int TARGET_RT_LITTLE_ENDIAN = 1; - -const int TARGET_RT_BIG_ENDIAN = 0; - -const int TARGET_RT_64_BIT = 1; +const int TARGET_ABI_USES_IOS_VALUES = 1; const int __DARWIN_FD_SETSIZE = 1024; @@ -97860,12 +80781,34 @@ const int NFDBITS = 32; const int FD_SETSIZE = 1024; +const int OBJC_API_VERSION = 2; + +const int OBJC_NO_GC = 1; + +const int NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER = 1; + +const int OBJC_OLD_DISPATCH_PROTOTYPES = 0; + const int __bool_true_false_are_defined = 1; const int true1 = 1; const int false1 = 0; +const int OBJC_BOOL_IS_BOOL = 1; + +const int YES = 1; + +const int NO = 0; + +const int NSIntegerMax = 9223372036854775807; + +const int NSIntegerMin = -9223372036854775808; + +const int NSUIntegerMax = -1; + +const int NSINTEGER_DEFINED = 1; + const int __GNUC_VA_LIST = 1; const int __DARWIN_CLK_TCK = 100; @@ -97924,8 +80867,184 @@ const int QUAD_MAX = 9223372036854775807; const int QUAD_MIN = -9223372036854775808; +const int ARG_MAX = 1048576; + +const int CHILD_MAX = 266; + +const int GID_MAX = 2147483647; + +const int LINK_MAX = 32767; + +const int MAX_CANON = 1024; + +const int MAX_INPUT = 1024; + +const int NAME_MAX = 255; + +const int NGROUPS_MAX = 16; + +const int UID_MAX = 2147483647; + +const int OPEN_MAX = 10240; + +const int PATH_MAX = 1024; + +const int PIPE_BUF = 512; + +const int BC_BASE_MAX = 99; + +const int BC_DIM_MAX = 2048; + +const int BC_SCALE_MAX = 99; + +const int BC_STRING_MAX = 1000; + +const int CHARCLASS_NAME_MAX = 14; + +const int COLL_WEIGHTS_MAX = 2; + +const int EQUIV_CLASS_MAX = 2; + +const int EXPR_NEST_MAX = 32; + +const int LINE_MAX = 2048; + +const int RE_DUP_MAX = 255; + +const int NZERO = 20; + +const int _POSIX_ARG_MAX = 4096; + +const int _POSIX_CHILD_MAX = 25; + +const int _POSIX_LINK_MAX = 8; + +const int _POSIX_MAX_CANON = 255; + +const int _POSIX_MAX_INPUT = 255; + +const int _POSIX_NAME_MAX = 14; + +const int _POSIX_NGROUPS_MAX = 8; + +const int _POSIX_OPEN_MAX = 20; + +const int _POSIX_PATH_MAX = 256; + +const int _POSIX_PIPE_BUF = 512; + +const int _POSIX_SSIZE_MAX = 32767; + +const int _POSIX_STREAM_MAX = 8; + +const int _POSIX_TZNAME_MAX = 6; + +const int _POSIX2_BC_BASE_MAX = 99; + +const int _POSIX2_BC_DIM_MAX = 2048; + +const int _POSIX2_BC_SCALE_MAX = 99; + +const int _POSIX2_BC_STRING_MAX = 1000; + +const int _POSIX2_EQUIV_CLASS_MAX = 2; + +const int _POSIX2_EXPR_NEST_MAX = 32; + +const int _POSIX2_LINE_MAX = 2048; + +const int _POSIX2_RE_DUP_MAX = 255; + +const int _POSIX_AIO_LISTIO_MAX = 2; + +const int _POSIX_AIO_MAX = 1; + +const int _POSIX_DELAYTIMER_MAX = 32; + +const int _POSIX_MQ_OPEN_MAX = 8; + +const int _POSIX_MQ_PRIO_MAX = 32; + +const int _POSIX_RTSIG_MAX = 8; + +const int _POSIX_SEM_NSEMS_MAX = 256; + +const int _POSIX_SEM_VALUE_MAX = 32767; + +const int _POSIX_SIGQUEUE_MAX = 32; + +const int _POSIX_TIMER_MAX = 32; + +const int _POSIX_CLOCKRES_MIN = 20000000; + +const int _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4; + const int _POSIX_THREAD_KEYS_MAX = 128; +const int _POSIX_THREAD_THREADS_MAX = 64; + +const int PTHREAD_DESTRUCTOR_ITERATIONS = 4; + +const int PTHREAD_KEYS_MAX = 512; + +const int PTHREAD_STACK_MIN = 16384; + +const int _POSIX_HOST_NAME_MAX = 255; + +const int _POSIX_LOGIN_NAME_MAX = 9; + +const int _POSIX_SS_REPL_MAX = 4; + +const int _POSIX_SYMLINK_MAX = 255; + +const int _POSIX_SYMLOOP_MAX = 8; + +const int _POSIX_TRACE_EVENT_NAME_MAX = 30; + +const int _POSIX_TRACE_NAME_MAX = 8; + +const int _POSIX_TRACE_SYS_MAX = 8; + +const int _POSIX_TRACE_USER_EVENT_MAX = 32; + +const int _POSIX_TTY_NAME_MAX = 9; + +const int _POSIX2_CHARCLASS_NAME_MAX = 14; + +const int _POSIX2_COLL_WEIGHTS_MAX = 2; + +const int _POSIX_RE_DUP_MAX = 255; + +const int OFF_MIN = -9223372036854775808; + +const int OFF_MAX = 9223372036854775807; + +const int PASS_MAX = 128; + +const int NL_ARGMAX = 9; + +const int NL_LANGMAX = 14; + +const int NL_MSGMAX = 32767; + +const int NL_NMAX = 1; + +const int NL_SETMAX = 255; + +const int NL_TEXTMAX = 2048; + +const int _XOPEN_IOV_MAX = 16; + +const int IOV_MAX = 1024; + +const int _XOPEN_NAME_MAX = 255; + +const int _XOPEN_PATH_MAX = 1024; + +const int NS_BLOCKS_AVAILABLE = 1; + +const int __COREFOUNDATION_CFAVAILABILITY__ = 1; + const int API_TO_BE_DEPRECATED = 100000; const int API_TO_BE_DEPRECATED_MACOS = 100000; @@ -97940,10 +81059,412 @@ const int API_TO_BE_DEPRECATED_DRIVERKIT = 100000; const int API_TO_BE_DEPRECATED_VISIONOS = 100000; +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 UNIVERSAL_INTERFACES_VERSION = 1024; + +const int PRAGMA_IMPORT = 0; + +const int PRAGMA_ONCE = 0; + +const int PRAGMA_STRUCT_PACK = 1; + +const int PRAGMA_STRUCT_PACKPUSH = 1; + +const int PRAGMA_STRUCT_ALIGN = 0; + +const int PRAGMA_ENUM_PACK = 0; + +const int PRAGMA_ENUM_ALWAYSINT = 0; + +const int PRAGMA_ENUM_OPTIONS = 0; + +const int TYPE_EXTENDED = 0; + +const int TYPE_LONGDOUBLE_IS_DOUBLE = 0; + +const int TYPE_LONGLONG = 1; + +const int FUNCTION_PASCAL = 0; + +const int FUNCTION_DECLSPEC = 0; + +const int FUNCTION_WIN32CC = 0; + +const int TARGET_API_MAC_OS8 = 0; + +const int TARGET_API_MAC_CARBON = 1; + +const int TARGET_API_MAC_OSX = 1; + +const int TARGET_CARBON = 1; + +const int OLDROUTINENAMES = 0; + +const int OPAQUE_TOOLBOX_STRUCTS = 1; + +const int OPAQUE_UPP_TYPES = 1; + +const int ACCESSOR_CALLS_ARE_FUNCTIONS = 1; + +const int CALL_NOT_IN_CARBON = 0; + +const int MIXEDMODE_CALLS_ARE_FUNCTIONS = 1; + +const int ALLOW_OBSOLETE_CARBON_MACMEMORY = 0; + +const int ALLOW_OBSOLETE_CARBON_OSUTILS = 0; + +const int kInvalidID = 0; + 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 double NSTimeIntervalSince1970 = 978307200.0; + +const int __COREFOUNDATION_CFARRAY__ = 1; + const int OS_OBJECT_HAVE_OBJC_SUPPORT = 0; const int OS_OBJECT_USE_OBJC = 0; @@ -97952,335 +81473,619 @@ const int OS_OBJECT_SWIFT3 = 0; const int OS_OBJECT_USE_OBJC_RETAIN_RELEASE = 0; +const int SEC_OS_IPHONE = 0; + +const int SEC_OS_OSX = 1; + +const int SEC_OS_OSX_INCLUDES = 1; + +const int SECURITY_TYPE_UNIFICATION = 1; + +const int __COREFOUNDATION_COREFOUNDATION__ = 1; + +const int __COREFOUNDATION__ = 1; + const String __ASSERT_FILE_NAME = 'temp_for_macros.hpp'; -const int SEEK_SET = 0; +const int _CACHED_RUNES = 256; -const int SEEK_CUR = 1; +const int _CRMASK = -256; -const int SEEK_END = 2; +const String _RUNE_MAGIC_A = 'RuneMagA'; -const int SEEK_HOLE = 3; +const int _CTYPE_A = 256; -const int SEEK_DATA = 4; +const int _CTYPE_C = 512; + +const int _CTYPE_D = 1024; + +const int _CTYPE_G = 2048; + +const int _CTYPE_L = 4096; + +const int _CTYPE_P = 8192; + +const int _CTYPE_S = 16384; + +const int _CTYPE_U = 32768; + +const int _CTYPE_X = 65536; + +const int _CTYPE_B = 131072; + +const int _CTYPE_R = 262144; + +const int _CTYPE_I = 524288; + +const int _CTYPE_T = 1048576; + +const int _CTYPE_Q = 2097152; + +const int _CTYPE_SW0 = 536870912; + +const int _CTYPE_SW1 = 1073741824; + +const int _CTYPE_SW2 = 2147483648; + +const int _CTYPE_SW3 = 3221225472; + +const int _CTYPE_SWM = 3758096384; + +const int _CTYPE_SWS = 30; + +const int EPERM = 1; + +const int ENOENT = 2; + +const int ESRCH = 3; -const String __PRI_8_LENGTH_MODIFIER__ = 'hh'; +const int EINTR = 4; -const String __PRI_64_LENGTH_MODIFIER__ = 'll'; +const int EIO = 5; -const String __SCN_64_LENGTH_MODIFIER__ = 'll'; +const int ENXIO = 6; -const String __PRI_MAX_LENGTH_MODIFIER__ = 'j'; +const int E2BIG = 7; -const String __SCN_MAX_LENGTH_MODIFIER__ = 'j'; +const int ENOEXEC = 8; -const String PRId8 = 'hhd'; +const int EBADF = 9; -const String PRIi8 = 'hhi'; +const int ECHILD = 10; -const String PRIo8 = 'hho'; +const int EDEADLK = 11; -const String PRIu8 = 'hhu'; +const int ENOMEM = 12; -const String PRIx8 = 'hhx'; +const int EACCES = 13; -const String PRIX8 = 'hhX'; +const int EFAULT = 14; -const String PRId16 = 'hd'; +const int ENOTBLK = 15; -const String PRIi16 = 'hi'; +const int EBUSY = 16; -const String PRIo16 = 'ho'; +const int EEXIST = 17; -const String PRIu16 = 'hu'; +const int EXDEV = 18; -const String PRIx16 = 'hx'; +const int ENODEV = 19; -const String PRIX16 = 'hX'; +const int ENOTDIR = 20; -const String PRId32 = 'd'; +const int EISDIR = 21; -const String PRIi32 = 'i'; +const int EINVAL = 22; -const String PRIo32 = 'o'; +const int ENFILE = 23; -const String PRIu32 = 'u'; +const int EMFILE = 24; -const String PRIx32 = 'x'; +const int ENOTTY = 25; -const String PRIX32 = 'X'; +const int ETXTBSY = 26; -const String PRId64 = 'lld'; +const int EFBIG = 27; -const String PRIi64 = 'lli'; +const int ENOSPC = 28; -const String PRIo64 = 'llo'; +const int ESPIPE = 29; -const String PRIu64 = 'llu'; +const int EROFS = 30; -const String PRIx64 = 'llx'; +const int EMLINK = 31; -const String PRIX64 = 'llX'; +const int EPIPE = 32; -const String PRIdLEAST8 = 'hhd'; +const int EDOM = 33; -const String PRIiLEAST8 = 'hhi'; +const int ERANGE = 34; -const String PRIoLEAST8 = 'hho'; +const int EAGAIN = 35; -const String PRIuLEAST8 = 'hhu'; +const int EWOULDBLOCK = 35; -const String PRIxLEAST8 = 'hhx'; +const int EINPROGRESS = 36; -const String PRIXLEAST8 = 'hhX'; +const int EALREADY = 37; -const String PRIdLEAST16 = 'hd'; +const int ENOTSOCK = 38; -const String PRIiLEAST16 = 'hi'; +const int EDESTADDRREQ = 39; -const String PRIoLEAST16 = 'ho'; +const int EMSGSIZE = 40; -const String PRIuLEAST16 = 'hu'; +const int EPROTOTYPE = 41; -const String PRIxLEAST16 = 'hx'; +const int ENOPROTOOPT = 42; -const String PRIXLEAST16 = 'hX'; +const int EPROTONOSUPPORT = 43; -const String PRIdLEAST32 = 'd'; +const int ESOCKTNOSUPPORT = 44; -const String PRIiLEAST32 = 'i'; +const int ENOTSUP = 45; -const String PRIoLEAST32 = 'o'; +const int EPFNOSUPPORT = 46; -const String PRIuLEAST32 = 'u'; +const int EAFNOSUPPORT = 47; -const String PRIxLEAST32 = 'x'; +const int EADDRINUSE = 48; -const String PRIXLEAST32 = 'X'; +const int EADDRNOTAVAIL = 49; -const String PRIdLEAST64 = 'lld'; +const int ENETDOWN = 50; -const String PRIiLEAST64 = 'lli'; +const int ENETUNREACH = 51; -const String PRIoLEAST64 = 'llo'; +const int ENETRESET = 52; -const String PRIuLEAST64 = 'llu'; +const int ECONNABORTED = 53; -const String PRIxLEAST64 = 'llx'; +const int ECONNRESET = 54; -const String PRIXLEAST64 = 'llX'; +const int ENOBUFS = 55; -const String PRIdFAST8 = 'hhd'; +const int EISCONN = 56; -const String PRIiFAST8 = 'hhi'; +const int ENOTCONN = 57; -const String PRIoFAST8 = 'hho'; +const int ESHUTDOWN = 58; -const String PRIuFAST8 = 'hhu'; +const int ETOOMANYREFS = 59; -const String PRIxFAST8 = 'hhx'; +const int ETIMEDOUT = 60; -const String PRIXFAST8 = 'hhX'; +const int ECONNREFUSED = 61; -const String PRIdFAST16 = 'hd'; +const int ELOOP = 62; -const String PRIiFAST16 = 'hi'; +const int ENAMETOOLONG = 63; -const String PRIoFAST16 = 'ho'; +const int EHOSTDOWN = 64; -const String PRIuFAST16 = 'hu'; +const int EHOSTUNREACH = 65; -const String PRIxFAST16 = 'hx'; +const int ENOTEMPTY = 66; -const String PRIXFAST16 = 'hX'; +const int EPROCLIM = 67; -const String PRIdFAST32 = 'd'; +const int EUSERS = 68; -const String PRIiFAST32 = 'i'; +const int EDQUOT = 69; -const String PRIoFAST32 = 'o'; +const int ESTALE = 70; -const String PRIuFAST32 = 'u'; +const int EREMOTE = 71; -const String PRIxFAST32 = 'x'; +const int EBADRPC = 72; -const String PRIXFAST32 = 'X'; +const int ERPCMISMATCH = 73; -const String PRIdFAST64 = 'lld'; +const int EPROGUNAVAIL = 74; -const String PRIiFAST64 = 'lli'; +const int EPROGMISMATCH = 75; -const String PRIoFAST64 = 'llo'; +const int EPROCUNAVAIL = 76; -const String PRIuFAST64 = 'llu'; +const int ENOLCK = 77; -const String PRIxFAST64 = 'llx'; +const int ENOSYS = 78; -const String PRIXFAST64 = 'llX'; +const int EFTYPE = 79; -const String PRIdPTR = 'ld'; +const int EAUTH = 80; -const String PRIiPTR = 'li'; +const int ENEEDAUTH = 81; -const String PRIoPTR = 'lo'; +const int EPWROFF = 82; -const String PRIuPTR = 'lu'; +const int EDEVERR = 83; -const String PRIxPTR = 'lx'; +const int EOVERFLOW = 84; -const String PRIXPTR = 'lX'; +const int EBADEXEC = 85; -const String PRIdMAX = 'jd'; +const int EBADARCH = 86; -const String PRIiMAX = 'ji'; +const int ESHLIBVERS = 87; -const String PRIoMAX = 'jo'; +const int EBADMACHO = 88; -const String PRIuMAX = 'ju'; +const int ECANCELED = 89; -const String PRIxMAX = 'jx'; +const int EIDRM = 90; -const String PRIXMAX = 'jX'; +const int ENOMSG = 91; -const String SCNd8 = 'hhd'; +const int EILSEQ = 92; -const String SCNi8 = 'hhi'; +const int ENOATTR = 93; -const String SCNo8 = 'hho'; +const int EBADMSG = 94; -const String SCNu8 = 'hhu'; +const int EMULTIHOP = 95; -const String SCNx8 = 'hhx'; +const int ENODATA = 96; -const String SCNd16 = 'hd'; +const int ENOLINK = 97; -const String SCNi16 = 'hi'; +const int ENOSR = 98; -const String SCNo16 = 'ho'; +const int ENOSTR = 99; -const String SCNu16 = 'hu'; +const int EPROTO = 100; -const String SCNx16 = 'hx'; +const int ETIME = 101; -const String SCNd32 = 'd'; +const int EOPNOTSUPP = 102; -const String SCNi32 = 'i'; +const int ENOPOLICY = 103; -const String SCNo32 = 'o'; +const int ENOTRECOVERABLE = 104; -const String SCNu32 = 'u'; +const int EOWNERDEAD = 105; -const String SCNx32 = 'x'; +const int EQFULL = 106; -const String SCNd64 = 'lld'; +const int ELAST = 106; -const String SCNi64 = 'lli'; +const int FLT_EVAL_METHOD = 0; -const String SCNo64 = 'llo'; +const int FLT_RADIX = 2; -const String SCNu64 = 'llu'; +const int FLT_MANT_DIG = 24; -const String SCNx64 = 'llx'; +const int DBL_MANT_DIG = 53; -const String SCNdLEAST8 = 'hhd'; +const int LDBL_MANT_DIG = 53; -const String SCNiLEAST8 = 'hhi'; +const int FLT_DIG = 6; -const String SCNoLEAST8 = 'hho'; +const int DBL_DIG = 15; -const String SCNuLEAST8 = 'hhu'; +const int LDBL_DIG = 15; -const String SCNxLEAST8 = 'hhx'; +const int FLT_MIN_EXP = -125; -const String SCNdLEAST16 = 'hd'; +const int DBL_MIN_EXP = -1021; -const String SCNiLEAST16 = 'hi'; +const int LDBL_MIN_EXP = -1021; -const String SCNoLEAST16 = 'ho'; +const int FLT_MIN_10_EXP = -37; -const String SCNuLEAST16 = 'hu'; +const int DBL_MIN_10_EXP = -307; -const String SCNxLEAST16 = 'hx'; +const int LDBL_MIN_10_EXP = -307; -const String SCNdLEAST32 = 'd'; +const int FLT_MAX_EXP = 128; -const String SCNiLEAST32 = 'i'; +const int DBL_MAX_EXP = 1024; -const String SCNoLEAST32 = 'o'; +const int LDBL_MAX_EXP = 1024; -const String SCNuLEAST32 = 'u'; +const int FLT_MAX_10_EXP = 38; -const String SCNxLEAST32 = 'x'; +const int DBL_MAX_10_EXP = 308; -const String SCNdLEAST64 = 'lld'; +const int LDBL_MAX_10_EXP = 308; -const String SCNiLEAST64 = 'lli'; +const double FLT_MAX = 3.4028234663852886e+38; -const String SCNoLEAST64 = 'llo'; +const double DBL_MAX = 1.7976931348623157e+308; -const String SCNuLEAST64 = 'llu'; +const double LDBL_MAX = 1.7976931348623157e+308; -const String SCNxLEAST64 = 'llx'; +const double FLT_EPSILON = 1.1920928955078125e-7; -const String SCNdFAST8 = 'hhd'; +const double DBL_EPSILON = 2.220446049250313e-16; -const String SCNiFAST8 = 'hhi'; +const double LDBL_EPSILON = 2.220446049250313e-16; -const String SCNoFAST8 = 'hho'; +const double FLT_MIN = 1.1754943508222875e-38; -const String SCNuFAST8 = 'hhu'; +const double DBL_MIN = 2.2250738585072014e-308; -const String SCNxFAST8 = 'hhx'; +const double LDBL_MIN = 2.2250738585072014e-308; -const String SCNdFAST16 = 'hd'; +const int DECIMAL_DIG = 17; -const String SCNiFAST16 = 'hi'; +const int FLT_HAS_SUBNORM = 1; -const String SCNoFAST16 = 'ho'; +const int DBL_HAS_SUBNORM = 1; -const String SCNuFAST16 = 'hu'; +const int LDBL_HAS_SUBNORM = 1; -const String SCNxFAST16 = 'hx'; +const double FLT_TRUE_MIN = 1.401298464324817e-45; -const String SCNdFAST32 = 'd'; +const double DBL_TRUE_MIN = 5e-324; -const String SCNiFAST32 = 'i'; +const double LDBL_TRUE_MIN = 5e-324; -const String SCNoFAST32 = 'o'; +const int FLT_DECIMAL_DIG = 9; -const String SCNuFAST32 = 'u'; +const int DBL_DECIMAL_DIG = 17; -const String SCNxFAST32 = 'x'; +const int LDBL_DECIMAL_DIG = 17; -const String SCNdFAST64 = 'lld'; +const int LC_ALL = 0; -const String SCNiFAST64 = 'lli'; +const int LC_COLLATE = 1; -const String SCNoFAST64 = 'llo'; +const int LC_CTYPE = 2; -const String SCNuFAST64 = 'llu'; +const int LC_MONETARY = 3; -const String SCNxFAST64 = 'llx'; +const int LC_NUMERIC = 4; -const String SCNdPTR = 'ld'; +const int LC_TIME = 5; -const String SCNiPTR = 'li'; +const int LC_MESSAGES = 6; -const String SCNoPTR = 'lo'; +const int _LC_LAST = 7; -const String SCNuPTR = 'lu'; +const double HUGE_VAL = double.infinity; -const String SCNxPTR = 'lx'; +const double HUGE_VALF = double.infinity; -const String SCNdMAX = 'jd'; +const double HUGE_VALL = double.infinity; -const String SCNiMAX = 'ji'; +const double NAN = double.nan; -const String SCNoMAX = 'jo'; +const double INFINITY = double.infinity; -const String SCNuMAX = 'ju'; +const int FP_NAN = 1; -const String SCNxMAX = 'jx'; +const int FP_INFINITE = 2; + +const int FP_ZERO = 3; + +const int FP_NORMAL = 4; + +const int FP_SUBNORMAL = 5; + +const int FP_SUPERNORMAL = 6; + +const int FP_FAST_FMA = 1; + +const int FP_FAST_FMAF = 1; + +const int FP_FAST_FMAL = 1; + +const int FP_ILOGB0 = -2147483648; + +const int FP_ILOGBNAN = -2147483648; + +const int MATH_ERRNO = 1; + +const int MATH_ERREXCEPT = 2; + +const double M_E = 2.718281828459045; + +const double M_LOG2E = 1.4426950408889634; + +const double M_LOG10E = 0.4342944819032518; + +const double M_LN2 = 0.6931471805599453; + +const double M_LN10 = 2.302585092994046; + +const double M_PI = 3.141592653589793; + +const double M_PI_2 = 1.5707963267948966; + +const double M_PI_4 = 0.7853981633974483; + +const double M_1_PI = 0.3183098861837907; + +const double M_2_PI = 0.6366197723675814; + +const double M_2_SQRTPI = 1.1283791670955126; + +const double M_SQRT2 = 1.4142135623730951; + +const double M_SQRT1_2 = 0.7071067811865476; + +const double MAXFLOAT = 3.4028234663852886e+38; + +const int FP_SNAN = 1; + +const int FP_QNAN = 1; + +const double HUGE = 3.4028234663852886e+38; + +const double X_TLOSS = 14148475504056880.0; + +const int DOMAIN = 1; + +const int SING = 2; + +const int OVERFLOW = 3; + +const int UNDERFLOW = 4; + +const int TLOSS = 5; + +const int PLOSS = 6; + +const int _JBLEN = 48; + +const int RENAME_SECLUDE = 1; + +const int RENAME_SWAP = 2; + +const int RENAME_EXCL = 4; + +const int RENAME_RESERVED1 = 8; + +const int RENAME_NOFOLLOW_ANY = 16; + +const int SEEK_SET = 0; + +const int SEEK_CUR = 1; + +const int SEEK_END = 2; + +const int SEEK_HOLE = 3; + +const int SEEK_DATA = 4; + +const int __SLBF = 1; + +const int __SNBF = 2; + +const int __SRD = 4; + +const int __SWR = 8; + +const int __SRW = 16; + +const int __SEOF = 32; + +const int __SERR = 64; + +const int __SMBF = 128; + +const int __SAPP = 256; + +const int __SSTR = 512; + +const int __SOPT = 1024; + +const int __SNPT = 2048; + +const int __SOFF = 4096; + +const int __SMOD = 8192; + +const int __SALC = 16384; + +const int __SIGN = 32768; + +const int _IOFBF = 0; + +const int _IOLBF = 1; + +const int _IONBF = 2; + +const int BUFSIZ = 1024; + +const int EOF = -1; + +const int FOPEN_MAX = 20; + +const int FILENAME_MAX = 1024; + +const String P_tmpdir = '/var/tmp/'; + +const int L_tmpnam = 1024; + +const int TMP_MAX = 308915776; + +const int L_ctermid = 1024; + +const int CLOCKS_PER_SEC = 1000000; + +const int CLOCK_REALTIME = 0; + +const int CLOCK_MONOTONIC = 6; + +const int CLOCK_MONOTONIC_RAW = 4; + +const int CLOCK_MONOTONIC_RAW_APPROX = 5; + +const int CLOCK_UPTIME_RAW = 8; + +const int CLOCK_UPTIME_RAW_APPROX = 9; + +const int CLOCK_PROCESS_CPUTIME_ID = 12; + +const int CLOCK_THREAD_CPUTIME_ID = 16; + +const int TIME_UTC = 1; + +const int __COREFOUNDATION_CFBAG__ = 1; + +const int __COREFOUNDATION_CFBINARYHEAP__ = 1; + +const int __COREFOUNDATION_CFBITVECTOR__ = 1; + +const int __COREFOUNDATION_CFBYTEORDER__ = 1; + +const int CF_USE_OSBYTEORDER_H = 1; + +const int __COREFOUNDATION_CFCALENDAR__ = 1; + +const int __COREFOUNDATION_CFLOCALE__ = 1; + +const int __COREFOUNDATION_CFDICTIONARY__ = 1; + +const int __COREFOUNDATION_CFNOTIFICATIONCENTER__ = 1; + +const int __COREFOUNDATION_CFDATE__ = 1; + +const int __COREFOUNDATION_CFTIMEZONE__ = 1; + +const int __COREFOUNDATION_CFDATA__ = 1; + +const int __COREFOUNDATION_CFSTRING__ = 1; + +const int __COREFOUNDATION_CFCHARACTERSET__ = 1; + +const int __COREFOUNDATION_CFERROR__ = 1; + +const int kCFStringEncodingInvalidId = 4294967295; + +const int __kCFStringInlineBufferLength = 64; + +const int __COREFOUNDATION_CFCGTYPES__ = 1; + +const int CGFLOAT_IS_DOUBLE = 1; + +const double CGFLOAT_MIN = 2.2250738585072014e-308; + +const double CGFLOAT_MAX = 1.7976931348623157e+308; + +const double CGFLOAT_EPSILON = 2.220446049250313e-16; + +const int CGFLOAT_DEFINED = 1; + +const int CGVECTOR_DEFINED = 1; + +const int __COREFOUNDATION_CFDATEFORMATTER__ = 1; + +const int __COREFOUNDATION_CFNUMBER__ = 1; + +const int __COREFOUNDATION_CFNUMBERFORMATTER__ = 1; + +const int __COREFOUNDATION_CFPREFERENCES__ = 1; + +const int __COREFOUNDATION_CFPROPERTYLIST__ = 1; + +const int __COREFOUNDATION_CFSTREAM__ = 1; + +const int __COREFOUNDATION_CFURL__ = 1; + +const int __COREFOUNDATION_CFRUNLOOP__ = 1; const int MACH_PORT_NULL = 0; @@ -98464,6 +82269,8 @@ const int MPG_STRICT = 1; const int MPG_IMMOVABLE_RECEIVE = 2; +const int __COREFOUNDATION_CFSOCKET__ = 1; + const int _POSIX_VERSION = 200112; const int _POSIX2_VERSION = 200112; @@ -99468,7 +83275,7 @@ const int DISPATCH_TIME_FOREVER = -1; const int QOS_MIN_RELATIVE_PRIORITY = -15; -const int DISPATCH_APPLY_AUTO_AVAILABLE = 0; +const int DISPATCH_APPLY_AUTO_AVAILABLE = 1; const int DISPATCH_QUEUE_PRIORITY_HIGH = 2; @@ -99924,44 +83731,924 @@ const int DISPATCH_IO_STOP = 1; const int DISPATCH_IO_STRICT_INTERVAL = 1; -const int NSURLResponseUnknownLength = -1; +const int __COREFOUNDATION_CFSET__ = 1; + +const int __COREFOUNDATION_CFSTRINGENCODINGEXT__ = 1; + +const int __COREFOUNDATION_CFTREE__ = 1; + +const int __COREFOUNDATION_CFURLACCESS__ = 1; + +const int __COREFOUNDATION_CFUUID__ = 1; + +const int __COREFOUNDATION_CFUTILITIES__ = 1; + +const int __COREFOUNDATION_CFBUNDLE__ = 1; + +const int CPU_STATE_MAX = 4; + +const int CPU_STATE_USER = 0; + +const int CPU_STATE_SYSTEM = 1; + +const int CPU_STATE_IDLE = 2; + +const int CPU_STATE_NICE = 3; + +const int CPU_ARCH_MASK = 4278190080; + +const int CPU_ARCH_ABI64 = 16777216; + +const int CPU_ARCH_ABI64_32 = 33554432; + +const int CPU_TYPE_ANY = -1; + +const int CPU_TYPE_VAX = 1; + +const int CPU_TYPE_MC680x0 = 6; + +const int CPU_TYPE_X86 = 7; + +const int CPU_TYPE_I386 = 7; + +const int CPU_TYPE_X86_64 = 16777223; + +const int CPU_TYPE_MC98000 = 10; + +const int CPU_TYPE_HPPA = 11; + +const int CPU_TYPE_ARM = 12; + +const int CPU_TYPE_ARM64 = 16777228; + +const int CPU_TYPE_ARM64_32 = 33554444; + +const int CPU_TYPE_MC88000 = 13; + +const int CPU_TYPE_SPARC = 14; + +const int CPU_TYPE_I860 = 15; + +const int CPU_TYPE_POWERPC = 18; + +const int CPU_TYPE_POWERPC64 = 16777234; + +const int CPU_SUBTYPE_MASK = 4278190080; + +const int CPU_SUBTYPE_LIB64 = 2147483648; + +const int CPU_SUBTYPE_PTRAUTH_ABI = 2147483648; + +const int CPU_SUBTYPE_ANY = -1; + +const int CPU_SUBTYPE_MULTIPLE = -1; + +const int CPU_SUBTYPE_LITTLE_ENDIAN = 0; + +const int CPU_SUBTYPE_BIG_ENDIAN = 1; + +const int CPU_THREADTYPE_NONE = 0; + +const int CPU_SUBTYPE_VAX_ALL = 0; + +const int CPU_SUBTYPE_VAX780 = 1; + +const int CPU_SUBTYPE_VAX785 = 2; + +const int CPU_SUBTYPE_VAX750 = 3; + +const int CPU_SUBTYPE_VAX730 = 4; + +const int CPU_SUBTYPE_UVAXI = 5; + +const int CPU_SUBTYPE_UVAXII = 6; + +const int CPU_SUBTYPE_VAX8200 = 7; + +const int CPU_SUBTYPE_VAX8500 = 8; + +const int CPU_SUBTYPE_VAX8600 = 9; + +const int CPU_SUBTYPE_VAX8650 = 10; + +const int CPU_SUBTYPE_VAX8800 = 11; + +const int CPU_SUBTYPE_UVAXIII = 12; + +const int CPU_SUBTYPE_MC680x0_ALL = 1; + +const int CPU_SUBTYPE_MC68030 = 1; + +const int CPU_SUBTYPE_MC68040 = 2; + +const int CPU_SUBTYPE_MC68030_ONLY = 3; + +const int CPU_SUBTYPE_I386_ALL = 3; + +const int CPU_SUBTYPE_386 = 3; + +const int CPU_SUBTYPE_486 = 4; + +const int CPU_SUBTYPE_486SX = 132; + +const int CPU_SUBTYPE_586 = 5; + +const int CPU_SUBTYPE_PENT = 5; + +const int CPU_SUBTYPE_PENTPRO = 22; + +const int CPU_SUBTYPE_PENTII_M3 = 54; + +const int CPU_SUBTYPE_PENTII_M5 = 86; + +const int CPU_SUBTYPE_CELERON = 103; + +const int CPU_SUBTYPE_CELERON_MOBILE = 119; + +const int CPU_SUBTYPE_PENTIUM_3 = 8; + +const int CPU_SUBTYPE_PENTIUM_3_M = 24; + +const int CPU_SUBTYPE_PENTIUM_3_XEON = 40; + +const int CPU_SUBTYPE_PENTIUM_M = 9; + +const int CPU_SUBTYPE_PENTIUM_4 = 10; + +const int CPU_SUBTYPE_PENTIUM_4_M = 26; + +const int CPU_SUBTYPE_ITANIUM = 11; + +const int CPU_SUBTYPE_ITANIUM_2 = 27; + +const int CPU_SUBTYPE_XEON = 12; + +const int CPU_SUBTYPE_XEON_MP = 28; + +const int CPU_SUBTYPE_INTEL_FAMILY_MAX = 15; + +const int CPU_SUBTYPE_INTEL_MODEL_ALL = 0; + +const int CPU_SUBTYPE_X86_ALL = 3; + +const int CPU_SUBTYPE_X86_64_ALL = 3; + +const int CPU_SUBTYPE_X86_ARCH1 = 4; + +const int CPU_SUBTYPE_X86_64_H = 8; + +const int CPU_THREADTYPE_INTEL_HTT = 1; + +const int CPU_SUBTYPE_MIPS_ALL = 0; + +const int CPU_SUBTYPE_MIPS_R2300 = 1; + +const int CPU_SUBTYPE_MIPS_R2600 = 2; + +const int CPU_SUBTYPE_MIPS_R2800 = 3; + +const int CPU_SUBTYPE_MIPS_R2000a = 4; + +const int CPU_SUBTYPE_MIPS_R2000 = 5; + +const int CPU_SUBTYPE_MIPS_R3000a = 6; + +const int CPU_SUBTYPE_MIPS_R3000 = 7; + +const int CPU_SUBTYPE_MC98000_ALL = 0; + +const int CPU_SUBTYPE_MC98601 = 1; + +const int CPU_SUBTYPE_HPPA_ALL = 0; + +const int CPU_SUBTYPE_HPPA_7100 = 0; + +const int CPU_SUBTYPE_HPPA_7100LC = 1; + +const int CPU_SUBTYPE_MC88000_ALL = 0; + +const int CPU_SUBTYPE_MC88100 = 1; + +const int CPU_SUBTYPE_MC88110 = 2; + +const int CPU_SUBTYPE_SPARC_ALL = 0; + +const int CPU_SUBTYPE_I860_ALL = 0; + +const int CPU_SUBTYPE_I860_860 = 1; + +const int CPU_SUBTYPE_POWERPC_ALL = 0; + +const int CPU_SUBTYPE_POWERPC_601 = 1; + +const int CPU_SUBTYPE_POWERPC_602 = 2; + +const int CPU_SUBTYPE_POWERPC_603 = 3; + +const int CPU_SUBTYPE_POWERPC_603e = 4; + +const int CPU_SUBTYPE_POWERPC_603ev = 5; + +const int CPU_SUBTYPE_POWERPC_604 = 6; + +const int CPU_SUBTYPE_POWERPC_604e = 7; + +const int CPU_SUBTYPE_POWERPC_620 = 8; + +const int CPU_SUBTYPE_POWERPC_750 = 9; + +const int CPU_SUBTYPE_POWERPC_7400 = 10; + +const int CPU_SUBTYPE_POWERPC_7450 = 11; + +const int CPU_SUBTYPE_POWERPC_970 = 100; + +const int CPU_SUBTYPE_ARM_ALL = 0; + +const int CPU_SUBTYPE_ARM_V4T = 5; + +const int CPU_SUBTYPE_ARM_V6 = 6; + +const int CPU_SUBTYPE_ARM_V5TEJ = 7; + +const int CPU_SUBTYPE_ARM_XSCALE = 8; + +const int CPU_SUBTYPE_ARM_V7 = 9; + +const int CPU_SUBTYPE_ARM_V7F = 10; + +const int CPU_SUBTYPE_ARM_V7S = 11; + +const int CPU_SUBTYPE_ARM_V7K = 12; + +const int CPU_SUBTYPE_ARM_V8 = 13; + +const int CPU_SUBTYPE_ARM_V6M = 14; + +const int CPU_SUBTYPE_ARM_V7M = 15; + +const int CPU_SUBTYPE_ARM_V7EM = 16; + +const int CPU_SUBTYPE_ARM_V8M = 17; + +const int CPU_SUBTYPE_ARM64_ALL = 0; + +const int CPU_SUBTYPE_ARM64_V8 = 1; + +const int CPU_SUBTYPE_ARM64E = 2; + +const int CPU_SUBTYPE_ARM64_PTR_AUTH_MASK = 251658240; + +const int CPU_SUBTYPE_ARM64_32_ALL = 0; + +const int CPU_SUBTYPE_ARM64_32_V8 = 1; + +const int CPUFAMILY_UNKNOWN = 0; + +const int CPUFAMILY_POWERPC_G3 = 3471054153; + +const int CPUFAMILY_POWERPC_G4 = 2009171118; + +const int CPUFAMILY_POWERPC_G5 = 3983988906; + +const int CPUFAMILY_INTEL_6_13 = 2855483691; + +const int CPUFAMILY_INTEL_PENRYN = 2028621756; + +const int CPUFAMILY_INTEL_NEHALEM = 1801080018; + +const int CPUFAMILY_INTEL_WESTMERE = 1463508716; + +const int CPUFAMILY_INTEL_SANDYBRIDGE = 1418770316; + +const int CPUFAMILY_INTEL_IVYBRIDGE = 526772277; + +const int CPUFAMILY_INTEL_HASWELL = 280134364; + +const int CPUFAMILY_INTEL_BROADWELL = 1479463068; + +const int CPUFAMILY_INTEL_SKYLAKE = 939270559; + +const int CPUFAMILY_INTEL_KABYLAKE = 260141638; + +const int CPUFAMILY_INTEL_ICELAKE = 943936839; + +const int CPUFAMILY_INTEL_COMETLAKE = 486055998; + +const int CPUFAMILY_ARM_9 = 3878847406; + +const int CPUFAMILY_ARM_11 = 2415272152; + +const int CPUFAMILY_ARM_XSCALE = 1404044789; + +const int CPUFAMILY_ARM_12 = 3172666089; + +const int CPUFAMILY_ARM_13 = 214503012; + +const int CPUFAMILY_ARM_14 = 2517073649; + +const int CPUFAMILY_ARM_15 = 2823887818; + +const int CPUFAMILY_ARM_SWIFT = 506291073; + +const int CPUFAMILY_ARM_CYCLONE = 933271106; + +const int CPUFAMILY_ARM_TYPHOON = 747742334; + +const int CPUFAMILY_ARM_TWISTER = 2465937352; + +const int CPUFAMILY_ARM_HURRICANE = 1741614739; + +const int CPUFAMILY_ARM_MONSOON_MISTRAL = 3894312694; + +const int CPUFAMILY_ARM_VORTEX_TEMPEST = 131287967; + +const int CPUFAMILY_ARM_LIGHTNING_THUNDER = 1176831186; + +const int CPUFAMILY_ARM_FIRESTORM_ICESTORM = 458787763; + +const int CPUFAMILY_ARM_BLIZZARD_AVALANCHE = 3660830781; + +const int CPUFAMILY_ARM_EVEREST_SAWTOOTH = 2271604202; + +const int CPUFAMILY_ARM_IBIZA = 4197663070; + +const int CPUFAMILY_ARM_PALMA = 1912690738; + +const int CPUFAMILY_ARM_COLL = 678884789; + +const int CPUFAMILY_ARM_LOBOS = 1598941843; + +const int CPUFAMILY_ARM_DONAN = 1867590060; + +const int CPUSUBFAMILY_UNKNOWN = 0; + +const int CPUSUBFAMILY_ARM_HP = 1; + +const int CPUSUBFAMILY_ARM_HG = 2; + +const int CPUSUBFAMILY_ARM_M = 3; + +const int CPUSUBFAMILY_ARM_HS = 4; + +const int CPUSUBFAMILY_ARM_HC_HD = 5; + +const int CPUSUBFAMILY_ARM_HA = 6; + +const int CPUFAMILY_INTEL_6_23 = 2028621756; + +const int CPUFAMILY_INTEL_6_26 = 1801080018; + +const int __COREFOUNDATION_CFMESSAGEPORT__ = 1; + +const int __COREFOUNDATION_CFPLUGIN__ = 1; + +const int COREFOUNDATION_CFPLUGINCOM_SEPARATE = 1; + +const int __COREFOUNDATION_CFMACHPORT__ = 1; + +const int __COREFOUNDATION_CFATTRIBUTEDSTRING__ = 1; + +const int __COREFOUNDATION_CFURLENUMERATOR__ = 1; + +const int __COREFOUNDATION_CFFILESECURITY__ = 1; + +const int KAUTH_GUID_SIZE = 16; + +const int KAUTH_UID_NONE = 4294967195; + +const int KAUTH_GID_NONE = 4294967195; + +const int KAUTH_NTSID_MAX_AUTHORITIES = 16; + +const int KAUTH_NTSID_HDRSIZE = 8; + +const int KAUTH_EXTLOOKUP_SUCCESS = 0; + +const int KAUTH_EXTLOOKUP_BADRQ = 1; + +const int KAUTH_EXTLOOKUP_FAILURE = 2; + +const int KAUTH_EXTLOOKUP_FATAL = 3; + +const int KAUTH_EXTLOOKUP_INPROG = 100; + +const int KAUTH_EXTLOOKUP_VALID_UID = 1; + +const int KAUTH_EXTLOOKUP_VALID_UGUID = 2; + +const int KAUTH_EXTLOOKUP_VALID_USID = 4; + +const int KAUTH_EXTLOOKUP_VALID_GID = 8; + +const int KAUTH_EXTLOOKUP_VALID_GGUID = 16; + +const int KAUTH_EXTLOOKUP_VALID_GSID = 32; + +const int KAUTH_EXTLOOKUP_WANT_UID = 64; + +const int KAUTH_EXTLOOKUP_WANT_UGUID = 128; + +const int KAUTH_EXTLOOKUP_WANT_USID = 256; + +const int KAUTH_EXTLOOKUP_WANT_GID = 512; + +const int KAUTH_EXTLOOKUP_WANT_GGUID = 1024; + +const int KAUTH_EXTLOOKUP_WANT_GSID = 2048; + +const int KAUTH_EXTLOOKUP_WANT_MEMBERSHIP = 4096; + +const int KAUTH_EXTLOOKUP_VALID_MEMBERSHIP = 8192; + +const int KAUTH_EXTLOOKUP_ISMEMBER = 16384; + +const int KAUTH_EXTLOOKUP_VALID_PWNAM = 32768; + +const int KAUTH_EXTLOOKUP_WANT_PWNAM = 65536; + +const int KAUTH_EXTLOOKUP_VALID_GRNAM = 131072; + +const int KAUTH_EXTLOOKUP_WANT_GRNAM = 262144; + +const int KAUTH_EXTLOOKUP_VALID_SUPGRPS = 524288; + +const int KAUTH_EXTLOOKUP_WANT_SUPGRPS = 1048576; -const int DART_FLAGS_CURRENT_VERSION = 12; +const int KAUTH_EXTLOOKUP_REGISTER = 0; -const int DART_INITIALIZE_PARAMS_CURRENT_VERSION = 4; +const int KAUTH_EXTLOOKUP_RESULT = 1; -const int ILLEGAL_PORT = 0; +const int KAUTH_EXTLOOKUP_WORKER = 2; -const String DART_KERNEL_ISOLATE_NAME = 'kernel-service'; +const int KAUTH_EXTLOOKUP_DEREGISTER = 4; -const String DART_VM_SERVICE_ISOLATE_NAME = 'vm-service'; +const int KAUTH_GET_CACHE_SIZES = 8; -const String kSnapshotBuildIdCSymbol = 'kDartSnapshotBuildId'; +const int KAUTH_SET_CACHE_SIZES = 16; -const String kVmSnapshotDataCSymbol = 'kDartVmSnapshotData'; +const int KAUTH_CLEAR_CACHES = 32; -const String kVmSnapshotInstructionsCSymbol = 'kDartVmSnapshotInstructions'; +const String IDENTITYSVC_ENTITLEMENT = 'com.apple.private.identitysvc'; -const String kVmSnapshotBssCSymbol = 'kDartVmSnapshotBss'; +const int KAUTH_ACE_KINDMASK = 15; -const String kIsolateSnapshotDataCSymbol = 'kDartIsolateSnapshotData'; +const int KAUTH_ACE_PERMIT = 1; -const String kIsolateSnapshotInstructionsCSymbol = - 'kDartIsolateSnapshotInstructions'; +const int KAUTH_ACE_DENY = 2; -const String kIsolateSnapshotBssCSymbol = 'kDartIsolateSnapshotBss'; +const int KAUTH_ACE_AUDIT = 3; -const String kSnapshotBuildIdAsmSymbol = '_kDartSnapshotBuildId'; +const int KAUTH_ACE_ALARM = 4; -const String kVmSnapshotDataAsmSymbol = '_kDartVmSnapshotData'; +const int KAUTH_ACE_INHERITED = 16; -const String kVmSnapshotInstructionsAsmSymbol = '_kDartVmSnapshotInstructions'; +const int KAUTH_ACE_FILE_INHERIT = 32; + +const int KAUTH_ACE_DIRECTORY_INHERIT = 64; + +const int KAUTH_ACE_LIMIT_INHERIT = 128; + +const int KAUTH_ACE_ONLY_INHERIT = 256; + +const int KAUTH_ACE_SUCCESS = 512; + +const int KAUTH_ACE_FAILURE = 1024; + +const int KAUTH_ACE_INHERIT_CONTROL_FLAGS = 480; + +const int KAUTH_ACE_GENERIC_ALL = 2097152; + +const int KAUTH_ACE_GENERIC_EXECUTE = 4194304; + +const int KAUTH_ACE_GENERIC_WRITE = 8388608; + +const int KAUTH_ACE_GENERIC_READ = 16777216; + +const int KAUTH_ACL_MAX_ENTRIES = 128; + +const int KAUTH_ACL_FLAGS_PRIVATE = 65535; + +const int KAUTH_ACL_DEFER_INHERIT = 65536; + +const int KAUTH_ACL_NO_INHERIT = 131072; + +const int KAUTH_FILESEC_NOACL = 4294967295; + +const int KAUTH_FILESEC_MAGIC = 19710317; + +const int KAUTH_FILESEC_FLAGS_PRIVATE = 65535; + +const int KAUTH_FILESEC_DEFER_INHERIT = 65536; + +const int KAUTH_FILESEC_NO_INHERIT = 131072; + +const String KAUTH_FILESEC_XATTR = 'com.apple.system.Security'; + +const int KAUTH_ENDIAN_HOST = 1; + +const int KAUTH_ENDIAN_DISK = 2; + +const int KAUTH_VNODE_READ_DATA = 2; + +const int KAUTH_VNODE_LIST_DIRECTORY = 2; + +const int KAUTH_VNODE_WRITE_DATA = 4; + +const int KAUTH_VNODE_ADD_FILE = 4; + +const int KAUTH_VNODE_EXECUTE = 8; + +const int KAUTH_VNODE_SEARCH = 8; + +const int KAUTH_VNODE_DELETE = 16; + +const int KAUTH_VNODE_APPEND_DATA = 32; + +const int KAUTH_VNODE_ADD_SUBDIRECTORY = 32; + +const int KAUTH_VNODE_DELETE_CHILD = 64; + +const int KAUTH_VNODE_READ_ATTRIBUTES = 128; + +const int KAUTH_VNODE_WRITE_ATTRIBUTES = 256; + +const int KAUTH_VNODE_READ_EXTATTRIBUTES = 512; + +const int KAUTH_VNODE_WRITE_EXTATTRIBUTES = 1024; + +const int KAUTH_VNODE_READ_SECURITY = 2048; + +const int KAUTH_VNODE_WRITE_SECURITY = 4096; + +const int KAUTH_VNODE_TAKE_OWNERSHIP = 8192; + +const int KAUTH_VNODE_CHANGE_OWNER = 8192; + +const int KAUTH_VNODE_SYNCHRONIZE = 1048576; + +const int KAUTH_VNODE_LINKTARGET = 33554432; + +const int KAUTH_VNODE_CHECKIMMUTABLE = 67108864; + +const int KAUTH_VNODE_ACCESS = 2147483648; + +const int KAUTH_VNODE_NOIMMUTABLE = 1073741824; + +const int KAUTH_VNODE_SEARCHBYANYONE = 536870912; + +const int KAUTH_VNODE_GENERIC_READ_BITS = 2690; + +const int KAUTH_VNODE_GENERIC_WRITE_BITS = 5492; + +const int KAUTH_VNODE_GENERIC_EXECUTE_BITS = 8; + +const int KAUTH_VNODE_GENERIC_ALL_BITS = 8190; + +const int KAUTH_VNODE_WRITE_RIGHTS = 100676980; + +const int __DARWIN_ACL_READ_DATA = 2; + +const int __DARWIN_ACL_LIST_DIRECTORY = 2; + +const int __DARWIN_ACL_WRITE_DATA = 4; + +const int __DARWIN_ACL_ADD_FILE = 4; + +const int __DARWIN_ACL_EXECUTE = 8; + +const int __DARWIN_ACL_SEARCH = 8; + +const int __DARWIN_ACL_DELETE = 16; + +const int __DARWIN_ACL_APPEND_DATA = 32; + +const int __DARWIN_ACL_ADD_SUBDIRECTORY = 32; + +const int __DARWIN_ACL_DELETE_CHILD = 64; + +const int __DARWIN_ACL_READ_ATTRIBUTES = 128; + +const int __DARWIN_ACL_WRITE_ATTRIBUTES = 256; + +const int __DARWIN_ACL_READ_EXTATTRIBUTES = 512; + +const int __DARWIN_ACL_WRITE_EXTATTRIBUTES = 1024; + +const int __DARWIN_ACL_READ_SECURITY = 2048; + +const int __DARWIN_ACL_WRITE_SECURITY = 4096; + +const int __DARWIN_ACL_CHANGE_OWNER = 8192; + +const int __DARWIN_ACL_SYNCHRONIZE = 1048576; + +const int __DARWIN_ACL_EXTENDED_ALLOW = 1; + +const int __DARWIN_ACL_EXTENDED_DENY = 2; + +const int __DARWIN_ACL_ENTRY_INHERITED = 16; + +const int __DARWIN_ACL_ENTRY_FILE_INHERIT = 32; + +const int __DARWIN_ACL_ENTRY_DIRECTORY_INHERIT = 64; + +const int __DARWIN_ACL_ENTRY_LIMIT_INHERIT = 128; + +const int __DARWIN_ACL_ENTRY_ONLY_INHERIT = 256; + +const int __DARWIN_ACL_FLAG_NO_INHERIT = 131072; + +const int ACL_MAX_ENTRIES = 128; + +const int ACL_UNDEFINED_ID = 0; + +const int __COREFOUNDATION_CFSTRINGTOKENIZER__ = 1; + +const int __COREFOUNDATION_CFFILEDESCRIPTOR__ = 1; + +const int __COREFOUNDATION_CFUSERNOTIFICATION__ = 1; + +const int __COREFOUNDATION_CFXMLNODE__ = 1; + +const int __COREFOUNDATION_CFXMLPARSER__ = 1; + +const int _CSSMTYPE_H_ = 1; + +const int _CSSMCONFIG_H_ = 1; + +const int SEC_ASN1_TAG_MASK = 255; + +const int SEC_ASN1_TAGNUM_MASK = 31; + +const int SEC_ASN1_BOOLEAN = 1; + +const int SEC_ASN1_INTEGER = 2; + +const int SEC_ASN1_BIT_STRING = 3; + +const int SEC_ASN1_OCTET_STRING = 4; + +const int SEC_ASN1_NULL = 5; + +const int SEC_ASN1_OBJECT_ID = 6; + +const int SEC_ASN1_OBJECT_DESCRIPTOR = 7; + +const int SEC_ASN1_REAL = 9; + +const int SEC_ASN1_ENUMERATED = 10; + +const int SEC_ASN1_EMBEDDED_PDV = 11; + +const int SEC_ASN1_UTF8_STRING = 12; + +const int SEC_ASN1_SEQUENCE = 16; + +const int SEC_ASN1_SET = 17; + +const int SEC_ASN1_NUMERIC_STRING = 18; + +const int SEC_ASN1_PRINTABLE_STRING = 19; + +const int SEC_ASN1_T61_STRING = 20; + +const int SEC_ASN1_VIDEOTEX_STRING = 21; + +const int SEC_ASN1_IA5_STRING = 22; + +const int SEC_ASN1_UTC_TIME = 23; + +const int SEC_ASN1_GENERALIZED_TIME = 24; + +const int SEC_ASN1_GRAPHIC_STRING = 25; + +const int SEC_ASN1_VISIBLE_STRING = 26; + +const int SEC_ASN1_GENERAL_STRING = 27; + +const int SEC_ASN1_UNIVERSAL_STRING = 28; + +const int SEC_ASN1_BMP_STRING = 30; + +const int SEC_ASN1_HIGH_TAG_NUMBER = 31; + +const int SEC_ASN1_TELETEX_STRING = 20; + +const int SEC_ASN1_METHOD_MASK = 32; + +const int SEC_ASN1_PRIMITIVE = 0; + +const int SEC_ASN1_CONSTRUCTED = 32; + +const int SEC_ASN1_CLASS_MASK = 192; + +const int SEC_ASN1_UNIVERSAL = 0; + +const int SEC_ASN1_APPLICATION = 64; + +const int SEC_ASN1_CONTEXT_SPECIFIC = 128; + +const int SEC_ASN1_PRIVATE = 192; + +const int SEC_ASN1_OPTIONAL = 256; + +const int SEC_ASN1_EXPLICIT = 512; + +const int SEC_ASN1_ANY = 1024; + +const int SEC_ASN1_INLINE = 2048; + +const int SEC_ASN1_POINTER = 4096; + +const int SEC_ASN1_GROUP = 8192; + +const int SEC_ASN1_DYNAMIC = 16384; + +const int SEC_ASN1_SKIP = 32768; + +const int SEC_ASN1_INNER = 65536; + +const int SEC_ASN1_SAVE = 131072; + +const int SEC_ASN1_SKIP_REST = 524288; + +const int SEC_ASN1_CHOICE = 1048576; + +const int SEC_ASN1_SIGNED_INT = 8388608; + +const int SEC_ASN1_SEQUENCE_OF = 8208; + +const int SEC_ASN1_SET_OF = 8209; + +const int SEC_ASN1_ANY_CONTENTS = 66560; + +const int _CSSMAPPLE_H_ = 1; + +const int _CSSMERR_H_ = 1; + +const int _X509DEFS_H_ = 1; + +const int BER_TAG_UNKNOWN = 0; + +const int BER_TAG_BOOLEAN = 1; + +const int BER_TAG_INTEGER = 2; + +const int BER_TAG_BIT_STRING = 3; + +const int BER_TAG_OCTET_STRING = 4; + +const int BER_TAG_NULL = 5; + +const int BER_TAG_OID = 6; + +const int BER_TAG_OBJECT_DESCRIPTOR = 7; + +const int BER_TAG_EXTERNAL = 8; + +const int BER_TAG_REAL = 9; + +const int BER_TAG_ENUMERATED = 10; + +const int BER_TAG_PKIX_UTF8_STRING = 12; + +const int BER_TAG_SEQUENCE = 16; + +const int BER_TAG_SET = 17; + +const int BER_TAG_NUMERIC_STRING = 18; + +const int BER_TAG_PRINTABLE_STRING = 19; + +const int BER_TAG_T61_STRING = 20; + +const int BER_TAG_TELETEX_STRING = 20; + +const int BER_TAG_VIDEOTEX_STRING = 21; + +const int BER_TAG_IA5_STRING = 22; + +const int BER_TAG_UTC_TIME = 23; + +const int BER_TAG_GENERALIZED_TIME = 24; + +const int BER_TAG_GRAPHIC_STRING = 25; + +const int BER_TAG_ISO646_STRING = 26; + +const int BER_TAG_GENERAL_STRING = 27; + +const int BER_TAG_VISIBLE_STRING = 26; + +const int BER_TAG_PKIX_UNIVERSAL_STRING = 28; + +const int BER_TAG_PKIX_BMP_STRING = 30; + +const int CSSM_X509_OPTION_PRESENT = 1; + +const int CSSM_X509_OPTION_NOT_PRESENT = 0; + +const int CE_KU_DigitalSignature = 32768; + +const int CE_KU_NonRepudiation = 16384; + +const int CE_KU_KeyEncipherment = 8192; + +const int CE_KU_DataEncipherment = 4096; + +const int CE_KU_KeyAgreement = 2048; + +const int CE_KU_KeyCertSign = 1024; + +const int CE_KU_CRLSign = 512; + +const int CE_KU_EncipherOnly = 256; + +const int CE_KU_DecipherOnly = 128; + +const int CE_CR_Unspecified = 0; + +const int CE_CR_KeyCompromise = 1; + +const int CE_CR_CACompromise = 2; + +const int CE_CR_AffiliationChanged = 3; + +const int CE_CR_Superseded = 4; + +const int CE_CR_CessationOfOperation = 5; + +const int CE_CR_CertificateHold = 6; + +const int CE_CR_RemoveFromCRL = 8; + +const int CE_CD_Unspecified = 128; + +const int CE_CD_KeyCompromise = 64; + +const int CE_CD_CACompromise = 32; + +const int CE_CD_AffiliationChanged = 16; + +const int CE_CD_Superseded = 8; + +const int CE_CD_CessationOfOperation = 4; + +const int CE_CD_CertificateHold = 2; + +const int CSSM_APPLE_TP_SSL_OPTS_VERSION = 1; + +const int CSSM_APPLE_TP_SSL_CLIENT = 1; + +const int CSSM_APPLE_TP_CRL_OPTS_VERSION = 0; + +const int CSSM_APPLE_TP_SMIME_OPTS_VERSION = 0; + +const int CSSM_APPLE_TP_ACTION_VERSION = 0; + +const int CSSM_TP_APPLE_EVIDENCE_VERSION = 0; + +const int CSSM_EVIDENCE_FORM_APPLE_CUSTOM = 2147483648; + +const String CSSM_APPLE_CRL_END_OF_TIME = '99991231235959'; + +const String kKeychainSuffix = '.keychain'; + +const String kKeychainDbSuffix = '.keychain-db'; + +const String kSystemKeychainName = 'System.keychain'; + +const String kSystemKeychainDir = '/Library/Keychains/'; + +const String kSystemUnlockFile = '/var/db/SystemKey'; + +const String kSystemKeychainPath = '/Library/Keychains/System.keychain'; + +const String CSSM_APPLE_ACL_TAG_PARTITION_ID = '___PARTITION___'; + +const String CSSM_APPLE_ACL_TAG_INTEGRITY = '___INTEGRITY___'; + +const int errSecErrnoBase = 100000; + +const int errSecErrnoLimit = 100255; + +const int errSSLServerAuthCompleted = -9841; + +const int errSSLClientAuthCompleted = -9841; + +const int errSSLLast = -9849; + +const int NSMaximumStringLength = 2147483646; + +const int NS_UNICHAR_IS_EIGHT_BIT = 0; + +const int NSURLResponseUnknownLength = -1; -const String kVmSnapshotBssAsmSymbol = '_kDartVmSnapshotBss'; +const int NSOperationQualityOfServiceUserInteractive = 33; -const String kIsolateSnapshotDataAsmSymbol = '_kDartIsolateSnapshotData'; +const int NSOperationQualityOfServiceUserInitiated = 25; -const String kIsolateSnapshotInstructionsAsmSymbol = - '_kDartIsolateSnapshotInstructions'; +const int NSOperationQualityOfServiceUtility = 17; -const String kIsolateSnapshotBssAsmSymbol = '_kDartIsolateSnapshotBss'; +const int NSOperationQualityOfServiceBackground = 9; diff --git a/pkgs/cupertino_http/lib/src/utils.dart b/pkgs/cupertino_http/lib/src/utils.dart index 7bc87aa87c..8712c34dd8 100644 --- a/pkgs/cupertino_http/lib/src/utils.dart +++ b/pkgs/cupertino_http/lib/src/utils.dart @@ -5,10 +5,9 @@ import 'dart:ffi'; import 'dart:io'; -import 'native_cupertino_bindings.dart' as ncb; +import 'package:objective_c/objective_c.dart'; -const _packageName = 'cupertino_http'; -const _libName = _packageName; +import 'native_cupertino_bindings.dart' as ncb; /// Access to symbols that are linked into the process. /// @@ -23,70 +22,37 @@ final ncb.NativeCupertinoHttp linkedLibs = () { 'Platform ${Platform.operatingSystem} is not supported'); }(); -/// Access to symbols that are available in the cupertino_http helper shared -/// library. -final ncb.NativeCupertinoHttp helperLibs = _loadHelperLibrary(); - -DynamicLibrary _loadHelperDynamicLibrary() { - if (Platform.isMacOS || Platform.isIOS) { - return DynamicLibrary.open('$_libName.framework/$_libName'); - } - - throw UnsupportedError( - 'Platform ${Platform.operatingSystem} is not supported'); -} - -ncb.NativeCupertinoHttp _loadHelperLibrary() { - final lib = _loadHelperDynamicLibrary(); - - final initializeApi = lib.lookupFunction), - int Function(Pointer)>('Dart_InitializeApiDL'); - final initializeResult = initializeApi(NativeApi.initializeApiDLData); - if (initializeResult != 0) { - throw StateError('failed to init API.'); - } - - return ncb.NativeCupertinoHttp(lib); -} - -String? toStringOrNull(ncb.NSString? s) { - if (s == null) { - return null; - } - - return s.toString(); -} - /// Converts a NSDictionary containing NSString keys and NSString values into /// an equivalent map. -Map stringNSDictionaryToMap(ncb.NSDictionary d) { - // TODO(https://github.com/dart-lang/ffigen/issues/374): Make this - // function type safe. Currently it will unconditionally cast both keys and - // values to NSString with a likely crash down the line if that isn't their - // true types. +Map stringNSDictionaryToMap(NSDictionary d) { final m = {}; - - final keys = ncb.NSArray.castFrom(d.allKeys); + final keys = NSArray.castFrom(d.allKeys); for (var i = 0; i < keys.count; ++i) { final nsKey = keys.objectAtIndex_(i); - final key = ncb.NSString.castFrom(nsKey).toString(); - final value = ncb.NSString.castFrom(d.objectForKey_(nsKey)!).toString(); + if (!NSString.isInstance(nsKey)) { + throw UnsupportedError('keys must be strings'); + } + final key = NSString.castFrom(nsKey).toString(); + final nsValue = d.objectForKey_(nsKey); + if (nsValue == null || !NSString.isInstance(nsValue)) { + throw UnsupportedError('values must be strings'); + } + final value = NSString.castFrom(nsValue).toString(); m[key] = value; } return m; } -ncb.NSArray stringIterableToNSArray(Iterable strings) { - final array = - ncb.NSMutableArray.arrayWithCapacity_(linkedLibs, strings.length); +NSArray stringIterableToNSArray(Iterable strings) { + final array = NSMutableArray.arrayWithCapacity_(strings.length); var index = 0; for (var s in strings) { - array.setObject_atIndexedSubscript_(s.toNSString(linkedLibs), index++); + array.setObject_atIndexedSubscript_(s.toNSString(), index++); } return array; } -ncb.NSURL uriToNSURL(Uri uri) => ncb.NSURL - .URLWithString_(linkedLibs, uri.toString().toNSString(linkedLibs))!; +NSURL uriToNSURL(Uri uri) => NSURL.URLWithString_(uri.toString().toNSString())!; +Uri nsurlToUri(NSURL url) => Uri.parse(url.absoluteString!.toString()); diff --git a/pkgs/cupertino_http/pubspec.yaml b/pkgs/cupertino_http/pubspec.yaml index cff2546b3e..dbdda7067b 100644 --- a/pkgs/cupertino_http/pubspec.yaml +++ b/pkgs/cupertino_http/pubspec.yaml @@ -7,7 +7,7 @@ repository: https://github.com/dart-lang/http/tree/master/pkgs/cupertino_http environment: sdk: ^3.4.0 - flutter: '>=3.22.0' # If changed, update test matrix. + flutter: '>=3.24.0' # If changed, update test matrix. dependencies: async: ^2.5.0 @@ -16,11 +16,12 @@ dependencies: sdk: flutter http: ^1.2.0 http_profile: ^0.1.0 + objective_c: ^3.0.0 web_socket: ^0.1.0 dev_dependencies: dart_flutter_team_lints: ^3.0.0 - ffigen: ^11.0.0 + ffigen: ^15.0.0 flutter: plugin: diff --git a/pkgs/cupertino_http/src/CUPHTTPClientDelegate.h b/pkgs/cupertino_http/src/CUPHTTPClientDelegate.h deleted file mode 100644 index 775b70af56..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPClientDelegate.h +++ /dev/null @@ -1,65 +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. - -// Normally, we'd "import " -// but that would mean that ffigen would process every file in the Foundation -// framework, which is huge. So just import the headers that we need. -#import -#import - -#include "dart-sdk/include/dart_api_dl.h" - -/** - * The type of message being sent to a Dart port. See CUPHTTPClientDelegate. - */ -typedef NS_ENUM(NSInteger, MessageType) { - ResponseMessage = 0, - DataMessage = 1, - CompletedMessage = 2, - RedirectMessage = 3, - FinishedDownloading = 4, - WebSocketOpened = 5, - WebSocketClosed = 6, -}; - -/** - * The configuration associated with a NSURLSessionTask. - * See CUPHTTPClientDelegate. - */ -@interface CUPHTTPTaskConfiguration : NSObject - -- (id) initWithPort:(Dart_Port)sendPort; - -@property (readonly) Dart_Port sendPort; - -@end - -/** - * A delegate for NSURLSession that forwards events for registered - * NSURLSessionTasks and forwards them to a port for consumption in Dart. - * - * The messages sent to the port are contained in a List with one of 3 - * possible formats: - * - * 1. When the delegate receives a HTTP redirect response: - * [MessageType::RedirectMessage, ] - * - * 2. When the delegate receives a HTTP response: - * [MessageType::ResponseMessage, ] - * - * 3. When the delegate receives some HTTP data: - * [MessageType::DataMessage, ] - * - * 4. When the delegate is informed that the response is complete: - * [MessageType::CompletedMessage, ] - */ -@interface CUPHTTPClientDelegate : NSObject - -/** - * Instruct the delegate to forward events for the given task to the port - * specified in the configuration. - */ -- (void)registerTask:(NSURLSessionTask *)task - withConfiguration:(CUPHTTPTaskConfiguration *)config; -@end diff --git a/pkgs/cupertino_http/src/CUPHTTPClientDelegate.m b/pkgs/cupertino_http/src/CUPHTTPClientDelegate.m deleted file mode 100644 index b0f2fb742c..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPClientDelegate.m +++ /dev/null @@ -1,277 +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 "CUPHTTPClientDelegate.h" - -#import -#include - -#import "CUPHTTPCompletionHelper.h" -#import "CUPHTTPForwardedDelegate.h" - -static Dart_CObject MessageTypeToCObject(MessageType messageType) { - Dart_CObject cobj; - cobj.type = Dart_CObject_kInt64; - cobj.value.as_int64 = messageType; - return cobj; -} - -@implementation CUPHTTPTaskConfiguration - -- (id) initWithPort:(Dart_Port)sendPort { - self = [super init]; - if (self != nil) { - self->_sendPort = sendPort; - } - return self; -} - -@end - -@implementation CUPHTTPClientDelegate { - NSMapTable *taskConfigurations; -} - -- (instancetype)init { - self = [super init]; - if (self != nil) { - taskConfigurations = [[NSMapTable strongToStrongObjectsMapTable] retain]; - } - return self; -} - -- (void)dealloc { - [taskConfigurations release]; - [super dealloc]; -} - -- (void)registerTask:(NSURLSessionTask *) task - withConfiguration:(CUPHTTPTaskConfiguration *)config { - [taskConfigurations setObject:config forKey:task]; -} - --(void)unregisterTask:(NSURLSessionTask *) task { - [taskConfigurations removeObjectForKey:task]; -} - -- (void)URLSession:(NSURLSession *)session - task:(NSURLSessionTask *)task -willPerformHTTPRedirection:(NSHTTPURLResponse *)response - newRequest:(NSURLRequest *)request - completionHandler:(void (^)(NSURLRequest *))completionHandler { - CUPHTTPTaskConfiguration *config = [taskConfigurations objectForKey:task]; - NSAssert(config != nil, @"No configuration for task."); - - CUPHTTPForwardedRedirect *forwardedRedirect = [[CUPHTTPForwardedRedirect alloc] - initWithSession:session task:task - response:response request:request]; - Dart_CObject ctype = MessageTypeToCObject(RedirectMessage); - Dart_CObject credirect = NSObjectToCObject(forwardedRedirect); - Dart_CObject* message_carray[] = { &ctype, &credirect }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - [forwardedRedirect.lock lock]; // After this line, any attempt to acquire the lock will wait. - const bool success = Dart_PostCObject_DL(config.sendPort, &message_cobj); - NSAssert(success, @"Dart_PostCObject_DL failed."); - - // Will be unlocked by [CUPHTTPRedirect continueWithRequest:], which will - // set `redirect.redirectRequest`. - // - // See the @interface description for CUPHTTPRedirect. - [forwardedRedirect.lock lock]; - - completionHandler(forwardedRedirect.redirectRequest); - [forwardedRedirect release]; -} - -- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)task -didReceiveResponse:(NSURLResponse *)response - completionHandler:(void (^)(NSURLSessionResponseDisposition disposition))completionHandler -{ - CUPHTTPTaskConfiguration *config = [taskConfigurations objectForKey:task]; - NSAssert(config != nil, @"No configuration for task."); - - CUPHTTPForwardedResponse *forwardedResponse = [[CUPHTTPForwardedResponse alloc] - initWithSession:session - task:task - response:response]; - - - Dart_CObject ctype = MessageTypeToCObject(ResponseMessage); - Dart_CObject cRsponseReceived = NSObjectToCObject(forwardedResponse); - Dart_CObject* message_carray[] = { &ctype, &cRsponseReceived }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - [forwardedResponse.lock lock]; // After this line, any attempt to acquire the lock will wait. - const bool success = Dart_PostCObject_DL(config.sendPort, &message_cobj); - NSAssert(success, @"Dart_PostCObject_DL failed."); - - // Will be unlocked by [CUPHTTPRedirect continueWithRequest:], which will - // set `redirect.redirectRequest`. - // - // See the @interface description for CUPHTTPRedirect. - [forwardedResponse.lock lock]; - completionHandler(forwardedResponse.disposition); - [forwardedResponse release]; -} - - -- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)task - didReceiveData:(NSData *)data { - CUPHTTPTaskConfiguration *config = [taskConfigurations objectForKey:task]; - NSAssert(config != nil, @"No configuration for task."); - - CUPHTTPForwardedData *forwardedData = [[CUPHTTPForwardedData alloc] - initWithSession:session task:task data: data] - ; - - Dart_CObject ctype = MessageTypeToCObject(DataMessage); - Dart_CObject cReceiveData = NSObjectToCObject(forwardedData); - Dart_CObject* message_carray[] = { &ctype, &cReceiveData }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - [forwardedData.lock lock]; // After this line, any attempt to acquire the lock will wait. - const bool success = Dart_PostCObject_DL(config.sendPort, &message_cobj); - NSAssert(success, @"Dart_PostCObject_DL failed."); - - // Will be unlocked by [CUPHTTPRedirect continueWithRequest:], which will - // set `redirect.redirectRequest`. - // - // See the @interface description for CUPHTTPRedirect. - [forwardedData.lock lock]; - [forwardedData release]; -} - -- (void)URLSession:(NSURLSession *)session - downloadTask:(NSURLSessionDownloadTask *)downloadTask -didFinishDownloadingToURL:(NSURL *)location { - CUPHTTPTaskConfiguration *config = [taskConfigurations objectForKey:downloadTask]; - NSAssert(config != nil, @"No configuration for task."); - - CUPHTTPForwardedFinishedDownloading *forwardedFinishedDownload = [ - [CUPHTTPForwardedFinishedDownloading alloc] - initWithSession:session downloadTask:downloadTask url: location]; - - Dart_CObject ctype = MessageTypeToCObject(FinishedDownloading); - Dart_CObject cReceiveData = NSObjectToCObject(forwardedFinishedDownload); - Dart_CObject* message_carray[] = { &ctype, &cReceiveData }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - // After this line, any attempt to acquire the lock will wait. - [forwardedFinishedDownload.lock lock]; - const bool success = Dart_PostCObject_DL(config.sendPort, &message_cobj); - NSAssert(success, @"Dart_PostCObject_DL failed."); - - [forwardedFinishedDownload.lock lock]; - [forwardedFinishedDownload release]; -} - -- (void)URLSession:(NSURLSession *)session - task:(NSURLSessionTask *)task -didCompleteWithError:(nullable NSError *)error { - CUPHTTPTaskConfiguration *config = [taskConfigurations objectForKey:task]; - NSAssert(config != nil, @"No configuration for task."); - - CUPHTTPForwardedComplete *forwardedComplete = [[CUPHTTPForwardedComplete alloc] - initWithSession:session task:task error: error]; - - - Dart_CObject ctype = MessageTypeToCObject(CompletedMessage); - Dart_CObject cComplete = NSObjectToCObject(forwardedComplete); - Dart_CObject* message_carray[] = { &ctype, &cComplete }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - [forwardedComplete.lock lock]; // After this line, any attempt to acquire the lock will wait. - const bool success = Dart_PostCObject_DL(config.sendPort, &message_cobj); - NSAssert(success, @"Dart_PostCObject_DL failed."); - - // Will be unlocked by [CUPHTTPRedirect continueWithRequest:], which will - // set `redirect.redirectRequest`. - // - // See the @interface description for CUPHTTPRedirect. - [forwardedComplete.lock lock]; - [forwardedComplete release]; -} - -// https://developer.apple.com/documentation/foundation/nsurlsessionwebsocketdelegate?language=objc - - -- (void)URLSession:(NSURLSession *)session - webSocketTask:(NSURLSessionWebSocketTask *)task -didOpenWithProtocol:(nullable NSString *)protocol { - CUPHTTPTaskConfiguration *config = [taskConfigurations objectForKey:task]; - NSAssert(config != nil, @"No configuration for task."); - - CUPHTTPForwardedWebSocketOpened *opened = [[CUPHTTPForwardedWebSocketOpened alloc] - initWithSession:session webSocketTask:task - didOpenWithProtocol: protocol]; - - Dart_CObject ctype = MessageTypeToCObject(WebSocketOpened); - Dart_CObject cComplete = NSObjectToCObject(opened); - Dart_CObject* message_carray[] = { &ctype, &cComplete }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - [opened.lock lock]; // After this line, any attempt to acquire the lock will wait. - const bool success = Dart_PostCObject_DL(config.sendPort, &message_cobj); - NSAssert(success, @"Dart_PostCObject_DL failed."); - - [opened.lock lock]; - [opened release]; -} - - -- (void)URLSession:(NSURLSession *)session - webSocketTask:(NSURLSessionWebSocketTask *)task - didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode - reason:(nullable NSData *)reason { - CUPHTTPTaskConfiguration *config = [taskConfigurations objectForKey:task]; - NSAssert(config != nil, @"No configuration for task."); - - CUPHTTPForwardedWebSocketClosed *closed = [[CUPHTTPForwardedWebSocketClosed alloc] - initWithSession:session webSocketTask:task - code: closeCode - reason: reason]; - - Dart_CObject ctype = MessageTypeToCObject(WebSocketClosed); - Dart_CObject cComplete = NSObjectToCObject(closed); - Dart_CObject* message_carray[] = { &ctype, &cComplete }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - [closed.lock lock]; // After this line, any attempt to acquire the lock will wait. - const bool success = Dart_PostCObject_DL(config.sendPort, &message_cobj); - NSAssert(success, @"Dart_PostCObject_DL failed."); - - [closed.lock lock]; - [closed release]; -} - -@end diff --git a/pkgs/cupertino_http/src/CUPHTTPCompletionHelper.h b/pkgs/cupertino_http/src/CUPHTTPCompletionHelper.h deleted file mode 100644 index 501b80b1fc..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPCompletionHelper.h +++ /dev/null @@ -1,31 +0,0 @@ -// 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. - -// Normally, we'd "import " -// but that would mean that ffigen would process every file in the Foundation -// framework, which is huge. So just import the headers that we need. -#import -#import - -#include "dart-sdk/include/dart_api_dl.h" - -/** - * Creates a `Dart_CObject` containing the given `NSObject` pointer as an int. - */ -Dart_CObject NSObjectToCObject(NSObject* n); - -/** - * Executes [NSURLSessionWebSocketTask sendMessage:completionHandler:] and - * sends the results of the completion handler to the given `Dart_Port`. - */ -extern void CUPHTTPSendMessage(NSURLSessionWebSocketTask *task, - NSURLSessionWebSocketMessage *message, - Dart_Port sendPort); - -/** - * Executes [NSURLSessionWebSocketTask receiveMessageWithCompletionHandler:] - * and sends the results of the completion handler to the given `Dart_Port`. - */ -extern void CUPHTTPReceiveMessage(NSURLSessionWebSocketTask *task, - Dart_Port sendPort); diff --git a/pkgs/cupertino_http/src/CUPHTTPCompletionHelper.m b/pkgs/cupertino_http/src/CUPHTTPCompletionHelper.m deleted file mode 100644 index 9f8137d395..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPCompletionHelper.m +++ /dev/null @@ -1,45 +0,0 @@ -// 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 "CUPHTTPCompletionHelper.h" - -#import -#include - -Dart_CObject NSObjectToCObject(NSObject* n) { - Dart_CObject cobj; - cobj.type = Dart_CObject_kInt64; - cobj.value.as_int64 = (int64_t) n; - return cobj; -} - -void CUPHTTPSendMessage(NSURLSessionWebSocketTask *task, NSURLSessionWebSocketMessage *message, Dart_Port sendPort) { - [task sendMessage: message - completionHandler: ^(NSError *error) { - [error retain]; - Dart_CObject message_cobj = NSObjectToCObject(error); - const bool success = Dart_PostCObject_DL(sendPort, &message_cobj); - NSCAssert(success, @"Dart_PostCObject_DL failed."); - }]; -} - -void CUPHTTPReceiveMessage(NSURLSessionWebSocketTask *task, Dart_Port sendPort) { - [task - receiveMessageWithCompletionHandler: ^(NSURLSessionWebSocketMessage *message, NSError *error) { - [message retain]; - [error retain]; - - Dart_CObject cmessage = NSObjectToCObject(message); - Dart_CObject cerror = NSObjectToCObject(error); - Dart_CObject* message_carray[] = { &cmessage, &cerror }; - - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kArray; - message_cobj.value.as_array.length = 2; - message_cobj.value.as_array.values = message_carray; - - const bool success = Dart_PostCObject_DL(sendPort, &message_cobj); - NSCAssert(success, @"Dart_PostCObject_DL failed."); - }]; -} diff --git a/pkgs/cupertino_http/src/CUPHTTPForwardedDelegate.h b/pkgs/cupertino_http/src/CUPHTTPForwardedDelegate.h deleted file mode 100644 index 3e61ed494b..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPForwardedDelegate.h +++ /dev/null @@ -1,130 +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. - -// Normally, we'd "import " -// but that would mean that ffigen would process every file in the Foundation -// framework, which is huge. So just import the headers that we need. -#import -#import - - -/** - * An object used to communicate redirect information to Dart code. - * - * The flow is: - * 1. CUPHTTPClientDelegate receives a message from the URL Loading System. - * 2. CUPHTTPClientDelegate creates a new CUPHTTPForwardedDelegate subclass. - * 3. CUPHTTPClientDelegate sends the CUPHTTPForwardedDelegate to the - * configured Dart_Port. - * 4. CUPHTTPClientDelegate waits on CUPHTTPForwardedDelegate.lock - * 5. When the Dart code is done process the message received on the port, - * it calls [CUPHTTPForwardedDelegate finish*], which releases the lock. - * 6. CUPHTTPClientDelegate continues running. - */ -@interface CUPHTTPForwardedDelegate : NSObject -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task; - -/** - * Indicates that the task should continue executing using the given request. - */ -- (void) finish;; - -@property (readonly) NSURLSession *session; -@property (readonly) NSURLSessionTask *task; - -// This property is meant to be used only by CUPHTTPClientDelegate. -@property (readonly) NSLock *lock; - -@end - -@interface CUPHTTPForwardedRedirect : CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - response:(NSHTTPURLResponse *)response - request:(NSURLRequest *)request; - -/** - * Indicates that the task should continue executing using the given request. - * If the request is NIL then the redirect is not followed and the task is - * complete. - */ -- (void) finishWithRequest:(nullable NSURLRequest *) request; - -@property (readonly) NSHTTPURLResponse *response; -@property (readonly) NSURLRequest *request; - -// This property is meant to be used only by CUPHTTPClientDelegate. -@property (readonly) NSURLRequest *redirectRequest; - -@end - -@interface CUPHTTPForwardedResponse : CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - response:(NSURLResponse *)response; - -- (void) finishWithDisposition:(NSURLSessionResponseDisposition) disposition; - -@property (readonly) NSURLResponse *response; - -// This property is meant to be used only by CUPHTTPClientDelegate. -@property (readonly) NSURLSessionResponseDisposition disposition; - -@end - -@interface CUPHTTPForwardedData : CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - data:(NSData *)data; - -@property (readonly) NSData* data; - -@end - - -@interface CUPHTTPForwardedComplete : CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - error:(nullable NSError *)error; - -@property (nullable, readonly) NSError* error; - -@end - -@interface CUPHTTPForwardedFinishedDownloading : CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - downloadTask:(NSURLSessionDownloadTask *)downloadTask - url:(NSURL *)location; - -@property (readonly) NSURL* location; - -@end - -@interface CUPHTTPForwardedWebSocketOpened : CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - webSocketTask:(NSURLSessionWebSocketTask *)webSocketTask - didOpenWithProtocol:(nullable NSString *)protocol; - -@property (nullable, readonly) NSString* protocol; - -@end - -@interface CUPHTTPForwardedWebSocketClosed : CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - webSocketTask:(NSURLSessionWebSocketTask *)webSocketTask - code:(NSURLSessionWebSocketCloseCode)closeCode - reason:(NSData *)reason; - -@property (readonly) NSURLSessionWebSocketCloseCode closeCode; -@property (nullable, readonly) NSData* reason; - -@end diff --git a/pkgs/cupertino_http/src/CUPHTTPForwardedDelegate.m b/pkgs/cupertino_http/src/CUPHTTPForwardedDelegate.m deleted file mode 100644 index a9a401d5aa..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPForwardedDelegate.m +++ /dev/null @@ -1,183 +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 "CUPHTTPForwardedDelegate.h" - -#import -#include - -@implementation CUPHTTPForwardedDelegate - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task { - self = [super init]; - if (self != nil) { - self->_session = [session retain]; - self->_task = [task retain]; - self->_lock = [NSLock new]; - } - return self; -} - -- (void) dealloc { - [self->_session release]; - [self->_task release]; - [self->_lock release]; - [super dealloc]; -} - -- (void) finish { - [self->_lock unlock]; -} - -@end - -@implementation CUPHTTPForwardedRedirect - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - response:(NSHTTPURLResponse *)response - request:(NSURLRequest *)request{ - self = [super initWithSession: session task: task]; - if (self != nil) { - self->_response = [response retain]; - self->_request = [request retain]; - } - return self; -} - -- (void) dealloc { - [self->_response release]; - [self->_request release]; - [super dealloc]; -} - -- (void) finishWithRequest:(nullable NSURLRequest *) request { - self->_redirectRequest = [request retain]; - [super finish]; -} - -@end - -@implementation CUPHTTPForwardedResponse - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - response:(NSURLResponse *)response { - self = [super initWithSession: session task: task]; - if (self != nil) { - self->_response = [response retain]; - } - return self; -} - -- (void) dealloc { - [self->_response release]; - [super dealloc]; -} - -- (void) finishWithDisposition:(NSURLSessionResponseDisposition) disposition { - self->_disposition = disposition; - [super finish]; -} - -@end - -@implementation CUPHTTPForwardedData - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - data:(NSData *)data { - self = [super initWithSession: session task: task]; - if (self != nil) { - self->_data = [data retain]; - } - return self; -} - -- (void) dealloc { - [self->_data release]; - [super dealloc]; -} - -@end - -@implementation CUPHTTPForwardedComplete - -- (id) initWithSession:(NSURLSession *)session - task:(NSURLSessionTask *) task - error:(NSError *)error { - self = [super initWithSession: session task: task]; - if (self != nil) { - self->_error = [error retain]; - } - return self; -} - -- (void) dealloc { - [self->_error release]; - [super dealloc]; -} - -@end - -@implementation CUPHTTPForwardedFinishedDownloading - -- (id) initWithSession:(NSURLSession *)session - downloadTask:(NSURLSessionDownloadTask *)downloadTask - url:(NSURL *)location { - self = [super initWithSession: session task: downloadTask]; - if (self != nil) { - self->_location = [location retain]; - } - return self; -} - -- (void) dealloc { - [self->_location release]; - [super dealloc]; -} - -@end - -@implementation CUPHTTPForwardedWebSocketOpened - -- (id) initWithSession:(NSURLSession *)session - webSocketTask:(NSURLSessionWebSocketTask *)webSocketTask - didOpenWithProtocol:(NSString *)protocol { - self = [super initWithSession: session task: webSocketTask]; - if (self != nil) { - self->_protocol = [protocol retain]; - } - return self; -} - -- (void) dealloc { - [self->_protocol release]; - [super dealloc]; -} - -@end - -@implementation CUPHTTPForwardedWebSocketClosed - -- (id) initWithSession:(NSURLSession *)session - webSocketTask:(NSURLSessionWebSocketTask *)webSocketTask - code:(NSURLSessionWebSocketCloseCode)closeCode - reason:(NSData *)reason { - self = [super initWithSession: session task: webSocketTask]; - if (self != nil) { - self->_closeCode = closeCode; - self->_reason = [reason retain]; - } - return self; -} - -- (void) dealloc { - [self->_reason release]; - [super dealloc]; -} - -@end - diff --git a/pkgs/cupertino_http/src/CUPHTTPStreamToNSInputStreamAdapter.h b/pkgs/cupertino_http/src/CUPHTTPStreamToNSInputStreamAdapter.h deleted file mode 100644 index 6b0e2242d0..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPStreamToNSInputStreamAdapter.h +++ /dev/null @@ -1,23 +0,0 @@ -// 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. - -// Normally, we'd "import " -// but that would mean that ffigen would process every file in the Foundation -// framework, which is huge. So just import the headers that we need. -#import -#import - -#include "dart-sdk/include/dart_api_dl.h" - -/** - * A helper to convert a Dart Stream> into an Objective-C input stream. - */ -@interface CUPHTTPStreamToNSInputStreamAdapter : NSInputStream - -- (instancetype)initWithPort:(Dart_Port)sendPort; -- (NSUInteger)addData:(NSData *)data; -- (void)setDone; -- (void)setError:(NSError *)error; - -@end diff --git a/pkgs/cupertino_http/src/CUPHTTPStreamToNSInputStreamAdapter.m b/pkgs/cupertino_http/src/CUPHTTPStreamToNSInputStreamAdapter.m deleted file mode 100644 index ae4b0e223b..0000000000 --- a/pkgs/cupertino_http/src/CUPHTTPStreamToNSInputStreamAdapter.m +++ /dev/null @@ -1,173 +0,0 @@ -// 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 "CUPHTTPStreamToNSInputStreamAdapter.h" - -#import -#include - -@implementation CUPHTTPStreamToNSInputStreamAdapter { - Dart_Port _sendPort; - NSCondition* _dataCondition; - NSMutableData * _data; - NSStreamStatus _status; - BOOL _done; - NSError* _error; - id _delegate; // This is a weak reference. -} - -- (instancetype)initWithPort:(Dart_Port)sendPort { - self = [super init]; - if (self != nil) { - _sendPort = sendPort; - _dataCondition = [[NSCondition alloc] init]; - _data = [[NSMutableData alloc] init]; - _done = NO; - _status = NSStreamStatusNotOpen; - _error = nil; - _delegate = self; - } - return self; -} - -- (void)dealloc { - [_dataCondition release]; - [_data release]; - [_error release]; - [super dealloc]; -} - -- (NSUInteger)addData:(NSData *)data { - [_dataCondition lock]; - [_data appendData: data]; - [_dataCondition broadcast]; - [_dataCondition unlock]; - return [_data length]; -} - -- (void)setDone { - [_dataCondition lock]; - _done = YES; - [_dataCondition broadcast]; - [_dataCondition unlock]; -} - -- (void)setError:(NSError *)error { - [_dataCondition lock]; - [_error release]; - _error = [error retain]; - _status = NSStreamStatusError; - [_dataCondition broadcast]; - [_dataCondition unlock]; -} - - -#pragma mark - NSStream - -- (void)scheduleInRunLoop:(NSRunLoop*)runLoop forMode:(NSString*)mode { -} - -- (void)removeFromRunLoop:(NSRunLoop*)runLoop forMode:(NSString*)mode { -} - -- (void)open { - [_dataCondition lock]; - _status = NSStreamStatusOpen; - [_dataCondition unlock]; -} - -- (void)close { - [_dataCondition lock]; - _status = NSStreamStatusClosed; - [_dataCondition unlock]; -} - -- (id)propertyForKey:(NSStreamPropertyKey)key { - return nil; -} - -- (BOOL)setProperty:(id)property forKey:(NSStreamPropertyKey)key { - return NO; -} - -- (id)delegate { - return _delegate; -} - -- (void)setDelegate:(id)delegate { - if (delegate == nil) { - _delegate = self; - } else { - _delegate = delegate; - } -} - -- (NSError*)streamError { - return _error; -} - -- (NSStreamStatus)streamStatus { - return _status; -} - -#pragma mark - NSInputStream - -- (NSInteger)read:(uint8_t*)buffer maxLength:(NSUInteger)len { - os_log_with_type(OS_LOG_DEFAULT, - OS_LOG_TYPE_DEBUG, - "CUPHTTPStreamToNSInputStreamAdapter: read len=%tu", len); - [_dataCondition lock]; - - while ([_data length] == 0 && !_done && _error == nil) { - // There is no data to return so signal the Dart code that it should add more data through - // [self addData:]. - Dart_CObject message_cobj; - message_cobj.type = Dart_CObject_kInt64; - message_cobj.value.as_int64 = len; - - const bool success = Dart_PostCObject_DL(_sendPort, &message_cobj); - NSCAssert(success, @"Dart_PostCObject_DL failed."); - - [_dataCondition wait]; - } - - NSInteger copySize; - if (_error == nil) { - copySize = MIN(len, [_data length]); - NSRange readRange = NSMakeRange(0, copySize); - [_data getBytes:(void *)buffer range: readRange]; - // Shift the remaining data over to the beginning of the buffer. - [_data replaceBytesInRange: readRange withBytes: NULL length: 0]; - - if (_done && [_data length] == 0) { - _status = NSStreamStatusAtEnd; - } - } else { - copySize = -1; - } - - [_dataCondition unlock]; - return copySize; -} - -- (BOOL)getBuffer:(uint8_t**)buffer length:(NSUInteger*)len { - return NO; -} - -- (BOOL)hasBytesAvailable { - return YES; -} - -#pragma mark - NSStreamDelegate - -- (void)stream:(NSStream *)theStream handleEvent:(NSStreamEvent)streamEvent { - id delegate = _delegate; - if (delegate != self) { - os_log_with_type(OS_LOG_DEFAULT, - OS_LOG_TYPE_ERROR, - "CUPHTTPStreamToNSInputStreamAdapter: non-self delegate was invoked"); - } -} - -@end diff --git a/pkgs/cupertino_http/src/dart-sdk/include/dart_api.h b/pkgs/cupertino_http/src/dart-sdk/include/dart_api.h deleted file mode 100644 index abc0291836..0000000000 --- a/pkgs/cupertino_http/src/dart-sdk/include/dart_api.h +++ /dev/null @@ -1,3909 +0,0 @@ -/* - * Copyright (c) 2012, 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 RUNTIME_INCLUDE_DART_API_H_ -#define RUNTIME_INCLUDE_DART_API_H_ - -/** \mainpage Dart Embedding API Reference - * - * This reference describes the Dart Embedding API, which is used to embed the - * Dart Virtual Machine within C/C++ applications. - * - * This reference is generated from the header include/dart_api.h. - */ - -/* __STDC_FORMAT_MACROS has to be defined before including to - * enable platform independent printf format specifiers. */ -#ifndef __STDC_FORMAT_MACROS -#define __STDC_FORMAT_MACROS -#endif - -#include -#include -#include - -#ifdef __cplusplus -#define DART_EXTERN_C extern "C" -#else -#define DART_EXTERN_C extern -#endif - -#if defined(__CYGWIN__) -#error Tool chain and platform not supported. -#elif defined(_WIN32) -#if defined(DART_SHARED_LIB) -#define DART_EXPORT DART_EXTERN_C __declspec(dllexport) -#else -#define DART_EXPORT DART_EXTERN_C -#endif -#else -#if __GNUC__ >= 4 -#if defined(DART_SHARED_LIB) -#define DART_EXPORT \ - DART_EXTERN_C __attribute__((visibility("default"))) __attribute((used)) -#else -#define DART_EXPORT DART_EXTERN_C -#endif -#else -#error Tool chain not supported. -#endif -#endif - -#if __GNUC__ -#define DART_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#elif _MSC_VER -#define DART_WARN_UNUSED_RESULT _Check_return_ -#else -#define DART_WARN_UNUSED_RESULT -#endif - -/* - * ======= - * Handles - * ======= - */ - -/** - * An isolate is the unit of concurrency in Dart. Each isolate has - * its own memory and thread of control. No state is shared between - * isolates. Instead, isolates communicate by message passing. - * - * Each thread keeps track of its current isolate, which is the - * isolate which is ready to execute on the current thread. The - * current isolate may be NULL, in which case no isolate is ready to - * execute. Most of the Dart apis require there to be a current - * isolate in order to function without error. The current isolate is - * set by any call to Dart_CreateIsolateGroup or Dart_EnterIsolate. - */ -typedef struct _Dart_Isolate* Dart_Isolate; -typedef struct _Dart_IsolateGroup* Dart_IsolateGroup; - -/** - * An object reference managed by the Dart VM garbage collector. - * - * Because the garbage collector may move objects, it is unsafe to - * refer to objects directly. Instead, we refer to objects through - * handles, which are known to the garbage collector and updated - * automatically when the object is moved. Handles should be passed - * by value (except in cases like out-parameters) and should never be - * allocated on the heap. - * - * Most functions in the Dart Embedding API return a handle. When a - * function completes normally, this will be a valid handle to an - * object in the Dart VM heap. This handle may represent the result of - * the operation or it may be a special valid handle used merely to - * indicate successful completion. Note that a valid handle may in - * some cases refer to the null object. - * - * --- Error handles --- - * - * When a function encounters a problem that prevents it from - * completing normally, it returns an error handle (See Dart_IsError). - * An error handle has an associated error message that gives more - * details about the problem (See Dart_GetError). - * - * There are four kinds of error handles that can be produced, - * depending on what goes wrong: - * - * - Api error handles are produced when an api function is misused. - * This happens when a Dart embedding api function is called with - * invalid arguments or in an invalid context. - * - * - Unhandled exception error handles are produced when, during the - * execution of Dart code, an exception is thrown but not caught. - * Prototypically this would occur during a call to Dart_Invoke, but - * it can occur in any function which triggers the execution of Dart - * code (for example, Dart_ToString). - * - * An unhandled exception error provides access to an exception and - * stacktrace via the functions Dart_ErrorGetException and - * Dart_ErrorGetStackTrace. - * - * - Compilation error handles are produced when, during the execution - * of Dart code, a compile-time error occurs. As above, this can - * occur in any function which triggers the execution of Dart code. - * - * - Fatal error handles are produced when the system wants to shut - * down the current isolate. - * - * --- Propagating errors --- - * - * When an error handle is returned from the top level invocation of - * Dart code in a program, the embedder must handle the error as they - * see fit. Often, the embedder will print the error message produced - * by Dart_Error and exit the program. - * - * When an error is returned while in the body of a native function, - * it can be propagated up the call stack by calling - * Dart_PropagateError, Dart_SetReturnValue, or Dart_ThrowException. - * Errors should be propagated unless there is a specific reason not - * to. If an error is not propagated then it is ignored. For - * example, if an unhandled exception error is ignored, that - * effectively "catches" the unhandled exception. Fatal errors must - * always be propagated. - * - * When an error is propagated, any current scopes created by - * Dart_EnterScope will be exited. - * - * Using Dart_SetReturnValue to propagate an exception is somewhat - * more convenient than using Dart_PropagateError, and should be - * preferred for reasons discussed below. - * - * Dart_PropagateError and Dart_ThrowException do not return. Instead - * they transfer control non-locally using a setjmp-like mechanism. - * This can be inconvenient if you have resources that you need to - * clean up before propagating the error. - * - * When relying on Dart_PropagateError, we often return error handles - * rather than propagating them from helper functions. Consider the - * following contrived example: - * - * 1 Dart_Handle isLongStringHelper(Dart_Handle arg) { - * 2 intptr_t* length = 0; - * 3 result = Dart_StringLength(arg, &length); - * 4 if (Dart_IsError(result)) { - * 5 return result; - * 6 } - * 7 return Dart_NewBoolean(length > 100); - * 8 } - * 9 - * 10 void NativeFunction_isLongString(Dart_NativeArguments args) { - * 11 Dart_EnterScope(); - * 12 AllocateMyResource(); - * 13 Dart_Handle arg = Dart_GetNativeArgument(args, 0); - * 14 Dart_Handle result = isLongStringHelper(arg); - * 15 if (Dart_IsError(result)) { - * 16 FreeMyResource(); - * 17 Dart_PropagateError(result); - * 18 abort(); // will not reach here - * 19 } - * 20 Dart_SetReturnValue(result); - * 21 FreeMyResource(); - * 22 Dart_ExitScope(); - * 23 } - * - * In this example, we have a native function which calls a helper - * function to do its work. On line 5, the helper function could call - * Dart_PropagateError, but that would not give the native function a - * chance to call FreeMyResource(), causing a leak. Instead, the - * helper function returns the error handle to the caller, giving the - * caller a chance to clean up before propagating the error handle. - * - * When an error is propagated by calling Dart_SetReturnValue, the - * native function will be allowed to complete normally and then the - * exception will be propagated only once the native call - * returns. This can be convenient, as it allows the C code to clean - * up normally. - * - * The example can be written more simply using Dart_SetReturnValue to - * propagate the error. - * - * 1 Dart_Handle isLongStringHelper(Dart_Handle arg) { - * 2 intptr_t* length = 0; - * 3 result = Dart_StringLength(arg, &length); - * 4 if (Dart_IsError(result)) { - * 5 return result - * 6 } - * 7 return Dart_NewBoolean(length > 100); - * 8 } - * 9 - * 10 void NativeFunction_isLongString(Dart_NativeArguments args) { - * 11 Dart_EnterScope(); - * 12 AllocateMyResource(); - * 13 Dart_Handle arg = Dart_GetNativeArgument(args, 0); - * 14 Dart_SetReturnValue(isLongStringHelper(arg)); - * 15 FreeMyResource(); - * 16 Dart_ExitScope(); - * 17 } - * - * In this example, the call to Dart_SetReturnValue on line 14 will - * either return the normal return value or the error (potentially - * generated on line 3). The call to FreeMyResource on line 15 will - * execute in either case. - * - * --- Local and persistent handles --- - * - * Local handles are allocated within the current scope (see - * Dart_EnterScope) and go away when the current scope exits. Unless - * otherwise indicated, callers should assume that all functions in - * the Dart embedding api return local handles. - * - * Persistent handles are allocated within the current isolate. They - * can be used to store objects across scopes. Persistent handles have - * the lifetime of the current isolate unless they are explicitly - * deallocated (see Dart_DeletePersistentHandle). - * The type Dart_Handle represents a handle (both local and persistent). - * The type Dart_PersistentHandle is a Dart_Handle and it is used to - * document that a persistent handle is expected as a parameter to a call - * or the return value from a call is a persistent handle. - * - * FinalizableHandles are persistent handles which are auto deleted when - * the object is garbage collected. It is never safe to use these handles - * unless you know the object is still reachable. - * - * WeakPersistentHandles are persistent handles which are automatically set - * to point Dart_Null when the object is garbage collected. They are not auto - * deleted, so it is safe to use them after the object has become unreachable. - */ -typedef struct _Dart_Handle* Dart_Handle; -typedef Dart_Handle Dart_PersistentHandle; -typedef struct _Dart_WeakPersistentHandle* Dart_WeakPersistentHandle; -typedef struct _Dart_FinalizableHandle* Dart_FinalizableHandle; -// These structs are versioned by DART_API_DL_MAJOR_VERSION, bump the -// version when changing this struct. - -typedef void (*Dart_HandleFinalizer)(void* isolate_callback_data, void* peer); - -/** - * Is this an error handle? - * - * Requires there to be a current isolate. - */ -DART_EXPORT bool Dart_IsError(Dart_Handle handle); - -/** - * Is this an api error handle? - * - * Api error handles are produced when an api function is misused. - * This happens when a Dart embedding api function is called with - * invalid arguments or in an invalid context. - * - * Requires there to be a current isolate. - */ -DART_EXPORT bool Dart_IsApiError(Dart_Handle handle); - -/** - * Is this an unhandled exception error handle? - * - * Unhandled exception error handles are produced when, during the - * execution of Dart code, an exception is thrown but not caught. - * This can occur in any function which triggers the execution of Dart - * code. - * - * See Dart_ErrorGetException and Dart_ErrorGetStackTrace. - * - * Requires there to be a current isolate. - */ -DART_EXPORT bool Dart_IsUnhandledExceptionError(Dart_Handle handle); - -/** - * Is this a compilation error handle? - * - * Compilation error handles are produced when, during the execution - * of Dart code, a compile-time error occurs. This can occur in any - * function which triggers the execution of Dart code. - * - * Requires there to be a current isolate. - */ -DART_EXPORT bool Dart_IsCompilationError(Dart_Handle handle); - -/** - * Is this a fatal error handle? - * - * Fatal error handles are produced when the system wants to shut down - * the current isolate. - * - * Requires there to be a current isolate. - */ -DART_EXPORT bool Dart_IsFatalError(Dart_Handle handle); - -/** - * Gets the error message from an error handle. - * - * Requires there to be a current isolate. - * - * \return A C string containing an error message if the handle is - * error. An empty C string ("") if the handle is valid. This C - * String is scope allocated and is only valid until the next call - * to Dart_ExitScope. -*/ -DART_EXPORT const char* Dart_GetError(Dart_Handle handle); - -/** - * Is this an error handle for an unhandled exception? - */ -DART_EXPORT bool Dart_ErrorHasException(Dart_Handle handle); - -/** - * Gets the exception Object from an unhandled exception error handle. - */ -DART_EXPORT Dart_Handle Dart_ErrorGetException(Dart_Handle handle); - -/** - * Gets the stack trace Object from an unhandled exception error handle. - */ -DART_EXPORT Dart_Handle Dart_ErrorGetStackTrace(Dart_Handle handle); - -/** - * Produces an api error handle with the provided error message. - * - * Requires there to be a current isolate. - * - * \param error the error message. - */ -DART_EXPORT Dart_Handle Dart_NewApiError(const char* error); -DART_EXPORT Dart_Handle Dart_NewCompilationError(const char* error); - -/** - * Produces a new unhandled exception error handle. - * - * Requires there to be a current isolate. - * - * \param exception An instance of a Dart object to be thrown or - * an ApiError or CompilationError handle. - * When an ApiError or CompilationError handle is passed in - * a string object of the error message is created and it becomes - * the Dart object to be thrown. - */ -DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception); - -/** - * Propagates an error. - * - * If the provided handle is an unhandled exception error, this - * function will cause the unhandled exception to be rethrown. This - * will proceed in the standard way, walking up Dart frames until an - * appropriate 'catch' block is found, executing 'finally' blocks, - * etc. - * - * If the error is not an unhandled exception error, we will unwind - * the stack to the next C frame. Intervening Dart frames will be - * discarded; specifically, 'finally' blocks will not execute. This - * is the standard way that compilation errors (and the like) are - * handled by the Dart runtime. - * - * In either case, when an error is propagated any current scopes - * created by Dart_EnterScope will be exited. - * - * See the additional discussion under "Propagating Errors" at the - * beginning of this file. - * - * \param An error handle (See Dart_IsError) - * - * \return On success, this function does not return. On failure, the - * process is terminated. - */ -DART_EXPORT void Dart_PropagateError(Dart_Handle handle); - -/** - * Converts an object to a string. - * - * May generate an unhandled exception error. - * - * \return The converted string if no error occurs during - * the conversion. If an error does occur, an error handle is - * returned. - */ -DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object); - -/** - * Checks to see if two handles refer to identically equal objects. - * - * If both handles refer to instances, this is equivalent to using the top-level - * function identical() from dart:core. Otherwise, returns whether the two - * argument handles refer to the same object. - * - * \param obj1 An object to be compared. - * \param obj2 An object to be compared. - * - * \return True if the objects are identically equal. False otherwise. - */ -DART_EXPORT bool Dart_IdentityEquals(Dart_Handle obj1, Dart_Handle obj2); - -/** - * Allocates a handle in the current scope from a persistent handle. - */ -DART_EXPORT Dart_Handle Dart_HandleFromPersistent(Dart_PersistentHandle object); - -/** - * Allocates a handle in the current scope from a weak persistent handle. - * - * This will be a handle to Dart_Null if the object has been garbage collected. - */ -DART_EXPORT Dart_Handle -Dart_HandleFromWeakPersistent(Dart_WeakPersistentHandle object); - -/** - * Allocates a persistent handle for an object. - * - * This handle has the lifetime of the current isolate unless it is - * explicitly deallocated by calling Dart_DeletePersistentHandle. - * - * Requires there to be a current isolate. - */ -DART_EXPORT Dart_PersistentHandle Dart_NewPersistentHandle(Dart_Handle object); - -/** - * Assign value of local handle to a persistent handle. - * - * Requires there to be a current isolate. - * - * \param obj1 A persistent handle whose value needs to be set. - * \param obj2 An object whose value needs to be set to the persistent handle. - * - * \return Success if the persistent handle was set - * Otherwise, returns an error. - */ -DART_EXPORT void Dart_SetPersistentHandle(Dart_PersistentHandle obj1, - Dart_Handle obj2); - -/** - * Deallocates a persistent handle. - * - * Requires there to be a current isolate group. - */ -DART_EXPORT void Dart_DeletePersistentHandle(Dart_PersistentHandle object); - -/** - * Allocates a weak persistent handle for an object. - * - * This handle has the lifetime of the current isolate. The handle can also be - * explicitly deallocated by calling Dart_DeleteWeakPersistentHandle. - * - * If the object becomes unreachable the callback is invoked with the peer as - * argument. The callback can be executed on any thread, will have a current - * isolate group, but will not have a current isolate. The callback can only - * call Dart_DeletePersistentHandle or Dart_DeleteWeakPersistentHandle. This - * gives the embedder the ability to cleanup data associated with the object. - * The handle will point to the Dart_Null object after the finalizer has been - * run. It is illegal to call into the VM with any other Dart_* functions from - * the callback. If the handle is deleted before the object becomes - * unreachable, the callback is never invoked. - * - * Requires there to be a current isolate. - * - * \param object An object with identity. - * \param peer A pointer to a native object or NULL. This value is - * provided to callback when it is invoked. - * \param external_allocation_size The number of externally allocated - * bytes for peer. Used to inform the garbage collector. - * \param callback A function pointer that will be invoked sometime - * after the object is garbage collected, unless the handle has been deleted. - * A valid callback needs to be specified it cannot be NULL. - * - * \return The weak persistent handle or NULL. NULL is returned in case of bad - * parameters. - */ -DART_EXPORT Dart_WeakPersistentHandle -Dart_NewWeakPersistentHandle(Dart_Handle object, - void* peer, - intptr_t external_allocation_size, - Dart_HandleFinalizer callback); - -/** - * Deletes the given weak persistent [object] handle. - * - * Requires there to be a current isolate group. - */ -DART_EXPORT void Dart_DeleteWeakPersistentHandle( - Dart_WeakPersistentHandle object); - -/** - * Updates the external memory size for the given weak persistent handle. - * - * May trigger garbage collection. - */ -DART_EXPORT void Dart_UpdateExternalSize(Dart_WeakPersistentHandle object, - intptr_t external_allocation_size); - -/** - * Allocates a finalizable handle for an object. - * - * This handle has the lifetime of the current isolate group unless the object - * pointed to by the handle is garbage collected, in this case the VM - * automatically deletes the handle after invoking the callback associated - * with the handle. The handle can also be explicitly deallocated by - * calling Dart_DeleteFinalizableHandle. - * - * If the object becomes unreachable the callback is invoked with the - * the peer as argument. The callback can be executed on any thread, will have - * an isolate group, but will not have a current isolate. The callback can only - * call Dart_DeletePersistentHandle or Dart_DeleteWeakPersistentHandle. - * This gives the embedder the ability to cleanup data associated with the - * object and clear out any cached references to the handle. All references to - * this handle after the callback will be invalid. It is illegal to call into - * the VM with any other Dart_* functions from the callback. If the handle is - * deleted before the object becomes unreachable, the callback is never - * invoked. - * - * Requires there to be a current isolate. - * - * \param object An object with identity. - * \param peer A pointer to a native object or NULL. This value is - * provided to callback when it is invoked. - * \param external_allocation_size The number of externally allocated - * bytes for peer. Used to inform the garbage collector. - * \param callback A function pointer that will be invoked sometime - * after the object is garbage collected, unless the handle has been deleted. - * A valid callback needs to be specified it cannot be NULL. - * - * \return The finalizable handle or NULL. NULL is returned in case of bad - * parameters. - */ -DART_EXPORT Dart_FinalizableHandle -Dart_NewFinalizableHandle(Dart_Handle object, - void* peer, - intptr_t external_allocation_size, - Dart_HandleFinalizer callback); - -/** - * Deletes the given finalizable [object] handle. - * - * The caller has to provide the actual Dart object the handle was created from - * to prove the object (and therefore the finalizable handle) is still alive. - * - * Requires there to be a current isolate. - */ -DART_EXPORT void Dart_DeleteFinalizableHandle(Dart_FinalizableHandle object, - Dart_Handle strong_ref_to_object); - -/** - * Updates the external memory size for the given finalizable handle. - * - * The caller has to provide the actual Dart object the handle was created from - * to prove the object (and therefore the finalizable handle) is still alive. - * - * May trigger garbage collection. - */ -DART_EXPORT void Dart_UpdateFinalizableExternalSize( - Dart_FinalizableHandle object, - Dart_Handle strong_ref_to_object, - intptr_t external_allocation_size); - -/* - * ========================== - * Initialization and Globals - * ========================== - */ - -/** - * Gets the version string for the Dart VM. - * - * The version of the Dart VM can be accessed without initializing the VM. - * - * \return The version string for the embedded Dart VM. - */ -DART_EXPORT const char* Dart_VersionString(); - -/** - * Isolate specific flags are set when creating a new isolate using the - * Dart_IsolateFlags structure. - * - * Current version of flags is encoded in a 32-bit integer with 16 bits used - * for each part. - */ - -#define DART_FLAGS_CURRENT_VERSION (0x0000000c) - -typedef struct { - int32_t version; - bool enable_asserts; - bool use_field_guards; - bool use_osr; - bool obfuscate; - bool load_vmservice_library; - bool copy_parent_code; - bool null_safety; - bool is_system_isolate; -} Dart_IsolateFlags; - -/** - * Initialize Dart_IsolateFlags with correct version and default values. - */ -DART_EXPORT void Dart_IsolateFlagsInitialize(Dart_IsolateFlags* flags); - -/** - * An isolate creation and initialization callback function. - * - * This callback, provided by the embedder, is called when the VM - * needs to create an isolate. The callback should create an isolate - * by calling Dart_CreateIsolateGroup and load any scripts required for - * execution. - * - * This callback may be called on a different thread than the one - * running the parent isolate. - * - * When the function returns NULL, it is the responsibility of this - * function to ensure that Dart_ShutdownIsolate has been called if - * required (for example, if the isolate was created successfully by - * Dart_CreateIsolateGroup() but the root library fails to load - * successfully, then the function should call Dart_ShutdownIsolate - * before returning). - * - * When the function returns NULL, the function should set *error to - * a malloc-allocated buffer containing a useful error message. The - * caller of this function (the VM) will make sure that the buffer is - * freed. - * - * \param script_uri The uri of the main source file or snapshot to load. - * Either the URI of the parent isolate set in Dart_CreateIsolateGroup for - * Isolate.spawn, or the argument to Isolate.spawnUri canonicalized by the - * library tag handler of the parent isolate. - * The callback is responsible for loading the program by a call to - * Dart_LoadScriptFromKernel. - * \param main The name of the main entry point this isolate will - * eventually run. This is provided for advisory purposes only to - * improve debugging messages. The main function is not invoked by - * this function. - * \param package_root Ignored. - * \param package_config Uri of the package configuration file (either in format - * of .packages or .dart_tool/package_config.json) for this isolate - * to resolve package imports against. If this parameter is not passed the - * package resolution of the parent isolate should be used. - * \param flags Default flags for this isolate being spawned. Either inherited - * from the spawning isolate or passed as parameters when spawning the - * isolate from Dart code. - * \param isolate_data The isolate data which was passed to the - * parent isolate when it was created by calling Dart_CreateIsolateGroup(). - * \param error A structure into which the embedder can place a - * C string containing an error message in the case of failures. - * - * \return The embedder returns NULL if the creation and - * initialization was not successful and the isolate if successful. - */ -typedef Dart_Isolate (*Dart_IsolateGroupCreateCallback)( - const char* script_uri, - const char* main, - const char* package_root, - const char* package_config, - Dart_IsolateFlags* flags, - void* isolate_data, - char** error); - -/** - * An isolate initialization callback function. - * - * This callback, provided by the embedder, is called when the VM has created an - * isolate within an existing isolate group (i.e. from the same source as an - * existing isolate). - * - * The callback should setup native resolvers and might want to set a custom - * message handler via [Dart_SetMessageNotifyCallback] and mark the isolate as - * runnable. - * - * This callback may be called on a different thread than the one - * running the parent isolate. - * - * When the function returns `false`, it is the responsibility of this - * function to ensure that `Dart_ShutdownIsolate` has been called. - * - * When the function returns `false`, the function should set *error to - * a malloc-allocated buffer containing a useful error message. The - * caller of this function (the VM) will make sure that the buffer is - * freed. - * - * \param child_isolate_data The callback data to associate with the new - * child isolate. - * \param error A structure into which the embedder can place a - * C string containing an error message in the case the initialization fails. - * - * \return The embedder returns true if the initialization was successful and - * false otherwise (in which case the VM will terminate the isolate). - */ -typedef bool (*Dart_InitializeIsolateCallback)(void** child_isolate_data, - char** error); - -/** - * An isolate unhandled exception callback function. - * - * This callback has been DEPRECATED. - */ -typedef void (*Dart_IsolateUnhandledExceptionCallback)(Dart_Handle error); - -/** - * An isolate shutdown callback function. - * - * This callback, provided by the embedder, is called before the vm - * shuts down an isolate. The isolate being shutdown will be the current - * isolate. It is safe to run Dart code. - * - * This function should be used to dispose of native resources that - * are allocated to an isolate in order to avoid leaks. - * - * \param isolate_group_data The same callback data which was passed to the - * isolate group when it was created. - * \param isolate_data The same callback data which was passed to the isolate - * when it was created. - */ -typedef void (*Dart_IsolateShutdownCallback)(void* isolate_group_data, - void* isolate_data); - -/** - * An isolate cleanup callback function. - * - * This callback, provided by the embedder, is called after the vm - * shuts down an isolate. There will be no current isolate and it is *not* - * safe to run Dart code. - * - * This function should be used to dispose of native resources that - * are allocated to an isolate in order to avoid leaks. - * - * \param isolate_group_data The same callback data which was passed to the - * isolate group when it was created. - * \param isolate_data The same callback data which was passed to the isolate - * when it was created. - */ -typedef void (*Dart_IsolateCleanupCallback)(void* isolate_group_data, - void* isolate_data); - -/** - * An isolate group cleanup callback function. - * - * This callback, provided by the embedder, is called after the vm - * shuts down an isolate group. - * - * This function should be used to dispose of native resources that - * are allocated to an isolate in order to avoid leaks. - * - * \param isolate_group_data The same callback data which was passed to the - * isolate group when it was created. - * - */ -typedef void (*Dart_IsolateGroupCleanupCallback)(void* isolate_group_data); - -/** - * A thread death callback function. - * This callback, provided by the embedder, is called before a thread in the - * vm thread pool exits. - * This function could be used to dispose of native resources that - * are associated and attached to the thread, in order to avoid leaks. - */ -typedef void (*Dart_ThreadExitCallback)(); - -/** - * Callbacks provided by the embedder for file operations. If the - * embedder does not allow file operations these callbacks can be - * NULL. - * - * Dart_FileOpenCallback - opens a file for reading or writing. - * \param name The name of the file to open. - * \param write A boolean variable which indicates if the file is to - * opened for writing. If there is an existing file it needs to truncated. - * - * Dart_FileReadCallback - Read contents of file. - * \param data Buffer allocated in the callback into which the contents - * of the file are read into. It is the responsibility of the caller to - * free this buffer. - * \param file_length A variable into which the length of the file is returned. - * In the case of an error this value would be -1. - * \param stream Handle to the opened file. - * - * Dart_FileWriteCallback - Write data into file. - * \param data Buffer which needs to be written into the file. - * \param length Length of the buffer. - * \param stream Handle to the opened file. - * - * Dart_FileCloseCallback - Closes the opened file. - * \param stream Handle to the opened file. - * - */ -typedef void* (*Dart_FileOpenCallback)(const char* name, bool write); - -typedef void (*Dart_FileReadCallback)(uint8_t** data, - intptr_t* file_length, - void* stream); - -typedef void (*Dart_FileWriteCallback)(const void* data, - intptr_t length, - void* stream); - -typedef void (*Dart_FileCloseCallback)(void* stream); - -typedef bool (*Dart_EntropySource)(uint8_t* buffer, intptr_t length); - -/** - * Callback provided by the embedder that is used by the vmservice isolate - * to request the asset archive. The asset archive must be an uncompressed tar - * archive that is stored in a Uint8List. - * - * If the embedder has no vmservice isolate assets, the callback can be NULL. - * - * \return The embedder must return a handle to a Uint8List containing an - * uncompressed tar archive or null. - */ -typedef Dart_Handle (*Dart_GetVMServiceAssetsArchive)(); - -/** - * The current version of the Dart_InitializeFlags. Should be incremented every - * time Dart_InitializeFlags changes in a binary incompatible way. - */ -#define DART_INITIALIZE_PARAMS_CURRENT_VERSION (0x00000004) - -/** Forward declaration */ -struct Dart_CodeObserver; - -/** - * Callback provided by the embedder that is used by the VM to notify on code - * object creation, *before* it is invoked the first time. - * This is useful for embedders wanting to e.g. keep track of PCs beyond - * the lifetime of the garbage collected code objects. - * Note that an address range may be used by more than one code object over the - * lifecycle of a process. Clients of this function should record timestamps for - * these compilation events and when collecting PCs to disambiguate reused - * address ranges. - */ -typedef void (*Dart_OnNewCodeCallback)(struct Dart_CodeObserver* observer, - const char* name, - uintptr_t base, - uintptr_t size); - -typedef struct Dart_CodeObserver { - void* data; - - Dart_OnNewCodeCallback on_new_code; -} Dart_CodeObserver; - -/** - * Describes how to initialize the VM. Used with Dart_Initialize. - * - * \param version Identifies the version of the struct used by the client. - * should be initialized to DART_INITIALIZE_PARAMS_CURRENT_VERSION. - * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate - * or NULL if no snapshot is provided. If provided, the buffer must remain - * valid until Dart_Cleanup returns. - * \param instructions_snapshot A buffer containing a snapshot of precompiled - * instructions, or NULL if no snapshot is provided. If provided, the buffer - * must remain valid until Dart_Cleanup returns. - * \param initialize_isolate A function to be called during isolate - * initialization inside an existing isolate group. - * See Dart_InitializeIsolateCallback. - * \param create_group A function to be called during isolate group creation. - * See Dart_IsolateGroupCreateCallback. - * \param shutdown A function to be called right before an isolate is shutdown. - * See Dart_IsolateShutdownCallback. - * \param cleanup A function to be called after an isolate was shutdown. - * See Dart_IsolateCleanupCallback. - * \param cleanup_group A function to be called after an isolate group is shutdown. - * See Dart_IsolateGroupCleanupCallback. - * \param get_service_assets A function to be called by the service isolate when - * it requires the vmservice assets archive. - * See Dart_GetVMServiceAssetsArchive. - * \param code_observer An external code observer callback function. - * The observer can be invoked as early as during the Dart_Initialize() call. - */ -typedef struct { - int32_t version; - const uint8_t* vm_snapshot_data; - const uint8_t* vm_snapshot_instructions; - Dart_IsolateGroupCreateCallback create_group; - Dart_InitializeIsolateCallback initialize_isolate; - Dart_IsolateShutdownCallback shutdown_isolate; - Dart_IsolateCleanupCallback cleanup_isolate; - Dart_IsolateGroupCleanupCallback cleanup_group; - Dart_ThreadExitCallback thread_exit; - Dart_FileOpenCallback file_open; - Dart_FileReadCallback file_read; - Dart_FileWriteCallback file_write; - Dart_FileCloseCallback file_close; - Dart_EntropySource entropy_source; - Dart_GetVMServiceAssetsArchive get_service_assets; - bool start_kernel_isolate; - Dart_CodeObserver* code_observer; -} Dart_InitializeParams; - -/** - * Initializes the VM. - * - * \param params A struct containing initialization information. The version - * field of the struct must be DART_INITIALIZE_PARAMS_CURRENT_VERSION. - * - * \return NULL if initialization is successful. Returns an error message - * otherwise. The caller is responsible for freeing the error message. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Initialize( - Dart_InitializeParams* params); - -/** - * Cleanup state in the VM before process termination. - * - * \return NULL if cleanup is successful. Returns an error message otherwise. - * The caller is responsible for freeing the error message. - * - * NOTE: This function must not be called on a thread that was created by the VM - * itself. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_Cleanup(); - -/** - * Sets command line flags. Should be called before Dart_Initialize. - * - * \param argc The length of the arguments array. - * \param argv An array of arguments. - * - * \return NULL if successful. Returns an error message otherwise. - * The caller is responsible for freeing the error message. - * - * NOTE: This call does not store references to the passed in c-strings. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_SetVMFlags(int argc, - const char** argv); - -/** - * Returns true if the named VM flag is of boolean type, specified, and set to - * true. - * - * \param flag_name The name of the flag without leading punctuation - * (example: "enable_asserts"). - */ -DART_EXPORT bool Dart_IsVMFlagSet(const char* flag_name); - -/* - * ======== - * Isolates - * ======== - */ - -/** - * Creates a new isolate. The new isolate becomes the current isolate. - * - * A snapshot can be used to restore the VM quickly to a saved state - * and is useful for fast startup. If snapshot data is provided, the - * isolate will be started using that snapshot data. Requires a core snapshot or - * an app snapshot created by Dart_CreateSnapshot or - * Dart_CreatePrecompiledSnapshot* from a VM with the same version. - * - * Requires there to be no current isolate. - * - * \param script_uri The main source file or snapshot this isolate will load. - * The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a child - * isolate is created by Isolate.spawn. The embedder should use a URI that - * allows it to load the same program into such a child isolate. - * \param name A short name for the isolate to improve debugging messages. - * Typically of the format 'foo.dart:main()'. - * \param isolate_snapshot_data - * \param isolate_snapshot_instructions Buffers containing a snapshot of the - * isolate or NULL if no snapshot is provided. If provided, the buffers must - * remain valid until the isolate shuts down. - * \param flags Pointer to VM specific flags or NULL for default flags. - * \param isolate_group_data Embedder group data. This data can be obtained - * by calling Dart_IsolateGroupData and will be passed to the - * Dart_IsolateShutdownCallback, Dart_IsolateCleanupCallback, and - * Dart_IsolateGroupCleanupCallback. - * \param isolate_data Embedder data. This data will be passed to - * the Dart_IsolateGroupCreateCallback when new isolates are spawned from - * this parent isolate. - * \param error Returns NULL if creation is successful, an error message - * otherwise. The caller is responsible for calling free() on the error - * message. - * - * \return The new isolate on success, or NULL if isolate creation failed. - */ -DART_EXPORT Dart_Isolate -Dart_CreateIsolateGroup(const char* script_uri, - const char* name, - const uint8_t* isolate_snapshot_data, - const uint8_t* isolate_snapshot_instructions, - Dart_IsolateFlags* flags, - void* isolate_group_data, - void* isolate_data, - char** error); -/** - * Creates a new isolate inside the isolate group of [group_member]. - * - * Requires there to be no current isolate. - * - * \param group_member An isolate from the same group into which the newly created - * isolate should be born into. Other threads may not have entered / enter this - * member isolate. - * \param name A short name for the isolate for debugging purposes. - * \param shutdown_callback A callback to be called when the isolate is being - * shutdown (may be NULL). - * \param cleanup_callback A callback to be called when the isolate is being - * cleaned up (may be NULL). - * \param isolate_data The embedder-specific data associated with this isolate. - * \param error Set to NULL if creation is successful, set to an error - * message otherwise. The caller is responsible for calling free() on the - * error message. - * - * \return The newly created isolate on success, or NULL if isolate creation - * failed. - * - * If successful, the newly created isolate will become the current isolate. - */ -DART_EXPORT Dart_Isolate -Dart_CreateIsolateInGroup(Dart_Isolate group_member, - const char* name, - Dart_IsolateShutdownCallback shutdown_callback, - Dart_IsolateCleanupCallback cleanup_callback, - void* child_isolate_data, - char** error); - -/* TODO(turnidge): Document behavior when there is already a current - * isolate. */ - -/** - * Creates a new isolate from a Dart Kernel file. The new isolate - * becomes the current isolate. - * - * Requires there to be no current isolate. - * - * \param script_uri The main source file or snapshot this isolate will load. - * The VM will provide this URI to the Dart_IsolateGroupCreateCallback when a child - * isolate is created by Isolate.spawn. The embedder should use a URI that - * allows it to load the same program into such a child isolate. - * \param name A short name for the isolate to improve debugging messages. - * Typically of the format 'foo.dart:main()'. - * \param kernel_buffer - * \param kernel_buffer_size A buffer which contains a kernel/DIL program. Must - * remain valid until isolate shutdown. - * \param flags Pointer to VM specific flags or NULL for default flags. - * \param isolate_group_data Embedder group data. This data can be obtained - * by calling Dart_IsolateGroupData and will be passed to the - * Dart_IsolateShutdownCallback, Dart_IsolateCleanupCallback, and - * Dart_IsolateGroupCleanupCallback. - * \param isolate_data Embedder data. This data will be passed to - * the Dart_IsolateGroupCreateCallback when new isolates are spawned from - * this parent isolate. - * \param error Returns NULL if creation is successful, an error message - * otherwise. The caller is responsible for calling free() on the error - * message. - * - * \return The new isolate on success, or NULL if isolate creation failed. - */ -DART_EXPORT Dart_Isolate -Dart_CreateIsolateGroupFromKernel(const char* script_uri, - const char* name, - const uint8_t* kernel_buffer, - intptr_t kernel_buffer_size, - Dart_IsolateFlags* flags, - void* isolate_group_data, - void* isolate_data, - char** error); -/** - * Shuts down the current isolate. After this call, the current isolate is NULL. - * Any current scopes created by Dart_EnterScope will be exited. Invokes the - * shutdown callback and any callbacks of remaining weak persistent handles. - * - * Requires there to be a current isolate. - */ -DART_EXPORT void Dart_ShutdownIsolate(); -/* TODO(turnidge): Document behavior when there is no current isolate. */ - -/** - * Returns the current isolate. Will return NULL if there is no - * current isolate. - */ -DART_EXPORT Dart_Isolate Dart_CurrentIsolate(); - -/** - * Returns the callback data associated with the current isolate. This - * data was set when the isolate got created or initialized. - */ -DART_EXPORT void* Dart_CurrentIsolateData(); - -/** - * Returns the callback data associated with the given isolate. This - * data was set when the isolate got created or initialized. - */ -DART_EXPORT void* Dart_IsolateData(Dart_Isolate isolate); - -/** - * Returns the current isolate group. Will return NULL if there is no - * current isolate group. - */ -DART_EXPORT Dart_IsolateGroup Dart_CurrentIsolateGroup(); - -/** - * Returns the callback data associated with the current isolate group. This - * data was passed to the isolate group when it was created. - */ -DART_EXPORT void* Dart_CurrentIsolateGroupData(); - -/** - * Returns the callback data associated with the specified isolate group. This - * data was passed to the isolate when it was created. - * The embedder is responsible for ensuring the consistency of this data - * with respect to the lifecycle of an isolate group. - */ -DART_EXPORT void* Dart_IsolateGroupData(Dart_Isolate isolate); - -/** - * Returns the debugging name for the current isolate. - * - * This name is unique to each isolate and should only be used to make - * debugging messages more comprehensible. - */ -DART_EXPORT Dart_Handle Dart_DebugName(); - -/** - * Returns the ID for an isolate which is used to query the service protocol. - * - * It is the responsibility of the caller to free the returned ID. - */ -DART_EXPORT const char* Dart_IsolateServiceId(Dart_Isolate isolate); - -/** - * Enters an isolate. After calling this function, - * the current isolate will be set to the provided isolate. - * - * Requires there to be no current isolate. Multiple threads may not be in - * the same isolate at once. - */ -DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate); - -/** - * Kills the given isolate. - * - * This function has the same effect as dart:isolate's - * Isolate.kill(priority:immediate). - * It can interrupt ordinary Dart code but not native code. If the isolate is - * in the middle of a long running native function, the isolate will not be - * killed until control returns to Dart. - * - * Does not require a current isolate. It is safe to kill the current isolate if - * there is one. - */ -DART_EXPORT void Dart_KillIsolate(Dart_Isolate isolate); - -/** - * Notifies the VM that the embedder expects |size| bytes of memory have become - * unreachable. The VM may use this hint to adjust the garbage collector's - * growth policy. - * - * Multiple calls are interpreted as increasing, not replacing, the estimate of - * unreachable memory. - * - * Requires there to be a current isolate. - */ -DART_EXPORT void Dart_HintFreed(intptr_t size); - -/** - * Notifies the VM that the embedder expects to be idle until |deadline|. The VM - * may use this time to perform garbage collection or other tasks to avoid - * delays during execution of Dart code in the future. - * - * |deadline| is measured in microseconds against the system's monotonic time. - * This clock can be accessed via Dart_TimelineGetMicros(). - * - * Requires there to be a current isolate. - */ -DART_EXPORT void Dart_NotifyIdle(int64_t deadline); - -/** - * Notifies the VM that the system is running low on memory. - * - * Does not require a current isolate. Only valid after calling Dart_Initialize. - */ -DART_EXPORT void Dart_NotifyLowMemory(); - -/** - * Starts the CPU sampling profiler. - */ -DART_EXPORT void Dart_StartProfiling(); - -/** - * Stops the CPU sampling profiler. - * - * Note that some profile samples might still be taken after this fucntion - * returns due to the asynchronous nature of the implementation on some - * platforms. - */ -DART_EXPORT void Dart_StopProfiling(); - -/** - * Notifies the VM that the current thread should not be profiled until a - * matching call to Dart_ThreadEnableProfiling is made. - * - * NOTE: By default, if a thread has entered an isolate it will be profiled. - * This function should be used when an embedder knows a thread is about - * to make a blocking call and wants to avoid unnecessary interrupts by - * the profiler. - */ -DART_EXPORT void Dart_ThreadDisableProfiling(); - -/** - * Notifies the VM that the current thread should be profiled. - * - * NOTE: It is only legal to call this function *after* calling - * Dart_ThreadDisableProfiling. - * - * NOTE: By default, if a thread has entered an isolate it will be profiled. - */ -DART_EXPORT void Dart_ThreadEnableProfiling(); - -/** - * Register symbol information for the Dart VM's profiler and crash dumps. - * - * This consumes the output of //topaz/runtime/dart/profiler_symbols, which - * should be treated as opaque. - */ -DART_EXPORT void Dart_AddSymbols(const char* dso_name, - void* buffer, - intptr_t buffer_size); - -/** - * Exits an isolate. After this call, Dart_CurrentIsolate will - * return NULL. - * - * Requires there to be a current isolate. - */ -DART_EXPORT void Dart_ExitIsolate(); -/* TODO(turnidge): We don't want users of the api to be able to exit a - * "pure" dart isolate. Implement and document. */ - -/** - * Creates a full snapshot of the current isolate heap. - * - * A full snapshot is a compact representation of the dart vm isolate heap - * and dart isolate heap states. These snapshots are used to initialize - * the vm isolate on startup and fast initialization of an isolate. - * A Snapshot of the heap is created before any dart code has executed. - * - * Requires there to be a current isolate. Not available in the precompiled - * runtime (check Dart_IsPrecompiledRuntime). - * - * \param buffer Returns a pointer to a buffer containing the - * snapshot. This buffer is scope allocated and is only valid - * until the next call to Dart_ExitScope. - * \param size Returns the size of the buffer. - * \param is_core Create a snapshot containing core libraries. - * Such snapshot should be agnostic to null safety mode. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateSnapshot(uint8_t** vm_snapshot_data_buffer, - intptr_t* vm_snapshot_data_size, - uint8_t** isolate_snapshot_data_buffer, - intptr_t* isolate_snapshot_data_size, - bool is_core); - -/** - * Returns whether the buffer contains a kernel file. - * - * \param buffer Pointer to a buffer that might contain a kernel binary. - * \param buffer_size Size of the buffer. - * - * \return Whether the buffer contains a kernel binary (full or partial). - */ -DART_EXPORT bool Dart_IsKernel(const uint8_t* buffer, intptr_t buffer_size); - -/** - * Make isolate runnable. - * - * When isolates are spawned, this function is used to indicate that - * the creation and initialization (including script loading) of the - * isolate is complete and the isolate can start. - * This function expects there to be no current isolate. - * - * \param isolate The isolate to be made runnable. - * - * \return NULL if successful. Returns an error message otherwise. The caller - * is responsible for freeing the error message. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_IsolateMakeRunnable( - Dart_Isolate isolate); - -/* - * ================== - * Messages and Ports - * ================== - */ - -/** - * A port is used to send or receive inter-isolate messages - */ -typedef int64_t Dart_Port; - -/** - * ILLEGAL_PORT is a port number guaranteed never to be associated with a valid - * port. - */ -#define ILLEGAL_PORT ((Dart_Port)0) - -/** - * A message notification callback. - * - * This callback allows the embedder to provide an alternate wakeup - * mechanism for the delivery of inter-isolate messages. It is the - * responsibility of the embedder to call Dart_HandleMessage to - * process the message. - */ -typedef void (*Dart_MessageNotifyCallback)(Dart_Isolate dest_isolate); - -/** - * Allows embedders to provide an alternative wakeup mechanism for the - * delivery of inter-isolate messages. This setting only applies to - * the current isolate. - * - * Most embedders will only call this function once, before isolate - * execution begins. If this function is called after isolate - * execution begins, the embedder is responsible for threading issues. - */ -DART_EXPORT void Dart_SetMessageNotifyCallback( - Dart_MessageNotifyCallback message_notify_callback); -/* TODO(turnidge): Consider moving this to isolate creation so that it - * is impossible to mess up. */ - -/** - * Query the current message notify callback for the isolate. - * - * \return The current message notify callback for the isolate. - */ -DART_EXPORT Dart_MessageNotifyCallback Dart_GetMessageNotifyCallback(); - -/** - * The VM's default message handler supports pausing an isolate before it - * processes the first message and right after the it processes the isolate's - * final message. This can be controlled for all isolates by two VM flags: - * - * `--pause-isolates-on-start` - * `--pause-isolates-on-exit` - * - * Additionally, Dart_SetShouldPauseOnStart and Dart_SetShouldPauseOnExit can be - * used to control this behaviour on a per-isolate basis. - * - * When an embedder is using a Dart_MessageNotifyCallback the embedder - * needs to cooperate with the VM so that the service protocol can report - * accurate information about isolates and so that tools such as debuggers - * work reliably. - * - * The following functions can be used to implement pausing on start and exit. - */ - -/** - * If the VM flag `--pause-isolates-on-start` was passed this will be true. - * - * \return A boolean value indicating if pause on start was requested. - */ -DART_EXPORT bool Dart_ShouldPauseOnStart(); - -/** - * Override the VM flag `--pause-isolates-on-start` for the current isolate. - * - * \param should_pause Should the isolate be paused on start? - * - * NOTE: This must be called before Dart_IsolateMakeRunnable. - */ -DART_EXPORT void Dart_SetShouldPauseOnStart(bool should_pause); - -/** - * Is the current isolate paused on start? - * - * \return A boolean value indicating if the isolate is paused on start. - */ -DART_EXPORT bool Dart_IsPausedOnStart(); - -/** - * Called when the embedder has paused the current isolate on start and when - * the embedder has resumed the isolate. - * - * \param paused Is the isolate paused on start? - */ -DART_EXPORT void Dart_SetPausedOnStart(bool paused); - -/** - * If the VM flag `--pause-isolates-on-exit` was passed this will be true. - * - * \return A boolean value indicating if pause on exit was requested. - */ -DART_EXPORT bool Dart_ShouldPauseOnExit(); - -/** - * Override the VM flag `--pause-isolates-on-exit` for the current isolate. - * - * \param should_pause Should the isolate be paused on exit? - * - */ -DART_EXPORT void Dart_SetShouldPauseOnExit(bool should_pause); - -/** - * Is the current isolate paused on exit? - * - * \return A boolean value indicating if the isolate is paused on exit. - */ -DART_EXPORT bool Dart_IsPausedOnExit(); - -/** - * Called when the embedder has paused the current isolate on exit and when - * the embedder has resumed the isolate. - * - * \param paused Is the isolate paused on exit? - */ -DART_EXPORT void Dart_SetPausedOnExit(bool paused); - -/** - * Called when the embedder has caught a top level unhandled exception error - * in the current isolate. - * - * NOTE: It is illegal to call this twice on the same isolate without first - * clearing the sticky error to null. - * - * \param error The unhandled exception error. - */ -DART_EXPORT void Dart_SetStickyError(Dart_Handle error); - -/** - * Does the current isolate have a sticky error? - */ -DART_EXPORT bool Dart_HasStickyError(); - -/** - * Gets the sticky error for the current isolate. - * - * \return A handle to the sticky error object or null. - */ -DART_EXPORT Dart_Handle Dart_GetStickyError(); - -/** - * Handles the next pending message for the current isolate. - * - * May generate an unhandled exception error. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_HandleMessage(); - -/** - * Drains the microtask queue, then blocks the calling thread until the current - * isolate recieves a message, then handles all messages. - * - * \param timeout_millis When non-zero, the call returns after the indicated - number of milliseconds even if no message was received. - * \return A valid handle if no error occurs, otherwise an error handle. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_WaitForEvent(int64_t timeout_millis); - -/** - * Handles any pending messages for the vm service for the current - * isolate. - * - * This function may be used by an embedder at a breakpoint to avoid - * pausing the vm service. - * - * This function can indirectly cause the message notify callback to - * be called. - * - * \return true if the vm service requests the program resume - * execution, false otherwise - */ -DART_EXPORT bool Dart_HandleServiceMessages(); - -/** - * Does the current isolate have pending service messages? - * - * \return true if the isolate has pending service messages, false otherwise. - */ -DART_EXPORT bool Dart_HasServiceMessages(); - -/** - * Processes any incoming messages for the current isolate. - * - * This function may only be used when the embedder has not provided - * an alternate message delivery mechanism with - * Dart_SetMessageCallbacks. It is provided for convenience. - * - * This function waits for incoming messages for the current - * isolate. As new messages arrive, they are handled using - * Dart_HandleMessage. The routine exits when all ports to the - * current isolate are closed. - * - * \return A valid handle if the run loop exited successfully. If an - * exception or other error occurs while processing messages, an - * error handle is returned. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_RunLoop(); - -/** - * Lets the VM run message processing for the isolate. - * - * This function expects there to a current isolate and the current isolate - * must not have an active api scope. The VM will take care of making the - * isolate runnable (if not already), handles its message loop and will take - * care of shutting the isolate down once it's done. - * - * \param errors_are_fatal Whether uncaught errors should be fatal. - * \param on_error_port A port to notify on uncaught errors (or ILLEGAL_PORT). - * \param on_exit_port A port to notify on exit (or ILLEGAL_PORT). - * \param error A non-NULL pointer which will hold an error message if the call - * fails. The error has to be free()ed by the caller. - * - * \return If successfull the VM takes owernship of the isolate and takes care - * of its message loop. If not successful the caller retains owernship of the - * isolate. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT bool Dart_RunLoopAsync( - bool errors_are_fatal, - Dart_Port on_error_port, - Dart_Port on_exit_port, - char** error); - -/* TODO(turnidge): Should this be removed from the public api? */ - -/** - * Gets the main port id for the current isolate. - */ -DART_EXPORT Dart_Port Dart_GetMainPortId(); - -/** - * Does the current isolate have live ReceivePorts? - * - * A ReceivePort is live when it has not been closed. - */ -DART_EXPORT bool Dart_HasLivePorts(); - -/** - * Posts a message for some isolate. The message is a serialized - * object. - * - * Requires there to be a current isolate. - * - * \param port The destination port. - * \param object An object from the current isolate. - * - * \return True if the message was posted. - */ -DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle object); - -/** - * Returns a new SendPort with the provided port id. - * - * \param port_id The destination port. - * - * \return A new SendPort if no errors occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id); - -/** - * Gets the SendPort id for the provided SendPort. - * \param port A SendPort object whose id is desired. - * \param port_id Returns the id of the SendPort. - * \return Success if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_SendPortGetId(Dart_Handle port, - Dart_Port* port_id); - -/* - * ====== - * Scopes - * ====== - */ - -/** - * Enters a new scope. - * - * All new local handles will be created in this scope. Additionally, - * some functions may return "scope allocated" memory which is only - * valid within this scope. - * - * Requires there to be a current isolate. - */ -DART_EXPORT void Dart_EnterScope(); - -/** - * Exits a scope. - * - * The previous scope (if any) becomes the current scope. - * - * Requires there to be a current isolate. - */ -DART_EXPORT void Dart_ExitScope(); - -/** - * The Dart VM uses "zone allocation" for temporary structures. Zones - * support very fast allocation of small chunks of memory. The chunks - * cannot be deallocated individually, but instead zones support - * deallocating all chunks in one fast operation. - * - * This function makes it possible for the embedder to allocate - * temporary data in the VMs zone allocator. - * - * Zone allocation is possible: - * 1. when inside a scope where local handles can be allocated - * 2. when processing a message from a native port in a native port - * handler - * - * All the memory allocated this way will be reclaimed either on the - * next call to Dart_ExitScope or when the native port handler exits. - * - * \param size Size of the memory to allocate. - * - * \return A pointer to the allocated memory. NULL if allocation - * failed. Failure might due to is no current VM zone. - */ -DART_EXPORT uint8_t* Dart_ScopeAllocate(intptr_t size); - -/* - * ======= - * Objects - * ======= - */ - -/** - * Returns the null object. - * - * \return A handle to the null object. - */ -DART_EXPORT Dart_Handle Dart_Null(); - -/** - * Is this object null? - */ -DART_EXPORT bool Dart_IsNull(Dart_Handle object); - -/** - * Returns the empty string object. - * - * \return A handle to the empty string object. - */ -DART_EXPORT Dart_Handle Dart_EmptyString(); - -/** - * Returns types that are not classes, and which therefore cannot be looked up - * as library members by Dart_GetType. - * - * \return A handle to the dynamic, void or Never type. - */ -DART_EXPORT Dart_Handle Dart_TypeDynamic(); -DART_EXPORT Dart_Handle Dart_TypeVoid(); -DART_EXPORT Dart_Handle Dart_TypeNever(); - -/** - * Checks if the two objects are equal. - * - * The result of the comparison is returned through the 'equal' - * parameter. The return value itself is used to indicate success or - * failure, not equality. - * - * May generate an unhandled exception error. - * - * \param obj1 An object to be compared. - * \param obj2 An object to be compared. - * \param equal Returns the result of the equality comparison. - * - * \return A valid handle if no error occurs during the comparison. - */ -DART_EXPORT Dart_Handle Dart_ObjectEquals(Dart_Handle obj1, - Dart_Handle obj2, - bool* equal); - -/** - * Is this object an instance of some type? - * - * The result of the test is returned through the 'instanceof' parameter. - * The return value itself is used to indicate success or failure. - * - * \param object An object. - * \param type A type. - * \param instanceof Return true if 'object' is an instance of type 'type'. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_ObjectIsType(Dart_Handle object, - Dart_Handle type, - bool* instanceof); - -/** - * Query object type. - * - * \param object Some Object. - * - * \return true if Object is of the specified type. - */ -DART_EXPORT bool Dart_IsInstance(Dart_Handle object); -DART_EXPORT bool Dart_IsNumber(Dart_Handle object); -DART_EXPORT bool Dart_IsInteger(Dart_Handle object); -DART_EXPORT bool Dart_IsDouble(Dart_Handle object); -DART_EXPORT bool Dart_IsBoolean(Dart_Handle object); -DART_EXPORT bool Dart_IsString(Dart_Handle object); -DART_EXPORT bool Dart_IsStringLatin1(Dart_Handle object); /* (ISO-8859-1) */ -DART_EXPORT bool Dart_IsExternalString(Dart_Handle object); -DART_EXPORT bool Dart_IsList(Dart_Handle object); -DART_EXPORT bool Dart_IsMap(Dart_Handle object); -DART_EXPORT bool Dart_IsLibrary(Dart_Handle object); -DART_EXPORT bool Dart_IsType(Dart_Handle handle); -DART_EXPORT bool Dart_IsFunction(Dart_Handle handle); -DART_EXPORT bool Dart_IsVariable(Dart_Handle handle); -DART_EXPORT bool Dart_IsTypeVariable(Dart_Handle handle); -DART_EXPORT bool Dart_IsClosure(Dart_Handle object); -DART_EXPORT bool Dart_IsTypedData(Dart_Handle object); -DART_EXPORT bool Dart_IsByteBuffer(Dart_Handle object); -DART_EXPORT bool Dart_IsFuture(Dart_Handle object); - -/* - * ========= - * Instances - * ========= - */ - -/* - * For the purposes of the embedding api, not all objects returned are - * Dart language objects. Within the api, we use the term 'Instance' - * to indicate handles which refer to true Dart language objects. - * - * TODO(turnidge): Reorganize the "Object" section above, pulling down - * any functions that more properly belong here. */ - -/** - * Gets the type of a Dart language object. - * - * \param instance Some Dart object. - * - * \return If no error occurs, the type is returned. Otherwise an - * error handle is returned. - */ -DART_EXPORT Dart_Handle Dart_InstanceGetType(Dart_Handle instance); - -/** - * Returns the name for the provided class type. - * - * \return A valid string handle if no error occurs during the - * operation. - */ -DART_EXPORT Dart_Handle Dart_ClassName(Dart_Handle cls_type); - -/** - * Returns the name for the provided function or method. - * - * \return A valid string handle if no error occurs during the - * operation. - */ -DART_EXPORT Dart_Handle Dart_FunctionName(Dart_Handle function); - -/** - * Returns a handle to the owner of a function. - * - * The owner of an instance method or a static method is its defining - * class. The owner of a top-level function is its defining - * library. The owner of the function of a non-implicit closure is the - * function of the method or closure that defines the non-implicit - * closure. - * - * \return A valid handle to the owner of the function, or an error - * handle if the argument is not a valid handle to a function. - */ -DART_EXPORT Dart_Handle Dart_FunctionOwner(Dart_Handle function); - -/** - * Determines whether a function handle referes to a static function - * of method. - * - * For the purposes of the embedding API, a top-level function is - * implicitly declared static. - * - * \param function A handle to a function or method declaration. - * \param is_static Returns whether the function or method is declared static. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_FunctionIsStatic(Dart_Handle function, - bool* is_static); - -/** - * Is this object a closure resulting from a tear-off (closurized method)? - * - * Returns true for closures produced when an ordinary method is accessed - * through a getter call. Returns false otherwise, in particular for closures - * produced from local function declarations. - * - * \param object Some Object. - * - * \return true if Object is a tear-off. - */ -DART_EXPORT bool Dart_IsTearOff(Dart_Handle object); - -/** - * Retrieves the function of a closure. - * - * \return A handle to the function of the closure, or an error handle if the - * argument is not a closure. - */ -DART_EXPORT Dart_Handle Dart_ClosureFunction(Dart_Handle closure); - -/** - * Returns a handle to the library which contains class. - * - * \return A valid handle to the library with owns class, null if the class - * has no library or an error handle if the argument is not a valid handle - * to a class type. - */ -DART_EXPORT Dart_Handle Dart_ClassLibrary(Dart_Handle cls_type); - -/* - * ============================= - * Numbers, Integers and Doubles - * ============================= - */ - -/** - * Does this Integer fit into a 64-bit signed integer? - * - * \param integer An integer. - * \param fits Returns true if the integer fits into a 64-bit signed integer. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_IntegerFitsIntoInt64(Dart_Handle integer, - bool* fits); - -/** - * Does this Integer fit into a 64-bit unsigned integer? - * - * \param integer An integer. - * \param fits Returns true if the integer fits into a 64-bit unsigned integer. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_IntegerFitsIntoUint64(Dart_Handle integer, - bool* fits); - -/** - * Returns an Integer with the provided value. - * - * \param value The value of the integer. - * - * \return The Integer object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value); - -/** - * Returns an Integer with the provided value. - * - * \param value The unsigned value of the integer. - * - * \return The Integer object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value); - -/** - * Returns an Integer with the provided value. - * - * \param value The value of the integer represented as a C string - * containing a hexadecimal number. - * - * \return The Integer object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewIntegerFromHexCString(const char* value); - -/** - * Gets the value of an Integer. - * - * The integer must fit into a 64-bit signed integer, otherwise an error occurs. - * - * \param integer An Integer. - * \param value Returns the value of the Integer. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_IntegerToInt64(Dart_Handle integer, - int64_t* value); - -/** - * Gets the value of an Integer. - * - * The integer must fit into a 64-bit unsigned integer, otherwise an - * error occurs. - * - * \param integer An Integer. - * \param value Returns the value of the Integer. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_IntegerToUint64(Dart_Handle integer, - uint64_t* value); - -/** - * Gets the value of an integer as a hexadecimal C string. - * - * \param integer An Integer. - * \param value Returns the value of the Integer as a hexadecimal C - * string. This C string is scope allocated and is only valid until - * the next call to Dart_ExitScope. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_IntegerToHexCString(Dart_Handle integer, - const char** value); - -/** - * Returns a Double with the provided value. - * - * \param value A double. - * - * \return The Double object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewDouble(double value); - -/** - * Gets the value of a Double - * - * \param double_obj A Double - * \param value Returns the value of the Double. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_DoubleValue(Dart_Handle double_obj, double* value); - -/** - * Returns a closure of static function 'function_name' in the class 'class_name' - * in the exported namespace of specified 'library'. - * - * \param library Library object - * \param cls_type Type object representing a Class - * \param function_name Name of the static function in the class - * - * \return A valid Dart instance if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_GetStaticMethodClosure(Dart_Handle library, - Dart_Handle cls_type, - Dart_Handle function_name); - -/* - * ======== - * Booleans - * ======== - */ - -/** - * Returns the True object. - * - * Requires there to be a current isolate. - * - * \return A handle to the True object. - */ -DART_EXPORT Dart_Handle Dart_True(); - -/** - * Returns the False object. - * - * Requires there to be a current isolate. - * - * \return A handle to the False object. - */ -DART_EXPORT Dart_Handle Dart_False(); - -/** - * Returns a Boolean with the provided value. - * - * \param value true or false. - * - * \return The Boolean object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewBoolean(bool value); - -/** - * Gets the value of a Boolean - * - * \param boolean_obj A Boolean - * \param value Returns the value of the Boolean. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_BooleanValue(Dart_Handle boolean_obj, bool* value); - -/* - * ======= - * Strings - * ======= - */ - -/** - * Gets the length of a String. - * - * \param str A String. - * \param length Returns the length of the String. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* length); - -/** - * Returns a String built from the provided C string - * (There is an implicit assumption that the C string passed in contains - * UTF-8 encoded characters and '\0' is considered as a termination - * character). - * - * \param value A C String - * - * \return The String object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char* str); -/* TODO(turnidge): Document what happens when we run out of memory - * during this call. */ - -/** - * Returns a String built from an array of UTF-8 encoded characters. - * - * \param utf8_array An array of UTF-8 encoded characters. - * \param length The length of the codepoints array. - * - * \return The String object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewStringFromUTF8(const uint8_t* utf8_array, - intptr_t length); - -/** - * Returns a String built from an array of UTF-16 encoded characters. - * - * \param utf16_array An array of UTF-16 encoded characters. - * \param length The length of the codepoints array. - * - * \return The String object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t* utf16_array, - intptr_t length); - -/** - * Returns a String built from an array of UTF-32 encoded characters. - * - * \param utf32_array An array of UTF-32 encoded characters. - * \param length The length of the codepoints array. - * - * \return The String object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const int32_t* utf32_array, - intptr_t length); - -/** - * Returns a String which references an external array of - * Latin-1 (ISO-8859-1) encoded characters. - * - * \param latin1_array Array of Latin-1 encoded characters. This must not move. - * \param length The length of the characters array. - * \param peer An external pointer to associate with this string. - * \param external_allocation_size The number of externally allocated - * bytes for peer. Used to inform the garbage collector. - * \param callback A callback to be called when this string is finalized. - * - * \return The String object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle -Dart_NewExternalLatin1String(const uint8_t* latin1_array, - intptr_t length, - void* peer, - intptr_t external_allocation_size, - Dart_HandleFinalizer callback); - -/** - * Returns a String which references an external array of UTF-16 encoded - * characters. - * - * \param utf16_array An array of UTF-16 encoded characters. This must not move. - * \param length The length of the characters array. - * \param peer An external pointer to associate with this string. - * \param external_allocation_size The number of externally allocated - * bytes for peer. Used to inform the garbage collector. - * \param callback A callback to be called when this string is finalized. - * - * \return The String object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle -Dart_NewExternalUTF16String(const uint16_t* utf16_array, - intptr_t length, - void* peer, - intptr_t external_allocation_size, - Dart_HandleFinalizer callback); - -/** - * Gets the C string representation of a String. - * (It is a sequence of UTF-8 encoded values with a '\0' termination.) - * - * \param str A string. - * \param cstr Returns the String represented as a C string. - * This C string is scope allocated and is only valid until - * the next call to Dart_ExitScope. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_StringToCString(Dart_Handle str, - const char** cstr); - -/** - * Gets a UTF-8 encoded representation of a String. - * - * Any unpaired surrogate code points in the string will be converted as - * replacement characters (U+FFFD, 0xEF 0xBF 0xBD in UTF-8). If you need - * to preserve unpaired surrogates, use the Dart_StringToUTF16 function. - * - * \param str A string. - * \param utf8_array Returns the String represented as UTF-8 code - * units. This UTF-8 array is scope allocated and is only valid - * until the next call to Dart_ExitScope. - * \param length Used to return the length of the array which was - * actually used. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str, - uint8_t** utf8_array, - intptr_t* length); - -/** - * Gets the data corresponding to the string object. This function returns - * the data only for Latin-1 (ISO-8859-1) string objects. For all other - * string objects it returns an error. - * - * \param str A string. - * \param latin1_array An array allocated by the caller, used to return - * the string data. - * \param length Used to pass in the length of the provided array. - * Used to return the length of the array which was actually used. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_StringToLatin1(Dart_Handle str, - uint8_t* latin1_array, - intptr_t* length); - -/** - * Gets the UTF-16 encoded representation of a string. - * - * \param str A string. - * \param utf16_array An array allocated by the caller, used to return - * the array of UTF-16 encoded characters. - * \param length Used to pass in the length of the provided array. - * Used to return the length of the array which was actually used. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str, - uint16_t* utf16_array, - intptr_t* length); - -/** - * Gets the storage size in bytes of a String. - * - * \param str A String. - * \param length Returns the storage size in bytes of the String. - * This is the size in bytes needed to store the String. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_StringStorageSize(Dart_Handle str, intptr_t* size); - -/** - * Retrieves some properties associated with a String. - * Properties retrieved are: - * - character size of the string (one or two byte) - * - length of the string - * - peer pointer of string if it is an external string. - * \param str A String. - * \param char_size Returns the character size of the String. - * \param str_len Returns the length of the String. - * \param peer Returns the peer pointer associated with the String or 0 if - * there is no peer pointer for it. - * \return Success if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_StringGetProperties(Dart_Handle str, - intptr_t* char_size, - intptr_t* str_len, - void** peer); - -/* - * ===== - * Lists - * ===== - */ - -/** - * Returns a List of the desired length. - * - * \param length The length of the list. - * - * \return The List object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewList(intptr_t length); - -typedef enum { - Dart_CoreType_Dynamic, - Dart_CoreType_Int, - Dart_CoreType_String, -} Dart_CoreType_Id; - -// TODO(bkonyi): convert this to use nullable types once NNBD is enabled. -/** - * Returns a List of the desired length with the desired legacy element type. - * - * \param element_type_id The type of elements of the list. - * \param length The length of the list. - * - * \return The List object if no error occurs. Otherwise returns an error - * handle. - */ -DART_EXPORT Dart_Handle Dart_NewListOf(Dart_CoreType_Id element_type_id, - intptr_t length); - -/** - * Returns a List of the desired length with the desired element type. - * - * \param element_type Handle to a nullable type object. E.g., from - * Dart_GetType or Dart_GetNullableType. - * - * \param length The length of the list. - * - * \return The List object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewListOfType(Dart_Handle element_type, - intptr_t length); - -/** - * Returns a List of the desired length with the desired element type, filled - * with the provided object. - * - * \param element_type Handle to a type object. E.g., from Dart_GetType. - * - * \param fill_object Handle to an object of type 'element_type' that will be - * used to populate the list. This parameter can only be Dart_Null() if the - * length of the list is 0 or 'element_type' is a nullable type. - * - * \param length The length of the list. - * - * \return The List object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewListOfTypeFilled(Dart_Handle element_type, - Dart_Handle fill_object, - intptr_t length); - -/** - * Gets the length of a List. - * - * May generate an unhandled exception error. - * - * \param list A List. - * \param length Returns the length of the List. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t* length); - -/** - * Gets the Object at some index of a List. - * - * If the index is out of bounds, an error occurs. - * - * May generate an unhandled exception error. - * - * \param list A List. - * \param index A valid index into the List. - * - * \return The Object in the List at the specified index if no error - * occurs. Otherwise returns an error handle. - */ -DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index); - -/** -* Gets a range of Objects from a List. -* -* If any of the requested index values are out of bounds, an error occurs. -* -* May generate an unhandled exception error. -* -* \param list A List. -* \param offset The offset of the first item to get. -* \param length The number of items to get. -* \param result A pointer to fill with the objects. -* -* \return Success if no error occurs during the operation. -*/ -DART_EXPORT Dart_Handle Dart_ListGetRange(Dart_Handle list, - intptr_t offset, - intptr_t length, - Dart_Handle* result); - -/** - * Sets the Object at some index of a List. - * - * If the index is out of bounds, an error occurs. - * - * May generate an unhandled exception error. - * - * \param array A List. - * \param index A valid index into the List. - * \param value The Object to put in the List. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list, - intptr_t index, - Dart_Handle value); - -/** - * May generate an unhandled exception error. - */ -DART_EXPORT Dart_Handle Dart_ListGetAsBytes(Dart_Handle list, - intptr_t offset, - uint8_t* native_array, - intptr_t length); - -/** - * May generate an unhandled exception error. - */ -DART_EXPORT Dart_Handle Dart_ListSetAsBytes(Dart_Handle list, - intptr_t offset, - const uint8_t* native_array, - intptr_t length); - -/* - * ==== - * Maps - * ==== - */ - -/** - * Gets the Object at some key of a Map. - * - * May generate an unhandled exception error. - * - * \param map A Map. - * \param key An Object. - * - * \return The value in the map at the specified key, null if the map does not - * contain the key, or an error handle. - */ -DART_EXPORT Dart_Handle Dart_MapGetAt(Dart_Handle map, Dart_Handle key); - -/** - * Returns whether the Map contains a given key. - * - * May generate an unhandled exception error. - * - * \param map A Map. - * - * \return A handle on a boolean indicating whether map contains the key. - * Otherwise returns an error handle. - */ -DART_EXPORT Dart_Handle Dart_MapContainsKey(Dart_Handle map, Dart_Handle key); - -/** - * Gets the list of keys of a Map. - * - * May generate an unhandled exception error. - * - * \param map A Map. - * - * \return The list of key Objects if no error occurs. Otherwise returns an - * error handle. - */ -DART_EXPORT Dart_Handle Dart_MapKeys(Dart_Handle map); - -/* - * ========== - * Typed Data - * ========== - */ - -typedef enum { - Dart_TypedData_kByteData = 0, - Dart_TypedData_kInt8, - Dart_TypedData_kUint8, - Dart_TypedData_kUint8Clamped, - Dart_TypedData_kInt16, - Dart_TypedData_kUint16, - Dart_TypedData_kInt32, - Dart_TypedData_kUint32, - Dart_TypedData_kInt64, - Dart_TypedData_kUint64, - Dart_TypedData_kFloat32, - Dart_TypedData_kFloat64, - Dart_TypedData_kInt32x4, - Dart_TypedData_kFloat32x4, - Dart_TypedData_kFloat64x2, - Dart_TypedData_kInvalid -} Dart_TypedData_Type; - -/** - * Return type if this object is a TypedData object. - * - * \return kInvalid if the object is not a TypedData object or the appropriate - * Dart_TypedData_Type. - */ -DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfTypedData(Dart_Handle object); - -/** - * Return type if this object is an external TypedData object. - * - * \return kInvalid if the object is not an external TypedData object or - * the appropriate Dart_TypedData_Type. - */ -DART_EXPORT Dart_TypedData_Type -Dart_GetTypeOfExternalTypedData(Dart_Handle object); - -/** - * Returns a TypedData object of the desired length and type. - * - * \param type The type of the TypedData object. - * \param length The length of the TypedData object (length in type units). - * - * \return The TypedData object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, - intptr_t length); - -/** - * Returns a TypedData object which references an external data array. - * - * \param type The type of the data array. - * \param data A data array. This array must not move. - * \param length The length of the data array (length in type units). - * - * \return The TypedData object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewExternalTypedData(Dart_TypedData_Type type, - void* data, - intptr_t length); - -/** - * Returns a TypedData object which references an external data array. - * - * \param type The type of the data array. - * \param data A data array. This array must not move. - * \param length The length of the data array (length in type units). - * \param peer A pointer to a native object or NULL. This value is - * provided to callback when it is invoked. - * \param external_allocation_size The number of externally allocated - * bytes for peer. Used to inform the garbage collector. - * \param callback A function pointer that will be invoked sometime - * after the object is garbage collected, unless the handle has been deleted. - * A valid callback needs to be specified it cannot be NULL. - * - * \return The TypedData object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle -Dart_NewExternalTypedDataWithFinalizer(Dart_TypedData_Type type, - void* data, - intptr_t length, - void* peer, - intptr_t external_allocation_size, - Dart_HandleFinalizer callback); - -/** - * Returns a ByteBuffer object for the typed data. - * - * \param type_data The TypedData object. - * - * \return The ByteBuffer object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data); - -/** - * Acquires access to the internal data address of a TypedData object. - * - * \param object The typed data object whose internal data address is to - * be accessed. - * \param type The type of the object is returned here. - * \param data The internal data address is returned here. - * \param len Size of the typed array is returned here. - * - * Notes: - * When the internal address of the object is acquired any calls to a - * Dart API function that could potentially allocate an object or run - * any Dart code will return an error. - * - * Any Dart API functions for accessing the data should not be called - * before the corresponding release. In particular, the object should - * not be acquired again before its release. This leads to undefined - * behavior. - * - * \return Success if the internal data address is acquired successfully. - * Otherwise, returns an error handle. - */ -DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object, - Dart_TypedData_Type* type, - void** data, - intptr_t* len); - -/** - * Releases access to the internal data address that was acquired earlier using - * Dart_TypedDataAcquireData. - * - * \param object The typed data object whose internal data address is to be - * released. - * - * \return Success if the internal data address is released successfully. - * Otherwise, returns an error handle. - */ -DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object); - -/** - * Returns the TypedData object associated with the ByteBuffer object. - * - * \param byte_buffer The ByteBuffer object. - * - * \return The TypedData object if no error occurs. Otherwise returns - * an error handle. - */ -DART_EXPORT Dart_Handle Dart_GetDataFromByteBuffer(Dart_Handle byte_buffer); - -/* - * ============================================================ - * Invoking Constructors, Methods, Closures and Field accessors - * ============================================================ - */ - -/** - * Invokes a constructor, creating a new object. - * - * This function allows hidden constructors (constructors with leading - * underscores) to be called. - * - * \param type Type of object to be constructed. - * \param constructor_name The name of the constructor to invoke. Use - * Dart_Null() or Dart_EmptyString() to invoke the unnamed constructor. - * This name should not include the name of the class. - * \param number_of_arguments Size of the arguments array. - * \param arguments An array of arguments to the constructor. - * - * \return If the constructor is called and completes successfully, - * then the new object. If an error occurs during execution, then an - * error handle is returned. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_New(Dart_Handle type, - Dart_Handle constructor_name, - int number_of_arguments, - Dart_Handle* arguments); - -/** - * Allocate a new object without invoking a constructor. - * - * \param type The type of an object to be allocated. - * - * \return The new object. If an error occurs during execution, then an - * error handle is returned. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_Allocate(Dart_Handle type); - -/** - * Allocate a new object without invoking a constructor, and sets specified - * native fields. - * - * \param type The type of an object to be allocated. - * \param num_native_fields The number of native fields to set. - * \param native_fields An array containing the value of native fields. - * - * \return The new object. If an error occurs during execution, then an - * error handle is returned. - */ -DART_EXPORT Dart_Handle -Dart_AllocateWithNativeFields(Dart_Handle type, - intptr_t num_native_fields, - const intptr_t* native_fields); - -/** - * Invokes a method or function. - * - * The 'target' parameter may be an object, type, or library. If - * 'target' is an object, then this function will invoke an instance - * method. If 'target' is a type, then this function will invoke a - * static method. If 'target' is a library, then this function will - * invoke a top-level function from that library. - * NOTE: This API call cannot be used to invoke methods of a type object. - * - * This function ignores visibility (leading underscores in names). - * - * May generate an unhandled exception error. - * - * \param target An object, type, or library. - * \param name The name of the function or method to invoke. - * \param number_of_arguments Size of the arguments array. - * \param arguments An array of arguments to the function. - * - * \return If the function or method is called and completes - * successfully, then the return value is returned. If an error - * occurs during execution, then an error handle is returned. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_Invoke(Dart_Handle target, - Dart_Handle name, - int number_of_arguments, - Dart_Handle* arguments); -/* TODO(turnidge): Document how to invoke operators. */ - -/** - * Invokes a Closure with the given arguments. - * - * May generate an unhandled exception error. - * - * \return If no error occurs during execution, then the result of - * invoking the closure is returned. If an error occurs during - * execution, then an error handle is returned. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_InvokeClosure(Dart_Handle closure, - int number_of_arguments, - Dart_Handle* arguments); - -/** - * Invokes a Generative Constructor on an object that was previously - * allocated using Dart_Allocate/Dart_AllocateWithNativeFields. - * - * The 'target' parameter must be an object. - * - * This function ignores visibility (leading underscores in names). - * - * May generate an unhandled exception error. - * - * \param target An object. - * \param name The name of the constructor to invoke. - * Use Dart_Null() or Dart_EmptyString() to invoke the unnamed constructor. - * \param number_of_arguments Size of the arguments array. - * \param arguments An array of arguments to the function. - * - * \return If the constructor is called and completes - * successfully, then the object is returned. If an error - * occurs during execution, then an error handle is returned. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_InvokeConstructor(Dart_Handle object, - Dart_Handle name, - int number_of_arguments, - Dart_Handle* arguments); - -/** - * Gets the value of a field. - * - * The 'container' parameter may be an object, type, or library. If - * 'container' is an object, then this function will access an - * instance field. If 'container' is a type, then this function will - * access a static field. If 'container' is a library, then this - * function will access a top-level variable. - * NOTE: This API call cannot be used to access fields of a type object. - * - * This function ignores field visibility (leading underscores in names). - * - * May generate an unhandled exception error. - * - * \param container An object, type, or library. - * \param name A field name. - * - * \return If no error occurs, then the value of the field is - * returned. Otherwise an error handle is returned. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_GetField(Dart_Handle container, Dart_Handle name); - -/** - * Sets the value of a field. - * - * The 'container' parameter may actually be an object, type, or - * library. If 'container' is an object, then this function will - * access an instance field. If 'container' is a type, then this - * function will access a static field. If 'container' is a library, - * then this function will access a top-level variable. - * NOTE: This API call cannot be used to access fields of a type object. - * - * This function ignores field visibility (leading underscores in names). - * - * May generate an unhandled exception error. - * - * \param container An object, type, or library. - * \param name A field name. - * \param value The new field value. - * - * \return A valid handle if no error occurs. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_SetField(Dart_Handle container, Dart_Handle name, Dart_Handle value); - -/* - * ========== - * Exceptions - * ========== - */ - -/* - * TODO(turnidge): Remove these functions from the api and replace all - * uses with Dart_NewUnhandledExceptionError. */ - -/** - * Throws an exception. - * - * This function causes a Dart language exception to be thrown. This - * will proceed in the standard way, walking up Dart frames until an - * appropriate 'catch' block is found, executing 'finally' blocks, - * etc. - * - * If an error handle is passed into this function, the error is - * propagated immediately. See Dart_PropagateError for a discussion - * of error propagation. - * - * If successful, this function does not return. Note that this means - * that the destructors of any stack-allocated C++ objects will not be - * called. If there are no Dart frames on the stack, an error occurs. - * - * \return An error handle if the exception was not thrown. - * Otherwise the function does not return. - */ -DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception); - -/** - * Rethrows an exception. - * - * Rethrows an exception, unwinding all dart frames on the stack. If - * successful, this function does not return. Note that this means - * that the destructors of any stack-allocated C++ objects will not be - * called. If there are no Dart frames on the stack, an error occurs. - * - * \return An error handle if the exception was not thrown. - * Otherwise the function does not return. - */ -DART_EXPORT Dart_Handle Dart_ReThrowException(Dart_Handle exception, - Dart_Handle stacktrace); - -/* - * =========================== - * Native fields and functions - * =========================== - */ - -/** - * Gets the number of native instance fields in an object. - */ -DART_EXPORT Dart_Handle Dart_GetNativeInstanceFieldCount(Dart_Handle obj, - int* count); - -/** - * Gets the value of a native field. - * - * TODO(turnidge): Document. - */ -DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, - int index, - intptr_t* value); - -/** - * Sets the value of a native field. - * - * TODO(turnidge): Document. - */ -DART_EXPORT Dart_Handle Dart_SetNativeInstanceField(Dart_Handle obj, - int index, - intptr_t value); - -/** - * The arguments to a native function. - * - * This object is passed to a native function to represent its - * arguments and return value. It allows access to the arguments to a - * native function by index. It also allows the return value of a - * native function to be set. - */ -typedef struct _Dart_NativeArguments* Dart_NativeArguments; - -/** - * Extracts current isolate group data from the native arguments structure. - */ -DART_EXPORT void* Dart_GetNativeIsolateGroupData(Dart_NativeArguments args); - -typedef enum { - Dart_NativeArgument_kBool = 0, - Dart_NativeArgument_kInt32, - Dart_NativeArgument_kUint32, - Dart_NativeArgument_kInt64, - Dart_NativeArgument_kUint64, - Dart_NativeArgument_kDouble, - Dart_NativeArgument_kString, - Dart_NativeArgument_kInstance, - Dart_NativeArgument_kNativeFields, -} Dart_NativeArgument_Type; - -typedef struct _Dart_NativeArgument_Descriptor { - uint8_t type; - uint8_t index; -} Dart_NativeArgument_Descriptor; - -typedef union _Dart_NativeArgument_Value { - bool as_bool; - int32_t as_int32; - uint32_t as_uint32; - int64_t as_int64; - uint64_t as_uint64; - double as_double; - struct { - Dart_Handle dart_str; - void* peer; - } as_string; - struct { - intptr_t num_fields; - intptr_t* values; - } as_native_fields; - Dart_Handle as_instance; -} Dart_NativeArgument_Value; - -enum { - kNativeArgNumberPos = 0, - kNativeArgNumberSize = 8, - kNativeArgTypePos = kNativeArgNumberPos + kNativeArgNumberSize, - kNativeArgTypeSize = 8, -}; - -#define BITMASK(size) ((1 << size) - 1) -#define DART_NATIVE_ARG_DESCRIPTOR(type, position) \ - (((type & BITMASK(kNativeArgTypeSize)) << kNativeArgTypePos) | \ - (position & BITMASK(kNativeArgNumberSize))) - -/** - * Gets the native arguments based on the types passed in and populates - * the passed arguments buffer with appropriate native values. - * - * \param args the Native arguments block passed into the native call. - * \param num_arguments length of argument descriptor array and argument - * values array passed in. - * \param arg_descriptors an array that describes the arguments that - * need to be retrieved. For each argument to be retrieved the descriptor - * contains the argument number (0, 1 etc.) and the argument type - * described using Dart_NativeArgument_Type, e.g: - * DART_NATIVE_ARG_DESCRIPTOR(Dart_NativeArgument_kBool, 1) indicates - * that the first argument is to be retrieved and it should be a boolean. - * \param arg_values array into which the native arguments need to be - * extracted into, the array is allocated by the caller (it could be - * stack allocated to avoid the malloc/free performance overhead). - * - * \return Success if all the arguments could be extracted correctly, - * returns an error handle if there were any errors while extracting the - * arguments (mismatched number of arguments, incorrect types, etc.). - */ -DART_EXPORT Dart_Handle -Dart_GetNativeArguments(Dart_NativeArguments args, - int num_arguments, - const Dart_NativeArgument_Descriptor* arg_descriptors, - Dart_NativeArgument_Value* arg_values); - -/** - * Gets the native argument at some index. - */ -DART_EXPORT Dart_Handle Dart_GetNativeArgument(Dart_NativeArguments args, - int index); -/* TODO(turnidge): Specify the behavior of an out-of-bounds access. */ - -/** - * Gets the number of native arguments. - */ -DART_EXPORT int Dart_GetNativeArgumentCount(Dart_NativeArguments args); - -/** - * Gets all the native fields of the native argument at some index. - * \param args Native arguments structure. - * \param arg_index Index of the desired argument in the structure above. - * \param num_fields size of the intptr_t array 'field_values' passed in. - * \param field_values intptr_t array in which native field values are returned. - * \return Success if the native fields where copied in successfully. Otherwise - * returns an error handle. On success the native field values are copied - * into the 'field_values' array, if the argument at 'arg_index' is a - * null object then 0 is copied as the native field values into the - * 'field_values' array. - */ -DART_EXPORT Dart_Handle -Dart_GetNativeFieldsOfArgument(Dart_NativeArguments args, - int arg_index, - int num_fields, - intptr_t* field_values); - -/** - * Gets the native field of the receiver. - */ -DART_EXPORT Dart_Handle Dart_GetNativeReceiver(Dart_NativeArguments args, - intptr_t* value); - -/** - * Gets a string native argument at some index. - * \param args Native arguments structure. - * \param arg_index Index of the desired argument in the structure above. - * \param peer Returns the peer pointer if the string argument has one. - * \return Success if the string argument has a peer, if it does not - * have a peer then the String object is returned. Otherwise returns - * an error handle (argument is not a String object). - */ -DART_EXPORT Dart_Handle Dart_GetNativeStringArgument(Dart_NativeArguments args, - int arg_index, - void** peer); - -/** - * Gets an integer native argument at some index. - * \param args Native arguments structure. - * \param arg_index Index of the desired argument in the structure above. - * \param value Returns the integer value if the argument is an Integer. - * \return Success if no error occurs. Otherwise returns an error handle. - */ -DART_EXPORT Dart_Handle Dart_GetNativeIntegerArgument(Dart_NativeArguments args, - int index, - int64_t* value); - -/** - * Gets a boolean native argument at some index. - * \param args Native arguments structure. - * \param arg_index Index of the desired argument in the structure above. - * \param value Returns the boolean value if the argument is a Boolean. - * \return Success if no error occurs. Otherwise returns an error handle. - */ -DART_EXPORT Dart_Handle Dart_GetNativeBooleanArgument(Dart_NativeArguments args, - int index, - bool* value); - -/** - * Gets a double native argument at some index. - * \param args Native arguments structure. - * \param arg_index Index of the desired argument in the structure above. - * \param value Returns the double value if the argument is a double. - * \return Success if no error occurs. Otherwise returns an error handle. - */ -DART_EXPORT Dart_Handle Dart_GetNativeDoubleArgument(Dart_NativeArguments args, - int index, - double* value); - -/** - * Sets the return value for a native function. - * - * If retval is an Error handle, then error will be propagated once - * the native functions exits. See Dart_PropagateError for a - * discussion of how different types of errors are propagated. - */ -DART_EXPORT void Dart_SetReturnValue(Dart_NativeArguments args, - Dart_Handle retval); - -DART_EXPORT void Dart_SetWeakHandleReturnValue(Dart_NativeArguments args, - Dart_WeakPersistentHandle rval); - -DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, - bool retval); - -DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, - int64_t retval); - -DART_EXPORT void Dart_SetDoubleReturnValue(Dart_NativeArguments args, - double retval); - -/** - * A native function. - */ -typedef void (*Dart_NativeFunction)(Dart_NativeArguments arguments); - -/** - * Native entry resolution callback. - * - * For libraries and scripts which have native functions, the embedder - * can provide a native entry resolver. This callback is used to map a - * name/arity to a Dart_NativeFunction. If no function is found, the - * callback should return NULL. - * - * The parameters to the native resolver function are: - * \param name a Dart string which is the name of the native function. - * \param num_of_arguments is the number of arguments expected by the - * native function. - * \param auto_setup_scope is a boolean flag that can be set by the resolver - * to indicate if this function needs a Dart API scope (see Dart_EnterScope/ - * Dart_ExitScope) to be setup automatically by the VM before calling into - * the native function. By default most native functions would require this - * to be true but some light weight native functions which do not call back - * into the VM through the Dart API may not require a Dart scope to be - * setup automatically. - * - * \return A valid Dart_NativeFunction which resolves to a native entry point - * for the native function. - * - * See Dart_SetNativeResolver. - */ -typedef Dart_NativeFunction (*Dart_NativeEntryResolver)(Dart_Handle name, - int num_of_arguments, - bool* auto_setup_scope); -/* TODO(turnidge): Consider renaming to NativeFunctionResolver or - * NativeResolver. */ - -/** - * Native entry symbol lookup callback. - * - * For libraries and scripts which have native functions, the embedder - * can provide a callback for mapping a native entry to a symbol. This callback - * maps a native function entry PC to the native function name. If no native - * entry symbol can be found, the callback should return NULL. - * - * The parameters to the native reverse resolver function are: - * \param nf A Dart_NativeFunction. - * - * \return A const UTF-8 string containing the symbol name or NULL. - * - * See Dart_SetNativeResolver. - */ -typedef const uint8_t* (*Dart_NativeEntrySymbol)(Dart_NativeFunction nf); - -/** - * FFI Native C function pointer resolver callback. - * - * See Dart_SetFfiNativeResolver. - */ -typedef void* (*Dart_FfiNativeResolver)(const char* name, uintptr_t args_n); - -/* - * =========== - * Environment - * =========== - */ - -/** - * An environment lookup callback function. - * - * \param name The name of the value to lookup in the environment. - * - * \return A valid handle to a string if the name exists in the - * current environment or Dart_Null() if not. - */ -typedef Dart_Handle (*Dart_EnvironmentCallback)(Dart_Handle name); - -/** - * Sets the environment callback for the current isolate. This - * callback is used to lookup environment values by name in the - * current environment. This enables the embedder to supply values for - * the const constructors bool.fromEnvironment, int.fromEnvironment - * and String.fromEnvironment. - */ -DART_EXPORT Dart_Handle -Dart_SetEnvironmentCallback(Dart_EnvironmentCallback callback); - -/** - * Sets the callback used to resolve native functions for a library. - * - * \param library A library. - * \param resolver A native entry resolver. - * - * \return A valid handle if the native resolver was set successfully. - */ -DART_EXPORT Dart_Handle -Dart_SetNativeResolver(Dart_Handle library, - Dart_NativeEntryResolver resolver, - Dart_NativeEntrySymbol symbol); -/* TODO(turnidge): Rename to Dart_LibrarySetNativeResolver? */ - -/** - * Returns the callback used to resolve native functions for a library. - * - * \param library A library. - * \param resolver a pointer to a Dart_NativeEntryResolver - * - * \return A valid handle if the library was found. - */ -DART_EXPORT Dart_Handle -Dart_GetNativeResolver(Dart_Handle library, Dart_NativeEntryResolver* resolver); - -/** - * Returns the callback used to resolve native function symbols for a library. - * - * \param library A library. - * \param resolver a pointer to a Dart_NativeEntrySymbol. - * - * \return A valid handle if the library was found. - */ -DART_EXPORT Dart_Handle Dart_GetNativeSymbol(Dart_Handle library, - Dart_NativeEntrySymbol* resolver); - -/** - * Sets the callback used to resolve FFI native functions for a library. - * The resolved functions are expected to be a C function pointer of the - * correct signature (as specified in the `@FfiNative()` function - * annotation in Dart code). - * - * NOTE: This is an experimental feature and might change in the future. - * - * \param library A library. - * \param resolver A native function resolver. - * - * \return A valid handle if the native resolver was set successfully. - */ -DART_EXPORT Dart_Handle -Dart_SetFfiNativeResolver(Dart_Handle library, Dart_FfiNativeResolver resolver); - -/* - * ===================== - * Scripts and Libraries - * ===================== - */ - -typedef enum { - Dart_kCanonicalizeUrl = 0, - Dart_kImportTag, - Dart_kKernelTag, -} Dart_LibraryTag; - -/** - * The library tag handler is a multi-purpose callback provided by the - * embedder to the Dart VM. The embedder implements the tag handler to - * provide the ability to load Dart scripts and imports. - * - * -- TAGS -- - * - * Dart_kCanonicalizeUrl - * - * This tag indicates that the embedder should canonicalize 'url' with - * respect to 'library'. For most embedders, the - * Dart_DefaultCanonicalizeUrl function is a sufficient implementation - * of this tag. The return value should be a string holding the - * canonicalized url. - * - * Dart_kImportTag - * - * This tag is used to load a library from IsolateMirror.loadUri. The embedder - * should call Dart_LoadLibraryFromKernel to provide the library to the VM. The - * return value should be an error or library (the result from - * Dart_LoadLibraryFromKernel). - * - * Dart_kKernelTag - * - * This tag is used to load the intermediate file (kernel) generated by - * the Dart front end. This tag is typically used when a 'hot-reload' - * of an application is needed and the VM is 'use dart front end' mode. - * The dart front end typically compiles all the scripts, imports and part - * files into one intermediate file hence we don't use the source/import or - * script tags. The return value should be an error or a TypedData containing - * the kernel bytes. - * - */ -typedef Dart_Handle (*Dart_LibraryTagHandler)( - Dart_LibraryTag tag, - Dart_Handle library_or_package_map_url, - Dart_Handle url); - -/** - * Sets library tag handler for the current isolate. This handler is - * used to handle the various tags encountered while loading libraries - * or scripts in the isolate. - * - * \param handler Handler code to be used for handling the various tags - * encountered while loading libraries or scripts in the isolate. - * - * \return If no error occurs, the handler is set for the isolate. - * Otherwise an error handle is returned. - * - * TODO(turnidge): Document. - */ -DART_EXPORT Dart_Handle -Dart_SetLibraryTagHandler(Dart_LibraryTagHandler handler); - -/** - * Handles deferred loading requests. When this handler is invoked, it should - * eventually load the deferred loading unit with the given id and call - * Dart_DeferredLoadComplete or Dart_DeferredLoadCompleteError. It is - * recommended that the loading occur asynchronously, but it is permitted to - * call Dart_DeferredLoadComplete or Dart_DeferredLoadCompleteError before the - * handler returns. - * - * If an error is returned, it will be propogated through - * `prefix.loadLibrary()`. This is useful for synchronous - * implementations, which must propogate any unwind errors from - * Dart_DeferredLoadComplete or Dart_DeferredLoadComplete. Otherwise the handler - * should return a non-error such as `Dart_Null()`. - */ -typedef Dart_Handle (*Dart_DeferredLoadHandler)(intptr_t loading_unit_id); - -/** - * Sets the deferred load handler for the current isolate. This handler is - * used to handle loading deferred imports in an AppJIT or AppAOT program. - */ -DART_EXPORT Dart_Handle -Dart_SetDeferredLoadHandler(Dart_DeferredLoadHandler handler); - -/** - * Notifies the VM that a deferred load completed successfully. This function - * will eventually cause the corresponding `prefix.loadLibrary()` futures to - * complete. - * - * Requires the current isolate to be the same current isolate during the - * invocation of the Dart_DeferredLoadHandler. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_DeferredLoadComplete(intptr_t loading_unit_id, - const uint8_t* snapshot_data, - const uint8_t* snapshot_instructions); - -/** - * Notifies the VM that a deferred load failed. This function - * will eventually cause the corresponding `prefix.loadLibrary()` futures to - * complete with an error. - * - * If `transient` is true, future invocations of `prefix.loadLibrary()` will - * trigger new load requests. If false, futures invocation will complete with - * the same error. - * - * Requires the current isolate to be the same current isolate during the - * invocation of the Dart_DeferredLoadHandler. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_DeferredLoadCompleteError(intptr_t loading_unit_id, - const char* error_message, - bool transient); - -/** - * Canonicalizes a url with respect to some library. - * - * The url is resolved with respect to the library's url and some url - * normalizations are performed. - * - * This canonicalization function should be sufficient for most - * embedders to implement the Dart_kCanonicalizeUrl tag. - * - * \param base_url The base url relative to which the url is - * being resolved. - * \param url The url being resolved and canonicalized. This - * parameter is a string handle. - * - * \return If no error occurs, a String object is returned. Otherwise - * an error handle is returned. - */ -DART_EXPORT Dart_Handle Dart_DefaultCanonicalizeUrl(Dart_Handle base_url, - Dart_Handle url); - -/** - * Loads the root library for the current isolate. - * - * Requires there to be no current root library. - * - * \param buffer A buffer which contains a kernel binary (see - * pkg/kernel/binary.md). Must remain valid until isolate group shutdown. - * \param buffer_size Length of the passed in buffer. - * - * \return A handle to the root library, or an error. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_LoadScriptFromKernel(const uint8_t* kernel_buffer, intptr_t kernel_size); - -/** - * Gets the library for the root script for the current isolate. - * - * If the root script has not yet been set for the current isolate, - * this function returns Dart_Null(). This function never returns an - * error handle. - * - * \return Returns the root Library for the current isolate or Dart_Null(). - */ -DART_EXPORT Dart_Handle Dart_RootLibrary(); - -/** - * Sets the root library for the current isolate. - * - * \return Returns an error handle if `library` is not a library handle. - */ -DART_EXPORT Dart_Handle Dart_SetRootLibrary(Dart_Handle library); - -/** - * Lookup or instantiate a legacy type by name and type arguments from a - * Library. - * - * \param library The library containing the class or interface. - * \param class_name The class name for the type. - * \param number_of_type_arguments Number of type arguments. - * For non parametric types the number of type arguments would be 0. - * \param type_arguments Pointer to an array of type arguments. - * For non parameteric types a NULL would be passed in for this argument. - * - * \return If no error occurs, the type is returned. - * Otherwise an error handle is returned. - */ -DART_EXPORT Dart_Handle Dart_GetType(Dart_Handle library, - Dart_Handle class_name, - intptr_t number_of_type_arguments, - Dart_Handle* type_arguments); - -/** - * Lookup or instantiate a nullable type by name and type arguments from - * Library. - * - * \param library The library containing the class or interface. - * \param class_name The class name for the type. - * \param number_of_type_arguments Number of type arguments. - * For non parametric types the number of type arguments would be 0. - * \param type_arguments Pointer to an array of type arguments. - * For non parameteric types a NULL would be passed in for this argument. - * - * \return If no error occurs, the type is returned. - * Otherwise an error handle is returned. - */ -DART_EXPORT Dart_Handle Dart_GetNullableType(Dart_Handle library, - Dart_Handle class_name, - intptr_t number_of_type_arguments, - Dart_Handle* type_arguments); - -/** - * Lookup or instantiate a non-nullable type by name and type arguments from - * Library. - * - * \param library The library containing the class or interface. - * \param class_name The class name for the type. - * \param number_of_type_arguments Number of type arguments. - * For non parametric types the number of type arguments would be 0. - * \param type_arguments Pointer to an array of type arguments. - * For non parameteric types a NULL would be passed in for this argument. - * - * \return If no error occurs, the type is returned. - * Otherwise an error handle is returned. - */ -DART_EXPORT Dart_Handle -Dart_GetNonNullableType(Dart_Handle library, - Dart_Handle class_name, - intptr_t number_of_type_arguments, - Dart_Handle* type_arguments); - -/** - * Creates a nullable version of the provided type. - * - * \param type The type to be converted to a nullable type. - * - * \return If no error occurs, a nullable type is returned. - * Otherwise an error handle is returned. - */ -DART_EXPORT Dart_Handle Dart_TypeToNullableType(Dart_Handle type); - -/** - * Creates a non-nullable version of the provided type. - * - * \param type The type to be converted to a non-nullable type. - * - * \return If no error occurs, a non-nullable type is returned. - * Otherwise an error handle is returned. - */ -DART_EXPORT Dart_Handle Dart_TypeToNonNullableType(Dart_Handle type); - -/** - * A type's nullability. - * - * \param type A Dart type. - * \param result An out parameter containing the result of the check. True if - * the type is of the specified nullability, false otherwise. - * - * \return Returns an error handle if type is not of type Type. - */ -DART_EXPORT Dart_Handle Dart_IsNullableType(Dart_Handle type, bool* result); -DART_EXPORT Dart_Handle Dart_IsNonNullableType(Dart_Handle type, bool* result); -DART_EXPORT Dart_Handle Dart_IsLegacyType(Dart_Handle type, bool* result); - -/** - * Lookup a class or interface by name from a Library. - * - * \param library The library containing the class or interface. - * \param class_name The name of the class or interface. - * - * \return If no error occurs, the class or interface is - * returned. Otherwise an error handle is returned. - */ -DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library, - Dart_Handle class_name); -/* TODO(asiva): The above method needs to be removed once all uses - * of it are removed from the embedder code. */ - -/** - * Returns an import path to a Library, such as "file:///test.dart" or - * "dart:core". - */ -DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library); - -/** - * Returns a URL from which a Library was loaded. - */ -DART_EXPORT Dart_Handle Dart_LibraryResolvedUrl(Dart_Handle library); - -/** - * \return An array of libraries. - */ -DART_EXPORT Dart_Handle Dart_GetLoadedLibraries(); - -DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url); -/* TODO(turnidge): Consider returning Dart_Null() when the library is - * not found to distinguish that from a true error case. */ - -/** - * Report an loading error for the library. - * - * \param library The library that failed to load. - * \param error The Dart error instance containing the load error. - * - * \return If the VM handles the error, the return value is - * a null handle. If it doesn't handle the error, the error - * object is returned. - */ -DART_EXPORT Dart_Handle Dart_LibraryHandleError(Dart_Handle library, - Dart_Handle error); - -/** - * Called by the embedder to load a partial program. Does not set the root - * library. - * - * \param buffer A buffer which contains a kernel binary (see - * pkg/kernel/binary.md). Must remain valid until isolate shutdown. - * \param buffer_size Length of the passed in buffer. - * - * \return A handle to the main library of the compilation unit, or an error. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_LoadLibraryFromKernel(const uint8_t* kernel_buffer, - intptr_t kernel_buffer_size); - -/** - * Indicates that all outstanding load requests have been satisfied. - * This finalizes all the new classes loaded and optionally completes - * deferred library futures. - * - * Requires there to be a current isolate. - * - * \param complete_futures Specify true if all deferred library - * futures should be completed, false otherwise. - * - * \return Success if all classes have been finalized and deferred library - * futures are completed. Otherwise, returns an error. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_FinalizeLoading(bool complete_futures); - -/* - * ===== - * Peers - * ===== - */ - -/** - * The peer field is a lazily allocated field intended for storage of - * an uncommonly used values. Most instances types can have a peer - * field allocated. The exceptions are subtypes of Null, num, and - * bool. - */ - -/** - * Returns the value of peer field of 'object' in 'peer'. - * - * \param object An object. - * \param peer An out parameter that returns the value of the peer - * field. - * - * \return Returns an error if 'object' is a subtype of Null, num, or - * bool. - */ -DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer); - -/** - * Sets the value of the peer field of 'object' to the value of - * 'peer'. - * - * \param object An object. - * \param peer A value to store in the peer field. - * - * \return Returns an error if 'object' is a subtype of Null, num, or - * bool. - */ -DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer); - -/* - * ====== - * Kernel - * ====== - */ - -/** - * Experimental support for Dart to Kernel parser isolate. - * - * TODO(hausner): Document finalized interface. - * - */ - -// TODO(33433): Remove kernel service from the embedding API. - -typedef enum { - Dart_KernelCompilationStatus_Unknown = -1, - Dart_KernelCompilationStatus_Ok = 0, - Dart_KernelCompilationStatus_Error = 1, - Dart_KernelCompilationStatus_Crash = 2, - Dart_KernelCompilationStatus_MsgFailed = 3, -} Dart_KernelCompilationStatus; - -typedef struct { - Dart_KernelCompilationStatus status; - bool null_safety; - char* error; - uint8_t* kernel; - intptr_t kernel_size; -} Dart_KernelCompilationResult; - -typedef enum { - Dart_KernelCompilationVerbosityLevel_Error = 0, - Dart_KernelCompilationVerbosityLevel_Warning, - Dart_KernelCompilationVerbosityLevel_Info, - Dart_KernelCompilationVerbosityLevel_All, -} Dart_KernelCompilationVerbosityLevel; - -DART_EXPORT bool Dart_IsKernelIsolate(Dart_Isolate isolate); -DART_EXPORT bool Dart_KernelIsolateIsRunning(); -DART_EXPORT Dart_Port Dart_KernelPort(); - -/** - * Compiles the given `script_uri` to a kernel file. - * - * \param platform_kernel A buffer containing the kernel of the platform (e.g. - * `vm_platform_strong.dill`). The VM does not take ownership of this memory. - * - * \param platform_kernel_size The length of the platform_kernel buffer. - * - * \param snapshot_compile Set to `true` when the compilation is for a snapshot. - * This is used by the frontend to determine if compilation related information - * should be printed to console (e.g., null safety mode). - * - * \param verbosity Specifies the logging behavior of the kernel compilation - * service. - * - * \return Returns the result of the compilation. - * - * On a successful compilation the returned [Dart_KernelCompilationResult] has - * a status of [Dart_KernelCompilationStatus_Ok] and the `kernel`/`kernel_size` - * fields are set. The caller takes ownership of the malloc()ed buffer. - * - * On a failed compilation the `error` might be set describing the reason for - * the failed compilation. The caller takes ownership of the malloc()ed - * error. - * - * Requires there to be a current isolate. - */ -DART_EXPORT Dart_KernelCompilationResult -Dart_CompileToKernel(const char* script_uri, - const uint8_t* platform_kernel, - const intptr_t platform_kernel_size, - bool incremental_compile, - bool snapshot_compile, - const char* package_config, - Dart_KernelCompilationVerbosityLevel verbosity); - -typedef struct { - const char* uri; - const char* source; -} Dart_SourceFile; - -DART_EXPORT Dart_KernelCompilationResult Dart_KernelListDependencies(); - -/** - * Sets the kernel buffer which will be used to load Dart SDK sources - * dynamically at runtime. - * - * \param platform_kernel A buffer containing kernel which has sources for the - * Dart SDK populated. Note: The VM does not take ownership of this memory. - * - * \param platform_kernel_size The length of the platform_kernel buffer. - */ -DART_EXPORT void Dart_SetDartLibrarySourcesKernel( - const uint8_t* platform_kernel, - const intptr_t platform_kernel_size); - -/** - * Detect the null safety opt-in status. - * - * When running from source, it is based on the opt-in status of `script_uri`. - * When running from a kernel buffer, it is based on the mode used when - * generating `kernel_buffer`. - * When running from an appJIT or AOT snapshot, it is based on the mode used - * when generating `snapshot_data`. - * - * \param script_uri Uri of the script that contains the source code - * - * \param package_config Uri of the package configuration file (either in format - * of .packages or .dart_tool/package_config.json) for the null safety - * detection to resolve package imports against. If this parameter is not - * passed the package resolution of the parent isolate should be used. - * - * \param original_working_directory current working directory when the VM - * process was launched, this is used to correctly resolve the path specified - * for package_config. - * - * \param snapshot_data - * - * \param snapshot_instructions Buffers containing a snapshot of the - * isolate or NULL if no snapshot is provided. If provided, the buffers must - * remain valid until the isolate shuts down. - * - * \param kernel_buffer - * - * \param kernel_buffer_size A buffer which contains a kernel/DIL program. Must - * remain valid until isolate shutdown. - * - * \return Returns true if the null safety is opted in by the input being - * run `script_uri`, `snapshot_data` or `kernel_buffer`. - * - */ -DART_EXPORT bool Dart_DetectNullSafety(const char* script_uri, - const char* package_config, - const char* original_working_directory, - const uint8_t* snapshot_data, - const uint8_t* snapshot_instructions, - const uint8_t* kernel_buffer, - intptr_t kernel_buffer_size); - -#define DART_KERNEL_ISOLATE_NAME "kernel-service" - -/* - * ======= - * Service - * ======= - */ - -#define DART_VM_SERVICE_ISOLATE_NAME "vm-service" - -/** - * Returns true if isolate is the service isolate. - * - * \param isolate An isolate - * - * \return Returns true if 'isolate' is the service isolate. - */ -DART_EXPORT bool Dart_IsServiceIsolate(Dart_Isolate isolate); - -/** - * Writes the CPU profile to the timeline as a series of 'instant' events. - * - * Note that this is an expensive operation. - * - * \param main_port The main port of the Isolate whose profile samples to write. - * \param error An optional error, must be free()ed by caller. - * - * \return Returns true if the profile is successfully written and false - * otherwise. - */ -DART_EXPORT bool Dart_WriteProfileToTimeline(Dart_Port main_port, char** error); - -/* - * ============== - * Precompilation - * ============== - */ - -/** - * Compiles all functions reachable from entry points and marks - * the isolate to disallow future compilation. - * - * Entry points should be specified using `@pragma("vm:entry-point")` - * annotation. - * - * \return An error handle if a compilation error or runtime error running const - * constructors was encountered. - */ -DART_EXPORT Dart_Handle Dart_Precompile(); - -typedef void (*Dart_CreateLoadingUnitCallback)( - void* callback_data, - intptr_t loading_unit_id, - void** write_callback_data, - void** write_debug_callback_data); -typedef void (*Dart_StreamingWriteCallback)(void* callback_data, - const uint8_t* buffer, - intptr_t size); -typedef void (*Dart_StreamingCloseCallback)(void* callback_data); - -DART_EXPORT Dart_Handle Dart_LoadingUnitLibraryUris(intptr_t loading_unit_id); - -// On Darwin systems, 'dlsym' adds an '_' to the beginning of the symbol name. -// Use the '...CSymbol' definitions for resolving through 'dlsym'. The actual -// symbol names in the objects are given by the '...AsmSymbol' definitions. -#if defined(__APPLE__) -#define kSnapshotBuildIdCSymbol "kDartSnapshotBuildId" -#define kVmSnapshotDataCSymbol "kDartVmSnapshotData" -#define kVmSnapshotInstructionsCSymbol "kDartVmSnapshotInstructions" -#define kVmSnapshotBssCSymbol "kDartVmSnapshotBss" -#define kIsolateSnapshotDataCSymbol "kDartIsolateSnapshotData" -#define kIsolateSnapshotInstructionsCSymbol "kDartIsolateSnapshotInstructions" -#define kIsolateSnapshotBssCSymbol "kDartIsolateSnapshotBss" -#else -#define kSnapshotBuildIdCSymbol "_kDartSnapshotBuildId" -#define kVmSnapshotDataCSymbol "_kDartVmSnapshotData" -#define kVmSnapshotInstructionsCSymbol "_kDartVmSnapshotInstructions" -#define kVmSnapshotBssCSymbol "_kDartVmSnapshotBss" -#define kIsolateSnapshotDataCSymbol "_kDartIsolateSnapshotData" -#define kIsolateSnapshotInstructionsCSymbol "_kDartIsolateSnapshotInstructions" -#define kIsolateSnapshotBssCSymbol "_kDartIsolateSnapshotBss" -#endif - -#define kSnapshotBuildIdAsmSymbol "_kDartSnapshotBuildId" -#define kVmSnapshotDataAsmSymbol "_kDartVmSnapshotData" -#define kVmSnapshotInstructionsAsmSymbol "_kDartVmSnapshotInstructions" -#define kVmSnapshotBssAsmSymbol "_kDartVmSnapshotBss" -#define kIsolateSnapshotDataAsmSymbol "_kDartIsolateSnapshotData" -#define kIsolateSnapshotInstructionsAsmSymbol \ - "_kDartIsolateSnapshotInstructions" -#define kIsolateSnapshotBssAsmSymbol "_kDartIsolateSnapshotBss" - -/** - * Creates a precompiled snapshot. - * - A root library must have been loaded. - * - Dart_Precompile must have been called. - * - * Outputs an assembly file defining the symbols listed in the definitions - * above. - * - * The assembly should be compiled as a static or shared library and linked or - * loaded by the embedder. Running this snapshot requires a VM compiled with - * DART_PRECOMPILED_SNAPSHOT. The kDartVmSnapshotData and - * kDartVmSnapshotInstructions should be passed to Dart_Initialize. The - * kDartIsolateSnapshotData and kDartIsolateSnapshotInstructions should be - * passed to Dart_CreateIsolateGroup. - * - * The callback will be invoked one or more times to provide the assembly code. - * - * If stripped is true, then the assembly code will not include DWARF - * debugging sections. - * - * If debug_callback_data is provided, debug_callback_data will be used with - * the callback to provide separate debugging information. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateAppAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback, - void* callback_data, - bool stripped, - void* debug_callback_data); -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateAppAOTSnapshotAsAssemblies( - Dart_CreateLoadingUnitCallback next_callback, - void* next_callback_data, - bool stripped, - Dart_StreamingWriteCallback write_callback, - Dart_StreamingCloseCallback close_callback); - -/** - * Creates a precompiled snapshot. - * - A root library must have been loaded. - * - Dart_Precompile must have been called. - * - * Outputs an ELF shared library defining the symbols - * - _kDartVmSnapshotData - * - _kDartVmSnapshotInstructions - * - _kDartIsolateSnapshotData - * - _kDartIsolateSnapshotInstructions - * - * The shared library should be dynamically loaded by the embedder. - * Running this snapshot requires a VM compiled with DART_PRECOMPILED_SNAPSHOT. - * The kDartVmSnapshotData and kDartVmSnapshotInstructions should be passed to - * Dart_Initialize. The kDartIsolateSnapshotData and - * kDartIsolateSnapshotInstructions should be passed to Dart_CreateIsolate. - * - * The callback will be invoked one or more times to provide the binary output. - * - * If stripped is true, then the binary output will not include DWARF - * debugging sections. - * - * If debug_callback_data is provided, debug_callback_data will be used with - * the callback to provide separate debugging information. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateAppAOTSnapshotAsElf(Dart_StreamingWriteCallback callback, - void* callback_data, - bool stripped, - void* debug_callback_data); -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateAppAOTSnapshotAsElfs(Dart_CreateLoadingUnitCallback next_callback, - void* next_callback_data, - bool stripped, - Dart_StreamingWriteCallback write_callback, - Dart_StreamingCloseCallback close_callback); - -/** - * Like Dart_CreateAppAOTSnapshotAsAssembly, but only includes - * kDartVmSnapshotData and kDartVmSnapshotInstructions. It also does - * not strip DWARF information from the generated assembly or allow for - * separate debug information. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateVMAOTSnapshotAsAssembly(Dart_StreamingWriteCallback callback, - void* callback_data); - -/** - * Sorts the class-ids in depth first traversal order of the inheritance - * tree. This is a costly operation, but it can make method dispatch - * more efficient and is done before writing snapshots. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_SortClasses(); - -/** - * Creates a snapshot that caches compiled code and type feedback for faster - * startup and quicker warmup in a subsequent process. - * - * Outputs a snapshot in two pieces. The pieces should be passed to - * Dart_CreateIsolateGroup in a VM using the same VM snapshot pieces used in the - * current VM. The instructions piece must be loaded with read and execute - * permissions; the data piece may be loaded as read-only. - * - * - Requires the VM to have not been started with --precompilation. - * - Not supported when targeting IA32. - * - The VM writing the snapshot and the VM reading the snapshot must be the - * same version, must be built in the same DEBUG/RELEASE/PRODUCT mode, must - * be targeting the same architecture, and must both be in checked mode or - * both in unchecked mode. - * - * The buffers are scope allocated and are only valid until the next call to - * Dart_ExitScope. - * - * \return A valid handle if no error occurs during the operation. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateAppJITSnapshotAsBlobs(uint8_t** isolate_snapshot_data_buffer, - intptr_t* isolate_snapshot_data_size, - uint8_t** isolate_snapshot_instructions_buffer, - intptr_t* isolate_snapshot_instructions_size); - -/** - * Like Dart_CreateAppJITSnapshotAsBlobs, but also creates a new VM snapshot. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_CreateCoreJITSnapshotAsBlobs( - uint8_t** vm_snapshot_data_buffer, - intptr_t* vm_snapshot_data_size, - uint8_t** vm_snapshot_instructions_buffer, - intptr_t* vm_snapshot_instructions_size, - uint8_t** isolate_snapshot_data_buffer, - intptr_t* isolate_snapshot_data_size, - uint8_t** isolate_snapshot_instructions_buffer, - intptr_t* isolate_snapshot_instructions_size); - -/** - * Get obfuscation map for precompiled code. - * - * Obfuscation map is encoded as a JSON array of pairs (original name, - * obfuscated name). - * - * \return Returns an error handler if the VM was built in a mode that does not - * support obfuscation. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle -Dart_GetObfuscationMap(uint8_t** buffer, intptr_t* buffer_length); - -/** - * Returns whether the VM only supports running from precompiled snapshots and - * not from any other kind of snapshot or from source (that is, the VM was - * compiled with DART_PRECOMPILED_RUNTIME). - */ -DART_EXPORT bool Dart_IsPrecompiledRuntime(); - -/** - * Print a native stack trace. Used for crash handling. - * - * If context is NULL, prints the current stack trace. Otherwise, context - * should be a CONTEXT* (Windows) or ucontext_t* (POSIX) from a signal handler - * running on the current thread. - */ -DART_EXPORT void Dart_DumpNativeStackTrace(void* context); - -/** - * Indicate that the process is about to abort, and the Dart VM should not - * attempt to cleanup resources. - */ -DART_EXPORT void Dart_PrepareToAbort(); - -#endif /* INCLUDE_DART_API_H_ */ /* NOLINT */ diff --git a/pkgs/cupertino_http/src/dart-sdk/include/dart_api_dl.c b/pkgs/cupertino_http/src/dart-sdk/include/dart_api_dl.c deleted file mode 100644 index c4a68f4449..0000000000 --- a/pkgs/cupertino_http/src/dart-sdk/include/dart_api_dl.c +++ /dev/null @@ -1,59 +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 "dart_api_dl.h" /* NOLINT */ -#include "dart_version.h" /* NOLINT */ -#include "internal/dart_api_dl_impl.h" /* NOLINT */ - -#include - -#define DART_API_DL_DEFINITIONS(name, R, A) name##_Type name##_DL = NULL; - -DART_API_ALL_DL_SYMBOLS(DART_API_DL_DEFINITIONS) - -#undef DART_API_DL_DEFINITIONS - -typedef void* DartApiEntry_function; - -DartApiEntry_function FindFunctionPointer(const DartApiEntry* entries, - const char* name) { - while (entries->name != NULL) { - if (strcmp(entries->name, name) == 0) return entries->function; - entries++; - } - return NULL; -} - -intptr_t Dart_InitializeApiDL(void* data) { - DartApi* dart_api_data = (DartApi*)data; - - if (dart_api_data->major != DART_API_DL_MAJOR_VERSION) { - // If the DartVM we're running on does not have the same version as this - // file was compiled against, refuse to initialize. The symbols are not - // compatible. - return -1; - } - // Minor versions are allowed to be different. - // If the DartVM has a higher minor version, it will provide more symbols - // than we initialize here. - // If the DartVM has a lower minor version, it will not provide all symbols. - // In that case, we leave the missing symbols un-initialized. Those symbols - // should not be used by the Dart and native code. The client is responsible - // for checking the minor version number himself based on which symbols it - // is using. - // (If we would error out on this case, recompiling native code against a - // newer SDK would break all uses on older SDKs, which is too strict.) - - const DartApiEntry* dart_api_function_pointers = dart_api_data->functions; - -#define DART_API_DL_INIT(name, R, A) \ - name##_DL = \ - (name##_Type)(FindFunctionPointer(dart_api_function_pointers, #name)); - DART_API_ALL_DL_SYMBOLS(DART_API_DL_INIT) -#undef DART_API_DL_INIT - - return 0; -} diff --git a/pkgs/cupertino_http/src/dart-sdk/include/dart_api_dl.h b/pkgs/cupertino_http/src/dart-sdk/include/dart_api_dl.h deleted file mode 100644 index 62f48b63f6..0000000000 --- a/pkgs/cupertino_http/src/dart-sdk/include/dart_api_dl.h +++ /dev/null @@ -1,150 +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. - */ - -#ifndef RUNTIME_INCLUDE_DART_API_DL_H_ -#define RUNTIME_INCLUDE_DART_API_DL_H_ - -#include "dart_api.h" /* NOLINT */ -#include "dart_native_api.h" /* NOLINT */ - -/** \mainpage Dynamically Linked Dart API - * - * This exposes a subset of symbols from dart_api.h and dart_native_api.h - * available in every Dart embedder through dynamic linking. - * - * All symbols are postfixed with _DL to indicate that they are dynamically - * linked and to prevent conflicts with the original symbol. - * - * Link `dart_api_dl.c` file into your library and invoke - * `Dart_InitializeApiDL` with `NativeApi.initializeApiDLData`. - */ - -DART_EXPORT intptr_t Dart_InitializeApiDL(void* data); - -// ============================================================================ -// IMPORTANT! Never update these signatures without properly updating -// DART_API_DL_MAJOR_VERSION and DART_API_DL_MINOR_VERSION. -// -// Verbatim copy of `dart_native_api.h` and `dart_api.h` symbol names and types -// to trigger compile-time errors if the sybols in those files are updated -// without updating these. -// -// Function return and argument types, and typedefs are carbon copied. Structs -// are typechecked nominally in C/C++, so they are not copied, instead a -// comment is added to their definition. -typedef int64_t Dart_Port_DL; - -typedef void (*Dart_NativeMessageHandler_DL)(Dart_Port_DL dest_port_id, - Dart_CObject* message); - -// dart_native_api.h symbols can be called on any thread. -#define DART_NATIVE_API_DL_SYMBOLS(F) \ - /***** dart_native_api.h *****/ \ - /* Dart_Port */ \ - F(Dart_PostCObject, bool, (Dart_Port_DL port_id, Dart_CObject * message)) \ - F(Dart_PostInteger, bool, (Dart_Port_DL port_id, int64_t message)) \ - F(Dart_NewNativePort, Dart_Port_DL, \ - (const char* name, Dart_NativeMessageHandler_DL handler, \ - bool handle_concurrently)) \ - F(Dart_CloseNativePort, bool, (Dart_Port_DL native_port_id)) - -// dart_api.h symbols can only be called on Dart threads. -#define DART_API_DL_SYMBOLS(F) \ - /***** dart_api.h *****/ \ - /* Errors */ \ - F(Dart_IsError, bool, (Dart_Handle handle)) \ - F(Dart_IsApiError, bool, (Dart_Handle handle)) \ - F(Dart_IsUnhandledExceptionError, bool, (Dart_Handle handle)) \ - F(Dart_IsCompilationError, bool, (Dart_Handle handle)) \ - F(Dart_IsFatalError, bool, (Dart_Handle handle)) \ - F(Dart_GetError, const char*, (Dart_Handle handle)) \ - F(Dart_ErrorHasException, bool, (Dart_Handle handle)) \ - F(Dart_ErrorGetException, Dart_Handle, (Dart_Handle handle)) \ - F(Dart_ErrorGetStackTrace, Dart_Handle, (Dart_Handle handle)) \ - F(Dart_NewApiError, Dart_Handle, (const char* error)) \ - F(Dart_NewCompilationError, Dart_Handle, (const char* error)) \ - F(Dart_NewUnhandledExceptionError, Dart_Handle, (Dart_Handle exception)) \ - F(Dart_PropagateError, void, (Dart_Handle handle)) \ - /* Dart_Handle, Dart_PersistentHandle, Dart_WeakPersistentHandle */ \ - F(Dart_HandleFromPersistent, Dart_Handle, (Dart_PersistentHandle object)) \ - F(Dart_HandleFromWeakPersistent, Dart_Handle, \ - (Dart_WeakPersistentHandle object)) \ - F(Dart_NewPersistentHandle, Dart_PersistentHandle, (Dart_Handle object)) \ - F(Dart_SetPersistentHandle, void, \ - (Dart_PersistentHandle obj1, Dart_Handle obj2)) \ - F(Dart_DeletePersistentHandle, void, (Dart_PersistentHandle object)) \ - F(Dart_NewWeakPersistentHandle, Dart_WeakPersistentHandle, \ - (Dart_Handle object, void* peer, intptr_t external_allocation_size, \ - Dart_HandleFinalizer callback)) \ - F(Dart_DeleteWeakPersistentHandle, void, (Dart_WeakPersistentHandle object)) \ - F(Dart_UpdateExternalSize, void, \ - (Dart_WeakPersistentHandle object, intptr_t external_allocation_size)) \ - F(Dart_NewFinalizableHandle, Dart_FinalizableHandle, \ - (Dart_Handle object, void* peer, intptr_t external_allocation_size, \ - Dart_HandleFinalizer callback)) \ - F(Dart_DeleteFinalizableHandle, void, \ - (Dart_FinalizableHandle object, Dart_Handle strong_ref_to_object)) \ - F(Dart_UpdateFinalizableExternalSize, void, \ - (Dart_FinalizableHandle object, Dart_Handle strong_ref_to_object, \ - intptr_t external_allocation_size)) \ - /* Dart_Port */ \ - F(Dart_Post, bool, (Dart_Port_DL port_id, Dart_Handle object)) \ - F(Dart_NewSendPort, Dart_Handle, (Dart_Port_DL port_id)) \ - F(Dart_SendPortGetId, Dart_Handle, \ - (Dart_Handle port, Dart_Port_DL * port_id)) \ - /* Scopes */ \ - F(Dart_EnterScope, void, ()) \ - F(Dart_ExitScope, void, ()) - -#define DART_API_ALL_DL_SYMBOLS(F) \ - DART_NATIVE_API_DL_SYMBOLS(F) \ - DART_API_DL_SYMBOLS(F) -// IMPORTANT! Never update these signatures without properly updating -// DART_API_DL_MAJOR_VERSION and DART_API_DL_MINOR_VERSION. -// -// End of verbatim copy. -// ============================================================================ - -// Copy of definition of DART_EXPORT without 'used' attribute. -// -// The 'used' attribute cannot be used with DART_API_ALL_DL_SYMBOLS because -// they are not function declarations, but variable declarations with a -// function pointer type. -// -// The function pointer variables are initialized with the addresses of the -// functions in the VM. If we were to use function declarations instead, we -// would need to forward the call to the VM adding indirection. -#if defined(__CYGWIN__) -#error Tool chain and platform not supported. -#elif defined(_WIN32) -#if defined(DART_SHARED_LIB) -#define DART_EXPORT_DL DART_EXTERN_C __declspec(dllexport) -#else -#define DART_EXPORT_DL DART_EXTERN_C -#endif -#else -#if __GNUC__ >= 4 -#if defined(DART_SHARED_LIB) -#define DART_EXPORT_DL DART_EXTERN_C __attribute__((visibility("default"))) -#else -#define DART_EXPORT_DL DART_EXTERN_C -#endif -#else -#error Tool chain not supported. -#endif -#endif - -#define DART_API_DL_DECLARATIONS(name, R, A) \ - typedef R(*name##_Type) A; \ - DART_EXPORT_DL name##_Type name##_DL; - -DART_API_ALL_DL_SYMBOLS(DART_API_DL_DECLARATIONS) - -#undef DART_API_DL_DECLARATIONS - -#undef DART_EXPORT_DL - -#endif /* RUNTIME_INCLUDE_DART_API_DL_H_ */ /* NOLINT */ \ No newline at end of file diff --git a/pkgs/cupertino_http/src/dart-sdk/include/dart_native_api.h b/pkgs/cupertino_http/src/dart-sdk/include/dart_native_api.h deleted file mode 100644 index f99fff1150..0000000000 --- a/pkgs/cupertino_http/src/dart-sdk/include/dart_native_api.h +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Copyright (c) 2013, 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 RUNTIME_INCLUDE_DART_NATIVE_API_H_ -#define RUNTIME_INCLUDE_DART_NATIVE_API_H_ - -#include "dart_api.h" /* NOLINT */ - -/* - * ========================================== - * Message sending/receiving from native code - * ========================================== - */ - -/** - * A Dart_CObject is used for representing Dart objects as native C - * data outside the Dart heap. These objects are totally detached from - * the Dart heap. Only a subset of the Dart objects have a - * representation as a Dart_CObject. - * - * The string encoding in the 'value.as_string' is UTF-8. - * - * All the different types from dart:typed_data are exposed as type - * kTypedData. The specific type from dart:typed_data is in the type - * field of the as_typed_data structure. The length in the - * as_typed_data structure is always in bytes. - * - * The data for kTypedData is copied on message send and ownership remains with - * the caller. The ownership of data for kExternalTyped is passed to the VM on - * message send and returned when the VM invokes the - * Dart_HandleFinalizer callback; a non-NULL callback must be provided. - */ -typedef enum { - Dart_CObject_kNull = 0, - Dart_CObject_kBool, - Dart_CObject_kInt32, - Dart_CObject_kInt64, - Dart_CObject_kDouble, - Dart_CObject_kString, - Dart_CObject_kArray, - Dart_CObject_kTypedData, - Dart_CObject_kExternalTypedData, - Dart_CObject_kSendPort, - Dart_CObject_kCapability, - Dart_CObject_kNativePointer, - Dart_CObject_kUnsupported, - Dart_CObject_kNumberOfTypes -} Dart_CObject_Type; - -typedef struct _Dart_CObject { - Dart_CObject_Type type; - union { - bool as_bool; - int32_t as_int32; - int64_t as_int64; - double as_double; - char* as_string; - struct { - Dart_Port id; - Dart_Port origin_id; - } as_send_port; - struct { - int64_t id; - } as_capability; - struct { - intptr_t length; - struct _Dart_CObject** values; - } as_array; - struct { - Dart_TypedData_Type type; - intptr_t length; /* in elements, not bytes */ - uint8_t* values; - } as_typed_data; - struct { - Dart_TypedData_Type type; - intptr_t length; /* in elements, not bytes */ - uint8_t* data; - void* peer; - Dart_HandleFinalizer callback; - } as_external_typed_data; - struct { - intptr_t ptr; - intptr_t size; - Dart_HandleFinalizer callback; - } as_native_pointer; - } value; -} Dart_CObject; -// This struct is versioned by DART_API_DL_MAJOR_VERSION, bump the version when -// changing this struct. - -/** - * Posts a message on some port. The message will contain the Dart_CObject - * object graph rooted in 'message'. - * - * While the message is being sent the state of the graph of Dart_CObject - * structures rooted in 'message' should not be accessed, as the message - * generation will make temporary modifications to the data. When the message - * has been sent the graph will be fully restored. - * - * If true is returned, the message was enqueued, and finalizers for external - * typed data will eventually run, even if the receiving isolate shuts down - * before processing the message. If false is returned, the message was not - * enqueued and ownership of external typed data in the message remains with the - * caller. - * - * This function may be called on any thread when the VM is running (that is, - * after Dart_Initialize has returned and before Dart_Cleanup has been called). - * - * \param port_id The destination port. - * \param message The message to send. - * - * \return True if the message was posted. - */ -DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message); - -/** - * Posts a message on some port. The message will contain the integer 'message'. - * - * \param port_id The destination port. - * \param message The message to send. - * - * \return True if the message was posted. - */ -DART_EXPORT bool Dart_PostInteger(Dart_Port port_id, int64_t message); - -/** - * A native message handler. - * - * This handler is associated with a native port by calling - * Dart_NewNativePort. - * - * The message received is decoded into the message structure. The - * lifetime of the message data is controlled by the caller. All the - * data references from the message are allocated by the caller and - * will be reclaimed when returning to it. - */ -typedef void (*Dart_NativeMessageHandler)(Dart_Port dest_port_id, - Dart_CObject* message); - -/** - * Creates a new native port. When messages are received on this - * native port, then they will be dispatched to the provided native - * message handler. - * - * \param name The name of this port in debugging messages. - * \param handler The C handler to run when messages arrive on the port. - * \param handle_concurrently Is it okay to process requests on this - * native port concurrently? - * - * \return If successful, returns the port id for the native port. In - * case of error, returns ILLEGAL_PORT. - */ -DART_EXPORT Dart_Port Dart_NewNativePort(const char* name, - Dart_NativeMessageHandler handler, - bool handle_concurrently); -/* TODO(turnidge): Currently handle_concurrently is ignored. */ - -/** - * Closes the native port with the given id. - * - * The port must have been allocated by a call to Dart_NewNativePort. - * - * \param native_port_id The id of the native port to close. - * - * \return Returns true if the port was closed successfully. - */ -DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id); - -/* - * ================== - * Verification Tools - * ================== - */ - -/** - * Forces all loaded classes and functions to be compiled eagerly in - * the current isolate.. - * - * TODO(turnidge): Document. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_CompileAll(); - -/** - * Finalizes all classes. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_FinalizeAllClasses(); - -/* This function is intentionally undocumented. - * - * It should not be used outside internal tests. - */ -DART_EXPORT void* Dart_ExecuteInternalCommand(const char* command, void* arg); - -#endif /* INCLUDE_DART_NATIVE_API_H_ */ /* NOLINT */ diff --git a/pkgs/cupertino_http/src/dart-sdk/include/dart_tools_api.h b/pkgs/cupertino_http/src/dart-sdk/include/dart_tools_api.h deleted file mode 100644 index f36ec6b561..0000000000 --- a/pkgs/cupertino_http/src/dart-sdk/include/dart_tools_api.h +++ /dev/null @@ -1,526 +0,0 @@ -// Copyright (c) 2011, 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 RUNTIME_INCLUDE_DART_TOOLS_API_H_ -#define RUNTIME_INCLUDE_DART_TOOLS_API_H_ - -#include "dart_api.h" /* NOLINT */ - -/** \mainpage Dart Tools Embedding API Reference - * - * This reference describes the Dart embedding API for tools. Tools include - * a debugger, service protocol, and timeline. - * - * NOTE: The APIs described in this file are unstable and subject to change. - * - * This reference is generated from the header include/dart_tools_api.h. - */ - -/* - * ======== - * Debugger - * ======== - */ - -/** - * ILLEGAL_ISOLATE_ID is a number guaranteed never to be associated with a - * valid isolate. - */ -#define ILLEGAL_ISOLATE_ID ILLEGAL_PORT - - -/* - * ======= - * Service - * ======= - */ - -/** - * A service request callback function. - * - * These callbacks, registered by the embedder, are called when the VM receives - * a service request it can't handle and the service request command name - * matches one of the embedder registered handlers. - * - * The return value of the callback indicates whether the response - * should be used as a regular result or an error result. - * Specifically, if the callback returns true, a regular JSON-RPC - * response is built in the following way: - * - * { - * "jsonrpc": "2.0", - * "result": , - * "id": , - * } - * - * If the callback returns false, a JSON-RPC error is built like this: - * - * { - * "jsonrpc": "2.0", - * "error": , - * "id": , - * } - * - * \param method The rpc method name. - * \param param_keys Service requests can have key-value pair parameters. The - * keys and values are flattened and stored in arrays. - * \param param_values The values associated with the keys. - * \param num_params The length of the param_keys and param_values arrays. - * \param user_data The user_data pointer registered with this handler. - * \param result A C string containing a valid JSON object. The returned - * pointer will be freed by the VM by calling free. - * - * \return True if the result is a regular JSON-RPC response, false if the - * result is a JSON-RPC error. - */ -typedef bool (*Dart_ServiceRequestCallback)(const char* method, - const char** param_keys, - const char** param_values, - intptr_t num_params, - void* user_data, - const char** json_object); - -/** - * Register a Dart_ServiceRequestCallback to be called to handle - * requests for the named rpc on a specific isolate. The callback will - * be invoked with the current isolate set to the request target. - * - * \param method The name of the method that this callback is responsible for. - * \param callback The callback to invoke. - * \param user_data The user data passed to the callback. - * - * NOTE: If multiple callbacks with the same name are registered, only - * the last callback registered will be remembered. - */ -DART_EXPORT void Dart_RegisterIsolateServiceRequestCallback( - const char* method, - Dart_ServiceRequestCallback callback, - void* user_data); - -/** - * Register a Dart_ServiceRequestCallback to be called to handle - * requests for the named rpc. The callback will be invoked without a - * current isolate. - * - * \param method The name of the command that this callback is responsible for. - * \param callback The callback to invoke. - * \param user_data The user data passed to the callback. - * - * NOTE: If multiple callbacks with the same name are registered, only - * the last callback registered will be remembered. - */ -DART_EXPORT void Dart_RegisterRootServiceRequestCallback( - const char* method, - Dart_ServiceRequestCallback callback, - void* user_data); - -/** - * Embedder information which can be requested by the VM for internal or - * reporting purposes. - * - * The pointers in this structure are not going to be cached or freed by the VM. - */ - - #define DART_EMBEDDER_INFORMATION_CURRENT_VERSION (0x00000001) - -typedef struct { - int32_t version; - const char* name; // [optional] The name of the embedder - int64_t current_rss; // [optional] the current RSS of the embedder - int64_t max_rss; // [optional] the maximum RSS of the embedder -} Dart_EmbedderInformation; - -/** - * Callback provided by the embedder that is used by the vm to request - * information. - * - * \return Returns a pointer to a Dart_EmbedderInformation structure. - * The embedder keeps the ownership of the structure and any field in it. - * The embedder must ensure that the structure will remain valid until the - * next invokation of the callback. - */ -typedef void (*Dart_EmbedderInformationCallback)( - Dart_EmbedderInformation* info); - -/** - * Register a Dart_ServiceRequestCallback to be called to handle - * requests for the named rpc. The callback will be invoked without a - * current isolate. - * - * \param method The name of the command that this callback is responsible for. - * \param callback The callback to invoke. - * \param user_data The user data passed to the callback. - * - * NOTE: If multiple callbacks with the same name are registered, only - * the last callback registered will be remembered. - */ -DART_EXPORT void Dart_SetEmbedderInformationCallback( - Dart_EmbedderInformationCallback callback); - -/** - * Invoke a vm-service method and wait for its result. - * - * \param request_json The utf8-encoded json-rpc request. - * \param request_json_length The length of the json-rpc request. - * - * \param response_json The returned utf8-encoded json response, must be - * free()ed by caller. - * \param response_json_length The length of the returned json response. - * \param error An optional error, must be free()ed by caller. - * - * \return Whether the call was sucessfully performed. - * - * NOTE: This method does not need a current isolate and must not have the - * vm-isolate being the current isolate. It must be called after - * Dart_Initialize() and before Dart_Cleanup(). - */ -DART_EXPORT bool Dart_InvokeVMServiceMethod(uint8_t* request_json, - intptr_t request_json_length, - uint8_t** response_json, - intptr_t* response_json_length, - char** error); - -/* - * ======== - * Event Streams - * ======== - */ - -/** - * A callback invoked when the VM service gets a request to listen to - * some stream. - * - * \return Returns true iff the embedder supports the named stream id. - */ -typedef bool (*Dart_ServiceStreamListenCallback)(const char* stream_id); - -/** - * A callback invoked when the VM service gets a request to cancel - * some stream. - */ -typedef void (*Dart_ServiceStreamCancelCallback)(const char* stream_id); - -/** - * Adds VM service stream callbacks. - * - * \param listen_callback A function pointer to a listen callback function. - * A listen callback function should not be already set when this function - * is called. A NULL value removes the existing listen callback function - * if any. - * - * \param cancel_callback A function pointer to a cancel callback function. - * A cancel callback function should not be already set when this function - * is called. A NULL value removes the existing cancel callback function - * if any. - * - * \return Success if the callbacks were added. Otherwise, returns an - * error handle. - */ -DART_EXPORT char* Dart_SetServiceStreamCallbacks( - Dart_ServiceStreamListenCallback listen_callback, - Dart_ServiceStreamCancelCallback cancel_callback); - -/** - * A callback invoked when the VM service receives an event. - */ -typedef void (*Dart_NativeStreamConsumer)(const uint8_t* event_json, - intptr_t event_json_length); - -/** - * Sets the native VM service stream callbacks for a particular stream. - * Note: The function may be called on multiple threads concurrently. - * - * \param consumer A function pointer to an event handler callback function. - * A NULL value removes the existing listen callback function if any. - * - * \param stream_id The ID of the stream on which to set the callback. - */ -DART_EXPORT void Dart_SetNativeServiceStreamCallback( - Dart_NativeStreamConsumer consumer, - const char* stream_id); - -/** - * Sends a data event to clients of the VM Service. - * - * A data event is used to pass an array of bytes to subscribed VM - * Service clients. For example, in the standalone embedder, this is - * function used to provide WriteEvents on the Stdout and Stderr - * streams. - * - * If the embedder passes in a stream id for which no client is - * subscribed, then the event is ignored. - * - * \param stream_id The id of the stream on which to post the event. - * - * \param event_kind A string identifying what kind of event this is. - * For example, 'WriteEvent'. - * - * \param bytes A pointer to an array of bytes. - * - * \param bytes_length The length of the byte array. - * - * \return NULL if the arguments are well formed. Otherwise, returns an - * error string. The caller is responsible for freeing the error message. - */ -DART_EXPORT char* Dart_ServiceSendDataEvent(const char* stream_id, - const char* event_kind, - const uint8_t* bytes, - intptr_t bytes_length); - -/** - * Usage statistics for a space/generation at a particular moment in time. - * - * \param used Amount of memory used, in bytes. - * - * \param capacity Memory capacity, in bytes. - * - * \param external External memory, in bytes. - * - * \param collections How many times the garbage collector has run in this - * space. - * - * \param time Cumulative time spent collecting garbage in this space, in - * seconds. - * - * \param avg_collection_period Average time between garbage collector running - * in this space, in milliseconds. - */ -typedef struct { - intptr_t used; - intptr_t capacity; - intptr_t external; - intptr_t collections; - double time; - double avg_collection_period; -} Dart_GCStats; - -/** - * A Garbage Collection event with memory usage statistics. - * - * \param type The event type. Static lifetime. - * - * \param reason The reason for the GC event. Static lifetime. - * - * \param new_space Data for New Space. - * - * \param old_space Data for Old Space. - */ -typedef struct { - const char* type; - const char* reason; - const char* isolate_id; - - Dart_GCStats new_space; - Dart_GCStats old_space; -} Dart_GCEvent; - -/** - * A callback invoked when the VM emits a GC event. - * - * \param event The GC event data. Pointer only valid for the duration of the - * callback. - */ -typedef void (*Dart_GCEventCallback)(Dart_GCEvent* event); - -/** - * Sets the native GC event callback. - * - * \param callback A function pointer to an event handler callback function. - * A NULL value removes the existing listen callback function if any. - */ -DART_EXPORT void Dart_SetGCEventCallback(Dart_GCEventCallback callback); - -/* - * ======== - * Reload support - * ======== - * - * These functions are used to implement reloading in the Dart VM. - * This is an experimental feature, so embedders should be prepared - * for these functions to change. - */ - -/** - * A callback which determines whether the file at some url has been - * modified since some time. If the file cannot be found, true should - * be returned. - */ -typedef bool (*Dart_FileModifiedCallback)(const char* url, int64_t since); - -DART_EXPORT char* Dart_SetFileModifiedCallback( - Dart_FileModifiedCallback file_modified_callback); - -/** - * Returns true if isolate is currently reloading. - */ -DART_EXPORT bool Dart_IsReloading(); - -/* - * ======== - * Timeline - * ======== - */ - -/** - * Returns a timestamp in microseconds. This timestamp is suitable for - * passing into the timeline system, and uses the same monotonic clock - * as dart:developer's Timeline.now. - * - * \return A timestamp that can be passed to the timeline system. - */ -DART_EXPORT int64_t Dart_TimelineGetMicros(); - -/** - * Returns a raw timestamp in from the monotonic clock. - * - * \return A raw timestamp from the monotonic clock. - */ -DART_EXPORT int64_t Dart_TimelineGetTicks(); - -/** - * Returns the frequency of the monotonic clock. - * - * \return The frequency of the monotonic clock. - */ -DART_EXPORT int64_t Dart_TimelineGetTicksFrequency(); - -typedef enum { - Dart_Timeline_Event_Begin, // Phase = 'B'. - Dart_Timeline_Event_End, // Phase = 'E'. - Dart_Timeline_Event_Instant, // Phase = 'i'. - Dart_Timeline_Event_Duration, // Phase = 'X'. - Dart_Timeline_Event_Async_Begin, // Phase = 'b'. - Dart_Timeline_Event_Async_End, // Phase = 'e'. - Dart_Timeline_Event_Async_Instant, // Phase = 'n'. - Dart_Timeline_Event_Counter, // Phase = 'C'. - Dart_Timeline_Event_Flow_Begin, // Phase = 's'. - Dart_Timeline_Event_Flow_Step, // Phase = 't'. - Dart_Timeline_Event_Flow_End, // Phase = 'f'. -} Dart_Timeline_Event_Type; - -/** - * Add a timeline event to the embedder stream. - * - * \param label The name of the event. Its lifetime must extend at least until - * Dart_Cleanup. - * \param timestamp0 The first timestamp of the event. - * \param timestamp1_or_async_id The second timestamp of the event or - * the async id. - * \param argument_count The number of argument names and values. - * \param argument_names An array of names of the arguments. The lifetime of the - * names must extend at least until Dart_Cleanup. The array may be reclaimed - * when this call returns. - * \param argument_values An array of values of the arguments. The values and - * the array may be reclaimed when this call returns. - */ -DART_EXPORT void Dart_TimelineEvent(const char* label, - int64_t timestamp0, - int64_t timestamp1_or_async_id, - Dart_Timeline_Event_Type type, - intptr_t argument_count, - const char** argument_names, - const char** argument_values); - -/** - * Associates a name with the current thread. This name will be used to name - * threads in the timeline. Can only be called after a call to Dart_Initialize. - * - * \param name The name of the thread. - */ -DART_EXPORT void Dart_SetThreadName(const char* name); - -/* - * ======= - * Metrics - * ======= - */ - -/** - * Return metrics gathered for the VM and individual isolates. - * - * NOTE: Non-heap metrics are not available in PRODUCT builds of Dart. - * Calling the non-heap metric functions on a PRODUCT build might return invalid metrics. - */ -DART_EXPORT int64_t Dart_VMIsolateCountMetric(); // Counter -DART_EXPORT int64_t Dart_VMCurrentRSSMetric(); // Byte -DART_EXPORT int64_t Dart_VMPeakRSSMetric(); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapOldUsedMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapOldUsedMaxMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapOldCapacityMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapOldCapacityMaxMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapOldExternalMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapNewUsedMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapNewUsedMaxMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapNewCapacityMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapNewCapacityMaxMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapNewExternalMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapGlobalUsedMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateHeapGlobalUsedMaxMetric(Dart_Isolate isolate); // Byte -DART_EXPORT int64_t -Dart_IsolateRunnableLatencyMetric(Dart_Isolate isolate); // Microsecond -DART_EXPORT int64_t -Dart_IsolateRunnableHeapSizeMetric(Dart_Isolate isolate); // Byte - -/* - * ======== - * UserTags - * ======== - */ - -/* - * Gets the current isolate's currently set UserTag instance. - * - * \return The currently set UserTag instance. - */ -DART_EXPORT Dart_Handle Dart_GetCurrentUserTag(); - -/* - * Gets the current isolate's default UserTag instance. - * - * \return The default UserTag with label 'Default' - */ -DART_EXPORT Dart_Handle Dart_GetDefaultUserTag(); - -/* - * Creates a new UserTag instance. - * - * \param label The name of the new UserTag. - * - * \return The newly created UserTag instance or an error handle. - */ -DART_EXPORT Dart_Handle Dart_NewUserTag(const char* label); - -/* - * Updates the current isolate's UserTag to a new value. - * - * \param user_tag The UserTag to be set as the current UserTag. - * - * \return The previously set UserTag instance or an error handle. - */ -DART_EXPORT Dart_Handle Dart_SetCurrentUserTag(Dart_Handle user_tag); - -/* - * Returns the label of a given UserTag instance. - * - * \param user_tag The UserTag from which the label will be retrieved. - * - * \return The UserTag's label. NULL if the user_tag is invalid. The caller is - * responsible for freeing the returned label. - */ -DART_EXPORT DART_WARN_UNUSED_RESULT char* Dart_GetUserTagLabel( - Dart_Handle user_tag); - -#endif // RUNTIME_INCLUDE_DART_TOOLS_API_H_ diff --git a/pkgs/cupertino_http/src/dart-sdk/include/dart_version.h b/pkgs/cupertino_http/src/dart-sdk/include/dart_version.h deleted file mode 100644 index b3b4924392..0000000000 --- a/pkgs/cupertino_http/src/dart-sdk/include/dart_version.h +++ /dev/null @@ -1,16 +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. - */ - -#ifndef RUNTIME_INCLUDE_DART_VERSION_H_ -#define RUNTIME_INCLUDE_DART_VERSION_H_ - -// On breaking changes the major version is increased. -// On backwards compatible changes the minor version is increased. -// The versioning covers the symbols exposed in dart_api_dl.h -#define DART_API_DL_MAJOR_VERSION 2 -#define DART_API_DL_MINOR_VERSION 0 - -#endif /* RUNTIME_INCLUDE_DART_VERSION_H_ */ /* NOLINT */ diff --git a/pkgs/cupertino_http/src/dart-sdk/include/internal/dart_api_dl_impl.h b/pkgs/cupertino_http/src/dart-sdk/include/internal/dart_api_dl_impl.h deleted file mode 100644 index ad13a4b811..0000000000 --- a/pkgs/cupertino_http/src/dart-sdk/include/internal/dart_api_dl_impl.h +++ /dev/null @@ -1,21 +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. - */ - -#ifndef RUNTIME_INCLUDE_INTERNAL_DART_API_DL_IMPL_H_ -#define RUNTIME_INCLUDE_INTERNAL_DART_API_DL_IMPL_H_ - -typedef struct { - const char* name; - void (*function)(); -} DartApiEntry; - -typedef struct { - const int major; - const int minor; - const DartApiEntry* const functions; -} DartApi; - -#endif /* RUNTIME_INCLUDE_INTERNAL_DART_API_DL_IMPL_H_ */ /* NOLINT */ diff --git a/pkgs/http/pubspec.yaml b/pkgs/http/pubspec.yaml index 8c37cff9b1..06eb639ef4 100644 --- a/pkgs/http/pubspec.yaml +++ b/pkgs/http/pubspec.yaml @@ -9,7 +9,7 @@ topics: - protocols environment: - sdk: ^3.3.0 + sdk: ^3.4.0 dependencies: async: ^2.5.0 diff --git a/pkgs/http_client_conformance_tests/pubspec.yaml b/pkgs/http_client_conformance_tests/pubspec.yaml index ae2662b693..74d165e6f9 100644 --- a/pkgs/http_client_conformance_tests/pubspec.yaml +++ b/pkgs/http_client_conformance_tests/pubspec.yaml @@ -7,7 +7,7 @@ repository: https://github.com/dart-lang/http/tree/master/pkgs/http_client_confo publish_to: none environment: - sdk: ^3.2.0 + sdk: ^3.4.0 dependencies: async: ^2.8.2 diff --git a/pkgs/web_socket/pubspec.yaml b/pkgs/web_socket/pubspec.yaml index 9c0cab597f..57d243ed80 100644 --- a/pkgs/web_socket/pubspec.yaml +++ b/pkgs/web_socket/pubspec.yaml @@ -6,7 +6,7 @@ repository: https://github.com/dart-lang/http/tree/master/pkgs/web_socket version: 0.1.6 environment: - sdk: ^3.3.0 + sdk: ^3.4.0 dependencies: web: '>=0.5.0 <2.0.0' diff --git a/pkgs/web_socket_conformance_tests/bin/generate_server_wrappers.dart b/pkgs/web_socket_conformance_tests/bin/generate_server_wrappers.dart index 546d795688..045b7ba3f5 100644 --- a/pkgs/web_socket_conformance_tests/bin/generate_server_wrappers.dart +++ b/pkgs/web_socket_conformance_tests/bin/generate_server_wrappers.dart @@ -37,8 +37,8 @@ Future> startServer() async => spawnHybridUri(Uri( void main() async { final files = await Directory('lib/src').list().toList(); - final formatter = DartFormatter( - languageVersion: DartFormatter.latestLanguageVersion); + final formatter = + DartFormatter(languageVersion: DartFormatter.latestLanguageVersion); files.where((file) => file.path.endsWith('_server.dart')).forEach((file) { final vmPath = file.path.replaceAll('_server.dart', '_server_vm.dart'); diff --git a/pkgs/web_socket_conformance_tests/pubspec.yaml b/pkgs/web_socket_conformance_tests/pubspec.yaml index 84329c461e..d7b64f2e36 100644 --- a/pkgs/web_socket_conformance_tests/pubspec.yaml +++ b/pkgs/web_socket_conformance_tests/pubspec.yaml @@ -7,12 +7,12 @@ repository: https://github.com/dart-lang/http/tree/master/pkgs/web_socket_confor publish_to: none environment: - sdk: ^3.3.0 + sdk: ^3.4.0 dependencies: async: ^2.11.0 crypto: ^3.0.3 - dart_style: ^2.3.4 + dart_style: ^2.3.7 stream_channel: ^2.1.2 test: ^1.24.0 web_socket: ^0.1.0 diff --git a/tool/ci.sh b/tool/ci.sh index 864885d1fe..133b358da3 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Created with package:mono_repo v6.6.1 +# Created with package:mono_repo v6.6.2 # Support built in commands on windows out of the box.