From b2792e896e0891ee5e877815b0d9051d8497cdf0 Mon Sep 17 00:00:00 2001 From: Robert Bastian <4706271+robertbastian@users.noreply.github.com> Date: Tue, 23 Jan 2024 17:14:16 +0100 Subject: [PATCH] Diplomat bump: Dart native (#4514) --- .github/workflows/artifacts-build.yml | 50 ++ .github/workflows/build-test.yml | 2 + Cargo.lock | 8 +- Cargo.toml | 8 +- ffi/capi/bindings/dart/AnyCalendarKind.g.dart | 27 +- .../bindings/dart/Bcp47ToIanaMapper.g.dart | 24 +- ffi/capi/bindings/dart/Bidi.g.dart | 69 +- ffi/capi/bindings/dart/BidiInfo.g.dart | 42 +- ffi/capi/bindings/dart/BidiParagraph.g.dart | 69 +- ffi/capi/bindings/dart/Calendar.g.dart | 33 +- .../dart/CanonicalCombiningClassMap.g.dart | 24 +- .../bindings/dart/CanonicalComposition.g.dart | 24 +- .../dart/CanonicalDecomposition.g.dart | 24 +- ffi/capi/bindings/dart/CaseMapCloser.g.dart | 33 +- ffi/capi/bindings/dart/CaseMapper.g.dart | 114 ++-- .../bindings/dart/CodePointMapData16.g.dart | 51 +- .../bindings/dart/CodePointMapData8.g.dart | 132 ++-- .../dart/CodePointRangeIterator.g.dart | 15 +- .../bindings/dart/CodePointSetBuilder.g.dart | 150 ++--- .../bindings/dart/CodePointSetData.g.dart | 636 ++++++++---------- ffi/capi/bindings/dart/Collator.g.dart | 33 +- .../bindings/dart/ComposingNormalizer.g.dart | 42 +- ffi/capi/bindings/dart/CustomTimeZone.g.dart | 231 +++---- ffi/capi/bindings/dart/DataProvider.g.dart | 69 +- ffi/capi/bindings/dart/Date.g.dart | 150 ++--- ffi/capi/bindings/dart/DateFormatter.g.dart | 51 +- ffi/capi/bindings/dart/DateTime.g.dart | 213 +++--- .../bindings/dart/DateTimeFormatter.g.dart | 33 +- .../dart/DecomposingNormalizer.g.dart | 42 +- ffi/capi/bindings/dart/FixedDecimal.g.dart | 285 ++++---- .../dart/FixedDecimalFormatter.g.dart | 24 +- .../GeneralCategoryNameToMaskMapper.g.dart | 33 +- .../GraphemeClusterBreakIteratorLatin1.g.dart | 15 +- .../GraphemeClusterBreakIteratorUtf16.g.dart | 15 +- .../GraphemeClusterBreakIteratorUtf8.g.dart | 15 +- .../dart/GraphemeClusterSegmenter.g.dart | 24 +- .../dart/GregorianDateFormatter.g.dart | 33 +- .../dart/GregorianDateTimeFormatter.g.dart | 24 +- .../GregorianZonedDateTimeFormatter.g.dart | 33 +- .../bindings/dart/IanaToBcp47Mapper.g.dart | 15 +- ffi/capi/bindings/dart/IsoDate.g.dart | 132 ++-- ffi/capi/bindings/dart/IsoDateTime.g.dart | 213 +++--- .../dart/LineBreakIteratorLatin1.g.dart | 15 +- .../dart/LineBreakIteratorUtf16.g.dart | 15 +- .../dart/LineBreakIteratorUtf8.g.dart | 15 +- ffi/capi/bindings/dart/LineSegmenter.g.dart | 69 +- ffi/capi/bindings/dart/List.g.dart | 51 +- ffi/capi/bindings/dart/ListFormatter.g.dart | 42 +- ffi/capi/bindings/dart/Locale.g.dart | 141 ++-- .../bindings/dart/LocaleCanonicalizer.g.dart | 33 +- .../bindings/dart/LocaleDirectionality.g.dart | 51 +- .../dart/LocaleDisplayNamesFormatter.g.dart | 24 +- ffi/capi/bindings/dart/LocaleExpander.g.dart | 42 +- .../dart/LocaleFallbackIterator.g.dart | 24 +- .../bindings/dart/LocaleFallbacker.g.dart | 33 +- .../dart/LocaleFallbackerWithConfig.g.dart | 15 +- ffi/capi/bindings/dart/Logger.g.dart | 24 +- .../bindings/dart/MetazoneCalculator.g.dart | 15 +- ffi/capi/bindings/dart/PluralCategory.g.dart | 9 +- ffi/capi/bindings/dart/PluralOperands.g.dart | 15 +- ffi/capi/bindings/dart/PluralRules.g.dart | 42 +- .../dart/PropertyValueNameToEnumMapper.g.dart | 105 ++- .../bindings/dart/RegionDisplayNames.g.dart | 24 +- .../bindings/dart/ReorderedIndexMap.g.dart | 42 +- .../bindings/dart/ScriptExtensionsSet.g.dart | 33 +- .../bindings/dart/ScriptWithExtensions.g.dart | 51 +- .../dart/ScriptWithExtensionsBorrowed.g.dart | 42 +- .../dart/SentenceBreakIteratorLatin1.g.dart | 15 +- .../dart/SentenceBreakIteratorUtf16.g.dart | 15 +- .../dart/SentenceBreakIteratorUtf8.g.dart | 15 +- .../bindings/dart/SentenceSegmenter.g.dart | 24 +- ffi/capi/bindings/dart/Time.g.dart | 60 +- ffi/capi/bindings/dart/TimeFormatter.g.dart | 42 +- .../bindings/dart/TimeZoneFormatter.g.dart | 96 ++- ffi/capi/bindings/dart/TitlecaseMapper.g.dart | 24 +- .../bindings/dart/TitlecaseOptionsV1.g.dart | 9 +- ffi/capi/bindings/dart/UnicodeSetData.g.dart | 78 +-- ffi/capi/bindings/dart/WeekCalculator.g.dart | 42 +- .../dart/WordBreakIteratorLatin1.g.dart | 33 +- .../dart/WordBreakIteratorUtf16.g.dart | 33 +- .../dart/WordBreakIteratorUtf8.g.dart | 33 +- ffi/capi/bindings/dart/WordSegmenter.g.dart | 42 +- .../dart/ZonedDateTimeFormatter.g.dart | 42 +- ffi/capi/bindings/dart/lib.g.dart | 41 +- ffi/dart/.gitignore | 4 +- ffi/dart/Makefile | 21 - ffi/dart/build.dart | 30 + ffi/dart/lib/icu.dart | 8 +- ffi/dart/lib/src | 1 + ffi/dart/pubspec.yaml | 3 +- ffi/dart/test/icu_test.dart | 34 +- ffi/dart/tool/build_libs.dart | 153 +++++ tools/make/ffi.toml | 8 +- 93 files changed, 2585 insertions(+), 2553 deletions(-) delete mode 100644 ffi/dart/Makefile create mode 100644 ffi/dart/build.dart create mode 120000 ffi/dart/lib/src create mode 100644 ffi/dart/tool/build_libs.dart diff --git a/.github/workflows/artifacts-build.yml b/.github/workflows/artifacts-build.yml index 7f7c52b47d2..7849fc014bf 100644 --- a/.github/workflows/artifacts-build.yml +++ b/.github/workflows/artifacts-build.yml @@ -228,6 +228,8 @@ jobs: - name: Install Dart uses: dart-lang/setup-dart@v1 + with: + sdk: 3.3.0-279.1.beta - name: Build docs run: | @@ -707,3 +709,51 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v1 + + dart-libs: + name: "Build Dart binaries" + if: github.ref == 'refs/heads/main' && github.repository == 'unicode-org/icu4x' + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust toolchains + run: | + rustup toolchain install stable + - name: Show the selected Rust toolchain + run: rustup show + - uses: dart-lang/setup-dart@v1 + with: + sdk: 3.3.0-279.1.beta + + - name: Setup additional linkers + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get install gcc-aarch64-linux-gnu gcc-arm-linux-gnueabihf gcc-riscv64-linux-gnu gcc-i686-linux-gnu + echo "[target]" >> .cargo/config.toml + echo "aarch64-linux-android.linker=\"$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang\"" >> .cargo/config.toml + echo "armv7-linux-androideabi.linker=\"$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi30-clang\"" >> .cargo/config.toml + echo "i686-linux-android.linker=\"$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android30-clang\"" >> .cargo/config.toml + echo "x86_64-linux-android.linker=\"$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android30-clang\"" >> .cargo/config.toml + echo "riscv64-linux-android.linker=\"$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/riscv64-linux-android35-clang\"" >> .cargo/config.toml + echo "aarch64-unknown-linux-gnu.linker=\"aarch64-linux-gnu-gcc\"" >> .cargo/config.toml + echo "armv7-unknown-linux-gnueabihf.linker=\"arm-linux-gnueabihf-gcc\"" >> .cargo/config.toml + echo "riscv64gc-unknown-linux-gnu.linker=\"riscv64-linux-gnu-gcc\"" >> .cargo/config.toml + + - name: Build + run: | + cd ffi/dart + dart --enable-experiment=native-assets pub get + cd ../.. + dart run ffi/dart/tool/build_libs.dart bin + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: dart-${{matrix.os}}-libs + path: bin \ No newline at end of file diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 8a1748af4cc..da7882ea7b0 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -527,6 +527,8 @@ jobs: # Job-specific dependencies - uses: dart-lang/setup-dart@v1 + with: + sdk: 3.3.0-279.1.beta # Actual job - name: Run `cargo make ci-job-test-dart` diff --git a/Cargo.lock b/Cargo.lock index 1f71dd25f2b..17fe9dd7431 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -797,7 +797,7 @@ dependencies = [ [[package]] name = "diplomat" version = "0.7.0" -source = "git+https://github.com/rust-diplomat/diplomat.git?rev=8194def008d44fd0a36276976d5268df4e572a27#8194def008d44fd0a36276976d5268df4e572a27" +source = "git+https://github.com/rust-diplomat/diplomat.git?rev=2d647ac0b9b4c72a4f7e2b98a309cb944156877a#2d647ac0b9b4c72a4f7e2b98a309cb944156877a" dependencies = [ "diplomat_core", "proc-macro2", @@ -815,7 +815,7 @@ dependencies = [ [[package]] name = "diplomat-runtime" version = "0.7.0" -source = "git+https://github.com/rust-diplomat/diplomat.git?rev=8194def008d44fd0a36276976d5268df4e572a27#8194def008d44fd0a36276976d5268df4e572a27" +source = "git+https://github.com/rust-diplomat/diplomat.git?rev=2d647ac0b9b4c72a4f7e2b98a309cb944156877a#2d647ac0b9b4c72a4f7e2b98a309cb944156877a" dependencies = [ "log", ] @@ -823,7 +823,7 @@ dependencies = [ [[package]] name = "diplomat-tool" version = "0.7.0" -source = "git+https://github.com/rust-diplomat/diplomat.git?rev=8194def008d44fd0a36276976d5268df4e572a27#8194def008d44fd0a36276976d5268df4e572a27" +source = "git+https://github.com/rust-diplomat/diplomat.git?rev=2d647ac0b9b4c72a4f7e2b98a309cb944156877a#2d647ac0b9b4c72a4f7e2b98a309cb944156877a" dependencies = [ "askama", "clap 3.2.25", @@ -843,7 +843,7 @@ dependencies = [ [[package]] name = "diplomat_core" version = "0.7.0" -source = "git+https://github.com/rust-diplomat/diplomat.git?rev=8194def008d44fd0a36276976d5268df4e572a27#8194def008d44fd0a36276976d5268df4e572a27" +source = "git+https://github.com/rust-diplomat/diplomat.git?rev=2d647ac0b9b4c72a4f7e2b98a309cb944156877a#2d647ac0b9b4c72a4f7e2b98a309cb944156877a" dependencies = [ "displaydoc", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index 708c701796e..f6962b9e891 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -228,10 +228,10 @@ icu_benchmark_macros = { path = "tools/benchmark/macros" } # The version here can either be a `version = ".."` spec or `git = "https://github.com/rust-diplomat/diplomat", rev = ".."` # Diplomat must be published preceding a new ICU4X release but may use git versions in between -diplomat = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "8194def008d44fd0a36276976d5268df4e572a27" } -diplomat-runtime = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "8194def008d44fd0a36276976d5268df4e572a27" } -diplomat_core = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "8194def008d44fd0a36276976d5268df4e572a27" } -diplomat-tool = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "8194def008d44fd0a36276976d5268df4e572a27" } +diplomat = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "2d647ac0b9b4c72a4f7e2b98a309cb944156877a" } +diplomat-runtime = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "2d647ac0b9b4c72a4f7e2b98a309cb944156877a" } +diplomat_core = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "2d647ac0b9b4c72a4f7e2b98a309cb944156877a" } +diplomat-tool = { git = "https://github.com/rust-diplomat/diplomat.git", rev = "2d647ac0b9b4c72a4f7e2b98a309cb944156877a" } # Size optimized builds [profile.release-opt-size] diff --git a/ffi/capi/bindings/dart/AnyCalendarKind.g.dart b/ffi/capi/bindings/dart/AnyCalendarKind.g.dart index fd07cd7fd32..02953e8ad1a 100644 --- a/ffi/capi/bindings/dart/AnyCalendarKind.g.dart +++ b/ffi/capi/bindings/dart/AnyCalendarKind.g.dart @@ -79,11 +79,6 @@ enum AnyCalendarKind { return AnyCalendarKind.values[result.union.ok]; } - // ignore: non_constant_identifier_names - static final _ICU4XAnyCalendarKind_get_for_locale = - _capi)>>('ICU4XAnyCalendarKind_get_for_locale') - .asFunction<_ResultInt32Void Function(ffi.Pointer)>(isLeaf: true); - /// Obtain the calendar type given a BCP-47 -u-ca- extension string. /// /// Errors if the calendar is not known or supported. @@ -102,11 +97,6 @@ enum AnyCalendarKind { return AnyCalendarKind.values[result.union.ok]; } - // ignore: non_constant_identifier_names - static final _ICU4XAnyCalendarKind_get_for_bcp47 = - _capi, ffi.Size)>>('ICU4XAnyCalendarKind_get_for_bcp47') - .asFunction<_ResultInt32Void Function(ffi.Pointer, int)>(isLeaf: true); - /// Obtain the string suitable for use in the -u-ca- extension in a BCP47 locale. /// /// See the [Rust documentation for `as_bcp47_string`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendarKind.html#method.as_bcp47_string) for more information. @@ -120,9 +110,16 @@ enum AnyCalendarKind { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XAnyCalendarKind_bcp47 = - _capi)>>('ICU4XAnyCalendarKind_bcp47') - .asFunction<_ResultVoidInt32 Function(int, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native<_ResultInt32Void Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XAnyCalendarKind_get_for_locale') +// ignore: non_constant_identifier_names +external _ResultInt32Void _ICU4XAnyCalendarKind_get_for_locale(ffi.Pointer locale); + +@ffi.Native<_ResultInt32Void Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XAnyCalendarKind_get_for_bcp47') +// ignore: non_constant_identifier_names +external _ResultInt32Void _ICU4XAnyCalendarKind_get_for_bcp47(ffi.Pointer sData, int sLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Int32, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XAnyCalendarKind_bcp47') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XAnyCalendarKind_bcp47(int self, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/Bcp47ToIanaMapper.g.dart b/ffi/capi/bindings/dart/Bcp47ToIanaMapper.g.dart index 8a984580ae7..41cd440ae7b 100644 --- a/ffi/capi/bindings/dart/Bcp47ToIanaMapper.g.dart +++ b/ffi/capi/bindings/dart/Bcp47ToIanaMapper.g.dart @@ -15,7 +15,7 @@ final class Bcp47ToIanaMapper implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XBcp47ToIanaMapper_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XBcp47ToIanaMapper_destroy)); /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.IanaBcp47RoundTripMapper.html#method.new) for more information. /// @@ -28,11 +28,6 @@ final class Bcp47ToIanaMapper implements ffi.Finalizable { return Bcp47ToIanaMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XBcp47ToIanaMapper_create = - _capi)>>('ICU4XBcp47ToIanaMapper_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Writes out the canonical IANA time zone ID corresponding to the given BCP-47 ID. /// /// See the [Rust documentation for `bcp47_to_iana`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.IanaBcp47RoundTripMapper.html#method.bcp47_to_iana) for more information. @@ -49,9 +44,16 @@ final class Bcp47ToIanaMapper implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XBcp47ToIanaMapper_get = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XBcp47ToIanaMapper_get') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBcp47ToIanaMapper_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XBcp47ToIanaMapper_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XBcp47ToIanaMapper_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XBcp47ToIanaMapper_create(ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XBcp47ToIanaMapper_get') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XBcp47ToIanaMapper_get(ffi.Pointer self, ffi.Pointer valueData, int valueLength, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/Bidi.g.dart b/ffi/capi/bindings/dart/Bidi.g.dart index 3750389db4b..179c0717ce2 100644 --- a/ffi/capi/bindings/dart/Bidi.g.dart +++ b/ffi/capi/bindings/dart/Bidi.g.dart @@ -15,7 +15,7 @@ final class Bidi implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XBidi_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XBidi_destroy)); /// Creates a new [`Bidi`] from locale data. /// @@ -30,11 +30,6 @@ final class Bidi implements ffi.Finalizable { return Bidi._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XBidi_create = - _capi)>>('ICU4XBidi_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Use the data loaded in this object to process a string and calculate bidi information /// /// Takes in a Level for the default level, if it is an invalid value it will default to LTR @@ -48,11 +43,6 @@ final class Bidi implements ffi.Finalizable { return BidiInfo._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XBidi_for_text = - _capi Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Uint8)>>('ICU4XBidi_for_text') - .asFunction Function(ffi.Pointer, ffi.Pointer, int, int)>(isLeaf: true); - /// Utility function for producing reorderings given a list of levels /// /// Produces a map saying which visual index maps to which source index. @@ -71,11 +61,6 @@ final class Bidi implements ffi.Finalizable { return ReorderedIndexMap._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XBidi_reorder_visual = - _capi Function(ffi.Pointer, ffi.Pointer, ffi.Size)>>('ICU4XBidi_reorder_visual') - .asFunction Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Check if a Level returned by level_at is an RTL level. /// /// Invalid levels (numbers greater than 125) will be assumed LTR @@ -86,11 +71,6 @@ final class Bidi implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XBidi_level_is_rtl = - _capi>('ICU4XBidi_level_is_rtl') - .asFunction(isLeaf: true); - /// Check if a Level returned by level_at is an LTR level. /// /// Invalid levels (numbers greater than 125) will be assumed LTR @@ -101,11 +81,6 @@ final class Bidi implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XBidi_level_is_ltr = - _capi>('ICU4XBidi_level_is_ltr') - .asFunction(isLeaf: true); - /// Get a basic RTL Level value /// /// See the [Rust documentation for `rtl`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.rtl) for more information. @@ -114,11 +89,6 @@ final class Bidi implements ffi.Finalizable { return result; }(); - // ignore: non_constant_identifier_names - static final _ICU4XBidi_level_rtl = - _capi>('ICU4XBidi_level_rtl') - .asFunction(isLeaf: true); - /// Get a simple LTR Level value /// /// See the [Rust documentation for `ltr`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.ltr) for more information. @@ -126,9 +96,36 @@ final class Bidi implements ffi.Finalizable { final result = _ICU4XBidi_level_ltr(); return result; }(); - - // ignore: non_constant_identifier_names - static final _ICU4XBidi_level_ltr = - _capi>('ICU4XBidi_level_ltr') - .asFunction(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidi_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XBidi_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XBidi_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XBidi_create(ffi.Pointer provider); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Uint8)>(isLeaf: true, symbol: 'ICU4XBidi_for_text') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XBidi_for_text(ffi.Pointer self, ffi.Pointer textData, int textLength, int defaultLevel); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XBidi_reorder_visual') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XBidi_reorder_visual(ffi.Pointer self, ffi.Pointer levelsData, int levelsLength); + +@ffi.Native(isLeaf: true, symbol: 'ICU4XBidi_level_is_rtl') +// ignore: non_constant_identifier_names +external bool _ICU4XBidi_level_is_rtl(int level); + +@ffi.Native(isLeaf: true, symbol: 'ICU4XBidi_level_is_ltr') +// ignore: non_constant_identifier_names +external bool _ICU4XBidi_level_is_ltr(int level); + +@ffi.Native(isLeaf: true, symbol: 'ICU4XBidi_level_rtl') +// ignore: non_constant_identifier_names +external int _ICU4XBidi_level_rtl(); + +@ffi.Native(isLeaf: true, symbol: 'ICU4XBidi_level_ltr') +// ignore: non_constant_identifier_names +external int _ICU4XBidi_level_ltr(); diff --git a/ffi/capi/bindings/dart/BidiInfo.g.dart b/ffi/capi/bindings/dart/BidiInfo.g.dart index e382d5bf853..812a84d6be5 100644 --- a/ffi/capi/bindings/dart/BidiInfo.g.dart +++ b/ffi/capi/bindings/dart/BidiInfo.g.dart @@ -15,7 +15,7 @@ final class BidiInfo implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XBidiInfo_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XBidiInfo_destroy)); /// The number of paragraphs contained here int get paragraphCount { @@ -23,33 +23,18 @@ final class BidiInfo implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XBidiInfo_paragraph_count = - _capi)>>('ICU4XBidiInfo_paragraph_count') - .asFunction)>(isLeaf: true); - /// Get the nth paragraph, returning `None` if out of bounds BidiParagraph? paragraphAt(int n) { final result = _ICU4XBidiInfo_paragraph_at(_underlying, n); return result.address == 0 ? null : BidiParagraph._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XBidiInfo_paragraph_at = - _capi Function(ffi.Pointer, ffi.Size)>>('ICU4XBidiInfo_paragraph_at') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// The number of bytes in this full text int get size { final result = _ICU4XBidiInfo_size(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XBidiInfo_size = - _capi)>>('ICU4XBidiInfo_size') - .asFunction)>(isLeaf: true); - /// Get the BIDI level at a particular byte index in the full text. /// This integer is conceptually a `unicode_bidi::Level`, /// and can be further inspected using the static methods on ICU4XBidi. @@ -59,9 +44,24 @@ final class BidiInfo implements ffi.Finalizable { final result = _ICU4XBidiInfo_level_at(_underlying, pos); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XBidiInfo_level_at = - _capi, ffi.Size)>>('ICU4XBidiInfo_level_at') - .asFunction, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiInfo_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XBidiInfo_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiInfo_paragraph_count') +// ignore: non_constant_identifier_names +external int _ICU4XBidiInfo_paragraph_count(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XBidiInfo_paragraph_at') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XBidiInfo_paragraph_at(ffi.Pointer self, int n); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiInfo_size') +// ignore: non_constant_identifier_names +external int _ICU4XBidiInfo_size(ffi.Pointer self); + +@ffi.Native, ffi.Size)>(isLeaf: true, symbol: 'ICU4XBidiInfo_level_at') +// ignore: non_constant_identifier_names +external int _ICU4XBidiInfo_level_at(ffi.Pointer self, int pos); diff --git a/ffi/capi/bindings/dart/BidiParagraph.g.dart b/ffi/capi/bindings/dart/BidiParagraph.g.dart index dfe0fe23552..56e21974f12 100644 --- a/ffi/capi/bindings/dart/BidiParagraph.g.dart +++ b/ffi/capi/bindings/dart/BidiParagraph.g.dart @@ -13,7 +13,7 @@ final class BidiParagraph implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XBidiParagraph_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XBidiParagraph_destroy)); /// Given a paragraph index `n` within the surrounding text, this sets this /// object to the paragraph at that index. Returns `Error::OutOfBoundsError` when out of bounds. @@ -29,11 +29,6 @@ final class BidiParagraph implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XBidiParagraph_set_paragraph_in_text = - _capi, ffi.Size)>>('ICU4XBidiParagraph_set_paragraph_in_text') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// The primary direction of this paragraph /// /// See the [Rust documentation for `level_at`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at) for more information. @@ -42,11 +37,6 @@ final class BidiParagraph implements ffi.Finalizable { return BidiDirection.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XBidiParagraph_direction = - _capi)>>('ICU4XBidiParagraph_direction') - .asFunction)>(isLeaf: true); - /// The number of bytes in this paragraph /// /// See the [Rust documentation for `len`](https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.ParagraphInfo.html#method.len) for more information. @@ -55,33 +45,18 @@ final class BidiParagraph implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XBidiParagraph_size = - _capi)>>('ICU4XBidiParagraph_size') - .asFunction)>(isLeaf: true); - /// The start index of this paragraph within the source text int get rangeStart { final result = _ICU4XBidiParagraph_range_start(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XBidiParagraph_range_start = - _capi)>>('ICU4XBidiParagraph_range_start') - .asFunction)>(isLeaf: true); - /// The end index of this paragraph within the source text int get rangeEnd { final result = _ICU4XBidiParagraph_range_end(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XBidiParagraph_range_end = - _capi)>>('ICU4XBidiParagraph_range_end') - .asFunction)>(isLeaf: true); - /// Reorder a line based on display order. The ranges are specified relative to the source text and must be contained /// within this paragraph's range. /// @@ -97,11 +72,6 @@ final class BidiParagraph implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XBidiParagraph_reorder_line = - _capi, ffi.Size, ffi.Size, ffi.Pointer)>>('ICU4XBidiParagraph_reorder_line') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, int, int, ffi.Pointer)>(isLeaf: true); - /// Get the BIDI level at a particular byte index in this paragraph. /// This integer is conceptually a `unicode_bidi::Level`, /// and can be further inspected using the static methods on ICU4XBidi. @@ -113,9 +83,36 @@ final class BidiParagraph implements ffi.Finalizable { final result = _ICU4XBidiParagraph_level_at(_underlying, pos); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XBidiParagraph_level_at = - _capi, ffi.Size)>>('ICU4XBidiParagraph_level_at') - .asFunction, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XBidiParagraph_destroy(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_set_paragraph_in_text') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XBidiParagraph_set_paragraph_in_text(ffi.Pointer self, int n); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_direction') +// ignore: non_constant_identifier_names +external int _ICU4XBidiParagraph_direction(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_size') +// ignore: non_constant_identifier_names +external int _ICU4XBidiParagraph_size(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_range_start') +// ignore: non_constant_identifier_names +external int _ICU4XBidiParagraph_range_start(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_range_end') +// ignore: non_constant_identifier_names +external int _ICU4XBidiParagraph_range_end(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Size, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_reorder_line') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XBidiParagraph_reorder_line(ffi.Pointer self, int rangeStart, int rangeEnd, ffi.Pointer writeable); + +@ffi.Native, ffi.Size)>(isLeaf: true, symbol: 'ICU4XBidiParagraph_level_at') +// ignore: non_constant_identifier_names +external int _ICU4XBidiParagraph_level_at(ffi.Pointer self, int pos); diff --git a/ffi/capi/bindings/dart/Calendar.g.dart b/ffi/capi/bindings/dart/Calendar.g.dart index 732546b4e16..4855106d8aa 100644 --- a/ffi/capi/bindings/dart/Calendar.g.dart +++ b/ffi/capi/bindings/dart/Calendar.g.dart @@ -13,7 +13,7 @@ final class Calendar implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCalendar_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCalendar_destroy)); /// Creates a new [`Calendar`] from the specified date and time. /// @@ -28,11 +28,6 @@ final class Calendar implements ffi.Finalizable { return Calendar._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCalendar_create_for_locale = - _capi, ffi.Pointer)>>('ICU4XCalendar_create_for_locale') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Creates a new [`Calendar`] from the specified date and time. /// /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.new) for more information. @@ -46,11 +41,6 @@ final class Calendar implements ffi.Finalizable { return Calendar._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCalendar_create_for_kind = - _capi, ffi.Int32)>>('ICU4XCalendar_create_for_kind') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// Returns the kind of this calendar /// /// See the [Rust documentation for `kind`](https://docs.rs/icu/latest/icu/calendar/enum.AnyCalendar.html#method.kind) for more information. @@ -58,9 +48,20 @@ final class Calendar implements ffi.Finalizable { final result = _ICU4XCalendar_kind(_underlying); return AnyCalendarKind.values[result]; } - - // ignore: non_constant_identifier_names - static final _ICU4XCalendar_kind = - _capi)>>('ICU4XCalendar_kind') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCalendar_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCalendar_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCalendar_create_for_locale') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCalendar_create_for_locale(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XCalendar_create_for_kind') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCalendar_create_for_kind(ffi.Pointer provider, int kind); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCalendar_kind') +// ignore: non_constant_identifier_names +external int _ICU4XCalendar_kind(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/CanonicalCombiningClassMap.g.dart b/ffi/capi/bindings/dart/CanonicalCombiningClassMap.g.dart index 0f9e3f6b71f..f8b2eabd5f0 100644 --- a/ffi/capi/bindings/dart/CanonicalCombiningClassMap.g.dart +++ b/ffi/capi/bindings/dart/CanonicalCombiningClassMap.g.dart @@ -15,7 +15,7 @@ final class CanonicalCombiningClassMap implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCanonicalCombiningClassMap_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCanonicalCombiningClassMap_destroy)); /// Construct a new ICU4XCanonicalCombiningClassMap instance for NFC /// @@ -30,11 +30,6 @@ final class CanonicalCombiningClassMap implements ffi.Finalizable { return CanonicalCombiningClassMap._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCanonicalCombiningClassMap_create = - _capi)>>('ICU4XCanonicalCombiningClassMap_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalCombiningClassMap.html#method.get) for more information. /// /// Additional information: [1](https://docs.rs/icu/latest/icu/properties/properties/struct.CanonicalCombiningClass.html) @@ -42,9 +37,16 @@ final class CanonicalCombiningClassMap implements ffi.Finalizable { final result = _ICU4XCanonicalCombiningClassMap_get(_underlying, ch); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XCanonicalCombiningClassMap_get = - _capi, ffi.Uint32)>>('ICU4XCanonicalCombiningClassMap_get') - .asFunction, Rune)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCanonicalCombiningClassMap_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCanonicalCombiningClassMap_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCanonicalCombiningClassMap_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCanonicalCombiningClassMap_create(ffi.Pointer provider); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCanonicalCombiningClassMap_get') +// ignore: non_constant_identifier_names +external int _ICU4XCanonicalCombiningClassMap_get(ffi.Pointer self, Rune ch); diff --git a/ffi/capi/bindings/dart/CanonicalComposition.g.dart b/ffi/capi/bindings/dart/CanonicalComposition.g.dart index e686fb01ff7..96b846c09b7 100644 --- a/ffi/capi/bindings/dart/CanonicalComposition.g.dart +++ b/ffi/capi/bindings/dart/CanonicalComposition.g.dart @@ -17,7 +17,7 @@ final class CanonicalComposition implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCanonicalComposition_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCanonicalComposition_destroy)); /// Construct a new ICU4XCanonicalComposition instance for NFC /// @@ -32,11 +32,6 @@ final class CanonicalComposition implements ffi.Finalizable { return CanonicalComposition._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCanonicalComposition_create = - _capi)>>('ICU4XCanonicalComposition_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Performs canonical composition (including Hangul) on a pair of characters /// or returns NUL if these characters don’t compose. Composition exclusions are taken into account. /// @@ -45,9 +40,16 @@ final class CanonicalComposition implements ffi.Finalizable { final result = _ICU4XCanonicalComposition_compose(_underlying, starter, second); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XCanonicalComposition_compose = - _capi, ffi.Uint32, ffi.Uint32)>>('ICU4XCanonicalComposition_compose') - .asFunction, Rune, Rune)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCanonicalComposition_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCanonicalComposition_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCanonicalComposition_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCanonicalComposition_create(ffi.Pointer provider); + +@ffi.Native, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCanonicalComposition_compose') +// ignore: non_constant_identifier_names +external Rune _ICU4XCanonicalComposition_compose(ffi.Pointer self, Rune starter, Rune second); diff --git a/ffi/capi/bindings/dart/CanonicalDecomposition.g.dart b/ffi/capi/bindings/dart/CanonicalDecomposition.g.dart index 4b0fe976e7a..3e154ccfb3b 100644 --- a/ffi/capi/bindings/dart/CanonicalDecomposition.g.dart +++ b/ffi/capi/bindings/dart/CanonicalDecomposition.g.dart @@ -17,7 +17,7 @@ final class CanonicalDecomposition implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCanonicalDecomposition_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCanonicalDecomposition_destroy)); /// Construct a new ICU4XCanonicalDecomposition instance for NFC /// @@ -32,11 +32,6 @@ final class CanonicalDecomposition implements ffi.Finalizable { return CanonicalDecomposition._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCanonicalDecomposition_create = - _capi)>>('ICU4XCanonicalDecomposition_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Performs non-recursive canonical decomposition (including for Hangul). /// /// See the [Rust documentation for `decompose`](https://docs.rs/icu/latest/icu/normalizer/properties/struct.CanonicalDecomposition.html#method.decompose) for more information. @@ -44,9 +39,16 @@ final class CanonicalDecomposition implements ffi.Finalizable { final result = _ICU4XCanonicalDecomposition_decompose(_underlying, c); return Decomposed._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XCanonicalDecomposition_decompose = - _capi, ffi.Uint32)>>('ICU4XCanonicalDecomposition_decompose') - .asFunction<_DecomposedFfi Function(ffi.Pointer, Rune)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCanonicalDecomposition_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCanonicalDecomposition_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCanonicalDecomposition_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCanonicalDecomposition_create(ffi.Pointer provider); + +@ffi.Native<_DecomposedFfi Function(ffi.Pointer, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCanonicalDecomposition_decompose') +// ignore: non_constant_identifier_names +external _DecomposedFfi _ICU4XCanonicalDecomposition_decompose(ffi.Pointer self, Rune c); diff --git a/ffi/capi/bindings/dart/CaseMapCloser.g.dart b/ffi/capi/bindings/dart/CaseMapCloser.g.dart index eb262fc4651..29a914b061f 100644 --- a/ffi/capi/bindings/dart/CaseMapCloser.g.dart +++ b/ffi/capi/bindings/dart/CaseMapCloser.g.dart @@ -13,7 +13,7 @@ final class CaseMapCloser implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCaseMapCloser_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCaseMapCloser_destroy)); /// Construct a new ICU4XCaseMapper instance /// @@ -28,11 +28,6 @@ final class CaseMapCloser implements ffi.Finalizable { return CaseMapCloser._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapCloser_create = - _capi)>>('ICU4XCaseMapCloser_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Adds all simple case mappings and the full case folding for `c` to `builder`. /// Also adds special case closure mappings. /// @@ -41,11 +36,6 @@ final class CaseMapCloser implements ffi.Finalizable { _ICU4XCaseMapCloser_add_case_closure_to(_underlying, c, builder._underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapCloser_add_case_closure_to = - _capi, ffi.Uint32, ffi.Pointer)>>('ICU4XCaseMapCloser_add_case_closure_to') - .asFunction, Rune, ffi.Pointer)>(isLeaf: true); - /// Finds all characters and strings which may casemap to `s` as their full case folding string /// and adds them to the set. /// @@ -59,9 +49,20 @@ final class CaseMapCloser implements ffi.Finalizable { temp.releaseAll(); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapCloser_add_string_case_closure_to = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XCaseMapCloser_add_string_case_closure_to') - .asFunction, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCaseMapCloser_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCaseMapCloser_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapCloser_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCaseMapCloser_create(ffi.Pointer provider); + +@ffi.Native, ffi.Uint32, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapCloser_add_case_closure_to') +// ignore: non_constant_identifier_names +external void _ICU4XCaseMapCloser_add_case_closure_to(ffi.Pointer self, Rune c, ffi.Pointer builder); + +@ffi.Native, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapCloser_add_string_case_closure_to') +// ignore: non_constant_identifier_names +external bool _ICU4XCaseMapCloser_add_string_case_closure_to(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer builder); diff --git a/ffi/capi/bindings/dart/CaseMapper.g.dart b/ffi/capi/bindings/dart/CaseMapper.g.dart index 14d3ffb8378..90c5ef0e305 100644 --- a/ffi/capi/bindings/dart/CaseMapper.g.dart +++ b/ffi/capi/bindings/dart/CaseMapper.g.dart @@ -13,7 +13,7 @@ final class CaseMapper implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCaseMapper_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCaseMapper_destroy)); /// Construct a new ICU4XCaseMapper instance /// @@ -28,11 +28,6 @@ final class CaseMapper implements ffi.Finalizable { return CaseMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_create = - _capi)>>('ICU4XCaseMapper_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Returns the full lowercase mapping of the given string /// /// See the [Rust documentation for `lowercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.lowercase) for more information. @@ -50,11 +45,6 @@ final class CaseMapper implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_lowercase = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer, ffi.Pointer)>>('ICU4XCaseMapper_lowercase') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the full uppercase mapping of the given string /// /// See the [Rust documentation for `uppercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.uppercase) for more information. @@ -72,11 +62,6 @@ final class CaseMapper implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_uppercase = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer, ffi.Pointer)>>('ICU4XCaseMapper_uppercase') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the full titlecase mapping of the given string, performing head adjustment without /// loading additional data. /// (if head adjustment is enabled in the options) @@ -98,11 +83,6 @@ final class CaseMapper implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1 = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer, _TitlecaseOptionsV1Ffi, ffi.Pointer)>>('ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, _TitlecaseOptionsV1Ffi, ffi.Pointer)>(isLeaf: true); - /// Case-folds the characters in the given string /// /// See the [Rust documentation for `fold`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.fold) for more information. @@ -120,11 +100,6 @@ final class CaseMapper implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_fold = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XCaseMapper_fold') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); - /// Case-folds the characters in the given string /// using Turkic (T) mappings for dotted/dotless I. /// @@ -143,11 +118,6 @@ final class CaseMapper implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_fold_turkic = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XCaseMapper_fold_turkic') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); - /// Adds all simple case mappings and the full case folding for `c` to `builder`. /// Also adds special case closure mappings. /// @@ -165,11 +135,6 @@ final class CaseMapper implements ffi.Finalizable { _ICU4XCaseMapper_add_case_closure_to(_underlying, c, builder._underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_add_case_closure_to = - _capi, ffi.Uint32, ffi.Pointer)>>('ICU4XCaseMapper_add_case_closure_to') - .asFunction, Rune, ffi.Pointer)>(isLeaf: true); - /// Returns the simple lowercase mapping of the given character. /// /// This function only implements simple and common mappings. @@ -182,11 +147,6 @@ final class CaseMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_simple_lowercase = - _capi, ffi.Uint32)>>('ICU4XCaseMapper_simple_lowercase') - .asFunction, Rune)>(isLeaf: true); - /// Returns the simple uppercase mapping of the given character. /// /// This function only implements simple and common mappings. @@ -199,11 +159,6 @@ final class CaseMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_simple_uppercase = - _capi, ffi.Uint32)>>('ICU4XCaseMapper_simple_uppercase') - .asFunction, Rune)>(isLeaf: true); - /// Returns the simple titlecase mapping of the given character. /// /// This function only implements simple and common mappings. @@ -216,11 +171,6 @@ final class CaseMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_simple_titlecase = - _capi, ffi.Uint32)>>('ICU4XCaseMapper_simple_titlecase') - .asFunction, Rune)>(isLeaf: true); - /// Returns the simple casefolding of the given character. /// /// This function only implements simple folding. @@ -232,11 +182,6 @@ final class CaseMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_simple_fold = - _capi, ffi.Uint32)>>('ICU4XCaseMapper_simple_fold') - .asFunction, Rune)>(isLeaf: true); - /// Returns the simple casefolding of the given character in the Turkic locale /// /// This function only implements simple folding. @@ -247,9 +192,56 @@ final class CaseMapper implements ffi.Finalizable { final result = _ICU4XCaseMapper_simple_fold_turkic(_underlying, ch); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XCaseMapper_simple_fold_turkic = - _capi, ffi.Uint32)>>('ICU4XCaseMapper_simple_fold_turkic') - .asFunction, Rune)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCaseMapper_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCaseMapper_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapper_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCaseMapper_create(ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapper_lowercase') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCaseMapper_lowercase(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer locale, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapper_uppercase') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCaseMapper_uppercase(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer locale, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer, _TitlecaseOptionsV1Ffi, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer locale, _TitlecaseOptionsV1Ffi options, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapper_fold') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCaseMapper_fold(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapper_fold_turkic') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCaseMapper_fold_turkic(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer writeable); + +@ffi.Native, ffi.Uint32, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCaseMapper_add_case_closure_to') +// ignore: non_constant_identifier_names +external void _ICU4XCaseMapper_add_case_closure_to(ffi.Pointer self, Rune c, ffi.Pointer builder); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCaseMapper_simple_lowercase') +// ignore: non_constant_identifier_names +external Rune _ICU4XCaseMapper_simple_lowercase(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCaseMapper_simple_uppercase') +// ignore: non_constant_identifier_names +external Rune _ICU4XCaseMapper_simple_uppercase(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCaseMapper_simple_titlecase') +// ignore: non_constant_identifier_names +external Rune _ICU4XCaseMapper_simple_titlecase(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCaseMapper_simple_fold') +// ignore: non_constant_identifier_names +external Rune _ICU4XCaseMapper_simple_fold(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCaseMapper_simple_fold_turkic') +// ignore: non_constant_identifier_names +external Rune _ICU4XCaseMapper_simple_fold_turkic(ffi.Pointer self, Rune ch); diff --git a/ffi/capi/bindings/dart/CodePointMapData16.g.dart b/ffi/capi/bindings/dart/CodePointMapData16.g.dart index 82e9315a4e1..708070afdb3 100644 --- a/ffi/capi/bindings/dart/CodePointMapData16.g.dart +++ b/ffi/capi/bindings/dart/CodePointMapData16.g.dart @@ -21,7 +21,7 @@ final class CodePointMapData16 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCodePointMapData16_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCodePointMapData16_destroy)); /// Gets the value for a code point. /// @@ -31,11 +31,6 @@ final class CodePointMapData16 implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData16_get = - _capi, ffi.Uint32)>>('ICU4XCodePointMapData16_get') - .asFunction, Rune)>(isLeaf: true); - /// Produces an iterator over ranges of code points that map to `value` /// /// See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information. @@ -44,11 +39,6 @@ final class CodePointMapData16 implements ffi.Finalizable { return CodePointRangeIterator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData16_iter_ranges_for_value = - _capi Function(ffi.Pointer, ffi.Uint16)>>('ICU4XCodePointMapData16_iter_ranges_for_value') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// Produces an iterator over ranges of code points that do not map to `value` /// /// See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information. @@ -57,11 +47,6 @@ final class CodePointMapData16 implements ffi.Finalizable { return CodePointRangeIterator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData16_iter_ranges_for_value_complemented = - _capi Function(ffi.Pointer, ffi.Uint16)>>('ICU4XCodePointMapData16_iter_ranges_for_value_complemented') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// Gets a [`CodePointSetData`] representing all entries in this map that map to the given value /// /// See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information. @@ -70,11 +55,6 @@ final class CodePointMapData16 implements ffi.Finalizable { return CodePointSetData._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData16_get_set_for_value = - _capi Function(ffi.Pointer, ffi.Uint16)>>('ICU4XCodePointMapData16_get_set_for_value') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `script`](https://docs.rs/icu/latest/icu/properties/maps/fn.script.html) for more information. /// /// Throws [Error] on failure. @@ -85,9 +65,28 @@ final class CodePointMapData16 implements ffi.Finalizable { } return CodePointMapData16._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData16_load_script = - _capi)>>('ICU4XCodePointMapData16_load_script') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCodePointMapData16_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointMapData16_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointMapData16_get') +// ignore: non_constant_identifier_names +external int _ICU4XCodePointMapData16_get(ffi.Pointer self, Rune cp); + +@ffi.Native Function(ffi.Pointer, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XCodePointMapData16_iter_ranges_for_value') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointMapData16_iter_ranges_for_value(ffi.Pointer self, int value); + +@ffi.Native Function(ffi.Pointer, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XCodePointMapData16_iter_ranges_for_value_complemented') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointMapData16_iter_ranges_for_value_complemented(ffi.Pointer self, int value); + +@ffi.Native Function(ffi.Pointer, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XCodePointMapData16_get_set_for_value') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointMapData16_get_set_for_value(ffi.Pointer self, int value); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData16_load_script') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData16_load_script(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/CodePointMapData8.g.dart b/ffi/capi/bindings/dart/CodePointMapData8.g.dart index 735487f3497..65387fde02e 100644 --- a/ffi/capi/bindings/dart/CodePointMapData8.g.dart +++ b/ffi/capi/bindings/dart/CodePointMapData8.g.dart @@ -21,7 +21,7 @@ final class CodePointMapData8 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCodePointMapData8_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCodePointMapData8_destroy)); /// Gets the value for a code point. /// @@ -31,11 +31,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_get = - _capi, ffi.Uint32)>>('ICU4XCodePointMapData8_get') - .asFunction, Rune)>(isLeaf: true); - /// Converts a general category to its corresponding mask value /// /// Nonexistant general categories will map to the empty mask @@ -46,11 +41,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_general_category_to_mask = - _capi>('ICU4XCodePointMapData8_general_category_to_mask') - .asFunction(isLeaf: true); - /// Produces an iterator over ranges of code points that map to `value` /// /// See the [Rust documentation for `iter_ranges_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value) for more information. @@ -59,11 +49,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointRangeIterator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_iter_ranges_for_value = - _capi Function(ffi.Pointer, ffi.Uint8)>>('ICU4XCodePointMapData8_iter_ranges_for_value') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// Produces an iterator over ranges of code points that do not map to `value` /// /// See the [Rust documentation for `iter_ranges_for_value_complemented`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented) for more information. @@ -72,11 +57,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointRangeIterator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_iter_ranges_for_value_complemented = - _capi Function(ffi.Pointer, ffi.Uint8)>>('ICU4XCodePointMapData8_iter_ranges_for_value_complemented') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// Given a mask value (the nth bit marks property value = n), produce an iterator over ranges of code points /// whose property values are contained in the mask. /// @@ -92,11 +72,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointRangeIterator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_iter_ranges_for_mask = - _capi Function(ffi.Pointer, ffi.Uint32)>>('ICU4XCodePointMapData8_iter_ranges_for_mask') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// Gets a [`CodePointSetData`] representing all entries in this map that map to the given value /// /// See the [Rust documentation for `get_set_for_value`](https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value) for more information. @@ -105,11 +80,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointSetData._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_get_set_for_value = - _capi Function(ffi.Pointer, ffi.Uint8)>>('ICU4XCodePointMapData8_get_set_for_value') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `general_category`](https://docs.rs/icu/latest/icu/properties/maps/fn.general_category.html) for more information. /// /// Throws [Error] on failure. @@ -121,11 +91,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointMapData8._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_load_general_category = - _capi)>>('ICU4XCodePointMapData8_load_general_category') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `bidi_class`](https://docs.rs/icu/latest/icu/properties/maps/fn.bidi_class.html) for more information. /// /// Throws [Error] on failure. @@ -137,11 +102,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointMapData8._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_load_bidi_class = - _capi)>>('ICU4XCodePointMapData8_load_bidi_class') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `east_asian_width`](https://docs.rs/icu/latest/icu/properties/maps/fn.east_asian_width.html) for more information. /// /// Throws [Error] on failure. @@ -153,11 +113,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointMapData8._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_load_east_asian_width = - _capi)>>('ICU4XCodePointMapData8_load_east_asian_width') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `indic_syllabic_category`](https://docs.rs/icu/latest/icu/properties/maps/fn.indic_syllabic_category.html) for more information. /// /// Throws [Error] on failure. @@ -169,11 +124,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointMapData8._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_load_indic_syllabic_category = - _capi)>>('ICU4XCodePointMapData8_load_indic_syllabic_category') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `line_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.line_break.html) for more information. /// /// Throws [Error] on failure. @@ -185,11 +135,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointMapData8._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_load_line_break = - _capi)>>('ICU4XCodePointMapData8_load_line_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `grapheme_cluster_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.grapheme_cluster_break.html) for more information. /// /// Throws [Error] on failure. @@ -201,11 +146,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointMapData8._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_try_grapheme_cluster_break = - _capi)>>('ICU4XCodePointMapData8_try_grapheme_cluster_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `word_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.word_break.html) for more information. /// /// Throws [Error] on failure. @@ -217,11 +157,6 @@ final class CodePointMapData8 implements ffi.Finalizable { return CodePointMapData8._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_load_word_break = - _capi)>>('ICU4XCodePointMapData8_load_word_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `sentence_break`](https://docs.rs/icu/latest/icu/properties/maps/fn.sentence_break.html) for more information. /// /// Throws [Error] on failure. @@ -232,9 +167,64 @@ final class CodePointMapData8 implements ffi.Finalizable { } return CodePointMapData8._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XCodePointMapData8_load_sentence_break = - _capi)>>('ICU4XCodePointMapData8_load_sentence_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointMapData8_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_get') +// ignore: non_constant_identifier_names +external int _ICU4XCodePointMapData8_get(ffi.Pointer self, Rune cp); + +@ffi.Native(isLeaf: true, symbol: 'ICU4XCodePointMapData8_general_category_to_mask') +// ignore: non_constant_identifier_names +external int _ICU4XCodePointMapData8_general_category_to_mask(int gc); + +@ffi.Native Function(ffi.Pointer, ffi.Uint8)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_iter_ranges_for_value') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointMapData8_iter_ranges_for_value(ffi.Pointer self, int value); + +@ffi.Native Function(ffi.Pointer, ffi.Uint8)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_iter_ranges_for_value_complemented') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointMapData8_iter_ranges_for_value_complemented(ffi.Pointer self, int value); + +@ffi.Native Function(ffi.Pointer, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_iter_ranges_for_mask') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointMapData8_iter_ranges_for_mask(ffi.Pointer self, int mask); + +@ffi.Native Function(ffi.Pointer, ffi.Uint8)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_get_set_for_value') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointMapData8_get_set_for_value(ffi.Pointer self, int value); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_load_general_category') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_general_category(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_load_bidi_class') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_bidi_class(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_load_east_asian_width') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_east_asian_width(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_load_indic_syllabic_category') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_indic_syllabic_category(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_load_line_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_line_break(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_try_grapheme_cluster_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_try_grapheme_cluster_break(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_load_word_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_word_break(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointMapData8_load_sentence_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointMapData8_load_sentence_break(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/CodePointRangeIterator.g.dart b/ffi/capi/bindings/dart/CodePointRangeIterator.g.dart index 11e66faa101..67846675573 100644 --- a/ffi/capi/bindings/dart/CodePointRangeIterator.g.dart +++ b/ffi/capi/bindings/dart/CodePointRangeIterator.g.dart @@ -14,7 +14,7 @@ final class CodePointRangeIterator implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('CodePointRangeIterator_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_CodePointRangeIterator_destroy)); /// Advance the iterator by one and return the next range. /// @@ -23,9 +23,12 @@ final class CodePointRangeIterator implements ffi.Finalizable { final result = _CodePointRangeIterator_next(_underlying); return CodePointRangeIteratorResult._(result); } - - // ignore: non_constant_identifier_names - static final _CodePointRangeIterator_next = - _capi)>>('CodePointRangeIterator_next') - .asFunction<_CodePointRangeIteratorResultFfi Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'CodePointRangeIterator_destroy') +// ignore: non_constant_identifier_names +external void _CodePointRangeIterator_destroy(ffi.Pointer self); + +@ffi.Native<_CodePointRangeIteratorResultFfi Function(ffi.Pointer)>(isLeaf: true, symbol: 'CodePointRangeIterator_next') +// ignore: non_constant_identifier_names +external _CodePointRangeIteratorResultFfi _CodePointRangeIterator_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/CodePointSetBuilder.g.dart b/ffi/capi/bindings/dart/CodePointSetBuilder.g.dart index 4a68be2f4e9..4082878da2f 100644 --- a/ffi/capi/bindings/dart/CodePointSetBuilder.g.dart +++ b/ffi/capi/bindings/dart/CodePointSetBuilder.g.dart @@ -13,7 +13,7 @@ final class CodePointSetBuilder implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCodePointSetBuilder_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCodePointSetBuilder_destroy)); /// Make a new set builder containing nothing /// @@ -23,11 +23,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { return CodePointSetBuilder._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_create = - _capi Function()>>('ICU4XCodePointSetBuilder_create') - .asFunction Function()>(isLeaf: true); - /// Build this into a set /// /// This object is repopulated with an empty builder @@ -38,11 +33,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { return CodePointSetData._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_build = - _capi Function(ffi.Pointer)>>('ICU4XCodePointSetBuilder_build') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Complements this set /// /// (Elements in this set are removed and vice versa) @@ -52,11 +42,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_complement(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_complement = - _capi)>>('ICU4XCodePointSetBuilder_complement') - .asFunction)>(isLeaf: true); - /// Returns whether this set is empty /// /// See the [Rust documentation for `is_empty`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.is_empty) for more information. @@ -65,11 +50,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_is_empty = - _capi)>>('ICU4XCodePointSetBuilder_is_empty') - .asFunction)>(isLeaf: true); - /// Add a single character to the set /// /// See the [Rust documentation for `add_char`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_char) for more information. @@ -77,11 +57,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_add_char(_underlying, ch); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_add_char = - _capi, ffi.Uint32)>>('ICU4XCodePointSetBuilder_add_char') - .asFunction, Rune)>(isLeaf: true); - /// Add an inclusive range of characters to the set /// /// See the [Rust documentation for `add_range`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_range) for more information. @@ -89,11 +64,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_add_inclusive_range(_underlying, start, end); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_add_inclusive_range = - _capi, ffi.Uint32, ffi.Uint32)>>('ICU4XCodePointSetBuilder_add_inclusive_range') - .asFunction, Rune, Rune)>(isLeaf: true); - /// Add all elements that belong to the provided set to the set /// /// See the [Rust documentation for `add_set`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.add_set) for more information. @@ -101,11 +71,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_add_set(_underlying, data._underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_add_set = - _capi, ffi.Pointer)>>('ICU4XCodePointSetBuilder_add_set') - .asFunction, ffi.Pointer)>(isLeaf: true); - /// Remove a single character to the set /// /// See the [Rust documentation for `remove_char`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_char) for more information. @@ -113,11 +78,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_remove_char(_underlying, ch); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_remove_char = - _capi, ffi.Uint32)>>('ICU4XCodePointSetBuilder_remove_char') - .asFunction, Rune)>(isLeaf: true); - /// Remove an inclusive range of characters from the set /// /// See the [Rust documentation for `remove_range`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_range) for more information. @@ -125,11 +85,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_remove_inclusive_range(_underlying, start, end); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_remove_inclusive_range = - _capi, ffi.Uint32, ffi.Uint32)>>('ICU4XCodePointSetBuilder_remove_inclusive_range') - .asFunction, Rune, Rune)>(isLeaf: true); - /// Remove all elements that belong to the provided set from the set /// /// See the [Rust documentation for `remove_set`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.remove_set) for more information. @@ -137,11 +92,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_remove_set(_underlying, data._underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_remove_set = - _capi, ffi.Pointer)>>('ICU4XCodePointSetBuilder_remove_set') - .asFunction, ffi.Pointer)>(isLeaf: true); - /// Removes all elements from the set except a single character /// /// See the [Rust documentation for `retain_char`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_char) for more information. @@ -149,11 +99,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_retain_char(_underlying, ch); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_retain_char = - _capi, ffi.Uint32)>>('ICU4XCodePointSetBuilder_retain_char') - .asFunction, Rune)>(isLeaf: true); - /// Removes all elements from the set except an inclusive range of characters f /// /// See the [Rust documentation for `retain_range`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_range) for more information. @@ -161,11 +106,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_retain_inclusive_range(_underlying, start, end); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_retain_inclusive_range = - _capi, ffi.Uint32, ffi.Uint32)>>('ICU4XCodePointSetBuilder_retain_inclusive_range') - .asFunction, Rune, Rune)>(isLeaf: true); - /// Removes all elements from the set except all elements in the provided set /// /// See the [Rust documentation for `retain_set`](https://docs.rs/icu/latest/icu/collections/codepointinvlist/struct.CodePointInversionListBuilder.html#method.retain_set) for more information. @@ -173,11 +113,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_retain_set(_underlying, data._underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_retain_set = - _capi, ffi.Pointer)>>('ICU4XCodePointSetBuilder_retain_set') - .asFunction, ffi.Pointer)>(isLeaf: true); - /// Complement a single character to the set /// /// (Characters which are in this set are removed and vice versa) @@ -187,11 +122,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_complement_char(_underlying, ch); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_complement_char = - _capi, ffi.Uint32)>>('ICU4XCodePointSetBuilder_complement_char') - .asFunction, Rune)>(isLeaf: true); - /// Complement an inclusive range of characters from the set /// /// (Characters which are in this set are removed and vice versa) @@ -201,11 +131,6 @@ final class CodePointSetBuilder implements ffi.Finalizable { _ICU4XCodePointSetBuilder_complement_inclusive_range(_underlying, start, end); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_complement_inclusive_range = - _capi, ffi.Uint32, ffi.Uint32)>>('ICU4XCodePointSetBuilder_complement_inclusive_range') - .asFunction, Rune, Rune)>(isLeaf: true); - /// Complement all elements that belong to the provided set from the set /// /// (Characters which are in this set are removed and vice versa) @@ -214,9 +139,72 @@ final class CodePointSetBuilder implements ffi.Finalizable { void complementSet(CodePointSetData data) { _ICU4XCodePointSetBuilder_complement_set(_underlying, data._underlying); } - - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetBuilder_complement_set = - _capi, ffi.Pointer)>>('ICU4XCodePointSetBuilder_complement_set') - .asFunction, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_destroy(ffi.Pointer self); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_create') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointSetBuilder_create(); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_build') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointSetBuilder_build(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_complement') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_complement(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_is_empty') +// ignore: non_constant_identifier_names +external bool _ICU4XCodePointSetBuilder_is_empty(ffi.Pointer self); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_add_char') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_add_char(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_add_inclusive_range') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_add_inclusive_range(ffi.Pointer self, Rune start, Rune end); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_add_set') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_add_set(ffi.Pointer self, ffi.Pointer data); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_remove_char') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_remove_char(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_remove_inclusive_range') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_remove_inclusive_range(ffi.Pointer self, Rune start, Rune end); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_remove_set') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_remove_set(ffi.Pointer self, ffi.Pointer data); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_retain_char') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_retain_char(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_retain_inclusive_range') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_retain_inclusive_range(ffi.Pointer self, Rune start, Rune end); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_retain_set') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_retain_set(ffi.Pointer self, ffi.Pointer data); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_complement_char') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_complement_char(ffi.Pointer self, Rune ch); + +@ffi.Native, ffi.Uint32, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_complement_inclusive_range') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_complement_inclusive_range(ffi.Pointer self, Rune start, Rune end); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetBuilder_complement_set') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetBuilder_complement_set(ffi.Pointer self, ffi.Pointer data); diff --git a/ffi/capi/bindings/dart/CodePointSetData.g.dart b/ffi/capi/bindings/dart/CodePointSetData.g.dart index e7121ec5861..2907b1e56a6 100644 --- a/ffi/capi/bindings/dart/CodePointSetData.g.dart +++ b/ffi/capi/bindings/dart/CodePointSetData.g.dart @@ -19,7 +19,7 @@ final class CodePointSetData implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCodePointSetData_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCodePointSetData_destroy)); /// Checks whether the code point is in the set. /// @@ -29,11 +29,6 @@ final class CodePointSetData implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_contains = - _capi, ffi.Uint32)>>('ICU4XCodePointSetData_contains') - .asFunction, Rune)>(isLeaf: true); - /// Produces an iterator over ranges of code points contained in this set /// /// See the [Rust documentation for `iter_ranges`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges) for more information. @@ -42,11 +37,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointRangeIterator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_iter_ranges = - _capi Function(ffi.Pointer)>>('ICU4XCodePointSetData_iter_ranges') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Produces an iterator over ranges of code points not contained in this set /// /// See the [Rust documentation for `iter_ranges_complemented`](https://docs.rs/icu/latest/icu/properties/sets/struct.CodePointSetDataBorrowed.html#method.iter_ranges_complemented) for more information. @@ -55,11 +45,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointRangeIterator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_iter_ranges_complemented = - _capi Function(ffi.Pointer)>>('ICU4XCodePointSetData_iter_ranges_complemented') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// which is a mask with the same format as the `U_GC_XX_MASK` mask in ICU4C /// /// See the [Rust documentation for `for_general_category_group`](https://docs.rs/icu/latest/icu/properties/sets/fn.for_general_category_group.html) for more information. @@ -73,11 +58,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_for_general_category_group = - _capi, ffi.Uint32)>>('ICU4XCodePointSetData_load_for_general_category_group') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `ascii_hex_digit`](https://docs.rs/icu/latest/icu/properties/sets/fn.ascii_hex_digit.html) for more information. /// /// Throws [Error] on failure. @@ -89,11 +69,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_ascii_hex_digit = - _capi)>>('ICU4XCodePointSetData_load_ascii_hex_digit') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `alnum`](https://docs.rs/icu/latest/icu/properties/sets/fn.alnum.html) for more information. /// /// Throws [Error] on failure. @@ -105,11 +80,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_alnum = - _capi)>>('ICU4XCodePointSetData_load_alnum') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `alphabetic`](https://docs.rs/icu/latest/icu/properties/sets/fn.alphabetic.html) for more information. /// /// Throws [Error] on failure. @@ -121,11 +91,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_alphabetic = - _capi)>>('ICU4XCodePointSetData_load_alphabetic') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `bidi_control`](https://docs.rs/icu/latest/icu/properties/sets/fn.bidi_control.html) for more information. /// /// Throws [Error] on failure. @@ -137,11 +102,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_bidi_control = - _capi)>>('ICU4XCodePointSetData_load_bidi_control') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `bidi_mirrored`](https://docs.rs/icu/latest/icu/properties/sets/fn.bidi_mirrored.html) for more information. /// /// Throws [Error] on failure. @@ -153,11 +113,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_bidi_mirrored = - _capi)>>('ICU4XCodePointSetData_load_bidi_mirrored') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `blank`](https://docs.rs/icu/latest/icu/properties/sets/fn.blank.html) for more information. /// /// Throws [Error] on failure. @@ -169,11 +124,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_blank = - _capi)>>('ICU4XCodePointSetData_load_blank') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `cased`](https://docs.rs/icu/latest/icu/properties/sets/fn.cased.html) for more information. /// /// Throws [Error] on failure. @@ -185,11 +135,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_cased = - _capi)>>('ICU4XCodePointSetData_load_cased') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `case_ignorable`](https://docs.rs/icu/latest/icu/properties/sets/fn.case_ignorable.html) for more information. /// /// Throws [Error] on failure. @@ -201,11 +146,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_case_ignorable = - _capi)>>('ICU4XCodePointSetData_load_case_ignorable') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `full_composition_exclusion`](https://docs.rs/icu/latest/icu/properties/sets/fn.full_composition_exclusion.html) for more information. /// /// Throws [Error] on failure. @@ -217,11 +157,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_full_composition_exclusion = - _capi)>>('ICU4XCodePointSetData_load_full_composition_exclusion') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `changes_when_casefolded`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_casefolded.html) for more information. /// /// Throws [Error] on failure. @@ -233,11 +168,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_changes_when_casefolded = - _capi)>>('ICU4XCodePointSetData_load_changes_when_casefolded') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `changes_when_casemapped`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_casemapped.html) for more information. /// /// Throws [Error] on failure. @@ -249,11 +179,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_changes_when_casemapped = - _capi)>>('ICU4XCodePointSetData_load_changes_when_casemapped') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `changes_when_nfkc_casefolded`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_nfkc_casefolded.html) for more information. /// /// Throws [Error] on failure. @@ -265,11 +190,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_changes_when_nfkc_casefolded = - _capi)>>('ICU4XCodePointSetData_load_changes_when_nfkc_casefolded') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `changes_when_lowercased`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_lowercased.html) for more information. /// /// Throws [Error] on failure. @@ -281,11 +201,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_changes_when_lowercased = - _capi)>>('ICU4XCodePointSetData_load_changes_when_lowercased') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `changes_when_titlecased`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_titlecased.html) for more information. /// /// Throws [Error] on failure. @@ -297,11 +212,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_changes_when_titlecased = - _capi)>>('ICU4XCodePointSetData_load_changes_when_titlecased') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `changes_when_uppercased`](https://docs.rs/icu/latest/icu/properties/sets/fn.changes_when_uppercased.html) for more information. /// /// Throws [Error] on failure. @@ -313,11 +223,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_changes_when_uppercased = - _capi)>>('ICU4XCodePointSetData_load_changes_when_uppercased') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `dash`](https://docs.rs/icu/latest/icu/properties/sets/fn.dash.html) for more information. /// /// Throws [Error] on failure. @@ -329,11 +234,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_dash = - _capi)>>('ICU4XCodePointSetData_load_dash') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `deprecated`](https://docs.rs/icu/latest/icu/properties/sets/fn.deprecated.html) for more information. /// /// Throws [Error] on failure. @@ -345,11 +245,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_deprecated = - _capi)>>('ICU4XCodePointSetData_load_deprecated') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `default_ignorable_code_point`](https://docs.rs/icu/latest/icu/properties/sets/fn.default_ignorable_code_point.html) for more information. /// /// Throws [Error] on failure. @@ -361,11 +256,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_default_ignorable_code_point = - _capi)>>('ICU4XCodePointSetData_load_default_ignorable_code_point') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `diacritic`](https://docs.rs/icu/latest/icu/properties/sets/fn.diacritic.html) for more information. /// /// Throws [Error] on failure. @@ -377,11 +267,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_diacritic = - _capi)>>('ICU4XCodePointSetData_load_diacritic') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `emoji_modifier_base`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_modifier_base.html) for more information. /// /// Throws [Error] on failure. @@ -393,11 +278,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_emoji_modifier_base = - _capi)>>('ICU4XCodePointSetData_load_emoji_modifier_base') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `emoji_component`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_component.html) for more information. /// /// Throws [Error] on failure. @@ -409,11 +289,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_emoji_component = - _capi)>>('ICU4XCodePointSetData_load_emoji_component') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `emoji_modifier`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_modifier.html) for more information. /// /// Throws [Error] on failure. @@ -425,11 +300,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_emoji_modifier = - _capi)>>('ICU4XCodePointSetData_load_emoji_modifier') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `emoji`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji.html) for more information. /// /// Throws [Error] on failure. @@ -441,11 +311,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_emoji = - _capi)>>('ICU4XCodePointSetData_load_emoji') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `emoji_presentation`](https://docs.rs/icu/latest/icu/properties/sets/fn.emoji_presentation.html) for more information. /// /// Throws [Error] on failure. @@ -457,11 +322,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_emoji_presentation = - _capi)>>('ICU4XCodePointSetData_load_emoji_presentation') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `extender`](https://docs.rs/icu/latest/icu/properties/sets/fn.extender.html) for more information. /// /// Throws [Error] on failure. @@ -473,11 +333,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_extender = - _capi)>>('ICU4XCodePointSetData_load_extender') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `extended_pictographic`](https://docs.rs/icu/latest/icu/properties/sets/fn.extended_pictographic.html) for more information. /// /// Throws [Error] on failure. @@ -489,11 +344,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_extended_pictographic = - _capi)>>('ICU4XCodePointSetData_load_extended_pictographic') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `graph`](https://docs.rs/icu/latest/icu/properties/sets/fn.graph.html) for more information. /// /// Throws [Error] on failure. @@ -505,11 +355,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_graph = - _capi)>>('ICU4XCodePointSetData_load_graph') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `grapheme_base`](https://docs.rs/icu/latest/icu/properties/sets/fn.grapheme_base.html) for more information. /// /// Throws [Error] on failure. @@ -521,11 +366,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_grapheme_base = - _capi)>>('ICU4XCodePointSetData_load_grapheme_base') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `grapheme_extend`](https://docs.rs/icu/latest/icu/properties/sets/fn.grapheme_extend.html) for more information. /// /// Throws [Error] on failure. @@ -537,11 +377,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_grapheme_extend = - _capi)>>('ICU4XCodePointSetData_load_grapheme_extend') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `grapheme_link`](https://docs.rs/icu/latest/icu/properties/sets/fn.grapheme_link.html) for more information. /// /// Throws [Error] on failure. @@ -553,11 +388,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_grapheme_link = - _capi)>>('ICU4XCodePointSetData_load_grapheme_link') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `hex_digit`](https://docs.rs/icu/latest/icu/properties/sets/fn.hex_digit.html) for more information. /// /// Throws [Error] on failure. @@ -569,11 +399,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_hex_digit = - _capi)>>('ICU4XCodePointSetData_load_hex_digit') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `hyphen`](https://docs.rs/icu/latest/icu/properties/sets/fn.hyphen.html) for more information. /// /// Throws [Error] on failure. @@ -585,11 +410,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_hyphen = - _capi)>>('ICU4XCodePointSetData_load_hyphen') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `id_continue`](https://docs.rs/icu/latest/icu/properties/sets/fn.id_continue.html) for more information. /// /// Throws [Error] on failure. @@ -601,11 +421,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_id_continue = - _capi)>>('ICU4XCodePointSetData_load_id_continue') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `ideographic`](https://docs.rs/icu/latest/icu/properties/sets/fn.ideographic.html) for more information. /// /// Throws [Error] on failure. @@ -617,11 +432,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_ideographic = - _capi)>>('ICU4XCodePointSetData_load_ideographic') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `id_start`](https://docs.rs/icu/latest/icu/properties/sets/fn.id_start.html) for more information. /// /// Throws [Error] on failure. @@ -633,11 +443,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_id_start = - _capi)>>('ICU4XCodePointSetData_load_id_start') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `ids_binary_operator`](https://docs.rs/icu/latest/icu/properties/sets/fn.ids_binary_operator.html) for more information. /// /// Throws [Error] on failure. @@ -649,11 +454,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_ids_binary_operator = - _capi)>>('ICU4XCodePointSetData_load_ids_binary_operator') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `ids_trinary_operator`](https://docs.rs/icu/latest/icu/properties/sets/fn.ids_trinary_operator.html) for more information. /// /// Throws [Error] on failure. @@ -665,11 +465,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_ids_trinary_operator = - _capi)>>('ICU4XCodePointSetData_load_ids_trinary_operator') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `join_control`](https://docs.rs/icu/latest/icu/properties/sets/fn.join_control.html) for more information. /// /// Throws [Error] on failure. @@ -681,11 +476,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_join_control = - _capi)>>('ICU4XCodePointSetData_load_join_control') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `logical_order_exception`](https://docs.rs/icu/latest/icu/properties/sets/fn.logical_order_exception.html) for more information. /// /// Throws [Error] on failure. @@ -697,11 +487,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_logical_order_exception = - _capi)>>('ICU4XCodePointSetData_load_logical_order_exception') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `lowercase`](https://docs.rs/icu/latest/icu/properties/sets/fn.lowercase.html) for more information. /// /// Throws [Error] on failure. @@ -713,11 +498,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_lowercase = - _capi)>>('ICU4XCodePointSetData_load_lowercase') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `math`](https://docs.rs/icu/latest/icu/properties/sets/fn.math.html) for more information. /// /// Throws [Error] on failure. @@ -729,11 +509,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_math = - _capi)>>('ICU4XCodePointSetData_load_math') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `noncharacter_code_point`](https://docs.rs/icu/latest/icu/properties/sets/fn.noncharacter_code_point.html) for more information. /// /// Throws [Error] on failure. @@ -745,11 +520,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_noncharacter_code_point = - _capi)>>('ICU4XCodePointSetData_load_noncharacter_code_point') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `nfc_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfc_inert.html) for more information. /// /// Throws [Error] on failure. @@ -761,11 +531,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_nfc_inert = - _capi)>>('ICU4XCodePointSetData_load_nfc_inert') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `nfd_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfd_inert.html) for more information. /// /// Throws [Error] on failure. @@ -777,11 +542,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_nfd_inert = - _capi)>>('ICU4XCodePointSetData_load_nfd_inert') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `nfkc_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfkc_inert.html) for more information. /// /// Throws [Error] on failure. @@ -793,11 +553,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_nfkc_inert = - _capi)>>('ICU4XCodePointSetData_load_nfkc_inert') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `nfkd_inert`](https://docs.rs/icu/latest/icu/properties/sets/fn.nfkd_inert.html) for more information. /// /// Throws [Error] on failure. @@ -809,11 +564,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_nfkd_inert = - _capi)>>('ICU4XCodePointSetData_load_nfkd_inert') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `pattern_syntax`](https://docs.rs/icu/latest/icu/properties/sets/fn.pattern_syntax.html) for more information. /// /// Throws [Error] on failure. @@ -825,11 +575,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_pattern_syntax = - _capi)>>('ICU4XCodePointSetData_load_pattern_syntax') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `pattern_white_space`](https://docs.rs/icu/latest/icu/properties/sets/fn.pattern_white_space.html) for more information. /// /// Throws [Error] on failure. @@ -841,11 +586,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_pattern_white_space = - _capi)>>('ICU4XCodePointSetData_load_pattern_white_space') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `prepended_concatenation_mark`](https://docs.rs/icu/latest/icu/properties/sets/fn.prepended_concatenation_mark.html) for more information. /// /// Throws [Error] on failure. @@ -857,11 +597,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_prepended_concatenation_mark = - _capi)>>('ICU4XCodePointSetData_load_prepended_concatenation_mark') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `print`](https://docs.rs/icu/latest/icu/properties/sets/fn.print.html) for more information. /// /// Throws [Error] on failure. @@ -873,11 +608,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_print = - _capi)>>('ICU4XCodePointSetData_load_print') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `quotation_mark`](https://docs.rs/icu/latest/icu/properties/sets/fn.quotation_mark.html) for more information. /// /// Throws [Error] on failure. @@ -889,11 +619,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_quotation_mark = - _capi)>>('ICU4XCodePointSetData_load_quotation_mark') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `radical`](https://docs.rs/icu/latest/icu/properties/sets/fn.radical.html) for more information. /// /// Throws [Error] on failure. @@ -905,11 +630,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_radical = - _capi)>>('ICU4XCodePointSetData_load_radical') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `regional_indicator`](https://docs.rs/icu/latest/icu/properties/sets/fn.regional_indicator.html) for more information. /// /// Throws [Error] on failure. @@ -921,11 +641,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_regional_indicator = - _capi)>>('ICU4XCodePointSetData_load_regional_indicator') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `soft_dotted`](https://docs.rs/icu/latest/icu/properties/sets/fn.soft_dotted.html) for more information. /// /// Throws [Error] on failure. @@ -937,11 +652,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_soft_dotted = - _capi)>>('ICU4XCodePointSetData_load_soft_dotted') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `segment_starter`](https://docs.rs/icu/latest/icu/properties/sets/fn.segment_starter.html) for more information. /// /// Throws [Error] on failure. @@ -953,11 +663,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_segment_starter = - _capi)>>('ICU4XCodePointSetData_load_segment_starter') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `case_sensitive`](https://docs.rs/icu/latest/icu/properties/sets/fn.case_sensitive.html) for more information. /// /// Throws [Error] on failure. @@ -969,11 +674,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_case_sensitive = - _capi)>>('ICU4XCodePointSetData_load_case_sensitive') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `sentence_terminal`](https://docs.rs/icu/latest/icu/properties/sets/fn.sentence_terminal.html) for more information. /// /// Throws [Error] on failure. @@ -985,11 +685,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_sentence_terminal = - _capi)>>('ICU4XCodePointSetData_load_sentence_terminal') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `terminal_punctuation`](https://docs.rs/icu/latest/icu/properties/sets/fn.terminal_punctuation.html) for more information. /// /// Throws [Error] on failure. @@ -1001,11 +696,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_terminal_punctuation = - _capi)>>('ICU4XCodePointSetData_load_terminal_punctuation') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `unified_ideograph`](https://docs.rs/icu/latest/icu/properties/sets/fn.unified_ideograph.html) for more information. /// /// Throws [Error] on failure. @@ -1017,11 +707,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_unified_ideograph = - _capi)>>('ICU4XCodePointSetData_load_unified_ideograph') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `uppercase`](https://docs.rs/icu/latest/icu/properties/sets/fn.uppercase.html) for more information. /// /// Throws [Error] on failure. @@ -1033,11 +718,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_uppercase = - _capi)>>('ICU4XCodePointSetData_load_uppercase') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `variation_selector`](https://docs.rs/icu/latest/icu/properties/sets/fn.variation_selector.html) for more information. /// /// Throws [Error] on failure. @@ -1049,11 +729,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_variation_selector = - _capi)>>('ICU4XCodePointSetData_load_variation_selector') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `white_space`](https://docs.rs/icu/latest/icu/properties/sets/fn.white_space.html) for more information. /// /// Throws [Error] on failure. @@ -1065,11 +740,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_white_space = - _capi)>>('ICU4XCodePointSetData_load_white_space') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `xdigit`](https://docs.rs/icu/latest/icu/properties/sets/fn.xdigit.html) for more information. /// /// Throws [Error] on failure. @@ -1081,11 +751,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_xdigit = - _capi)>>('ICU4XCodePointSetData_load_xdigit') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `xid_continue`](https://docs.rs/icu/latest/icu/properties/sets/fn.xid_continue.html) for more information. /// /// Throws [Error] on failure. @@ -1097,11 +762,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_xid_continue = - _capi)>>('ICU4XCodePointSetData_load_xid_continue') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `xid_start`](https://docs.rs/icu/latest/icu/properties/sets/fn.xid_start.html) for more information. /// /// Throws [Error] on failure. @@ -1113,11 +773,6 @@ final class CodePointSetData implements ffi.Finalizable { return CodePointSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_xid_start = - _capi)>>('ICU4XCodePointSetData_load_xid_start') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Loads data for a property specified as a string as long as it is one of the /// [ECMA-262 binary properties][ecma] (not including Any, ASCII, and Assigned pseudoproperties). /// @@ -1139,9 +794,288 @@ final class CodePointSetData implements ffi.Finalizable { } return CodePointSetData._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XCodePointSetData_load_for_ecma262 = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XCodePointSetData_load_for_ecma262') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCodePointSetData_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_contains') +// ignore: non_constant_identifier_names +external bool _ICU4XCodePointSetData_contains(ffi.Pointer self, Rune cp); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_iter_ranges') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointSetData_iter_ranges(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_iter_ranges_complemented') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCodePointSetData_iter_ranges_complemented(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_for_general_category_group') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_for_general_category_group(ffi.Pointer provider, int group); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_ascii_hex_digit') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ascii_hex_digit(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_alnum') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_alnum(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_alphabetic') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_alphabetic(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_bidi_control') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_bidi_control(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_bidi_mirrored') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_bidi_mirrored(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_blank') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_blank(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_cased') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_cased(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_case_ignorable') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_case_ignorable(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_full_composition_exclusion') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_full_composition_exclusion(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_changes_when_casefolded') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_casefolded(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_changes_when_casemapped') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_casemapped(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_changes_when_nfkc_casefolded') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_changes_when_lowercased') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_lowercased(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_changes_when_titlecased') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_titlecased(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_changes_when_uppercased') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_changes_when_uppercased(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_dash') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_dash(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_deprecated') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_deprecated(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_default_ignorable_code_point') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_default_ignorable_code_point(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_diacritic') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_diacritic(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_emoji_modifier_base') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_modifier_base(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_emoji_component') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_component(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_emoji_modifier') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_modifier(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_emoji') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_emoji_presentation') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_emoji_presentation(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_extender') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_extender(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_extended_pictographic') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_extended_pictographic(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_graph') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_graph(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_grapheme_base') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_grapheme_base(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_grapheme_extend') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_grapheme_extend(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_grapheme_link') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_grapheme_link(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_hex_digit') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_hex_digit(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_hyphen') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_hyphen(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_id_continue') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_id_continue(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_ideographic') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ideographic(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_id_start') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_id_start(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_ids_binary_operator') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ids_binary_operator(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_ids_trinary_operator') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_ids_trinary_operator(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_join_control') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_join_control(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_logical_order_exception') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_logical_order_exception(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_lowercase') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_lowercase(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_math') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_math(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_noncharacter_code_point') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_noncharacter_code_point(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_nfc_inert') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfc_inert(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_nfd_inert') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfd_inert(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_nfkc_inert') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfkc_inert(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_nfkd_inert') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_nfkd_inert(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_pattern_syntax') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_pattern_syntax(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_pattern_white_space') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_pattern_white_space(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_prepended_concatenation_mark') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_prepended_concatenation_mark(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_print') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_print(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_quotation_mark') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_quotation_mark(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_radical') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_radical(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_regional_indicator') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_regional_indicator(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_soft_dotted') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_soft_dotted(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_segment_starter') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_segment_starter(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_case_sensitive') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_case_sensitive(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_sentence_terminal') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_sentence_terminal(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_terminal_punctuation') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_terminal_punctuation(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_unified_ideograph') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_unified_ideograph(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_uppercase') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_uppercase(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_variation_selector') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_variation_selector(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_white_space') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_white_space(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_xdigit') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_xdigit(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_xid_continue') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_xid_continue(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_xid_start') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_xid_start(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XCodePointSetData_load_for_ecma262') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCodePointSetData_load_for_ecma262(ffi.Pointer provider, ffi.Pointer propertyNameData, int propertyNameLength); diff --git a/ffi/capi/bindings/dart/Collator.g.dart b/ffi/capi/bindings/dart/Collator.g.dart index 19af4f6adc3..584109a59ee 100644 --- a/ffi/capi/bindings/dart/Collator.g.dart +++ b/ffi/capi/bindings/dart/Collator.g.dart @@ -13,7 +13,7 @@ final class Collator implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCollator_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCollator_destroy)); /// Construct a new Collator instance. /// @@ -28,11 +28,6 @@ final class Collator implements ffi.Finalizable { return Collator._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCollator_create_v1 = - _capi, ffi.Pointer, _CollatorOptionsV1Ffi)>>('ICU4XCollator_create_v1') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, _CollatorOptionsV1Ffi)>(isLeaf: true); - /// Compare two strings. /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -48,11 +43,6 @@ final class Collator implements ffi.Finalizable { return Ordering.values.firstWhere((v) => v._underlying == result); } - // ignore: non_constant_identifier_names - static final _ICU4XCollator_compare_utf16 = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer, ffi.Size)>>('ICU4XCollator_compare_utf16') - .asFunction, ffi.Pointer, int, ffi.Pointer, int)>(isLeaf: true); - /// The resolved options showing how the default options, the requested options, /// and the options from locale data were combined. None of the struct fields /// will have `Auto` as the value. @@ -62,9 +52,20 @@ final class Collator implements ffi.Finalizable { final result = _ICU4XCollator_resolved_options(_underlying); return CollatorResolvedOptionsV1._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XCollator_resolved_options = - _capi)>>('ICU4XCollator_resolved_options') - .asFunction<_CollatorResolvedOptionsV1Ffi Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCollator_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCollator_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, _CollatorOptionsV1Ffi)>(isLeaf: true, symbol: 'ICU4XCollator_create_v1') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCollator_create_v1(ffi.Pointer provider, ffi.Pointer locale, _CollatorOptionsV1Ffi options); + +@ffi.Native, ffi.Pointer, ffi.Size, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XCollator_compare_utf16') +// ignore: non_constant_identifier_names +external int _ICU4XCollator_compare_utf16(ffi.Pointer self, ffi.Pointer leftData, int leftLength, ffi.Pointer rightData, int rightLength); + +@ffi.Native<_CollatorResolvedOptionsV1Ffi Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCollator_resolved_options') +// ignore: non_constant_identifier_names +external _CollatorResolvedOptionsV1Ffi _ICU4XCollator_resolved_options(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/ComposingNormalizer.g.dart b/ffi/capi/bindings/dart/ComposingNormalizer.g.dart index 541ded4dcc8..2a9d96f4194 100644 --- a/ffi/capi/bindings/dart/ComposingNormalizer.g.dart +++ b/ffi/capi/bindings/dart/ComposingNormalizer.g.dart @@ -13,7 +13,7 @@ final class ComposingNormalizer implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XComposingNormalizer_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XComposingNormalizer_destroy)); /// Construct a new ICU4XComposingNormalizer instance for NFC /// @@ -28,11 +28,6 @@ final class ComposingNormalizer implements ffi.Finalizable { return ComposingNormalizer._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XComposingNormalizer_create_nfc = - _capi)>>('ICU4XComposingNormalizer_create_nfc') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct a new ICU4XComposingNormalizer instance for NFKC /// /// See the [Rust documentation for `new_nfkc`](https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfkc) for more information. @@ -46,11 +41,6 @@ final class ComposingNormalizer implements ffi.Finalizable { return ComposingNormalizer._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XComposingNormalizer_create_nfkc = - _capi)>>('ICU4XComposingNormalizer_create_nfkc') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Normalize a string /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -71,11 +61,6 @@ final class ComposingNormalizer implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XComposingNormalizer_normalize = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XComposingNormalizer_normalize') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); - /// Check if a string is normalized /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -89,9 +74,24 @@ final class ComposingNormalizer implements ffi.Finalizable { temp.releaseAll(); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XComposingNormalizer_is_normalized = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XComposingNormalizer_is_normalized') - .asFunction, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XComposingNormalizer_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XComposingNormalizer_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XComposingNormalizer_create_nfc') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XComposingNormalizer_create_nfc(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XComposingNormalizer_create_nfkc') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XComposingNormalizer_create_nfkc(ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XComposingNormalizer_normalize') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XComposingNormalizer_normalize(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer writeable); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XComposingNormalizer_is_normalized') +// ignore: non_constant_identifier_names +external bool _ICU4XComposingNormalizer_is_normalized(ffi.Pointer self, ffi.Pointer sData, int sLength); diff --git a/ffi/capi/bindings/dart/CustomTimeZone.g.dart b/ffi/capi/bindings/dart/CustomTimeZone.g.dart index 3b3563a1d84..a763ca3fe9e 100644 --- a/ffi/capi/bindings/dart/CustomTimeZone.g.dart +++ b/ffi/capi/bindings/dart/CustomTimeZone.g.dart @@ -13,7 +13,7 @@ final class CustomTimeZone implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XCustomTimeZone_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XCustomTimeZone_destroy)); /// Creates a time zone from an offset string. /// @@ -31,11 +31,6 @@ final class CustomTimeZone implements ffi.Finalizable { return CustomTimeZone._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_create_from_string = - _capi, ffi.Size)>>('ICU4XCustomTimeZone_create_from_string') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// Creates a time zone with no information. /// /// See the [Rust documentation for `new_empty`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.new_empty) for more information. @@ -44,11 +39,6 @@ final class CustomTimeZone implements ffi.Finalizable { return CustomTimeZone._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_create_empty = - _capi Function()>>('ICU4XCustomTimeZone_create_empty') - .asFunction Function()>(isLeaf: true); - /// Creates a time zone for UTC. /// /// See the [Rust documentation for `utc`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.utc) for more information. @@ -57,11 +47,6 @@ final class CustomTimeZone implements ffi.Finalizable { return CustomTimeZone._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_create_utc = - _capi Function()>>('ICU4XCustomTimeZone_create_utc') - .asFunction Function()>(isLeaf: true); - /// Sets the `gmt_offset` field from offset seconds. /// /// Errors if the offset seconds are out of range. @@ -78,11 +63,6 @@ final class CustomTimeZone implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_try_set_gmt_offset_seconds = - _capi, ffi.Int32)>>('ICU4XCustomTimeZone_try_set_gmt_offset_seconds') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// Clears the `gmt_offset` field. /// /// See the [Rust documentation for `offset_seconds`](https://docs.rs/icu/latest/icu/timezone/struct.GmtOffset.html#method.offset_seconds) for more information. @@ -92,11 +72,6 @@ final class CustomTimeZone implements ffi.Finalizable { _ICU4XCustomTimeZone_clear_gmt_offset(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_clear_gmt_offset = - _capi)>>('ICU4XCustomTimeZone_clear_gmt_offset') - .asFunction)>(isLeaf: true); - /// Returns the value of the `gmt_offset` field as offset seconds. /// /// Errors if the `gmt_offset` field is empty. @@ -114,11 +89,6 @@ final class CustomTimeZone implements ffi.Finalizable { return result.union.ok; } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_gmt_offset_seconds = - _capi)>>('ICU4XCustomTimeZone_gmt_offset_seconds') - .asFunction<_ResultInt32Int32 Function(ffi.Pointer)>(isLeaf: true); - /// Returns whether the `gmt_offset` field is positive. /// /// Errors if the `gmt_offset` field is empty. @@ -134,11 +104,6 @@ final class CustomTimeZone implements ffi.Finalizable { return result.union.ok; } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_is_gmt_offset_positive = - _capi)>>('ICU4XCustomTimeZone_is_gmt_offset_positive') - .asFunction<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Returns whether the `gmt_offset` field is zero. /// /// Errors if the `gmt_offset` field is empty (which is not the same as zero). @@ -154,11 +119,6 @@ final class CustomTimeZone implements ffi.Finalizable { return result.union.ok; } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_is_gmt_offset_zero = - _capi)>>('ICU4XCustomTimeZone_is_gmt_offset_zero') - .asFunction<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Returns whether the `gmt_offset` field has nonzero minutes. /// /// Errors if the `gmt_offset` field is empty. @@ -174,11 +134,6 @@ final class CustomTimeZone implements ffi.Finalizable { return result.union.ok; } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_gmt_offset_has_minutes = - _capi)>>('ICU4XCustomTimeZone_gmt_offset_has_minutes') - .asFunction<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Returns whether the `gmt_offset` field has nonzero seconds. /// /// Errors if the `gmt_offset` field is empty. @@ -194,11 +149,6 @@ final class CustomTimeZone implements ffi.Finalizable { return result.union.ok; } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_gmt_offset_has_seconds = - _capi)>>('ICU4XCustomTimeZone_gmt_offset_has_seconds') - .asFunction<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Sets the `time_zone_id` field from a BCP-47 string. /// /// Errors if the string is not a valid BCP-47 time zone ID. @@ -218,11 +168,6 @@ final class CustomTimeZone implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_try_set_time_zone_id = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XCustomTimeZone_try_set_time_zone_id') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Sets the `time_zone_id` field from an IANA string by looking up /// the corresponding BCP-47 string. /// @@ -241,11 +186,6 @@ final class CustomTimeZone implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_try_set_iana_time_zone_id = - _capi, ffi.Pointer, ffi.Pointer, ffi.Size)>>('ICU4XCustomTimeZone_try_set_iana_time_zone_id') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Clears the `time_zone_id` field. /// /// See the [Rust documentation for `time_zone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.time_zone_id) for more information. @@ -255,11 +195,6 @@ final class CustomTimeZone implements ffi.Finalizable { _ICU4XCustomTimeZone_clear_time_zone_id(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_clear_time_zone_id = - _capi)>>('ICU4XCustomTimeZone_clear_time_zone_id') - .asFunction)>(isLeaf: true); - /// Writes the value of the `time_zone_id` field as a string. /// /// Errors if the `time_zone_id` field is empty. @@ -278,11 +213,6 @@ final class CustomTimeZone implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_time_zone_id = - _capi, ffi.Pointer)>>('ICU4XCustomTimeZone_time_zone_id') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Sets the `metazone_id` field from a string. /// /// Errors if the string is not a valid BCP-47 metazone ID. @@ -302,11 +232,6 @@ final class CustomTimeZone implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_try_set_metazone_id = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XCustomTimeZone_try_set_metazone_id') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Clears the `metazone_id` field. /// /// See the [Rust documentation for `metazone_id`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.metazone_id) for more information. @@ -316,11 +241,6 @@ final class CustomTimeZone implements ffi.Finalizable { _ICU4XCustomTimeZone_clear_metazone_id(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_clear_metazone_id = - _capi)>>('ICU4XCustomTimeZone_clear_metazone_id') - .asFunction)>(isLeaf: true); - /// Writes the value of the `metazone_id` field as a string. /// /// Errors if the `metazone_id` field is empty. @@ -339,11 +259,6 @@ final class CustomTimeZone implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_metazone_id = - _capi, ffi.Pointer)>>('ICU4XCustomTimeZone_metazone_id') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Sets the `zone_variant` field from a string. /// /// Errors if the string is not a valid zone variant. @@ -363,11 +278,6 @@ final class CustomTimeZone implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_try_set_zone_variant = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XCustomTimeZone_try_set_zone_variant') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Clears the `zone_variant` field. /// /// See the [Rust documentation for `zone_variant`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#structfield.zone_variant) for more information. @@ -377,11 +287,6 @@ final class CustomTimeZone implements ffi.Finalizable { _ICU4XCustomTimeZone_clear_zone_variant(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_clear_zone_variant = - _capi)>>('ICU4XCustomTimeZone_clear_zone_variant') - .asFunction)>(isLeaf: true); - /// Writes the value of the `zone_variant` field as a string. /// /// Errors if the `zone_variant` field is empty. @@ -400,11 +305,6 @@ final class CustomTimeZone implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_zone_variant = - _capi, ffi.Pointer)>>('ICU4XCustomTimeZone_zone_variant') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Sets the `zone_variant` field to standard time. /// /// See the [Rust documentation for `standard`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.standard) for more information. @@ -414,11 +314,6 @@ final class CustomTimeZone implements ffi.Finalizable { _ICU4XCustomTimeZone_set_standard_time(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_set_standard_time = - _capi)>>('ICU4XCustomTimeZone_set_standard_time') - .asFunction)>(isLeaf: true); - /// Sets the `zone_variant` field to daylight time. /// /// See the [Rust documentation for `daylight`](https://docs.rs/icu/latest/icu/timezone/struct.ZoneVariant.html#method.daylight) for more information. @@ -428,11 +323,6 @@ final class CustomTimeZone implements ffi.Finalizable { _ICU4XCustomTimeZone_set_daylight_time(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_set_daylight_time = - _capi)>>('ICU4XCustomTimeZone_set_daylight_time') - .asFunction)>(isLeaf: true); - /// Returns whether the `zone_variant` field is standard time. /// /// Errors if the `zone_variant` field is empty. @@ -450,11 +340,6 @@ final class CustomTimeZone implements ffi.Finalizable { return result.union.ok; } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_is_standard_time = - _capi)>>('ICU4XCustomTimeZone_is_standard_time') - .asFunction<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Returns whether the `zone_variant` field is daylight time. /// /// Errors if the `zone_variant` field is empty. @@ -472,11 +357,6 @@ final class CustomTimeZone implements ffi.Finalizable { return result.union.ok; } - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_is_daylight_time = - _capi)>>('ICU4XCustomTimeZone_is_daylight_time') - .asFunction<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Sets the metazone based on the time zone and the local timestamp. /// /// See the [Rust documentation for `maybe_calculate_metazone`](https://docs.rs/icu/latest/icu/timezone/struct.CustomTimeZone.html#method.maybe_calculate_metazone) for more information. @@ -485,9 +365,108 @@ final class CustomTimeZone implements ffi.Finalizable { void maybeCalculateMetazone(MetazoneCalculator metazoneCalculator, IsoDateTime localDatetime) { _ICU4XCustomTimeZone_maybe_calculate_metazone(_underlying, metazoneCalculator._underlying, localDatetime._underlying); } - - // ignore: non_constant_identifier_names - static final _ICU4XCustomTimeZone_maybe_calculate_metazone = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XCustomTimeZone_maybe_calculate_metazone') - .asFunction, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_create_from_string') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XCustomTimeZone_create_from_string(ffi.Pointer sData, int sLength); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_create_empty') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCustomTimeZone_create_empty(); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_create_utc') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XCustomTimeZone_create_utc(); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_gmt_offset_seconds') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_gmt_offset_seconds(ffi.Pointer self, int offsetSeconds); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_clear_gmt_offset') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_clear_gmt_offset(ffi.Pointer self); + +@ffi.Native<_ResultInt32Int32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_gmt_offset_seconds') +// ignore: non_constant_identifier_names +external _ResultInt32Int32 _ICU4XCustomTimeZone_gmt_offset_seconds(ffi.Pointer self); + +@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_is_gmt_offset_positive') +// ignore: non_constant_identifier_names +external _ResultBoolInt32 _ICU4XCustomTimeZone_is_gmt_offset_positive(ffi.Pointer self); + +@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_is_gmt_offset_zero') +// ignore: non_constant_identifier_names +external _ResultBoolInt32 _ICU4XCustomTimeZone_is_gmt_offset_zero(ffi.Pointer self); + +@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_gmt_offset_has_minutes') +// ignore: non_constant_identifier_names +external _ResultBoolInt32 _ICU4XCustomTimeZone_gmt_offset_has_minutes(ffi.Pointer self); + +@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_gmt_offset_has_seconds') +// ignore: non_constant_identifier_names +external _ResultBoolInt32 _ICU4XCustomTimeZone_gmt_offset_has_seconds(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_time_zone_id') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_time_zone_id(ffi.Pointer self, ffi.Pointer idData, int idLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_iana_time_zone_id') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_iana_time_zone_id(ffi.Pointer self, ffi.Pointer mapper, ffi.Pointer idData, int idLength); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_clear_time_zone_id') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_clear_time_zone_id(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_time_zone_id') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_time_zone_id(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_metazone_id') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_metazone_id(ffi.Pointer self, ffi.Pointer idData, int idLength); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_clear_metazone_id') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_clear_metazone_id(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_metazone_id') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_metazone_id(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_try_set_zone_variant') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_try_set_zone_variant(ffi.Pointer self, ffi.Pointer idData, int idLength); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_clear_zone_variant') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_clear_zone_variant(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_zone_variant') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XCustomTimeZone_zone_variant(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_set_standard_time') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_set_standard_time(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_set_daylight_time') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_set_daylight_time(ffi.Pointer self); + +@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_is_standard_time') +// ignore: non_constant_identifier_names +external _ResultBoolInt32 _ICU4XCustomTimeZone_is_standard_time(ffi.Pointer self); + +@ffi.Native<_ResultBoolInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_is_daylight_time') +// ignore: non_constant_identifier_names +external _ResultBoolInt32 _ICU4XCustomTimeZone_is_daylight_time(ffi.Pointer self); + +@ffi.Native, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XCustomTimeZone_maybe_calculate_metazone') +// ignore: non_constant_identifier_names +external void _ICU4XCustomTimeZone_maybe_calculate_metazone(ffi.Pointer self, ffi.Pointer metazoneCalculator, ffi.Pointer localDatetime); diff --git a/ffi/capi/bindings/dart/DataProvider.g.dart b/ffi/capi/bindings/dart/DataProvider.g.dart index c63e0ef10ae..2e2a2114d3d 100644 --- a/ffi/capi/bindings/dart/DataProvider.g.dart +++ b/ffi/capi/bindings/dart/DataProvider.g.dart @@ -15,7 +15,7 @@ final class DataProvider implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XDataProvider_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XDataProvider_destroy)); /// Constructs an [`DataProvider`] that uses compiled data. /// @@ -28,11 +28,6 @@ final class DataProvider implements ffi.Finalizable { return DataProvider._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDataProvider_create_compiled = - _capi Function()>>('ICU4XDataProvider_create_compiled') - .asFunction Function()>(isLeaf: true); - /// Constructs a `BlobDataProvider` and returns it as an [`DataProvider`]. /// /// See the [Rust documentation for `BlobDataProvider`](https://docs.rs/icu_provider_blob/latest/icu_provider_blob/struct.BlobDataProvider.html) for more information. @@ -49,11 +44,6 @@ final class DataProvider implements ffi.Finalizable { return DataProvider._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDataProvider_create_from_byte_slice = - _capi, ffi.Size)>>('ICU4XDataProvider_create_from_byte_slice') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// Constructs an empty [`DataProvider`]. /// /// See the [Rust documentation for `EmptyDataProvider`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/empty/struct.EmptyDataProvider.html) for more information. @@ -62,11 +52,6 @@ final class DataProvider implements ffi.Finalizable { return DataProvider._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDataProvider_create_empty = - _capi Function()>>('ICU4XDataProvider_create_empty') - .asFunction Function()>(isLeaf: true); - /// Creates a provider that tries the current provider and then, if the current provider /// doesn't support the data key, another provider `other`. /// @@ -86,11 +71,6 @@ final class DataProvider implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XDataProvider_fork_by_key = - _capi, ffi.Pointer)>>('ICU4XDataProvider_fork_by_key') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Same as `fork_by_key` but forks by locale instead of key. /// /// See the [Rust documentation for `MissingLocalePredicate`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fork/predicates/struct.MissingLocalePredicate.html) for more information. @@ -103,11 +83,6 @@ final class DataProvider implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XDataProvider_fork_by_locale = - _capi, ffi.Pointer)>>('ICU4XDataProvider_fork_by_locale') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Enables locale fallbacking for data requests made to this provider. /// /// Note that the test provider (from `create_test`) already has fallbacking enabled. @@ -124,11 +99,6 @@ final class DataProvider implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XDataProvider_enable_locale_fallback = - _capi)>>('ICU4XDataProvider_enable_locale_fallback') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `new_with_fallbacker`](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html#method.new_with_fallbacker) for more information. /// /// Additional information: [1](https://docs.rs/icu_provider_adapters/latest/icu_provider_adapters/fallback/struct.LocaleFallbackProvider.html) @@ -140,9 +110,36 @@ final class DataProvider implements ffi.Finalizable { throw Error.values.firstWhere((v) => v._underlying == result.union.err); } } - - // ignore: non_constant_identifier_names - static final _ICU4XDataProvider_enable_locale_fallback_with = - _capi, ffi.Pointer)>>('ICU4XDataProvider_enable_locale_fallback_with') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDataProvider_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XDataProvider_destroy(ffi.Pointer self); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XDataProvider_create_compiled') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDataProvider_create_compiled(); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XDataProvider_create_from_byte_slice') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDataProvider_create_from_byte_slice(ffi.Pointer blobData, int blobLength); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XDataProvider_create_empty') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDataProvider_create_empty(); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDataProvider_fork_by_key') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDataProvider_fork_by_key(ffi.Pointer self, ffi.Pointer other); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDataProvider_fork_by_locale') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDataProvider_fork_by_locale(ffi.Pointer self, ffi.Pointer other); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDataProvider_enable_locale_fallback') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDataProvider_enable_locale_fallback(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDataProvider_enable_locale_fallback_with') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDataProvider_enable_locale_fallback_with(ffi.Pointer self, ffi.Pointer fallbacker); diff --git a/ffi/capi/bindings/dart/Date.g.dart b/ffi/capi/bindings/dart/Date.g.dart index 6bfb908b67b..cfeab573512 100644 --- a/ffi/capi/bindings/dart/Date.g.dart +++ b/ffi/capi/bindings/dart/Date.g.dart @@ -15,7 +15,7 @@ final class Date implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XDate_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XDate_destroy)); /// Creates a new [`Date`] representing the ISO date and time /// given but in a given calendar @@ -31,11 +31,6 @@ final class Date implements ffi.Finalizable { return Date._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_create_from_iso_in_calendar = - _capi)>>('ICU4XDate_create_from_iso_in_calendar') - .asFunction<_ResultOpaqueInt32 Function(int, int, int, ffi.Pointer)>(isLeaf: true); - /// Creates a new [`Date`] from the given codes, which are interpreted in the given calendar system /// /// See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.try_new_from_codes) for more information. @@ -53,11 +48,6 @@ final class Date implements ffi.Finalizable { return Date._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_create_from_codes_in_calendar = - _capi, ffi.Size, ffi.Int32, ffi.Pointer, ffi.Size, ffi.Uint8, ffi.Pointer)>>('ICU4XDate_create_from_codes_in_calendar') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int, int, ffi.Pointer, int, int, ffi.Pointer)>(isLeaf: true); - /// Convert this date to one in a different calendar /// /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar) for more information. @@ -66,11 +56,6 @@ final class Date implements ffi.Finalizable { return Date._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_to_calendar = - _capi Function(ffi.Pointer, ffi.Pointer)>>('ICU4XDate_to_calendar') - .asFunction Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Converts this date to ISO /// /// See the [Rust documentation for `to_iso`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_iso) for more information. @@ -79,11 +64,6 @@ final class Date implements ffi.Finalizable { return IsoDate._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_to_iso = - _capi Function(ffi.Pointer)>>('ICU4XDate_to_iso') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Returns the 1-indexed day in the month for this date /// /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. @@ -92,11 +72,6 @@ final class Date implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDate_day_of_month = - _capi)>>('ICU4XDate_day_of_month') - .asFunction)>(isLeaf: true); - /// Returns the day in the week for this day /// /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. @@ -105,11 +80,6 @@ final class Date implements ffi.Finalizable { return IsoWeekday.values.firstWhere((v) => v._underlying == result); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_day_of_week = - _capi)>>('ICU4XDate_day_of_week') - .asFunction)>(isLeaf: true); - /// Returns the week number in this month, 1-indexed, based on what /// is considered the first day of the week (often a locale preference). /// @@ -121,11 +91,6 @@ final class Date implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDate_week_of_month = - _capi, ffi.Int32)>>('ICU4XDate_week_of_month') - .asFunction, int)>(isLeaf: true); - /// Returns the week number in this year, using week data /// /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. @@ -139,11 +104,6 @@ final class Date implements ffi.Finalizable { return WeekOf._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_week_of_year = - _capi, ffi.Pointer)>>('ICU4XDate_week_of_year') - .asFunction<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns 1-indexed number of the month of this date in its year /// /// Note that for lunar calendars this may not lead to the same month @@ -156,11 +116,6 @@ final class Date implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDate_ordinal_month = - _capi)>>('ICU4XDate_ordinal_month') - .asFunction)>(isLeaf: true); - /// Returns the month code for this date. Typically something /// like "M01", "M02", but can be more complicated for lunar calendars. /// @@ -176,11 +131,6 @@ final class Date implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_month_code = - _capi, ffi.Pointer)>>('ICU4XDate_month_code') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the year number in the current era for this date /// /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. @@ -189,11 +139,6 @@ final class Date implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDate_year_in_era = - _capi)>>('ICU4XDate_year_in_era') - .asFunction)>(isLeaf: true); - /// Returns the era for this date, /// /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/struct.Date.html#method.year) for more information. @@ -210,11 +155,6 @@ final class Date implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDate_era = - _capi, ffi.Pointer)>>('ICU4XDate_era') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the number of months in the year represented by this date /// /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. @@ -223,11 +163,6 @@ final class Date implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDate_months_in_year = - _capi)>>('ICU4XDate_months_in_year') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the month represented by this date /// /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. @@ -236,11 +171,6 @@ final class Date implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDate_days_in_month = - _capi)>>('ICU4XDate_days_in_month') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the year represented by this date /// /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. @@ -249,11 +179,6 @@ final class Date implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDate_days_in_year = - _capi)>>('ICU4XDate_days_in_year') - .asFunction)>(isLeaf: true); - /// Returns the [`Calendar`] object backing this date /// /// See the [Rust documentation for `calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar) for more information. @@ -261,9 +186,72 @@ final class Date implements ffi.Finalizable { final result = _ICU4XDate_calendar(_underlying); return Calendar._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XDate_calendar = - _capi Function(ffi.Pointer)>>('ICU4XDate_calendar') - .asFunction Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XDate_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int32, ffi.Uint8, ffi.Uint8, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_create_from_iso_in_calendar') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDate_create_from_iso_in_calendar(int year, int month, int day, ffi.Pointer calendar); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Size, ffi.Int32, ffi.Pointer, ffi.Size, ffi.Uint8, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_create_from_codes_in_calendar') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDate_create_from_codes_in_calendar(ffi.Pointer eraCodeData, int eraCodeLength, int year, ffi.Pointer monthCodeData, int monthCodeLength, int day, ffi.Pointer calendar); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_to_calendar') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDate_to_calendar(ffi.Pointer self, ffi.Pointer calendar); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_to_iso') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDate_to_iso(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_day_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XDate_day_of_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_day_of_week') +// ignore: non_constant_identifier_names +external int _ICU4XDate_day_of_week(ffi.Pointer self); + +@ffi.Native, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XDate_week_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XDate_week_of_month(ffi.Pointer self, int firstWeekday); + +@ffi.Native<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_week_of_year') +// ignore: non_constant_identifier_names +external _ResultWeekOfFfiInt32 _ICU4XDate_week_of_year(ffi.Pointer self, ffi.Pointer calculator); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_ordinal_month') +// ignore: non_constant_identifier_names +external int _ICU4XDate_ordinal_month(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_month_code') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDate_month_code(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_year_in_era') +// ignore: non_constant_identifier_names +external int _ICU4XDate_year_in_era(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_era') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDate_era(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_months_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XDate_months_in_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_days_in_month') +// ignore: non_constant_identifier_names +external int _ICU4XDate_days_in_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDate_days_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XDate_days_in_year(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDate_calendar') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDate_calendar(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/DateFormatter.g.dart b/ffi/capi/bindings/dart/DateFormatter.g.dart index ca28fce8c07..e09c75d75a3 100644 --- a/ffi/capi/bindings/dart/DateFormatter.g.dart +++ b/ffi/capi/bindings/dart/DateFormatter.g.dart @@ -16,7 +16,7 @@ final class DateFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XDateFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XDateFormatter_destroy)); /// Creates a new [`DateFormatter`] from locale data. /// @@ -31,11 +31,6 @@ final class DateFormatter implements ffi.Finalizable { return DateFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDateFormatter_create_with_length = - _capi, ffi.Pointer, ffi.Int32)>>('ICU4XDateFormatter_create_with_length') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Formats a [`Date`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. @@ -50,11 +45,6 @@ final class DateFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDateFormatter_format_date = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XDateFormatter_format_date') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`IsoDate`] to a string. /// /// Will convert to this formatter's calendar first @@ -71,11 +61,6 @@ final class DateFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDateFormatter_format_iso_date = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XDateFormatter_format_iso_date') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`DateTime`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateFormatter.html#method.format) for more information. @@ -90,11 +75,6 @@ final class DateFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDateFormatter_format_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XDateFormatter_format_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`IsoDateTime`] to a string. /// /// Will convert to this formatter's calendar first @@ -110,9 +90,28 @@ final class DateFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XDateFormatter_format_iso_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XDateFormatter_format_iso_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XDateFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XDateFormatter_create_with_length') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDateFormatter_create_with_length(ffi.Pointer provider, ffi.Pointer locale, int dateLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateFormatter_format_date') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateFormatter_format_date(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateFormatter_format_iso_date') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateFormatter_format_iso_date(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateFormatter_format_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateFormatter_format_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateFormatter_format_iso_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateFormatter_format_iso_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/DateTime.g.dart b/ffi/capi/bindings/dart/DateTime.g.dart index c5f0eb4f82c..a8403c09ca8 100644 --- a/ffi/capi/bindings/dart/DateTime.g.dart +++ b/ffi/capi/bindings/dart/DateTime.g.dart @@ -15,7 +15,7 @@ final class DateTime implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XDateTime_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XDateTime_destroy)); /// Creates a new [`DateTime`] representing the ISO date and time /// given but in a given calendar @@ -31,11 +31,6 @@ final class DateTime implements ffi.Finalizable { return DateTime._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_create_from_iso_in_calendar = - _capi)>>('ICU4XDateTime_create_from_iso_in_calendar') - .asFunction<_ResultOpaqueInt32 Function(int, int, int, int, int, int, int, ffi.Pointer)>(isLeaf: true); - /// Creates a new [`DateTime`] from the given codes, which are interpreted in the given calendar system /// /// See the [Rust documentation for `try_new_from_codes`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.try_new_from_codes) for more information. @@ -53,11 +48,6 @@ final class DateTime implements ffi.Finalizable { return DateTime._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_create_from_codes_in_calendar = - _capi, ffi.Size, ffi.Int32, ffi.Pointer, ffi.Size, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint32, ffi.Pointer)>>('ICU4XDateTime_create_from_codes_in_calendar') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int, int, ffi.Pointer, int, int, int, int, int, int, ffi.Pointer)>(isLeaf: true); - /// Creates a new [`DateTime`] from an [`Date`] and [`Time`] object /// /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new) for more information. @@ -66,11 +56,6 @@ final class DateTime implements ffi.Finalizable { return DateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_create_from_date_and_time = - _capi Function(ffi.Pointer, ffi.Pointer)>>('ICU4XDateTime_create_from_date_and_time') - .asFunction Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Gets a copy of the date contained in this object /// /// See the [Rust documentation for `date`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date) for more information. @@ -79,11 +64,6 @@ final class DateTime implements ffi.Finalizable { return Date._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_date = - _capi Function(ffi.Pointer)>>('ICU4XDateTime_date') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Gets the time contained in this object /// /// See the [Rust documentation for `time`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time) for more information. @@ -92,11 +72,6 @@ final class DateTime implements ffi.Finalizable { return Time._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_time = - _capi Function(ffi.Pointer)>>('ICU4XDateTime_time') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Converts this date to ISO /// /// See the [Rust documentation for `to_iso`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_iso) for more information. @@ -105,11 +80,6 @@ final class DateTime implements ffi.Finalizable { return IsoDateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_to_iso = - _capi Function(ffi.Pointer)>>('ICU4XDateTime_to_iso') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Convert this datetime to one in a different calendar /// /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar) for more information. @@ -118,11 +88,6 @@ final class DateTime implements ffi.Finalizable { return DateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_to_calendar = - _capi Function(ffi.Pointer, ffi.Pointer)>>('ICU4XDateTime_to_calendar') - .asFunction Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the hour in this time /// /// See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour) for more information. @@ -131,11 +96,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_hour = - _capi)>>('ICU4XDateTime_hour') - .asFunction)>(isLeaf: true); - /// Returns the minute in this time /// /// See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute) for more information. @@ -144,11 +104,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_minute = - _capi)>>('ICU4XDateTime_minute') - .asFunction)>(isLeaf: true); - /// Returns the second in this time /// /// See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second) for more information. @@ -157,11 +112,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_second = - _capi)>>('ICU4XDateTime_second') - .asFunction)>(isLeaf: true); - /// Returns the nanosecond in this time /// /// See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond) for more information. @@ -170,11 +120,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_nanosecond = - _capi)>>('ICU4XDateTime_nanosecond') - .asFunction)>(isLeaf: true); - /// Returns the 1-indexed day in the month for this date /// /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. @@ -183,11 +128,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_day_of_month = - _capi)>>('ICU4XDateTime_day_of_month') - .asFunction)>(isLeaf: true); - /// Returns the day in the week for this day /// /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. @@ -196,11 +136,6 @@ final class DateTime implements ffi.Finalizable { return IsoWeekday.values.firstWhere((v) => v._underlying == result); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_day_of_week = - _capi)>>('ICU4XDateTime_day_of_week') - .asFunction)>(isLeaf: true); - /// Returns the week number in this month, 1-indexed, based on what /// is considered the first day of the week (often a locale preference). /// @@ -212,11 +147,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_week_of_month = - _capi, ffi.Int32)>>('ICU4XDateTime_week_of_month') - .asFunction, int)>(isLeaf: true); - /// Returns the week number in this year, using week data /// /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. @@ -230,11 +160,6 @@ final class DateTime implements ffi.Finalizable { return WeekOf._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_week_of_year = - _capi, ffi.Pointer)>>('ICU4XDateTime_week_of_year') - .asFunction<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns 1-indexed number of the month of this date in its year /// /// Note that for lunar calendars this may not lead to the same month @@ -247,11 +172,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_ordinal_month = - _capi)>>('ICU4XDateTime_ordinal_month') - .asFunction)>(isLeaf: true); - /// Returns the month code for this date. Typically something /// like "M01", "M02", but can be more complicated for lunar calendars. /// @@ -267,11 +187,6 @@ final class DateTime implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_month_code = - _capi, ffi.Pointer)>>('ICU4XDateTime_month_code') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the year number in the current era for this date /// /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. @@ -280,11 +195,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_year_in_era = - _capi)>>('ICU4XDateTime_year_in_era') - .asFunction)>(isLeaf: true); - /// Returns the era for this date, /// /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. @@ -299,11 +209,6 @@ final class DateTime implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_era = - _capi, ffi.Pointer)>>('ICU4XDateTime_era') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the number of months in the year represented by this date /// /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. @@ -312,11 +217,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_months_in_year = - _capi)>>('ICU4XDateTime_months_in_year') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the month represented by this date /// /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. @@ -325,11 +225,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_days_in_month = - _capi)>>('ICU4XDateTime_days_in_month') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the year represented by this date /// /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. @@ -338,11 +233,6 @@ final class DateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_days_in_year = - _capi)>>('ICU4XDateTime_days_in_year') - .asFunction)>(isLeaf: true); - /// Returns the [`Calendar`] object backing this date /// /// See the [Rust documentation for `calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.calendar) for more information. @@ -350,9 +240,100 @@ final class DateTime implements ffi.Finalizable { final result = _ICU4XDateTime_calendar(_underlying); return Calendar._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XDateTime_calendar = - _capi Function(ffi.Pointer)>>('ICU4XDateTime_calendar') - .asFunction Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XDateTime_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int32, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint32, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_create_from_iso_in_calendar') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDateTime_create_from_iso_in_calendar(int year, int month, int day, int hour, int minute, int second, int nanosecond, ffi.Pointer calendar); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Size, ffi.Int32, ffi.Pointer, ffi.Size, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint32, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_create_from_codes_in_calendar') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDateTime_create_from_codes_in_calendar(ffi.Pointer eraCodeData, int eraCodeLength, int year, ffi.Pointer monthCodeData, int monthCodeLength, int day, int hour, int minute, int second, int nanosecond, ffi.Pointer calendar); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_create_from_date_and_time') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDateTime_create_from_date_and_time(ffi.Pointer date, ffi.Pointer time); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_date') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDateTime_date(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_time') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDateTime_time(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_to_iso') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDateTime_to_iso(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_to_calendar') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDateTime_to_calendar(ffi.Pointer self, ffi.Pointer calendar); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_hour') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_hour(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_minute') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_minute(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_second') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_second(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_nanosecond') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_nanosecond(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_day_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_day_of_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_day_of_week') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_day_of_week(ffi.Pointer self); + +@ffi.Native, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XDateTime_week_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_week_of_month(ffi.Pointer self, int firstWeekday); + +@ffi.Native<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_week_of_year') +// ignore: non_constant_identifier_names +external _ResultWeekOfFfiInt32 _ICU4XDateTime_week_of_year(ffi.Pointer self, ffi.Pointer calculator); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_ordinal_month') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_ordinal_month(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_month_code') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateTime_month_code(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_year_in_era') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_year_in_era(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_era') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateTime_era(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_months_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_months_in_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_days_in_month') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_days_in_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTime_days_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XDateTime_days_in_year(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTime_calendar') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XDateTime_calendar(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/DateTimeFormatter.g.dart b/ffi/capi/bindings/dart/DateTimeFormatter.g.dart index 307b7c590b1..ca8bb2e75fa 100644 --- a/ffi/capi/bindings/dart/DateTimeFormatter.g.dart +++ b/ffi/capi/bindings/dart/DateTimeFormatter.g.dart @@ -16,7 +16,7 @@ final class DateTimeFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XDateTimeFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XDateTimeFormatter_destroy)); /// Creates a new [`DateTimeFormatter`] from locale data. /// @@ -31,11 +31,6 @@ final class DateTimeFormatter implements ffi.Finalizable { return DateTimeFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTimeFormatter_create_with_lengths = - _capi, ffi.Pointer, ffi.Int32, ffi.Int32)>>('ICU4XDateTimeFormatter_create_with_lengths') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int, int)>(isLeaf: true); - /// Formats a [`DateTime`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.DateTimeFormatter.html#method.format) for more information. @@ -50,11 +45,6 @@ final class DateTimeFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDateTimeFormatter_format_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XDateTimeFormatter_format_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`IsoDateTime`] to a string. /// /// Will convert to this formatter's calendar first @@ -70,9 +60,20 @@ final class DateTimeFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XDateTimeFormatter_format_iso_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XDateTimeFormatter_format_iso_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDateTimeFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XDateTimeFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XDateTimeFormatter_create_with_lengths') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDateTimeFormatter_create_with_lengths(ffi.Pointer provider, ffi.Pointer locale, int dateLength, int timeLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTimeFormatter_format_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateTimeFormatter_format_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDateTimeFormatter_format_iso_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDateTimeFormatter_format_iso_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/DecomposingNormalizer.g.dart b/ffi/capi/bindings/dart/DecomposingNormalizer.g.dart index 91fdd30d87a..e05c8c49b7e 100644 --- a/ffi/capi/bindings/dart/DecomposingNormalizer.g.dart +++ b/ffi/capi/bindings/dart/DecomposingNormalizer.g.dart @@ -13,7 +13,7 @@ final class DecomposingNormalizer implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XDecomposingNormalizer_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XDecomposingNormalizer_destroy)); /// Construct a new ICU4XDecomposingNormalizer instance for NFC /// @@ -28,11 +28,6 @@ final class DecomposingNormalizer implements ffi.Finalizable { return DecomposingNormalizer._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDecomposingNormalizer_create_nfd = - _capi)>>('ICU4XDecomposingNormalizer_create_nfd') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct a new ICU4XDecomposingNormalizer instance for NFKC /// /// See the [Rust documentation for `new_nfkd`](https://docs.rs/icu/latest/icu/normalizer/struct.DecomposingNormalizer.html#method.new_nfkd) for more information. @@ -46,11 +41,6 @@ final class DecomposingNormalizer implements ffi.Finalizable { return DecomposingNormalizer._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XDecomposingNormalizer_create_nfkd = - _capi)>>('ICU4XDecomposingNormalizer_create_nfkd') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Normalize a string /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -71,11 +61,6 @@ final class DecomposingNormalizer implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XDecomposingNormalizer_normalize = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XDecomposingNormalizer_normalize') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); - /// Check if a string is normalized /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -89,9 +74,24 @@ final class DecomposingNormalizer implements ffi.Finalizable { temp.releaseAll(); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XDecomposingNormalizer_is_normalized = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XDecomposingNormalizer_is_normalized') - .asFunction, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XDecomposingNormalizer_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XDecomposingNormalizer_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDecomposingNormalizer_create_nfd') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDecomposingNormalizer_create_nfd(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDecomposingNormalizer_create_nfkd') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XDecomposingNormalizer_create_nfkd(ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XDecomposingNormalizer_normalize') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XDecomposingNormalizer_normalize(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer writeable); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XDecomposingNormalizer_is_normalized') +// ignore: non_constant_identifier_names +external bool _ICU4XDecomposingNormalizer_is_normalized(ffi.Pointer self, ffi.Pointer sData, int sLength); diff --git a/ffi/capi/bindings/dart/FixedDecimal.g.dart b/ffi/capi/bindings/dart/FixedDecimal.g.dart index 3fc3c21e187..961b9536ccc 100644 --- a/ffi/capi/bindings/dart/FixedDecimal.g.dart +++ b/ffi/capi/bindings/dart/FixedDecimal.g.dart @@ -13,7 +13,7 @@ final class FixedDecimal implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XFixedDecimal_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XFixedDecimal_destroy)); /// Construct an [`FixedDecimal`] from an integer. /// @@ -23,11 +23,6 @@ final class FixedDecimal implements ffi.Finalizable { return FixedDecimal._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_create_from_i64 = - _capi Function(ffi.Int64)>>('ICU4XFixedDecimal_create_from_i64') - .asFunction Function(int)>(isLeaf: true); - /// Construct an [`FixedDecimal`] from an float, with a given power of 10 for the lower magnitude /// /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information. @@ -43,11 +38,6 @@ final class FixedDecimal implements ffi.Finalizable { return FixedDecimal._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_create_from_f64_with_lower_magnitude = - _capi>('ICU4XFixedDecimal_create_from_f64_with_lower_magnitude') - .asFunction<_ResultOpaqueInt32 Function(double, int)>(isLeaf: true); - /// Construct an [`FixedDecimal`] from an float, for a given number of significant digits /// /// See the [Rust documentation for `try_from_f64`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.try_from_f64) for more information. @@ -63,11 +53,6 @@ final class FixedDecimal implements ffi.Finalizable { return FixedDecimal._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_create_from_f64_with_significant_digits = - _capi>('ICU4XFixedDecimal_create_from_f64_with_significant_digits') - .asFunction<_ResultOpaqueInt32 Function(double, int)>(isLeaf: true); - /// Construct an [`FixedDecimal`] from an float, with enough digits to recover /// the original floating point in IEEE 754 without needing trailing zeros /// @@ -84,11 +69,6 @@ final class FixedDecimal implements ffi.Finalizable { return FixedDecimal._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_create_from_f64_with_floating_precision = - _capi>('ICU4XFixedDecimal_create_from_f64_with_floating_precision') - .asFunction<_ResultOpaqueInt32 Function(double)>(isLeaf: true); - /// Construct an [`FixedDecimal`] from a string. /// /// See the [Rust documentation for `from_str`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.from_str) for more information. @@ -105,77 +85,42 @@ final class FixedDecimal implements ffi.Finalizable { return FixedDecimal._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_create_from_string = - _capi, ffi.Size)>>('ICU4XFixedDecimal_create_from_string') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `digit_at`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.digit_at) for more information. int digitAt(int magnitude) { final result = _ICU4XFixedDecimal_digit_at(_underlying, magnitude); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_digit_at = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_digit_at') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range) for more information. int get magnitudeStart { final result = _ICU4XFixedDecimal_magnitude_start(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_magnitude_start = - _capi)>>('ICU4XFixedDecimal_magnitude_start') - .asFunction)>(isLeaf: true); - /// See the [Rust documentation for `magnitude_range`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.magnitude_range) for more information. int get magnitudeEnd { final result = _ICU4XFixedDecimal_magnitude_end(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_magnitude_end = - _capi)>>('ICU4XFixedDecimal_magnitude_end') - .asFunction)>(isLeaf: true); - /// See the [Rust documentation for `nonzero_magnitude_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_start) for more information. int get nonzeroMagnitudeStart { final result = _ICU4XFixedDecimal_nonzero_magnitude_start(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_nonzero_magnitude_start = - _capi)>>('ICU4XFixedDecimal_nonzero_magnitude_start') - .asFunction)>(isLeaf: true); - /// See the [Rust documentation for `nonzero_magnitude_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.nonzero_magnitude_end) for more information. int get nonzeroMagnitudeEnd { final result = _ICU4XFixedDecimal_nonzero_magnitude_end(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_nonzero_magnitude_end = - _capi)>>('ICU4XFixedDecimal_nonzero_magnitude_end') - .asFunction)>(isLeaf: true); - /// See the [Rust documentation for `is_zero`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.is_zero) for more information. bool get isZero { final result = _ICU4XFixedDecimal_is_zero(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_is_zero = - _capi)>>('ICU4XFixedDecimal_is_zero') - .asFunction)>(isLeaf: true); - /// Multiply the [`FixedDecimal`] by a given power of ten. /// /// See the [Rust documentation for `multiply_pow10`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.multiply_pow10) for more information. @@ -183,22 +128,12 @@ final class FixedDecimal implements ffi.Finalizable { _ICU4XFixedDecimal_multiply_pow10(_underlying, power); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_multiply_pow10 = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_multiply_pow10') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.sign) for more information. FixedDecimalSign get sign { final result = _ICU4XFixedDecimal_sign(_underlying); return FixedDecimalSign.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_sign = - _capi)>>('ICU4XFixedDecimal_sign') - .asFunction)>(isLeaf: true); - /// Set the sign of the [`FixedDecimal`]. /// /// See the [Rust documentation for `set_sign`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.set_sign) for more information. @@ -206,41 +141,21 @@ final class FixedDecimal implements ffi.Finalizable { _ICU4XFixedDecimal_set_sign(_underlying, sign.index); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_set_sign = - _capi, ffi.Int32)>>('ICU4XFixedDecimal_set_sign') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `apply_sign_display`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.apply_sign_display) for more information. void applySignDisplay(FixedDecimalSignDisplay signDisplay) { _ICU4XFixedDecimal_apply_sign_display(_underlying, signDisplay.index); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_apply_sign_display = - _capi, ffi.Int32)>>('ICU4XFixedDecimal_apply_sign_display') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `trim_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_start) for more information. void trimStart() { _ICU4XFixedDecimal_trim_start(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_trim_start = - _capi)>>('ICU4XFixedDecimal_trim_start') - .asFunction)>(isLeaf: true); - /// See the [Rust documentation for `trim_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trim_end) for more information. void trimEnd() { _ICU4XFixedDecimal_trim_end(_underlying); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_trim_end = - _capi)>>('ICU4XFixedDecimal_trim_end') - .asFunction)>(isLeaf: true); - /// Zero-pad the [`FixedDecimal`] on the left to a particular position /// /// See the [Rust documentation for `pad_start`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_start) for more information. @@ -248,11 +163,6 @@ final class FixedDecimal implements ffi.Finalizable { _ICU4XFixedDecimal_pad_start(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_pad_start = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_pad_start') - .asFunction, int)>(isLeaf: true); - /// Zero-pad the [`FixedDecimal`] on the right to a particular position /// /// See the [Rust documentation for `pad_end`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.pad_end) for more information. @@ -260,11 +170,6 @@ final class FixedDecimal implements ffi.Finalizable { _ICU4XFixedDecimal_pad_end(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_pad_end = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_pad_end') - .asFunction, int)>(isLeaf: true); - /// Truncate the [`FixedDecimal`] on the left to a particular position, deleting digits if necessary. This is useful for, e.g. abbreviating years /// ("2022" -> "22") /// @@ -273,101 +178,51 @@ final class FixedDecimal implements ffi.Finalizable { _ICU4XFixedDecimal_set_max_position(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_set_max_position = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_set_max_position') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `trunc`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.trunc) for more information. void trunc(int position) { _ICU4XFixedDecimal_trunc(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_trunc = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_trunc') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `half_trunc`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_trunc) for more information. void halfTrunc(int position) { _ICU4XFixedDecimal_half_trunc(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_half_trunc = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_half_trunc') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `expand`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.expand) for more information. void expand(int position) { _ICU4XFixedDecimal_expand(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_expand = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_expand') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `half_expand`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_expand) for more information. void halfExpand(int position) { _ICU4XFixedDecimal_half_expand(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_half_expand = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_half_expand') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `ceil`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.ceil) for more information. void ceil(int position) { _ICU4XFixedDecimal_ceil(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_ceil = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_ceil') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `half_ceil`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_ceil) for more information. void halfCeil(int position) { _ICU4XFixedDecimal_half_ceil(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_half_ceil = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_half_ceil') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `floor`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.floor) for more information. void floor(int position) { _ICU4XFixedDecimal_floor(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_floor = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_floor') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `half_floor`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_floor) for more information. void halfFloor(int position) { _ICU4XFixedDecimal_half_floor(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_half_floor = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_half_floor') - .asFunction, int)>(isLeaf: true); - /// See the [Rust documentation for `half_even`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.half_even) for more information. void halfEven(int position) { _ICU4XFixedDecimal_half_even(_underlying, position); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_half_even = - _capi, ffi.Int16)>>('ICU4XFixedDecimal_half_even') - .asFunction, int)>(isLeaf: true); - /// Concatenates `other` to the end of `self`. /// /// If successful, `other` will be set to 0 and a successful status is returned. @@ -384,11 +239,6 @@ final class FixedDecimal implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_concatenate_end = - _capi, ffi.Pointer)>>('ICU4XFixedDecimal_concatenate_end') - .asFunction<_ResultVoidVoid Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Format the [`FixedDecimal`] as a string. /// /// See the [Rust documentation for `write_to`](https://docs.rs/fixed_decimal/latest/fixed_decimal/struct.FixedDecimal.html#method.write_to) for more information. @@ -398,9 +248,132 @@ final class FixedDecimal implements ffi.Finalizable { _ICU4XFixedDecimal_to_string(_underlying, writeable._underlying); return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimal_to_string = - _capi, ffi.Pointer)>>('ICU4XFixedDecimal_to_string') - .asFunction, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_destroy(ffi.Pointer self); + +@ffi.Native Function(ffi.Int64)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_create_from_i64') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XFixedDecimal_create_from_i64(int v); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Double, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_create_from_f64_with_lower_magnitude') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(double f, int magnitude); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Double, ffi.Uint8)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_create_from_f64_with_significant_digits') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XFixedDecimal_create_from_f64_with_significant_digits(double f, int digits); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Double)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_create_from_f64_with_floating_precision') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XFixedDecimal_create_from_f64_with_floating_precision(double f); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_create_from_string') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XFixedDecimal_create_from_string(ffi.Pointer vData, int vLength); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_digit_at') +// ignore: non_constant_identifier_names +external int _ICU4XFixedDecimal_digit_at(ffi.Pointer self, int magnitude); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_magnitude_start') +// ignore: non_constant_identifier_names +external int _ICU4XFixedDecimal_magnitude_start(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_magnitude_end') +// ignore: non_constant_identifier_names +external int _ICU4XFixedDecimal_magnitude_end(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_nonzero_magnitude_start') +// ignore: non_constant_identifier_names +external int _ICU4XFixedDecimal_nonzero_magnitude_start(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_nonzero_magnitude_end') +// ignore: non_constant_identifier_names +external int _ICU4XFixedDecimal_nonzero_magnitude_end(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_is_zero') +// ignore: non_constant_identifier_names +external bool _ICU4XFixedDecimal_is_zero(ffi.Pointer self); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_multiply_pow10') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_multiply_pow10(ffi.Pointer self, int power); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_sign') +// ignore: non_constant_identifier_names +external int _ICU4XFixedDecimal_sign(ffi.Pointer self); + +@ffi.Native, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_set_sign') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_set_sign(ffi.Pointer self, int sign); + +@ffi.Native, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_apply_sign_display') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_apply_sign_display(ffi.Pointer self, int signDisplay); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_trim_start') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_trim_start(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_trim_end') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_trim_end(ffi.Pointer self); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_pad_start') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_pad_start(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_pad_end') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_pad_end(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_set_max_position') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_set_max_position(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_trunc') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_trunc(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_half_trunc') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_half_trunc(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_expand') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_expand(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_half_expand') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_half_expand(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_ceil') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_ceil(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_half_ceil') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_half_ceil(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_floor') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_floor(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_half_floor') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_half_floor(ffi.Pointer self, int position); + +@ffi.Native, ffi.Int16)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_half_even') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_half_even(ffi.Pointer self, int position); + +@ffi.Native<_ResultVoidVoid Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_concatenate_end') +// ignore: non_constant_identifier_names +external _ResultVoidVoid _ICU4XFixedDecimal_concatenate_end(ffi.Pointer self, ffi.Pointer other); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XFixedDecimal_to_string') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimal_to_string(ffi.Pointer self, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/FixedDecimalFormatter.g.dart b/ffi/capi/bindings/dart/FixedDecimalFormatter.g.dart index fbf3c91e4b3..d71d4255834 100644 --- a/ffi/capi/bindings/dart/FixedDecimalFormatter.g.dart +++ b/ffi/capi/bindings/dart/FixedDecimalFormatter.g.dart @@ -15,7 +15,7 @@ final class FixedDecimalFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XFixedDecimalFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XFixedDecimalFormatter_destroy)); /// Creates a new [`FixedDecimalFormatter`] from locale data. /// @@ -30,11 +30,6 @@ final class FixedDecimalFormatter implements ffi.Finalizable { return FixedDecimalFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimalFormatter_create_with_grouping_strategy = - _capi, ffi.Pointer, ffi.Int32)>>('ICU4XFixedDecimalFormatter_create_with_grouping_strategy') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Formats a [`FixedDecimal`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/decimal/struct.FixedDecimalFormatter.html#method.format) for more information. @@ -48,9 +43,16 @@ final class FixedDecimalFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XFixedDecimalFormatter_format = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XFixedDecimalFormatter_format') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XFixedDecimalFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XFixedDecimalFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XFixedDecimalFormatter_create_with_grouping_strategy') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XFixedDecimalFormatter_create_with_grouping_strategy(ffi.Pointer provider, ffi.Pointer locale, int groupingStrategy); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XFixedDecimalFormatter_format') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XFixedDecimalFormatter_format(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/GeneralCategoryNameToMaskMapper.g.dart b/ffi/capi/bindings/dart/GeneralCategoryNameToMaskMapper.g.dart index d569f7396ee..070a444fef9 100644 --- a/ffi/capi/bindings/dart/GeneralCategoryNameToMaskMapper.g.dart +++ b/ffi/capi/bindings/dart/GeneralCategoryNameToMaskMapper.g.dart @@ -17,7 +17,7 @@ final class GeneralCategoryNameToMaskMapper implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGeneralCategoryNameToMaskMapper_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGeneralCategoryNameToMaskMapper_destroy)); /// Get the mask value matching the given name, using strict matching /// @@ -30,11 +30,6 @@ final class GeneralCategoryNameToMaskMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XGeneralCategoryNameToMaskMapper_get_strict = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XGeneralCategoryNameToMaskMapper_get_strict') - .asFunction, ffi.Pointer, int)>(isLeaf: true); - /// Get the mask value matching the given name, using loose matching /// /// Returns 0 if the name is unknown for this property @@ -46,11 +41,6 @@ final class GeneralCategoryNameToMaskMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XGeneralCategoryNameToMaskMapper_get_loose = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XGeneralCategoryNameToMaskMapper_get_loose') - .asFunction, ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html#method.get_name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -61,9 +51,20 @@ final class GeneralCategoryNameToMaskMapper implements ffi.Finalizable { } return GeneralCategoryNameToMaskMapper._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XGeneralCategoryNameToMaskMapper_load = - _capi)>>('ICU4XGeneralCategoryNameToMaskMapper_load') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGeneralCategoryNameToMaskMapper_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGeneralCategoryNameToMaskMapper_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XGeneralCategoryNameToMaskMapper_get_strict') +// ignore: non_constant_identifier_names +external int _ICU4XGeneralCategoryNameToMaskMapper_get_strict(ffi.Pointer self, ffi.Pointer nameData, int nameLength); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XGeneralCategoryNameToMaskMapper_get_loose') +// ignore: non_constant_identifier_names +external int _ICU4XGeneralCategoryNameToMaskMapper_get_loose(ffi.Pointer self, ffi.Pointer nameData, int nameLength); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XGeneralCategoryNameToMaskMapper_load') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XGeneralCategoryNameToMaskMapper_load(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorLatin1.g.dart b/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorLatin1.g.dart index a7f5275b791..97f77beb63d 100644 --- a/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorLatin1.g.dart +++ b/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorLatin1.g.dart @@ -13,7 +13,7 @@ final class GraphemeClusterBreakIteratorLatin1 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGraphemeClusterBreakIteratorLatin1_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGraphemeClusterBreakIteratorLatin1_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -23,9 +23,12 @@ final class GraphemeClusterBreakIteratorLatin1 implements ffi.Finalizable { final result = _ICU4XGraphemeClusterBreakIteratorLatin1_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XGraphemeClusterBreakIteratorLatin1_next = - _capi)>>('ICU4XGraphemeClusterBreakIteratorLatin1_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterBreakIteratorLatin1_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGraphemeClusterBreakIteratorLatin1_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterBreakIteratorLatin1_next') +// ignore: non_constant_identifier_names +external int _ICU4XGraphemeClusterBreakIteratorLatin1_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf16.g.dart b/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf16.g.dart index 94a8b6feaed..c375602fb9f 100644 --- a/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf16.g.dart +++ b/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf16.g.dart @@ -13,7 +13,7 @@ final class GraphemeClusterBreakIteratorUtf16 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGraphemeClusterBreakIteratorUtf16_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGraphemeClusterBreakIteratorUtf16_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -23,9 +23,12 @@ final class GraphemeClusterBreakIteratorUtf16 implements ffi.Finalizable { final result = _ICU4XGraphemeClusterBreakIteratorUtf16_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XGraphemeClusterBreakIteratorUtf16_next = - _capi)>>('ICU4XGraphemeClusterBreakIteratorUtf16_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterBreakIteratorUtf16_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGraphemeClusterBreakIteratorUtf16_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterBreakIteratorUtf16_next') +// ignore: non_constant_identifier_names +external int _ICU4XGraphemeClusterBreakIteratorUtf16_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf8.g.dart b/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf8.g.dart index 0695c96ac65..f64d145084b 100644 --- a/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf8.g.dart +++ b/ffi/capi/bindings/dart/GraphemeClusterBreakIteratorUtf8.g.dart @@ -13,7 +13,7 @@ final class GraphemeClusterBreakIteratorUtf8 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGraphemeClusterBreakIteratorUtf8_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGraphemeClusterBreakIteratorUtf8_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -23,9 +23,12 @@ final class GraphemeClusterBreakIteratorUtf8 implements ffi.Finalizable { final result = _ICU4XGraphemeClusterBreakIteratorUtf8_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XGraphemeClusterBreakIteratorUtf8_next = - _capi)>>('ICU4XGraphemeClusterBreakIteratorUtf8_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterBreakIteratorUtf8_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGraphemeClusterBreakIteratorUtf8_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterBreakIteratorUtf8_next') +// ignore: non_constant_identifier_names +external int _ICU4XGraphemeClusterBreakIteratorUtf8_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/GraphemeClusterSegmenter.g.dart b/ffi/capi/bindings/dart/GraphemeClusterSegmenter.g.dart index e33f0805711..17c03a91856 100644 --- a/ffi/capi/bindings/dart/GraphemeClusterSegmenter.g.dart +++ b/ffi/capi/bindings/dart/GraphemeClusterSegmenter.g.dart @@ -16,7 +16,7 @@ final class GraphemeClusterSegmenter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGraphemeClusterSegmenter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGraphemeClusterSegmenter_destroy)); /// Construct an [`GraphemeClusterSegmenter`]. /// @@ -31,11 +31,6 @@ final class GraphemeClusterSegmenter implements ffi.Finalizable { return GraphemeClusterSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XGraphemeClusterSegmenter_create = - _capi)>>('ICU4XGraphemeClusterSegmenter_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Segments a string. /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -49,9 +44,16 @@ final class GraphemeClusterSegmenter implements ffi.Finalizable { temp.releaseAll(); return GraphemeClusterBreakIteratorUtf16._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XGraphemeClusterSegmenter_segment_utf16 = - _capi Function(ffi.Pointer, ffi.Pointer, ffi.Size)>>('ICU4XGraphemeClusterSegmenter_segment_utf16') - .asFunction Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterSegmenter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGraphemeClusterSegmenter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterSegmenter_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XGraphemeClusterSegmenter_create(ffi.Pointer provider); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XGraphemeClusterSegmenter_segment_utf16') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XGraphemeClusterSegmenter_segment_utf16(ffi.Pointer self, ffi.Pointer inputData, int inputLength); diff --git a/ffi/capi/bindings/dart/GregorianDateFormatter.g.dart b/ffi/capi/bindings/dart/GregorianDateFormatter.g.dart index 3d9e3b1fd80..5a67f3a0009 100644 --- a/ffi/capi/bindings/dart/GregorianDateFormatter.g.dart +++ b/ffi/capi/bindings/dart/GregorianDateFormatter.g.dart @@ -16,7 +16,7 @@ final class GregorianDateFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGregorianDateFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGregorianDateFormatter_destroy)); /// Creates a new [`GregorianDateFormatter`] from locale data. /// @@ -31,11 +31,6 @@ final class GregorianDateFormatter implements ffi.Finalizable { return GregorianDateFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XGregorianDateFormatter_create_with_length = - _capi, ffi.Pointer, ffi.Int32)>>('ICU4XGregorianDateFormatter_create_with_length') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Formats a [`IsoDate`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information. @@ -50,11 +45,6 @@ final class GregorianDateFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XGregorianDateFormatter_format_iso_date = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XGregorianDateFormatter_format_iso_date') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`IsoDateTime`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateFormatter.html#method.format) for more information. @@ -68,9 +58,20 @@ final class GregorianDateFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XGregorianDateFormatter_format_iso_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XGregorianDateFormatter_format_iso_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGregorianDateFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGregorianDateFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XGregorianDateFormatter_create_with_length') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XGregorianDateFormatter_create_with_length(ffi.Pointer provider, ffi.Pointer locale, int length); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XGregorianDateFormatter_format_iso_date') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XGregorianDateFormatter_format_iso_date(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XGregorianDateFormatter_format_iso_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XGregorianDateFormatter_format_iso_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/GregorianDateTimeFormatter.g.dart b/ffi/capi/bindings/dart/GregorianDateTimeFormatter.g.dart index ef264f831c2..b7cdd838656 100644 --- a/ffi/capi/bindings/dart/GregorianDateTimeFormatter.g.dart +++ b/ffi/capi/bindings/dart/GregorianDateTimeFormatter.g.dart @@ -16,7 +16,7 @@ final class GregorianDateTimeFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGregorianDateTimeFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGregorianDateTimeFormatter_destroy)); /// Creates a new [`GregorianDateFormatter`] from locale data. /// @@ -31,11 +31,6 @@ final class GregorianDateTimeFormatter implements ffi.Finalizable { return GregorianDateTimeFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XGregorianDateTimeFormatter_create_with_lengths = - _capi, ffi.Pointer, ffi.Int32, ffi.Int32)>>('ICU4XGregorianDateTimeFormatter_create_with_lengths') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int, int)>(isLeaf: true); - /// Formats a [`IsoDateTime`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedDateTimeFormatter.html#method.format) for more information. @@ -49,9 +44,16 @@ final class GregorianDateTimeFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XGregorianDateTimeFormatter_format_iso_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XGregorianDateTimeFormatter_format_iso_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGregorianDateTimeFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGregorianDateTimeFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XGregorianDateTimeFormatter_create_with_lengths') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XGregorianDateTimeFormatter_create_with_lengths(ffi.Pointer provider, ffi.Pointer locale, int dateLength, int timeLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XGregorianDateTimeFormatter_format_iso_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XGregorianDateTimeFormatter_format_iso_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart b/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart index bacdb42e34c..dcce62a3f4a 100644 --- a/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart +++ b/ffi/capi/bindings/dart/GregorianZonedDateTimeFormatter.g.dart @@ -15,7 +15,7 @@ final class GregorianZonedDateTimeFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XGregorianZonedDateTimeFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XGregorianZonedDateTimeFormatter_destroy)); /// Creates a new [`GregorianZonedDateTimeFormatter`] from locale data. /// @@ -33,11 +33,6 @@ final class GregorianZonedDateTimeFormatter implements ffi.Finalizable { return GregorianZonedDateTimeFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XGregorianZonedDateTimeFormatter_create_with_lengths = - _capi, ffi.Pointer, ffi.Int32, ffi.Int32)>>('ICU4XGregorianZonedDateTimeFormatter_create_with_lengths') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int, int)>(isLeaf: true); - /// Creates a new [`GregorianZonedDateTimeFormatter`] from locale data. /// /// This function has `date_length` and `time_length` arguments and uses an ISO-8601 style @@ -54,11 +49,6 @@ final class GregorianZonedDateTimeFormatter implements ffi.Finalizable { return GregorianZonedDateTimeFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback = - _capi, ffi.Pointer, ffi.Int32, ffi.Int32, _IsoTimeZoneOptionsFfi)>>('ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int, int, _IsoTimeZoneOptionsFfi)>(isLeaf: true); - /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TypedZonedDateTimeFormatter.html#method.format) for more information. @@ -72,9 +62,20 @@ final class GregorianZonedDateTimeFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone = - _capi, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XGregorianZonedDateTimeFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XGregorianZonedDateTimeFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XGregorianZonedDateTimeFormatter_create_with_lengths') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(ffi.Pointer provider, ffi.Pointer locale, int dateLength, int timeLength); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32, _IsoTimeZoneOptionsFfi)>(isLeaf: true, symbol: 'ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(ffi.Pointer provider, ffi.Pointer locale, int dateLength, int timeLength, _IsoTimeZoneOptionsFfi zoneOptions); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(ffi.Pointer self, ffi.Pointer datetime, ffi.Pointer timeZone, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/IanaToBcp47Mapper.g.dart b/ffi/capi/bindings/dart/IanaToBcp47Mapper.g.dart index 86dc79f0d2a..354a2dbd821 100644 --- a/ffi/capi/bindings/dart/IanaToBcp47Mapper.g.dart +++ b/ffi/capi/bindings/dart/IanaToBcp47Mapper.g.dart @@ -19,7 +19,7 @@ final class IanaToBcp47Mapper implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XIanaToBcp47Mapper_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XIanaToBcp47Mapper_destroy)); /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.IanaToBcp47Mapper.html#method.new) for more information. /// @@ -31,9 +31,12 @@ final class IanaToBcp47Mapper implements ffi.Finalizable { } return IanaToBcp47Mapper._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XIanaToBcp47Mapper_create = - _capi)>>('ICU4XIanaToBcp47Mapper_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIanaToBcp47Mapper_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XIanaToBcp47Mapper_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIanaToBcp47Mapper_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XIanaToBcp47Mapper_create(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/IsoDate.g.dart b/ffi/capi/bindings/dart/IsoDate.g.dart index a2641080c22..ebe3d94c262 100644 --- a/ffi/capi/bindings/dart/IsoDate.g.dart +++ b/ffi/capi/bindings/dart/IsoDate.g.dart @@ -15,7 +15,7 @@ final class IsoDate implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XIsoDate_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XIsoDate_destroy)); /// Creates a new [`IsoDate`] from the specified date and time. /// @@ -30,11 +30,6 @@ final class IsoDate implements ffi.Finalizable { return IsoDate._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_create = - _capi>('ICU4XIsoDate_create') - .asFunction<_ResultOpaqueInt32 Function(int, int, int)>(isLeaf: true); - /// Creates a new [`IsoDate`] representing January 1, 1970. /// /// See the [Rust documentation for `unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.unix_epoch) for more information. @@ -43,11 +38,6 @@ final class IsoDate implements ffi.Finalizable { return IsoDate._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_create_for_unix_epoch = - _capi Function()>>('ICU4XIsoDate_create_for_unix_epoch') - .asFunction Function()>(isLeaf: true); - /// Convert this date to one in a different calendar /// /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_calendar) for more information. @@ -56,22 +46,12 @@ final class IsoDate implements ffi.Finalizable { return Date._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_to_calendar = - _capi Function(ffi.Pointer, ffi.Pointer)>>('ICU4XIsoDate_to_calendar') - .asFunction Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `to_any`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.to_any) for more information. Date toAny() { final result = _ICU4XIsoDate_to_any(_underlying); return Date._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_to_any = - _capi Function(ffi.Pointer)>>('ICU4XIsoDate_to_any') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Returns the 1-indexed day in the month for this date /// /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. @@ -80,11 +60,6 @@ final class IsoDate implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_day_of_month = - _capi)>>('ICU4XIsoDate_day_of_month') - .asFunction)>(isLeaf: true); - /// Returns the day in the week for this day /// /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. @@ -93,11 +68,6 @@ final class IsoDate implements ffi.Finalizable { return IsoWeekday.values.firstWhere((v) => v._underlying == result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_day_of_week = - _capi)>>('ICU4XIsoDate_day_of_week') - .asFunction)>(isLeaf: true); - /// Returns the week number in this month, 1-indexed, based on what /// is considered the first day of the week (often a locale preference). /// @@ -109,11 +79,6 @@ final class IsoDate implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_week_of_month = - _capi, ffi.Int32)>>('ICU4XIsoDate_week_of_month') - .asFunction, int)>(isLeaf: true); - /// Returns the week number in this year, using week data /// /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. @@ -127,11 +92,6 @@ final class IsoDate implements ffi.Finalizable { return WeekOf._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_week_of_year = - _capi, ffi.Pointer)>>('ICU4XIsoDate_week_of_year') - .asFunction<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns 1-indexed number of the month of this date in its year /// /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. @@ -140,11 +100,6 @@ final class IsoDate implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_month = - _capi)>>('ICU4XIsoDate_month') - .asFunction)>(isLeaf: true); - /// Returns the year number for this date /// /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. @@ -153,11 +108,6 @@ final class IsoDate implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_year = - _capi)>>('ICU4XIsoDate_year') - .asFunction)>(isLeaf: true); - /// Returns if the year is a leap year for this date /// /// See the [Rust documentation for `is_in_leap_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.is_in_leap_year) for more information. @@ -166,11 +116,6 @@ final class IsoDate implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_is_in_leap_year = - _capi)>>('ICU4XIsoDate_is_in_leap_year') - .asFunction)>(isLeaf: true); - /// Returns the number of months in the year represented by this date /// /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. @@ -179,11 +124,6 @@ final class IsoDate implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_months_in_year = - _capi)>>('ICU4XIsoDate_months_in_year') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the month represented by this date /// /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. @@ -192,11 +132,6 @@ final class IsoDate implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_days_in_month = - _capi)>>('ICU4XIsoDate_days_in_month') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the year represented by this date /// /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. @@ -204,9 +139,64 @@ final class IsoDate implements ffi.Finalizable { final result = _ICU4XIsoDate_days_in_year(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XIsoDate_days_in_year = - _capi)>>('ICU4XIsoDate_days_in_year') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XIsoDate_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int32, ffi.Uint8, ffi.Uint8)>(isLeaf: true, symbol: 'ICU4XIsoDate_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XIsoDate_create(int year, int month, int day); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XIsoDate_create_for_unix_epoch') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDate_create_for_unix_epoch(); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDate_to_calendar') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDate_to_calendar(ffi.Pointer self, ffi.Pointer calendar); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDate_to_any') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDate_to_any(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_day_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_day_of_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_day_of_week') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_day_of_week(ffi.Pointer self); + +@ffi.Native, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XIsoDate_week_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_week_of_month(ffi.Pointer self, int firstWeekday); + +@ffi.Native<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDate_week_of_year') +// ignore: non_constant_identifier_names +external _ResultWeekOfFfiInt32 _ICU4XIsoDate_week_of_year(ffi.Pointer self, ffi.Pointer calculator); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_year') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_is_in_leap_year') +// ignore: non_constant_identifier_names +external bool _ICU4XIsoDate_is_in_leap_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_months_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_months_in_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_days_in_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_days_in_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDate_days_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDate_days_in_year(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/IsoDateTime.g.dart b/ffi/capi/bindings/dart/IsoDateTime.g.dart index 1c22e0ad507..25306b6719b 100644 --- a/ffi/capi/bindings/dart/IsoDateTime.g.dart +++ b/ffi/capi/bindings/dart/IsoDateTime.g.dart @@ -15,7 +15,7 @@ final class IsoDateTime implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XIsoDateTime_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XIsoDateTime_destroy)); /// Creates a new [`IsoDateTime`] from the specified date and time. /// @@ -30,11 +30,6 @@ final class IsoDateTime implements ffi.Finalizable { return IsoDateTime._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_create = - _capi>('ICU4XIsoDateTime_create') - .asFunction<_ResultOpaqueInt32 Function(int, int, int, int, int, int, int)>(isLeaf: true); - /// Creates a new [`IsoDateTime`] from an [`IsoDate`] and [`Time`] object /// /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.new) for more information. @@ -43,11 +38,6 @@ final class IsoDateTime implements ffi.Finalizable { return IsoDateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_crate_from_date_and_time = - _capi Function(ffi.Pointer, ffi.Pointer)>>('ICU4XIsoDateTime_crate_from_date_and_time') - .asFunction Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Creates a new [`IsoDateTime`] of midnight on January 1, 1970 /// /// See the [Rust documentation for `local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.local_unix_epoch) for more information. @@ -56,11 +46,6 @@ final class IsoDateTime implements ffi.Finalizable { return IsoDateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_local_unix_epoch = - _capi Function()>>('ICU4XIsoDateTime_local_unix_epoch') - .asFunction Function()>(isLeaf: true); - /// Construct from the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) /// /// See the [Rust documentation for `from_minutes_since_local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.from_minutes_since_local_unix_epoch) for more information. @@ -69,11 +54,6 @@ final class IsoDateTime implements ffi.Finalizable { return IsoDateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch = - _capi Function(ffi.Int32)>>('ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch') - .asFunction Function(int)>(isLeaf: true); - /// Gets the date contained in this object /// /// See the [Rust documentation for `date`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.date) for more information. @@ -82,11 +62,6 @@ final class IsoDateTime implements ffi.Finalizable { return IsoDate._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_date = - _capi Function(ffi.Pointer)>>('ICU4XIsoDateTime_date') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Gets the time contained in this object /// /// See the [Rust documentation for `time`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#structfield.time) for more information. @@ -95,11 +70,6 @@ final class IsoDateTime implements ffi.Finalizable { return Time._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_time = - _capi Function(ffi.Pointer)>>('ICU4XIsoDateTime_time') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Converts this to an [`DateTime`] capable of being mixed with dates of /// other calendars /// @@ -109,11 +79,6 @@ final class IsoDateTime implements ffi.Finalizable { return DateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_to_any = - _capi Function(ffi.Pointer)>>('ICU4XIsoDateTime_to_any') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Gets the minutes since the local unix epoch for this date (Jan 1 1970, 00:00) /// /// See the [Rust documentation for `minutes_since_local_unix_epoch`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.minutes_since_local_unix_epoch) for more information. @@ -122,11 +87,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_minutes_since_local_unix_epoch = - _capi)>>('ICU4XIsoDateTime_minutes_since_local_unix_epoch') - .asFunction)>(isLeaf: true); - /// Convert this datetime to one in a different calendar /// /// See the [Rust documentation for `to_calendar`](https://docs.rs/icu/latest/icu/calendar/struct.DateTime.html#method.to_calendar) for more information. @@ -135,11 +95,6 @@ final class IsoDateTime implements ffi.Finalizable { return DateTime._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_to_calendar = - _capi Function(ffi.Pointer, ffi.Pointer)>>('ICU4XIsoDateTime_to_calendar') - .asFunction Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the hour in this time /// /// See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour) for more information. @@ -148,11 +103,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_hour = - _capi)>>('ICU4XIsoDateTime_hour') - .asFunction)>(isLeaf: true); - /// Returns the minute in this time /// /// See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute) for more information. @@ -161,11 +111,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_minute = - _capi)>>('ICU4XIsoDateTime_minute') - .asFunction)>(isLeaf: true); - /// Returns the second in this time /// /// See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second) for more information. @@ -174,11 +119,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_second = - _capi)>>('ICU4XIsoDateTime_second') - .asFunction)>(isLeaf: true); - /// Returns the nanosecond in this time /// /// See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond) for more information. @@ -187,11 +127,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_nanosecond = - _capi)>>('ICU4XIsoDateTime_nanosecond') - .asFunction)>(isLeaf: true); - /// Returns the 1-indexed day in the month for this date /// /// See the [Rust documentation for `day_of_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_month) for more information. @@ -200,11 +135,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_day_of_month = - _capi)>>('ICU4XIsoDateTime_day_of_month') - .asFunction)>(isLeaf: true); - /// Returns the day in the week for this day /// /// See the [Rust documentation for `day_of_week`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.day_of_week) for more information. @@ -213,11 +143,6 @@ final class IsoDateTime implements ffi.Finalizable { return IsoWeekday.values.firstWhere((v) => v._underlying == result); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_day_of_week = - _capi)>>('ICU4XIsoDateTime_day_of_week') - .asFunction)>(isLeaf: true); - /// Returns the week number in this month, 1-indexed, based on what /// is considered the first day of the week (often a locale preference). /// @@ -229,11 +154,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_week_of_month = - _capi, ffi.Int32)>>('ICU4XIsoDateTime_week_of_month') - .asFunction, int)>(isLeaf: true); - /// Returns the week number in this year, using week data /// /// See the [Rust documentation for `week_of_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.week_of_year) for more information. @@ -247,11 +167,6 @@ final class IsoDateTime implements ffi.Finalizable { return WeekOf._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_week_of_year = - _capi, ffi.Pointer)>>('ICU4XIsoDateTime_week_of_year') - .asFunction<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns 1-indexed number of the month of this date in its year /// /// See the [Rust documentation for `month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.month) for more information. @@ -260,11 +175,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_month = - _capi)>>('ICU4XIsoDateTime_month') - .asFunction)>(isLeaf: true); - /// Returns the year number for this date /// /// See the [Rust documentation for `year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.year) for more information. @@ -273,11 +183,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_year = - _capi)>>('ICU4XIsoDateTime_year') - .asFunction)>(isLeaf: true); - /// Returns whether this date is in a leap year /// /// See the [Rust documentation for `is_in_leap_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.is_in_leap_year) for more information. @@ -286,11 +191,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_is_in_leap_year = - _capi)>>('ICU4XIsoDateTime_is_in_leap_year') - .asFunction)>(isLeaf: true); - /// Returns the number of months in the year represented by this date /// /// See the [Rust documentation for `months_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.months_in_year) for more information. @@ -299,11 +199,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_months_in_year = - _capi)>>('ICU4XIsoDateTime_months_in_year') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the month represented by this date /// /// See the [Rust documentation for `days_in_month`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_month) for more information. @@ -312,11 +207,6 @@ final class IsoDateTime implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_days_in_month = - _capi)>>('ICU4XIsoDateTime_days_in_month') - .asFunction)>(isLeaf: true); - /// Returns the number of days in the year represented by this date /// /// See the [Rust documentation for `days_in_year`](https://docs.rs/icu/latest/icu/calendar/struct.Date.html#method.days_in_year) for more information. @@ -324,9 +214,100 @@ final class IsoDateTime implements ffi.Finalizable { final result = _ICU4XIsoDateTime_days_in_year(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XIsoDateTime_days_in_year = - _capi)>>('ICU4XIsoDateTime_days_in_year') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XIsoDateTime_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Int32, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XIsoDateTime_create(int year, int month, int day, int hour, int minute, int second, int nanosecond); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_crate_from_date_and_time') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDateTime_crate_from_date_and_time(ffi.Pointer date, ffi.Pointer time); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XIsoDateTime_local_unix_epoch') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDateTime_local_unix_epoch(); + +@ffi.Native Function(ffi.Int32)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(int minutes); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_date') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDateTime_date(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_time') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDateTime_time(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_to_any') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDateTime_to_any(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_minutes_since_local_unix_epoch') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_minutes_since_local_unix_epoch(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_to_calendar') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XIsoDateTime_to_calendar(ffi.Pointer self, ffi.Pointer calendar); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_hour') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_hour(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_minute') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_minute(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_second') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_second(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_nanosecond') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_nanosecond(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_day_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_day_of_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_day_of_week') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_day_of_week(ffi.Pointer self); + +@ffi.Native, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_week_of_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_week_of_month(ffi.Pointer self, int firstWeekday); + +@ffi.Native<_ResultWeekOfFfiInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_week_of_year') +// ignore: non_constant_identifier_names +external _ResultWeekOfFfiInt32 _ICU4XIsoDateTime_week_of_year(ffi.Pointer self, ffi.Pointer calculator); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_year') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_is_in_leap_year') +// ignore: non_constant_identifier_names +external bool _ICU4XIsoDateTime_is_in_leap_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_months_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_months_in_year(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_days_in_month') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_days_in_month(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XIsoDateTime_days_in_year') +// ignore: non_constant_identifier_names +external int _ICU4XIsoDateTime_days_in_year(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/LineBreakIteratorLatin1.g.dart b/ffi/capi/bindings/dart/LineBreakIteratorLatin1.g.dart index 64e9ec580fc..a38a84322d6 100644 --- a/ffi/capi/bindings/dart/LineBreakIteratorLatin1.g.dart +++ b/ffi/capi/bindings/dart/LineBreakIteratorLatin1.g.dart @@ -15,7 +15,7 @@ final class LineBreakIteratorLatin1 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLineBreakIteratorLatin1_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLineBreakIteratorLatin1_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -25,9 +25,12 @@ final class LineBreakIteratorLatin1 implements ffi.Finalizable { final result = _ICU4XLineBreakIteratorLatin1_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XLineBreakIteratorLatin1_next = - _capi)>>('ICU4XLineBreakIteratorLatin1_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLineBreakIteratorLatin1_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLineBreakIteratorLatin1_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLineBreakIteratorLatin1_next') +// ignore: non_constant_identifier_names +external int _ICU4XLineBreakIteratorLatin1_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/LineBreakIteratorUtf16.g.dart b/ffi/capi/bindings/dart/LineBreakIteratorUtf16.g.dart index fc753ff4e4e..3bbbffaafed 100644 --- a/ffi/capi/bindings/dart/LineBreakIteratorUtf16.g.dart +++ b/ffi/capi/bindings/dart/LineBreakIteratorUtf16.g.dart @@ -15,7 +15,7 @@ final class LineBreakIteratorUtf16 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLineBreakIteratorUtf16_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLineBreakIteratorUtf16_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -25,9 +25,12 @@ final class LineBreakIteratorUtf16 implements ffi.Finalizable { final result = _ICU4XLineBreakIteratorUtf16_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XLineBreakIteratorUtf16_next = - _capi)>>('ICU4XLineBreakIteratorUtf16_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLineBreakIteratorUtf16_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLineBreakIteratorUtf16_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLineBreakIteratorUtf16_next') +// ignore: non_constant_identifier_names +external int _ICU4XLineBreakIteratorUtf16_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/LineBreakIteratorUtf8.g.dart b/ffi/capi/bindings/dart/LineBreakIteratorUtf8.g.dart index dfa8e3e5993..ec8f336000b 100644 --- a/ffi/capi/bindings/dart/LineBreakIteratorUtf8.g.dart +++ b/ffi/capi/bindings/dart/LineBreakIteratorUtf8.g.dart @@ -15,7 +15,7 @@ final class LineBreakIteratorUtf8 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLineBreakIteratorUtf8_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLineBreakIteratorUtf8_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -25,9 +25,12 @@ final class LineBreakIteratorUtf8 implements ffi.Finalizable { final result = _ICU4XLineBreakIteratorUtf8_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XLineBreakIteratorUtf8_next = - _capi)>>('ICU4XLineBreakIteratorUtf8_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLineBreakIteratorUtf8_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLineBreakIteratorUtf8_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLineBreakIteratorUtf8_next') +// ignore: non_constant_identifier_names +external int _ICU4XLineBreakIteratorUtf8_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/LineSegmenter.g.dart b/ffi/capi/bindings/dart/LineSegmenter.g.dart index 0ddfe5e7622..097ef4ef410 100644 --- a/ffi/capi/bindings/dart/LineSegmenter.g.dart +++ b/ffi/capi/bindings/dart/LineSegmenter.g.dart @@ -15,7 +15,7 @@ final class LineSegmenter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLineSegmenter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLineSegmenter_destroy)); /// Construct a [`LineSegmenter`] with default options. It automatically loads the best /// available payload data for Burmese, Khmer, Lao, and Thai. @@ -31,11 +31,6 @@ final class LineSegmenter implements ffi.Finalizable { return LineSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLineSegmenter_create_auto = - _capi)>>('ICU4XLineSegmenter_create_auto') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct a [`LineSegmenter`] with default options and LSTM payload data for /// Burmese, Khmer, Lao, and Thai. /// @@ -50,11 +45,6 @@ final class LineSegmenter implements ffi.Finalizable { return LineSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLineSegmenter_create_lstm = - _capi)>>('ICU4XLineSegmenter_create_lstm') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct a [`LineSegmenter`] with default options and dictionary payload data for /// Burmese, Khmer, Lao, and Thai.. /// @@ -69,11 +59,6 @@ final class LineSegmenter implements ffi.Finalizable { return LineSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLineSegmenter_create_dictionary = - _capi)>>('ICU4XLineSegmenter_create_dictionary') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct a [`LineSegmenter`] with custom options. It automatically loads the best /// available payload data for Burmese, Khmer, Lao, and Thai. /// @@ -88,11 +73,6 @@ final class LineSegmenter implements ffi.Finalizable { return LineSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLineSegmenter_create_auto_with_options_v1 = - _capi, _LineBreakOptionsV1Ffi)>>('ICU4XLineSegmenter_create_auto_with_options_v1') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, _LineBreakOptionsV1Ffi)>(isLeaf: true); - /// Construct a [`LineSegmenter`] with custom options and LSTM payload data for /// Burmese, Khmer, Lao, and Thai. /// @@ -107,11 +87,6 @@ final class LineSegmenter implements ffi.Finalizable { return LineSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLineSegmenter_create_lstm_with_options_v1 = - _capi, _LineBreakOptionsV1Ffi)>>('ICU4XLineSegmenter_create_lstm_with_options_v1') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, _LineBreakOptionsV1Ffi)>(isLeaf: true); - /// Construct a [`LineSegmenter`] with custom options and dictionary payload data for /// Burmese, Khmer, Lao, and Thai. /// @@ -126,11 +101,6 @@ final class LineSegmenter implements ffi.Finalizable { return LineSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLineSegmenter_create_dictionary_with_options_v1 = - _capi, _LineBreakOptionsV1Ffi)>>('ICU4XLineSegmenter_create_dictionary_with_options_v1') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, _LineBreakOptionsV1Ffi)>(isLeaf: true); - /// Segments a string. /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -144,9 +114,36 @@ final class LineSegmenter implements ffi.Finalizable { temp.releaseAll(); return LineBreakIteratorUtf16._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XLineSegmenter_segment_utf16 = - _capi Function(ffi.Pointer, ffi.Pointer, ffi.Size)>>('ICU4XLineSegmenter_segment_utf16') - .asFunction Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLineSegmenter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_auto') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_auto(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_lstm') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_lstm(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_dictionary') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_dictionary(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, _LineBreakOptionsV1Ffi)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_auto_with_options_v1') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_auto_with_options_v1(ffi.Pointer provider, _LineBreakOptionsV1Ffi options); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, _LineBreakOptionsV1Ffi)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_lstm_with_options_v1') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_lstm_with_options_v1(ffi.Pointer provider, _LineBreakOptionsV1Ffi options); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, _LineBreakOptionsV1Ffi)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_create_dictionary_with_options_v1') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLineSegmenter_create_dictionary_with_options_v1(ffi.Pointer provider, _LineBreakOptionsV1Ffi options); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XLineSegmenter_segment_utf16') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XLineSegmenter_segment_utf16(ffi.Pointer self, ffi.Pointer inputData, int inputLength); diff --git a/ffi/capi/bindings/dart/List.g.dart b/ffi/capi/bindings/dart/List.g.dart index b9271c5af90..1f7647b48cb 100644 --- a/ffi/capi/bindings/dart/List.g.dart +++ b/ffi/capi/bindings/dart/List.g.dart @@ -13,7 +13,7 @@ final class List implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XList_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XList_destroy)); /// Create a new list of strings factory List() { @@ -21,11 +21,6 @@ final class List implements ffi.Finalizable { return List._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XList_create = - _capi Function()>>('ICU4XList_create') - .asFunction Function()>(isLeaf: true); - /// Create a new list of strings with preallocated space to hold /// at least `capacity` elements factory List.withCapacity(int capacity) { @@ -33,11 +28,6 @@ final class List implements ffi.Finalizable { return List._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XList_create_with_capacity = - _capi Function(ffi.Size)>>('ICU4XList_create_with_capacity') - .asFunction Function(int)>(isLeaf: true); - /// Push a string to the list /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -49,30 +39,39 @@ final class List implements ffi.Finalizable { temp.releaseAll(); } - // ignore: non_constant_identifier_names - static final _ICU4XList_push = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XList_push') - .asFunction, ffi.Pointer, int)>(isLeaf: true); - /// The number of elements in this list int get length { final result = _ICU4XList_len(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XList_len = - _capi)>>('ICU4XList_len') - .asFunction)>(isLeaf: true); - /// Whether this list is empty bool get isEmpty { final result = _ICU4XList_is_empty(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XList_is_empty = - _capi)>>('ICU4XList_is_empty') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XList_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XList_destroy(ffi.Pointer self); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XList_create') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XList_create(); + +@ffi.Native Function(ffi.Size)>(isLeaf: true, symbol: 'ICU4XList_create_with_capacity') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XList_create_with_capacity(int capacity); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XList_push') +// ignore: non_constant_identifier_names +external void _ICU4XList_push(ffi.Pointer self, ffi.Pointer valData, int valLength); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XList_len') +// ignore: non_constant_identifier_names +external int _ICU4XList_len(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XList_is_empty') +// ignore: non_constant_identifier_names +external bool _ICU4XList_is_empty(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/ListFormatter.g.dart b/ffi/capi/bindings/dart/ListFormatter.g.dart index 3b18137755b..331fa9f978d 100644 --- a/ffi/capi/bindings/dart/ListFormatter.g.dart +++ b/ffi/capi/bindings/dart/ListFormatter.g.dart @@ -13,7 +13,7 @@ final class ListFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XListFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XListFormatter_destroy)); /// Construct a new ICU4XListFormatter instance for And patterns /// @@ -28,11 +28,6 @@ final class ListFormatter implements ffi.Finalizable { return ListFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XListFormatter_create_and_with_length = - _capi, ffi.Pointer, ffi.Int32)>>('ICU4XListFormatter_create_and_with_length') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Construct a new ICU4XListFormatter instance for And patterns /// /// See the [Rust documentation for `try_new_or_with_length`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_or_with_length) for more information. @@ -46,11 +41,6 @@ final class ListFormatter implements ffi.Finalizable { return ListFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XListFormatter_create_or_with_length = - _capi, ffi.Pointer, ffi.Int32)>>('ICU4XListFormatter_create_or_with_length') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Construct a new ICU4XListFormatter instance for And patterns /// /// See the [Rust documentation for `try_new_unit_with_length`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.try_new_unit_with_length) for more information. @@ -64,11 +54,6 @@ final class ListFormatter implements ffi.Finalizable { return ListFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XListFormatter_create_unit_with_length = - _capi, ffi.Pointer, ffi.Int32)>>('ICU4XListFormatter_create_unit_with_length') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/list/struct.ListFormatter.html#method.format) for more information. /// /// Throws [Error] on failure. @@ -80,9 +65,24 @@ final class ListFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XListFormatter_format = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XListFormatter_format') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XListFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XListFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XListFormatter_create_and_with_length') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XListFormatter_create_and_with_length(ffi.Pointer provider, ffi.Pointer locale, int length); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XListFormatter_create_or_with_length') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XListFormatter_create_or_with_length(ffi.Pointer provider, ffi.Pointer locale, int length); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XListFormatter_create_unit_with_length') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XListFormatter_create_unit_with_length(ffi.Pointer provider, ffi.Pointer locale, int length); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XListFormatter_format') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XListFormatter_format(ffi.Pointer self, ffi.Pointer list, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/Locale.g.dart b/ffi/capi/bindings/dart/Locale.g.dart index b74024eb7f8..3d257d164f2 100644 --- a/ffi/capi/bindings/dart/Locale.g.dart +++ b/ffi/capi/bindings/dart/Locale.g.dart @@ -15,7 +15,7 @@ final class Locale implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocale_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocale_destroy)); /// Construct an [`Locale`] from an locale identifier. /// @@ -37,11 +37,6 @@ final class Locale implements ffi.Finalizable { return Locale._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_create_from_string = - _capi, ffi.Size)>>('ICU4XLocale_create_from_string') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int)>(isLeaf: true); - /// Construct a default undefined [`Locale`] "und". /// /// See the [Rust documentation for `UND`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#associatedconstant.UND) for more information. @@ -50,11 +45,6 @@ final class Locale implements ffi.Finalizable { return Locale._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_create_und = - _capi Function()>>('ICU4XLocale_create_und') - .asFunction Function()>(isLeaf: true); - /// Clones the [`Locale`]. /// /// See the [Rust documentation for `Locale`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html) for more information. @@ -63,11 +53,6 @@ final class Locale implements ffi.Finalizable { return Locale._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_clone = - _capi Function(ffi.Pointer)>>('ICU4XLocale_clone') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Write a string representation of the `LanguageIdentifier` part of /// [`Locale`] to `write`. /// @@ -83,11 +68,6 @@ final class Locale implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_basename = - _capi, ffi.Pointer)>>('ICU4XLocale_basename') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Write a string representation of the unicode extension to `write` /// /// See the [Rust documentation for `extensions`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.extensions) for more information. @@ -105,11 +85,6 @@ final class Locale implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_get_unicode_extension = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XLocale_get_unicode_extension') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); - /// Write a string representation of [`Locale`] language to `write` /// /// See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. @@ -124,11 +99,6 @@ final class Locale implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_language = - _capi, ffi.Pointer)>>('ICU4XLocale_language') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Set the language part of the [`Locale`]. /// /// See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information. @@ -144,11 +114,6 @@ final class Locale implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_set_language = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XLocale_set_language') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Write a string representation of [`Locale`] region to `write` /// /// See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. @@ -163,11 +128,6 @@ final class Locale implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_region = - _capi, ffi.Pointer)>>('ICU4XLocale_region') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Set the region part of the [`Locale`]. /// /// See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information. @@ -183,11 +143,6 @@ final class Locale implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_set_region = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XLocale_set_region') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Write a string representation of [`Locale`] script to `write` /// /// See the [Rust documentation for `id`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#structfield.id) for more information. @@ -202,11 +157,6 @@ final class Locale implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_script = - _capi, ffi.Pointer)>>('ICU4XLocale_script') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Set the script part of the [`Locale`]. Pass an empty string to remove the script. /// /// See the [Rust documentation for `try_from_bytes`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.try_from_bytes) for more information. @@ -222,11 +172,6 @@ final class Locale implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_set_script = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XLocale_set_script') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Best effort locale canonicalizer that doesn't need any data /// /// Use ICU4XLocaleCanonicalizer for better control and functionality @@ -246,11 +191,6 @@ final class Locale implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_canonicalize = - _capi, ffi.Size, ffi.Pointer)>>('ICU4XLocale_canonicalize') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); - /// Write a string representation of [`Locale`] to `write` /// /// See the [Rust documentation for `write_to`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.write_to) for more information. @@ -266,11 +206,6 @@ final class Locale implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_to_string = - _capi, ffi.Pointer)>>('ICU4XLocale_to_string') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `normalizing_eq`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.normalizing_eq) for more information. bool normalizingEq(String other) { final temp = ffi2.Arena(); @@ -280,11 +215,6 @@ final class Locale implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XLocale_normalizing_eq = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XLocale_normalizing_eq') - .asFunction, ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `strict_cmp`](https://docs.rs/icu/latest/icu/locid/struct.Locale.html#method.strict_cmp) for more information. Ordering strictCmp(String other) { final temp = ffi2.Arena(); @@ -293,9 +223,68 @@ final class Locale implements ffi.Finalizable { temp.releaseAll(); return Ordering.values.firstWhere((v) => v._underlying == result); } - - // ignore: non_constant_identifier_names - static final _ICU4XLocale_strict_cmp = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XLocale_strict_cmp') - .asFunction, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocale_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocale_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XLocale_create_from_string') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocale_create_from_string(ffi.Pointer nameData, int nameLength); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XLocale_create_und') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XLocale_create_und(); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_clone') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XLocale_clone(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_basename') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_basename(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_get_unicode_extension') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_get_unicode_extension(ffi.Pointer self, ffi.Pointer bytesData, int bytesLength, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_language') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_language(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XLocale_set_language') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_set_language(ffi.Pointer self, ffi.Pointer bytesData, int bytesLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_region') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_region(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XLocale_set_region') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_set_region(ffi.Pointer self, ffi.Pointer bytesData, int bytesLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_script') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_script(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XLocale_set_script') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_set_script(ffi.Pointer self, ffi.Pointer bytesData, int bytesLength); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_canonicalize') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_canonicalize(ffi.Pointer bytesData, int bytesLength, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocale_to_string') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocale_to_string(ffi.Pointer self, ffi.Pointer writeable); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XLocale_normalizing_eq') +// ignore: non_constant_identifier_names +external bool _ICU4XLocale_normalizing_eq(ffi.Pointer self, ffi.Pointer otherData, int otherLength); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XLocale_strict_cmp') +// ignore: non_constant_identifier_names +external int _ICU4XLocale_strict_cmp(ffi.Pointer self, ffi.Pointer otherData, int otherLength); diff --git a/ffi/capi/bindings/dart/LocaleCanonicalizer.g.dart b/ffi/capi/bindings/dart/LocaleCanonicalizer.g.dart index 9dcef698ccc..dc57dc91fd0 100644 --- a/ffi/capi/bindings/dart/LocaleCanonicalizer.g.dart +++ b/ffi/capi/bindings/dart/LocaleCanonicalizer.g.dart @@ -15,7 +15,7 @@ final class LocaleCanonicalizer implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocaleCanonicalizer_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocaleCanonicalizer_destroy)); /// Create a new [`LocaleCanonicalizer`]. /// @@ -30,11 +30,6 @@ final class LocaleCanonicalizer implements ffi.Finalizable { return LocaleCanonicalizer._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleCanonicalizer_create = - _capi)>>('ICU4XLocaleCanonicalizer_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Create a new [`LocaleCanonicalizer`] with extended data. /// /// See the [Rust documentation for `new_with_expander`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.new_with_expander) for more information. @@ -48,11 +43,6 @@ final class LocaleCanonicalizer implements ffi.Finalizable { return LocaleCanonicalizer._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleCanonicalizer_create_extended = - _capi)>>('ICU4XLocaleCanonicalizer_create_extended') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// FFI version of `LocaleCanonicalizer::canonicalize()`. /// /// See the [Rust documentation for `canonicalize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleCanonicalizer.html#method.canonicalize) for more information. @@ -60,9 +50,20 @@ final class LocaleCanonicalizer implements ffi.Finalizable { final result = _ICU4XLocaleCanonicalizer_canonicalize(_underlying, locale._underlying); return TransformResult.values[result]; } - - // ignore: non_constant_identifier_names - static final _ICU4XLocaleCanonicalizer_canonicalize = - _capi, ffi.Pointer)>>('ICU4XLocaleCanonicalizer_canonicalize') - .asFunction, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleCanonicalizer_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleCanonicalizer_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleCanonicalizer_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleCanonicalizer_create(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleCanonicalizer_create_extended') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleCanonicalizer_create_extended(ffi.Pointer provider); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleCanonicalizer_canonicalize') +// ignore: non_constant_identifier_names +external int _ICU4XLocaleCanonicalizer_canonicalize(ffi.Pointer self, ffi.Pointer locale); diff --git a/ffi/capi/bindings/dart/LocaleDirectionality.g.dart b/ffi/capi/bindings/dart/LocaleDirectionality.g.dart index 097f993c333..950743cf599 100644 --- a/ffi/capi/bindings/dart/LocaleDirectionality.g.dart +++ b/ffi/capi/bindings/dart/LocaleDirectionality.g.dart @@ -13,7 +13,7 @@ final class LocaleDirectionality implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocaleDirectionality_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocaleDirectionality_destroy)); /// Construct a new ICU4XLocaleDirectionality instance /// @@ -28,11 +28,6 @@ final class LocaleDirectionality implements ffi.Finalizable { return LocaleDirectionality._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleDirectionality_create = - _capi)>>('ICU4XLocaleDirectionality_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct a new ICU4XLocaleDirectionality instance with a custom expander /// /// See the [Rust documentation for `new_with_expander`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.new_with_expander) for more information. @@ -46,41 +41,45 @@ final class LocaleDirectionality implements ffi.Finalizable { return LocaleDirectionality._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleDirectionality_create_with_expander = - _capi, ffi.Pointer)>>('ICU4XLocaleDirectionality_create_with_expander') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `get`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.get) for more information. LocaleDirection operator [](Locale locale) { final result = _ICU4XLocaleDirectionality_get(_underlying, locale._underlying); return LocaleDirection.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleDirectionality_get = - _capi, ffi.Pointer)>>('ICU4XLocaleDirectionality_get') - .asFunction, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `is_left_to_right`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.is_left_to_right) for more information. bool isLeftToRight(Locale locale) { final result = _ICU4XLocaleDirectionality_is_left_to_right(_underlying, locale._underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleDirectionality_is_left_to_right = - _capi, ffi.Pointer)>>('ICU4XLocaleDirectionality_is_left_to_right') - .asFunction, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `is_right_to_left`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleDirectionality.html#method.is_right_to_left) for more information. bool isRightToLeft(Locale locale) { final result = _ICU4XLocaleDirectionality_is_right_to_left(_underlying, locale._underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XLocaleDirectionality_is_right_to_left = - _capi, ffi.Pointer)>>('ICU4XLocaleDirectionality_is_right_to_left') - .asFunction, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleDirectionality_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleDirectionality_create(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_create_with_expander') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleDirectionality_create_with_expander(ffi.Pointer provider, ffi.Pointer expander); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_get') +// ignore: non_constant_identifier_names +external int _ICU4XLocaleDirectionality_get(ffi.Pointer self, ffi.Pointer locale); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_is_left_to_right') +// ignore: non_constant_identifier_names +external bool _ICU4XLocaleDirectionality_is_left_to_right(ffi.Pointer self, ffi.Pointer locale); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleDirectionality_is_right_to_left') +// ignore: non_constant_identifier_names +external bool _ICU4XLocaleDirectionality_is_right_to_left(ffi.Pointer self, ffi.Pointer locale); diff --git a/ffi/capi/bindings/dart/LocaleDisplayNamesFormatter.g.dart b/ffi/capi/bindings/dart/LocaleDisplayNamesFormatter.g.dart index 31c9699c356..95b9c88f688 100644 --- a/ffi/capi/bindings/dart/LocaleDisplayNamesFormatter.g.dart +++ b/ffi/capi/bindings/dart/LocaleDisplayNamesFormatter.g.dart @@ -13,7 +13,7 @@ final class LocaleDisplayNamesFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocaleDisplayNamesFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocaleDisplayNamesFormatter_destroy)); /// Creates a new `LocaleDisplayNamesFormatter` from locale data and an options bag. /// @@ -28,11 +28,6 @@ final class LocaleDisplayNamesFormatter implements ffi.Finalizable { return LocaleDisplayNamesFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleDisplayNamesFormatter_create = - _capi, ffi.Pointer, _DisplayNamesOptionsV1Ffi)>>('ICU4XLocaleDisplayNamesFormatter_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, _DisplayNamesOptionsV1Ffi)>(isLeaf: true); - /// Returns the locale-specific display name of a locale. /// /// See the [Rust documentation for `of`](https://docs.rs/icu/latest/icu/displaynames/struct.LocaleDisplayNamesFormatter.html#method.of) for more information. @@ -46,9 +41,16 @@ final class LocaleDisplayNamesFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XLocaleDisplayNamesFormatter_of = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XLocaleDisplayNamesFormatter_of') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleDisplayNamesFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleDisplayNamesFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, _DisplayNamesOptionsV1Ffi)>(isLeaf: true, symbol: 'ICU4XLocaleDisplayNamesFormatter_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleDisplayNamesFormatter_create(ffi.Pointer provider, ffi.Pointer locale, _DisplayNamesOptionsV1Ffi options); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleDisplayNamesFormatter_of') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XLocaleDisplayNamesFormatter_of(ffi.Pointer self, ffi.Pointer locale, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/LocaleExpander.g.dart b/ffi/capi/bindings/dart/LocaleExpander.g.dart index 5652b2fc399..8527f1bbf42 100644 --- a/ffi/capi/bindings/dart/LocaleExpander.g.dart +++ b/ffi/capi/bindings/dart/LocaleExpander.g.dart @@ -15,7 +15,7 @@ final class LocaleExpander implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocaleExpander_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocaleExpander_destroy)); /// Create a new [`LocaleExpander`]. /// @@ -30,11 +30,6 @@ final class LocaleExpander implements ffi.Finalizable { return LocaleExpander._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleExpander_create = - _capi)>>('ICU4XLocaleExpander_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Create a new [`LocaleExpander`] with extended data. /// /// See the [Rust documentation for `new_extended`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.new_extended) for more information. @@ -48,11 +43,6 @@ final class LocaleExpander implements ffi.Finalizable { return LocaleExpander._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleExpander_create_extended = - _capi)>>('ICU4XLocaleExpander_create_extended') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// FFI version of `LocaleExpander::maximize()`. /// /// See the [Rust documentation for `maximize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.maximize) for more information. @@ -61,11 +51,6 @@ final class LocaleExpander implements ffi.Finalizable { return TransformResult.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleExpander_maximize = - _capi, ffi.Pointer)>>('ICU4XLocaleExpander_maximize') - .asFunction, ffi.Pointer)>(isLeaf: true); - /// FFI version of `LocaleExpander::minimize()`. /// /// See the [Rust documentation for `minimize`](https://docs.rs/icu/latest/icu/locid_transform/struct.LocaleExpander.html#method.minimize) for more information. @@ -73,9 +58,24 @@ final class LocaleExpander implements ffi.Finalizable { final result = _ICU4XLocaleExpander_minimize(_underlying, locale._underlying); return TransformResult.values[result]; } - - // ignore: non_constant_identifier_names - static final _ICU4XLocaleExpander_minimize = - _capi, ffi.Pointer)>>('ICU4XLocaleExpander_minimize') - .asFunction, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleExpander_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleExpander_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleExpander_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleExpander_create(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleExpander_create_extended') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleExpander_create_extended(ffi.Pointer provider); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleExpander_maximize') +// ignore: non_constant_identifier_names +external int _ICU4XLocaleExpander_maximize(ffi.Pointer self, ffi.Pointer locale); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleExpander_minimize') +// ignore: non_constant_identifier_names +external int _ICU4XLocaleExpander_minimize(ffi.Pointer self, ffi.Pointer locale); diff --git a/ffi/capi/bindings/dart/LocaleFallbackIterator.g.dart b/ffi/capi/bindings/dart/LocaleFallbackIterator.g.dart index a5ca6e36d49..127d8d56875 100644 --- a/ffi/capi/bindings/dart/LocaleFallbackIterator.g.dart +++ b/ffi/capi/bindings/dart/LocaleFallbackIterator.g.dart @@ -15,7 +15,7 @@ final class LocaleFallbackIterator implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocaleFallbackIterator_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocaleFallbackIterator_destroy)); /// Gets a snapshot of the current state of the locale. /// @@ -25,20 +25,22 @@ final class LocaleFallbackIterator implements ffi.Finalizable { return Locale._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleFallbackIterator_get = - _capi Function(ffi.Pointer)>>('ICU4XLocaleFallbackIterator_get') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Performs one step of the fallback algorithm, mutating the locale. /// /// See the [Rust documentation for `step`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbackIterator.html#method.step) for more information. void step() { _ICU4XLocaleFallbackIterator_step(_underlying); } - - // ignore: non_constant_identifier_names - static final _ICU4XLocaleFallbackIterator_step = - _capi)>>('ICU4XLocaleFallbackIterator_step') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleFallbackIterator_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleFallbackIterator_destroy(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleFallbackIterator_get') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XLocaleFallbackIterator_get(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleFallbackIterator_step') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleFallbackIterator_step(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/LocaleFallbacker.g.dart b/ffi/capi/bindings/dart/LocaleFallbacker.g.dart index e744c4505fc..e13c30b2593 100644 --- a/ffi/capi/bindings/dart/LocaleFallbacker.g.dart +++ b/ffi/capi/bindings/dart/LocaleFallbacker.g.dart @@ -15,7 +15,7 @@ final class LocaleFallbacker implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocaleFallbacker_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocaleFallbacker_destroy)); /// Creates a new `LocaleFallbacker` from a data provider. /// @@ -30,11 +30,6 @@ final class LocaleFallbacker implements ffi.Finalizable { return LocaleFallbacker._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleFallbacker_create = - _capi)>>('ICU4XLocaleFallbacker_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Creates a new `LocaleFallbacker` without data for limited functionality. /// /// See the [Rust documentation for `new_without_data`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.new_without_data) for more information. @@ -43,11 +38,6 @@ final class LocaleFallbacker implements ffi.Finalizable { return LocaleFallbacker._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XLocaleFallbacker_create_without_data = - _capi Function()>>('ICU4XLocaleFallbacker_create_without_data') - .asFunction Function()>(isLeaf: true); - /// Associates this `LocaleFallbacker` with configuration options. /// /// See the [Rust documentation for `for_config`](https://docs.rs/icu/latest/icu/locid_transform/fallback/struct.LocaleFallbacker.html#method.for_config) for more information. @@ -60,9 +50,20 @@ final class LocaleFallbacker implements ffi.Finalizable { } return LocaleFallbackerWithConfig._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XLocaleFallbacker_for_config = - _capi, _LocaleFallbackConfigFfi)>>('ICU4XLocaleFallbacker_for_config') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, _LocaleFallbackConfigFfi)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleFallbacker_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleFallbacker_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleFallbacker_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleFallbacker_create(ffi.Pointer provider); + +@ffi.Native Function()>(isLeaf: true, symbol: 'ICU4XLocaleFallbacker_create_without_data') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XLocaleFallbacker_create_without_data(); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, _LocaleFallbackConfigFfi)>(isLeaf: true, symbol: 'ICU4XLocaleFallbacker_for_config') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XLocaleFallbacker_for_config(ffi.Pointer self, _LocaleFallbackConfigFfi config); diff --git a/ffi/capi/bindings/dart/LocaleFallbackerWithConfig.g.dart b/ffi/capi/bindings/dart/LocaleFallbackerWithConfig.g.dart index 03de6083f23..e8efb519874 100644 --- a/ffi/capi/bindings/dart/LocaleFallbackerWithConfig.g.dart +++ b/ffi/capi/bindings/dart/LocaleFallbackerWithConfig.g.dart @@ -17,7 +17,7 @@ final class LocaleFallbackerWithConfig implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLocaleFallbackerWithConfig_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLocaleFallbackerWithConfig_destroy)); /// Creates an iterator from a locale with each step of fallback. /// @@ -26,9 +26,12 @@ final class LocaleFallbackerWithConfig implements ffi.Finalizable { final result = _ICU4XLocaleFallbackerWithConfig_fallback_for_locale(_underlying, locale._underlying); return LocaleFallbackIterator._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XLocaleFallbackerWithConfig_fallback_for_locale = - _capi Function(ffi.Pointer, ffi.Pointer)>>('ICU4XLocaleFallbackerWithConfig_fallback_for_locale') - .asFunction Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLocaleFallbackerWithConfig_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLocaleFallbackerWithConfig_destroy(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XLocaleFallbackerWithConfig_fallback_for_locale') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XLocaleFallbackerWithConfig_fallback_for_locale(ffi.Pointer self, ffi.Pointer locale); diff --git a/ffi/capi/bindings/dart/Logger.g.dart b/ffi/capi/bindings/dart/Logger.g.dart index 31ddc1f9f2c..d5c5ede041b 100644 --- a/ffi/capi/bindings/dart/Logger.g.dart +++ b/ffi/capi/bindings/dart/Logger.g.dart @@ -13,7 +13,7 @@ final class Logger implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XLogger_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XLogger_destroy)); /// Initialize the logger using `simple_logger` /// @@ -25,19 +25,21 @@ final class Logger implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XLogger_init_simple_logger = - _capi>('ICU4XLogger_init_simple_logger') - .asFunction(isLeaf: true); - /// Deprecated: since ICU4X 1.4, this now happens automatically if the `log` feature is enabled. static bool initConsoleLogger() { final result = _ICU4XLogger_init_console_logger(); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XLogger_init_console_logger = - _capi>('ICU4XLogger_init_console_logger') - .asFunction(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XLogger_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XLogger_destroy(ffi.Pointer self); + +@ffi.Native(isLeaf: true, symbol: 'ICU4XLogger_init_simple_logger') +// ignore: non_constant_identifier_names +external bool _ICU4XLogger_init_simple_logger(); + +@ffi.Native(isLeaf: true, symbol: 'ICU4XLogger_init_console_logger') +// ignore: non_constant_identifier_names +external bool _ICU4XLogger_init_console_logger(); diff --git a/ffi/capi/bindings/dart/MetazoneCalculator.g.dart b/ffi/capi/bindings/dart/MetazoneCalculator.g.dart index f5be7dcfb54..e8d0e64acdc 100644 --- a/ffi/capi/bindings/dart/MetazoneCalculator.g.dart +++ b/ffi/capi/bindings/dart/MetazoneCalculator.g.dart @@ -19,7 +19,7 @@ final class MetazoneCalculator implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XMetazoneCalculator_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XMetazoneCalculator_destroy)); /// See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/timezone/struct.MetazoneCalculator.html#method.new) for more information. /// @@ -31,9 +31,12 @@ final class MetazoneCalculator implements ffi.Finalizable { } return MetazoneCalculator._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XMetazoneCalculator_create = - _capi)>>('ICU4XMetazoneCalculator_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XMetazoneCalculator_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XMetazoneCalculator_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XMetazoneCalculator_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XMetazoneCalculator_create(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/PluralCategory.g.dart b/ffi/capi/bindings/dart/PluralCategory.g.dart index c4c681f9fa3..bd235fad3b5 100644 --- a/ffi/capi/bindings/dart/PluralCategory.g.dart +++ b/ffi/capi/bindings/dart/PluralCategory.g.dart @@ -39,9 +39,8 @@ enum PluralCategory { } return PluralCategory.values[result.union.ok]; } - - // ignore: non_constant_identifier_names - static final _ICU4XPluralCategory_get_for_cldr_string = - _capi, ffi.Size)>>('ICU4XPluralCategory_get_for_cldr_string') - .asFunction<_ResultInt32Void Function(ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native<_ResultInt32Void Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XPluralCategory_get_for_cldr_string') +// ignore: non_constant_identifier_names +external _ResultInt32Void _ICU4XPluralCategory_get_for_cldr_string(ffi.Pointer sData, int sLength); diff --git a/ffi/capi/bindings/dart/PluralOperands.g.dart b/ffi/capi/bindings/dart/PluralOperands.g.dart index c33165608f8..d580d1e3005 100644 --- a/ffi/capi/bindings/dart/PluralOperands.g.dart +++ b/ffi/capi/bindings/dart/PluralOperands.g.dart @@ -15,7 +15,7 @@ final class PluralOperands implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XPluralOperands_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XPluralOperands_destroy)); /// Construct for a given string representing a number /// @@ -32,9 +32,12 @@ final class PluralOperands implements ffi.Finalizable { } return PluralOperands._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XPluralOperands_create_from_string = - _capi, ffi.Size)>>('ICU4XPluralOperands_create_from_string') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XPluralOperands_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XPluralOperands_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XPluralOperands_create_from_string') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPluralOperands_create_from_string(ffi.Pointer sData, int sLength); diff --git a/ffi/capi/bindings/dart/PluralRules.g.dart b/ffi/capi/bindings/dart/PluralRules.g.dart index 13c2e3b407a..8d5329c5030 100644 --- a/ffi/capi/bindings/dart/PluralRules.g.dart +++ b/ffi/capi/bindings/dart/PluralRules.g.dart @@ -15,7 +15,7 @@ final class PluralRules implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XPluralRules_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XPluralRules_destroy)); /// Construct an [`PluralRules`] for the given locale, for cardinal numbers /// @@ -30,11 +30,6 @@ final class PluralRules implements ffi.Finalizable { return PluralRules._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPluralRules_create_cardinal = - _capi, ffi.Pointer)>>('ICU4XPluralRules_create_cardinal') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Construct an [`PluralRules`] for the given locale, for ordinal numbers /// /// See the [Rust documentation for `try_new_ordinal`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal) for more information. @@ -48,11 +43,6 @@ final class PluralRules implements ffi.Finalizable { return PluralRules._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPluralRules_create_ordinal = - _capi, ffi.Pointer)>>('ICU4XPluralRules_create_ordinal') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Get the category for a given number represented as operands /// /// See the [Rust documentation for `category_for`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.category_for) for more information. @@ -61,11 +51,6 @@ final class PluralRules implements ffi.Finalizable { return PluralCategory.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XPluralRules_category_for = - _capi, ffi.Pointer)>>('ICU4XPluralRules_category_for') - .asFunction, ffi.Pointer)>(isLeaf: true); - /// Get all of the categories needed in the current locale /// /// See the [Rust documentation for `categories`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.categories) for more information. @@ -73,9 +58,24 @@ final class PluralRules implements ffi.Finalizable { final result = _ICU4XPluralRules_categories(_underlying); return PluralCategories._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XPluralRules_categories = - _capi)>>('ICU4XPluralRules_categories') - .asFunction<_PluralCategoriesFfi Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XPluralRules_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XPluralRules_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPluralRules_create_cardinal') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPluralRules_create_cardinal(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPluralRules_create_ordinal') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPluralRules_create_ordinal(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPluralRules_category_for') +// ignore: non_constant_identifier_names +external int _ICU4XPluralRules_category_for(ffi.Pointer self, ffi.Pointer op); + +@ffi.Native<_PluralCategoriesFfi Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPluralRules_categories') +// ignore: non_constant_identifier_names +external _PluralCategoriesFfi _ICU4XPluralRules_categories(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/PropertyValueNameToEnumMapper.g.dart b/ffi/capi/bindings/dart/PropertyValueNameToEnumMapper.g.dart index 5e8553f341e..bf2cf158ad9 100644 --- a/ffi/capi/bindings/dart/PropertyValueNameToEnumMapper.g.dart +++ b/ffi/capi/bindings/dart/PropertyValueNameToEnumMapper.g.dart @@ -17,7 +17,7 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XPropertyValueNameToEnumMapper_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XPropertyValueNameToEnumMapper_destroy)); /// Get the property value matching the given name, using strict matching /// @@ -32,11 +32,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_get_strict = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XPropertyValueNameToEnumMapper_get_strict') - .asFunction, ffi.Pointer, int)>(isLeaf: true); - /// Get the property value matching the given name, using loose matching /// /// Returns -1 if the name is unknown for this property @@ -50,11 +45,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_get_loose = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XPropertyValueNameToEnumMapper_get_loose') - .asFunction, ffi.Pointer, int)>(isLeaf: true); - /// See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GeneralCategory.html#method.get_name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -66,11 +56,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_general_category = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_general_category') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.BidiClass.html#method.name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -82,11 +67,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_bidi_class = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_bidi_class') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.EastAsianWidth.html#method.name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -98,11 +78,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_east_asian_width = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_east_asian_width') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.IndicSyllabicCategory.html#method.name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -114,11 +89,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.LineBreak.html#method.name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -130,11 +100,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_line_break = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_line_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `get_name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.GraphemeClusterBreak.html#method.get_name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -146,11 +111,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.WordBreak.html#method.name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -162,11 +122,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_word_break = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_word_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.SentenceBreak.html#method.name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -178,11 +133,6 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { return PropertyValueNameToEnumMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_sentence_break = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_sentence_break') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `name_to_enum_mapper`](https://docs.rs/icu/latest/icu/properties/struct.Script.html#method.name_to_enum_mapper) for more information. /// /// Throws [Error] on failure. @@ -193,9 +143,52 @@ final class PropertyValueNameToEnumMapper implements ffi.Finalizable { } return PropertyValueNameToEnumMapper._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XPropertyValueNameToEnumMapper_load_script = - _capi)>>('ICU4XPropertyValueNameToEnumMapper_load_script') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XPropertyValueNameToEnumMapper_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_get_strict') +// ignore: non_constant_identifier_names +external int _ICU4XPropertyValueNameToEnumMapper_get_strict(ffi.Pointer self, ffi.Pointer nameData, int nameLength); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_get_loose') +// ignore: non_constant_identifier_names +external int _ICU4XPropertyValueNameToEnumMapper_get_loose(ffi.Pointer self, ffi.Pointer nameData, int nameLength); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_general_category') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_general_category(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_bidi_class') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_bidi_class(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_east_asian_width') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_east_asian_width(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_indic_syllabic_category(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_line_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_line_break(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_grapheme_cluster_break(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_word_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_word_break(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_sentence_break') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_sentence_break(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XPropertyValueNameToEnumMapper_load_script') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XPropertyValueNameToEnumMapper_load_script(ffi.Pointer provider); diff --git a/ffi/capi/bindings/dart/RegionDisplayNames.g.dart b/ffi/capi/bindings/dart/RegionDisplayNames.g.dart index 40e3b079502..98d0e4b3b9f 100644 --- a/ffi/capi/bindings/dart/RegionDisplayNames.g.dart +++ b/ffi/capi/bindings/dart/RegionDisplayNames.g.dart @@ -13,7 +13,7 @@ final class RegionDisplayNames implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XRegionDisplayNames_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XRegionDisplayNames_destroy)); /// Creates a new `RegionDisplayNames` from locale data and an options bag. /// @@ -28,11 +28,6 @@ final class RegionDisplayNames implements ffi.Finalizable { return RegionDisplayNames._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XRegionDisplayNames_create = - _capi, ffi.Pointer)>>('ICU4XRegionDisplayNames_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Returns the locale specific display name of a region. /// Note that the funtion returns an empty string in case the display name for a given /// region code is not found. @@ -51,9 +46,16 @@ final class RegionDisplayNames implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XRegionDisplayNames_of = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer)>>('ICU4XRegionDisplayNames_of') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XRegionDisplayNames_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XRegionDisplayNames_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XRegionDisplayNames_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XRegionDisplayNames_create(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XRegionDisplayNames_of') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XRegionDisplayNames_of(ffi.Pointer self, ffi.Pointer regionData, int regionLength, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/ReorderedIndexMap.g.dart b/ffi/capi/bindings/dart/ReorderedIndexMap.g.dart index 290bc7d5226..6d7b8fd94a0 100644 --- a/ffi/capi/bindings/dart/ReorderedIndexMap.g.dart +++ b/ffi/capi/bindings/dart/ReorderedIndexMap.g.dart @@ -17,7 +17,7 @@ final class ReorderedIndexMap implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XReorderedIndexMap_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XReorderedIndexMap_destroy)); /// Get this as a slice/array of indices core.List get asSlice { @@ -25,33 +25,18 @@ final class ReorderedIndexMap implements ffi.Finalizable { return core.Iterable.generate(result._length).map((i) => result._pointer[i]).toList(growable: false); } - // ignore: non_constant_identifier_names - static final _ICU4XReorderedIndexMap_as_slice = - _capi)>>('ICU4XReorderedIndexMap_as_slice') - .asFunction<_SliceUsize Function(ffi.Pointer)>(isLeaf: true); - /// The length of this map int get length { final result = _ICU4XReorderedIndexMap_len(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XReorderedIndexMap_len = - _capi)>>('ICU4XReorderedIndexMap_len') - .asFunction)>(isLeaf: true); - /// Whether this map is empty bool get isEmpty { final result = _ICU4XReorderedIndexMap_is_empty(_underlying); return result; } - // ignore: non_constant_identifier_names - static final _ICU4XReorderedIndexMap_is_empty = - _capi)>>('ICU4XReorderedIndexMap_is_empty') - .asFunction)>(isLeaf: true); - /// Get element at `index`. Returns 0 when out of bounds /// (note that 0 is also a valid in-bounds value, please use `len()` /// to avoid out-of-bounds) @@ -59,9 +44,24 @@ final class ReorderedIndexMap implements ffi.Finalizable { final result = _ICU4XReorderedIndexMap_get(_underlying, index); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XReorderedIndexMap_get = - _capi, ffi.Size)>>('ICU4XReorderedIndexMap_get') - .asFunction, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XReorderedIndexMap_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XReorderedIndexMap_destroy(ffi.Pointer self); + +@ffi.Native<_SliceUsize Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XReorderedIndexMap_as_slice') +// ignore: non_constant_identifier_names +external _SliceUsize _ICU4XReorderedIndexMap_as_slice(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XReorderedIndexMap_len') +// ignore: non_constant_identifier_names +external int _ICU4XReorderedIndexMap_len(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XReorderedIndexMap_is_empty') +// ignore: non_constant_identifier_names +external bool _ICU4XReorderedIndexMap_is_empty(ffi.Pointer self); + +@ffi.Native, ffi.Size)>(isLeaf: true, symbol: 'ICU4XReorderedIndexMap_get') +// ignore: non_constant_identifier_names +external int _ICU4XReorderedIndexMap_get(ffi.Pointer self, int index); diff --git a/ffi/capi/bindings/dart/ScriptExtensionsSet.g.dart b/ffi/capi/bindings/dart/ScriptExtensionsSet.g.dart index 8998504b17f..25be8c0f47f 100644 --- a/ffi/capi/bindings/dart/ScriptExtensionsSet.g.dart +++ b/ffi/capi/bindings/dart/ScriptExtensionsSet.g.dart @@ -15,7 +15,7 @@ final class ScriptExtensionsSet implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XScriptExtensionsSet_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XScriptExtensionsSet_destroy)); /// Check if the Script_Extensions property of the given code point covers the given script /// @@ -25,11 +25,6 @@ final class ScriptExtensionsSet implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XScriptExtensionsSet_contains = - _capi, ffi.Uint16)>>('ICU4XScriptExtensionsSet_contains') - .asFunction, int)>(isLeaf: true); - /// Get the number of scripts contained in here /// /// See the [Rust documentation for `iter`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information. @@ -38,11 +33,6 @@ final class ScriptExtensionsSet implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XScriptExtensionsSet_count = - _capi)>>('ICU4XScriptExtensionsSet_count') - .asFunction)>(isLeaf: true); - /// Get script at index, returning an error if out of bounds /// /// See the [Rust documentation for `iter`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptExtensionsSet.html#method.iter) for more information. @@ -55,9 +45,20 @@ final class ScriptExtensionsSet implements ffi.Finalizable { } return result.union.ok; } - - // ignore: non_constant_identifier_names - static final _ICU4XScriptExtensionsSet_script_at = - _capi, ffi.Size)>>('ICU4XScriptExtensionsSet_script_at') - .asFunction<_ResultUint16Void Function(ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XScriptExtensionsSet_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XScriptExtensionsSet_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XScriptExtensionsSet_contains') +// ignore: non_constant_identifier_names +external bool _ICU4XScriptExtensionsSet_contains(ffi.Pointer self, int script); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XScriptExtensionsSet_count') +// ignore: non_constant_identifier_names +external int _ICU4XScriptExtensionsSet_count(ffi.Pointer self); + +@ffi.Native<_ResultUint16Void Function(ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XScriptExtensionsSet_script_at') +// ignore: non_constant_identifier_names +external _ResultUint16Void _ICU4XScriptExtensionsSet_script_at(ffi.Pointer self, int index); diff --git a/ffi/capi/bindings/dart/ScriptWithExtensions.g.dart b/ffi/capi/bindings/dart/ScriptWithExtensions.g.dart index 74293c170e0..fc513ae749d 100644 --- a/ffi/capi/bindings/dart/ScriptWithExtensions.g.dart +++ b/ffi/capi/bindings/dart/ScriptWithExtensions.g.dart @@ -15,7 +15,7 @@ final class ScriptWithExtensions implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XScriptWithExtensions_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XScriptWithExtensions_destroy)); /// See the [Rust documentation for `script_with_extensions`](https://docs.rs/icu/latest/icu/properties/script/fn.script_with_extensions.html) for more information. /// @@ -28,11 +28,6 @@ final class ScriptWithExtensions implements ffi.Finalizable { return ScriptWithExtensions._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensions_create = - _capi)>>('ICU4XScriptWithExtensions_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Get the Script property value for a code point /// /// See the [Rust documentation for `get_script_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_val) for more information. @@ -41,11 +36,6 @@ final class ScriptWithExtensions implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensions_get_script_val = - _capi, ffi.Uint32)>>('ICU4XScriptWithExtensions_get_script_val') - .asFunction, int)>(isLeaf: true); - /// Check if the Script_Extensions property of the given code point covers the given script /// /// See the [Rust documentation for `has_script`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information. @@ -54,11 +44,6 @@ final class ScriptWithExtensions implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensions_has_script = - _capi, ffi.Uint32, ffi.Uint16)>>('ICU4XScriptWithExtensions_has_script') - .asFunction, int, int)>(isLeaf: true); - /// Borrow this object for a slightly faster variant with more operations /// /// See the [Rust documentation for `as_borrowed`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensions.html#method.as_borrowed) for more information. @@ -67,11 +52,6 @@ final class ScriptWithExtensions implements ffi.Finalizable { return ScriptWithExtensionsBorrowed._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensions_as_borrowed = - _capi Function(ffi.Pointer)>>('ICU4XScriptWithExtensions_as_borrowed') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - /// Get a list of ranges of code points that contain this script in their Script_Extensions values /// /// See the [Rust documentation for `get_script_extensions_ranges`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_ranges) for more information. @@ -79,9 +59,28 @@ final class ScriptWithExtensions implements ffi.Finalizable { final result = _ICU4XScriptWithExtensions_iter_ranges_for_script(_underlying, script); return CodePointRangeIterator._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensions_iter_ranges_for_script = - _capi Function(ffi.Pointer, ffi.Uint16)>>('ICU4XScriptWithExtensions_iter_ranges_for_script') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensions_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XScriptWithExtensions_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensions_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XScriptWithExtensions_create(ffi.Pointer provider); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensions_get_script_val') +// ignore: non_constant_identifier_names +external int _ICU4XScriptWithExtensions_get_script_val(ffi.Pointer self, int codePoint); + +@ffi.Native, ffi.Uint32, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensions_has_script') +// ignore: non_constant_identifier_names +external bool _ICU4XScriptWithExtensions_has_script(ffi.Pointer self, int codePoint, int script); + +@ffi.Native Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensions_as_borrowed') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XScriptWithExtensions_as_borrowed(ffi.Pointer self); + +@ffi.Native Function(ffi.Pointer, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensions_iter_ranges_for_script') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XScriptWithExtensions_iter_ranges_for_script(ffi.Pointer self, int script); diff --git a/ffi/capi/bindings/dart/ScriptWithExtensionsBorrowed.g.dart b/ffi/capi/bindings/dart/ScriptWithExtensionsBorrowed.g.dart index b4b629dfb4f..6b916c1d3bb 100644 --- a/ffi/capi/bindings/dart/ScriptWithExtensionsBorrowed.g.dart +++ b/ffi/capi/bindings/dart/ScriptWithExtensionsBorrowed.g.dart @@ -15,7 +15,7 @@ final class ScriptWithExtensionsBorrowed implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XScriptWithExtensionsBorrowed_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XScriptWithExtensionsBorrowed_destroy)); /// Get the Script property value for a code point /// @@ -25,11 +25,6 @@ final class ScriptWithExtensionsBorrowed implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensionsBorrowed_get_script_val = - _capi, ffi.Uint32)>>('ICU4XScriptWithExtensionsBorrowed_get_script_val') - .asFunction, int)>(isLeaf: true); - /// Get the Script property value for a code point /// /// See the [Rust documentation for `get_script_extensions_val`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.get_script_extensions_val) for more information. @@ -38,11 +33,6 @@ final class ScriptWithExtensionsBorrowed implements ffi.Finalizable { return ScriptExtensionsSet._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val = - _capi Function(ffi.Pointer, ffi.Uint32)>>('ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); - /// Check if the Script_Extensions property of the given code point covers the given script /// /// See the [Rust documentation for `has_script`](https://docs.rs/icu/latest/icu/properties/script/struct.ScriptWithExtensionsBorrowed.html#method.has_script) for more information. @@ -51,11 +41,6 @@ final class ScriptWithExtensionsBorrowed implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensionsBorrowed_has_script = - _capi, ffi.Uint32, ffi.Uint16)>>('ICU4XScriptWithExtensionsBorrowed_has_script') - .asFunction, int, int)>(isLeaf: true); - /// Build the CodePointSetData corresponding to a codepoints matching a particular script /// in their Script_Extensions /// @@ -64,9 +49,24 @@ final class ScriptWithExtensionsBorrowed implements ffi.Finalizable { final result = _ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set(_underlying, script); return CodePointSetData._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set = - _capi Function(ffi.Pointer, ffi.Uint16)>>('ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set') - .asFunction Function(ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensionsBorrowed_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XScriptWithExtensionsBorrowed_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensionsBorrowed_get_script_val') +// ignore: non_constant_identifier_names +external int _ICU4XScriptWithExtensionsBorrowed_get_script_val(ffi.Pointer self, int codePoint); + +@ffi.Native Function(ffi.Pointer, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XScriptWithExtensionsBorrowed_get_script_extensions_val(ffi.Pointer self, int codePoint); + +@ffi.Native, ffi.Uint32, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensionsBorrowed_has_script') +// ignore: non_constant_identifier_names +external bool _ICU4XScriptWithExtensionsBorrowed_has_script(ffi.Pointer self, int codePoint, int script); + +@ffi.Native Function(ffi.Pointer, ffi.Uint16)>(isLeaf: true, symbol: 'ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XScriptWithExtensionsBorrowed_get_script_extensions_set(ffi.Pointer self, int script); diff --git a/ffi/capi/bindings/dart/SentenceBreakIteratorLatin1.g.dart b/ffi/capi/bindings/dart/SentenceBreakIteratorLatin1.g.dart index 33d74272445..15aa47a7d8f 100644 --- a/ffi/capi/bindings/dart/SentenceBreakIteratorLatin1.g.dart +++ b/ffi/capi/bindings/dart/SentenceBreakIteratorLatin1.g.dart @@ -13,7 +13,7 @@ final class SentenceBreakIteratorLatin1 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XSentenceBreakIteratorLatin1_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XSentenceBreakIteratorLatin1_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -23,9 +23,12 @@ final class SentenceBreakIteratorLatin1 implements ffi.Finalizable { final result = _ICU4XSentenceBreakIteratorLatin1_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XSentenceBreakIteratorLatin1_next = - _capi)>>('ICU4XSentenceBreakIteratorLatin1_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XSentenceBreakIteratorLatin1_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XSentenceBreakIteratorLatin1_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XSentenceBreakIteratorLatin1_next') +// ignore: non_constant_identifier_names +external int _ICU4XSentenceBreakIteratorLatin1_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/SentenceBreakIteratorUtf16.g.dart b/ffi/capi/bindings/dart/SentenceBreakIteratorUtf16.g.dart index 25ac68675f3..2cdeb250d2f 100644 --- a/ffi/capi/bindings/dart/SentenceBreakIteratorUtf16.g.dart +++ b/ffi/capi/bindings/dart/SentenceBreakIteratorUtf16.g.dart @@ -13,7 +13,7 @@ final class SentenceBreakIteratorUtf16 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XSentenceBreakIteratorUtf16_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XSentenceBreakIteratorUtf16_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -23,9 +23,12 @@ final class SentenceBreakIteratorUtf16 implements ffi.Finalizable { final result = _ICU4XSentenceBreakIteratorUtf16_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XSentenceBreakIteratorUtf16_next = - _capi)>>('ICU4XSentenceBreakIteratorUtf16_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XSentenceBreakIteratorUtf16_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XSentenceBreakIteratorUtf16_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XSentenceBreakIteratorUtf16_next') +// ignore: non_constant_identifier_names +external int _ICU4XSentenceBreakIteratorUtf16_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/SentenceBreakIteratorUtf8.g.dart b/ffi/capi/bindings/dart/SentenceBreakIteratorUtf8.g.dart index e8b93c6cbd8..efe8ab55fe6 100644 --- a/ffi/capi/bindings/dart/SentenceBreakIteratorUtf8.g.dart +++ b/ffi/capi/bindings/dart/SentenceBreakIteratorUtf8.g.dart @@ -13,7 +13,7 @@ final class SentenceBreakIteratorUtf8 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XSentenceBreakIteratorUtf8_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XSentenceBreakIteratorUtf8_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -23,9 +23,12 @@ final class SentenceBreakIteratorUtf8 implements ffi.Finalizable { final result = _ICU4XSentenceBreakIteratorUtf8_next(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XSentenceBreakIteratorUtf8_next = - _capi)>>('ICU4XSentenceBreakIteratorUtf8_next') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XSentenceBreakIteratorUtf8_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XSentenceBreakIteratorUtf8_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XSentenceBreakIteratorUtf8_next') +// ignore: non_constant_identifier_names +external int _ICU4XSentenceBreakIteratorUtf8_next(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/SentenceSegmenter.g.dart b/ffi/capi/bindings/dart/SentenceSegmenter.g.dart index 7523ff7373b..06b568bf7bf 100644 --- a/ffi/capi/bindings/dart/SentenceSegmenter.g.dart +++ b/ffi/capi/bindings/dart/SentenceSegmenter.g.dart @@ -15,7 +15,7 @@ final class SentenceSegmenter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XSentenceSegmenter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XSentenceSegmenter_destroy)); /// Construct an [`SentenceSegmenter`]. /// @@ -30,11 +30,6 @@ final class SentenceSegmenter implements ffi.Finalizable { return SentenceSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XSentenceSegmenter_create = - _capi)>>('ICU4XSentenceSegmenter_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Segments a string. /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -48,9 +43,16 @@ final class SentenceSegmenter implements ffi.Finalizable { temp.releaseAll(); return SentenceBreakIteratorUtf16._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XSentenceSegmenter_segment_utf16 = - _capi Function(ffi.Pointer, ffi.Pointer, ffi.Size)>>('ICU4XSentenceSegmenter_segment_utf16') - .asFunction Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XSentenceSegmenter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XSentenceSegmenter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XSentenceSegmenter_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XSentenceSegmenter_create(ffi.Pointer provider); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XSentenceSegmenter_segment_utf16') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XSentenceSegmenter_segment_utf16(ffi.Pointer self, ffi.Pointer inputData, int inputLength); diff --git a/ffi/capi/bindings/dart/Time.g.dart b/ffi/capi/bindings/dart/Time.g.dart index a1919d638cc..e6d0f28af2b 100644 --- a/ffi/capi/bindings/dart/Time.g.dart +++ b/ffi/capi/bindings/dart/Time.g.dart @@ -15,7 +15,7 @@ final class Time implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XTime_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XTime_destroy)); /// Creates a new [`Time`] given field values /// @@ -30,11 +30,6 @@ final class Time implements ffi.Finalizable { return Time._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XTime_create = - _capi>('ICU4XTime_create') - .asFunction<_ResultOpaqueInt32 Function(int, int, int, int)>(isLeaf: true); - /// Creates a new [`Time`] representing midnight (00:00.000). /// /// See the [Rust documentation for `Time`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html) for more information. @@ -48,11 +43,6 @@ final class Time implements ffi.Finalizable { return Time._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XTime_create_midnight = - _capi>('ICU4XTime_create_midnight') - .asFunction<_ResultOpaqueInt32 Function()>(isLeaf: true); - /// Returns the hour in this time /// /// See the [Rust documentation for `hour`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.hour) for more information. @@ -61,11 +51,6 @@ final class Time implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XTime_hour = - _capi)>>('ICU4XTime_hour') - .asFunction)>(isLeaf: true); - /// Returns the minute in this time /// /// See the [Rust documentation for `minute`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.minute) for more information. @@ -74,11 +59,6 @@ final class Time implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XTime_minute = - _capi)>>('ICU4XTime_minute') - .asFunction)>(isLeaf: true); - /// Returns the second in this time /// /// See the [Rust documentation for `second`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.second) for more information. @@ -87,11 +67,6 @@ final class Time implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XTime_second = - _capi)>>('ICU4XTime_second') - .asFunction)>(isLeaf: true); - /// Returns the nanosecond in this time /// /// See the [Rust documentation for `nanosecond`](https://docs.rs/icu/latest/icu/calendar/types/struct.Time.html#structfield.nanosecond) for more information. @@ -99,9 +74,32 @@ final class Time implements ffi.Finalizable { final result = _ICU4XTime_nanosecond(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XTime_nanosecond = - _capi)>>('ICU4XTime_nanosecond') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTime_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XTime_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Uint8, ffi.Uint8, ffi.Uint8, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XTime_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XTime_create(int hour, int minute, int second, int nanosecond); + +@ffi.Native<_ResultOpaqueInt32 Function()>(isLeaf: true, symbol: 'ICU4XTime_create_midnight') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XTime_create_midnight(); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTime_hour') +// ignore: non_constant_identifier_names +external int _ICU4XTime_hour(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTime_minute') +// ignore: non_constant_identifier_names +external int _ICU4XTime_minute(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTime_second') +// ignore: non_constant_identifier_names +external int _ICU4XTime_second(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTime_nanosecond') +// ignore: non_constant_identifier_names +external int _ICU4XTime_nanosecond(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/TimeFormatter.g.dart b/ffi/capi/bindings/dart/TimeFormatter.g.dart index 8a68484910f..5d983a90f15 100644 --- a/ffi/capi/bindings/dart/TimeFormatter.g.dart +++ b/ffi/capi/bindings/dart/TimeFormatter.g.dart @@ -15,7 +15,7 @@ final class TimeFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XTimeFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XTimeFormatter_destroy)); /// Creates a new [`TimeFormatter`] from locale data. /// @@ -30,11 +30,6 @@ final class TimeFormatter implements ffi.Finalizable { return TimeFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XTimeFormatter_create_with_length = - _capi, ffi.Pointer, ffi.Int32)>>('ICU4XTimeFormatter_create_with_length') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); - /// Formats a [`Time`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. @@ -49,11 +44,6 @@ final class TimeFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XTimeFormatter_format_time = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XTimeFormatter_format_time') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`DateTime`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. @@ -68,11 +58,6 @@ final class TimeFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XTimeFormatter_format_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XTimeFormatter_format_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`IsoDateTime`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.TimeFormatter.html#method.format) for more information. @@ -86,9 +71,24 @@ final class TimeFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XTimeFormatter_format_iso_datetime = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XTimeFormatter_format_iso_datetime') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTimeFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XTimeFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XTimeFormatter_create_with_length') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XTimeFormatter_create_with_length(ffi.Pointer provider, ffi.Pointer locale, int length); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeFormatter_format_time') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeFormatter_format_time(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeFormatter_format_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeFormatter_format_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeFormatter_format_iso_datetime') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeFormatter_format_iso_datetime(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/TimeZoneFormatter.g.dart b/ffi/capi/bindings/dart/TimeZoneFormatter.g.dart index 4a0b225e9ea..12693e711e0 100644 --- a/ffi/capi/bindings/dart/TimeZoneFormatter.g.dart +++ b/ffi/capi/bindings/dart/TimeZoneFormatter.g.dart @@ -15,7 +15,7 @@ final class TimeZoneFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XTimeZoneFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XTimeZoneFormatter_destroy)); /// Creates a new [`TimeZoneFormatter`] from locale data. /// @@ -34,11 +34,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { return TimeZoneFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback = - _capi, ffi.Pointer)>>('ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Creates a new [`TimeZoneFormatter`] from locale data. /// /// Uses ISO-8601 as the fallback format. @@ -56,11 +51,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { return TimeZoneFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_create_with_iso_8601_fallback = - _capi, ffi.Pointer, _IsoTimeZoneOptionsFfi)>>('ICU4XTimeZoneFormatter_create_with_iso_8601_fallback') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, _IsoTimeZoneOptionsFfi)>(isLeaf: true); - /// Loads generic non-location long format. Example: "Pacific Time" /// /// See the [Rust documentation for `include_generic_non_location_long`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_non_location_long) for more information. @@ -73,11 +63,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_load_generic_non_location_long = - _capi, ffi.Pointer)>>('ICU4XTimeZoneFormatter_load_generic_non_location_long') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Loads generic non-location short format. Example: "PT" /// /// See the [Rust documentation for `include_generic_non_location_short`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_non_location_short) for more information. @@ -90,11 +75,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_load_generic_non_location_short = - _capi, ffi.Pointer)>>('ICU4XTimeZoneFormatter_load_generic_non_location_short') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Loads specific non-location long format. Example: "Pacific Standard Time" /// /// See the [Rust documentation for `include_specific_non_location_long`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_specific_non_location_long) for more information. @@ -107,11 +87,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_load_specific_non_location_long = - _capi, ffi.Pointer)>>('ICU4XTimeZoneFormatter_load_specific_non_location_long') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Loads specific non-location short format. Example: "PST" /// /// See the [Rust documentation for `include_specific_non_location_short`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_specific_non_location_short) for more information. @@ -124,11 +99,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_load_specific_non_location_short = - _capi, ffi.Pointer)>>('ICU4XTimeZoneFormatter_load_specific_non_location_short') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Loads generic location format. Example: "Los Angeles Time" /// /// See the [Rust documentation for `include_generic_location_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_generic_location_format) for more information. @@ -141,11 +111,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_load_generic_location_format = - _capi, ffi.Pointer)>>('ICU4XTimeZoneFormatter_load_generic_location_format') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Loads localized GMT format. Example: "GMT-07:00" /// /// See the [Rust documentation for `include_localized_gmt_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_localized_gmt_format) for more information. @@ -158,11 +123,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_include_localized_gmt_format = - _capi)>>('ICU4XTimeZoneFormatter_include_localized_gmt_format') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Loads ISO-8601 format. Example: "-07:00" /// /// See the [Rust documentation for `include_iso_8601_format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.include_iso_8601_format) for more information. @@ -175,11 +135,6 @@ final class TimeZoneFormatter implements ffi.Finalizable { } } - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_load_iso_8601_format = - _capi, _IsoTimeZoneOptionsFfi)>>('ICU4XTimeZoneFormatter_load_iso_8601_format') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, _IsoTimeZoneOptionsFfi)>(isLeaf: true); - /// Formats a [`CustomTimeZone`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/time_zone/struct.TimeZoneFormatter.html#method.format) for more information. @@ -195,9 +150,48 @@ final class TimeZoneFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XTimeZoneFormatter_format_custom_time_zone = - _capi, ffi.Pointer, ffi.Pointer)>>('ICU4XTimeZoneFormatter_format_custom_time_zone') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XTimeZoneFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XTimeZoneFormatter_create_with_localized_gmt_fallback(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, _IsoTimeZoneOptionsFfi)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_create_with_iso_8601_fallback') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XTimeZoneFormatter_create_with_iso_8601_fallback(ffi.Pointer provider, ffi.Pointer locale, _IsoTimeZoneOptionsFfi options); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_generic_non_location_long') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_generic_non_location_long(ffi.Pointer self, ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_generic_non_location_short') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_generic_non_location_short(ffi.Pointer self, ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_specific_non_location_long') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_specific_non_location_long(ffi.Pointer self, ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_specific_non_location_short') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_specific_non_location_short(ffi.Pointer self, ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_generic_location_format') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_generic_location_format(ffi.Pointer self, ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_include_localized_gmt_format') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_include_localized_gmt_format(ffi.Pointer self); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, _IsoTimeZoneOptionsFfi)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_load_iso_8601_format') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_load_iso_8601_format(ffi.Pointer self, _IsoTimeZoneOptionsFfi options); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTimeZoneFormatter_format_custom_time_zone') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTimeZoneFormatter_format_custom_time_zone(ffi.Pointer self, ffi.Pointer value, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/TitlecaseMapper.g.dart b/ffi/capi/bindings/dart/TitlecaseMapper.g.dart index e1d1be570d8..f6d9a0c223b 100644 --- a/ffi/capi/bindings/dart/TitlecaseMapper.g.dart +++ b/ffi/capi/bindings/dart/TitlecaseMapper.g.dart @@ -13,7 +13,7 @@ final class TitlecaseMapper implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XTitlecaseMapper_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XTitlecaseMapper_destroy)); /// Construct a new `TitlecaseMapper` instance /// @@ -28,11 +28,6 @@ final class TitlecaseMapper implements ffi.Finalizable { return TitlecaseMapper._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XTitlecaseMapper_create = - _capi)>>('ICU4XTitlecaseMapper_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Returns the full titlecase mapping of the given string /// /// The `v1` refers to the version of the options struct, which may change as we add more options @@ -51,9 +46,16 @@ final class TitlecaseMapper implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XTitlecaseMapper_titlecase_segment_v1 = - _capi, ffi.Pointer, ffi.Size, ffi.Pointer, _TitlecaseOptionsV1Ffi, ffi.Pointer)>>('ICU4XTitlecaseMapper_titlecase_segment_v1') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, int, ffi.Pointer, _TitlecaseOptionsV1Ffi, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XTitlecaseMapper_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XTitlecaseMapper_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTitlecaseMapper_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XTitlecaseMapper_create(ffi.Pointer provider); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Size, ffi.Pointer, _TitlecaseOptionsV1Ffi, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XTitlecaseMapper_titlecase_segment_v1') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XTitlecaseMapper_titlecase_segment_v1(ffi.Pointer self, ffi.Pointer sData, int sLength, ffi.Pointer locale, _TitlecaseOptionsV1Ffi options, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/TitlecaseOptionsV1.g.dart b/ffi/capi/bindings/dart/TitlecaseOptionsV1.g.dart index 7f754994f6f..de62aff5633 100644 --- a/ffi/capi/bindings/dart/TitlecaseOptionsV1.g.dart +++ b/ffi/capi/bindings/dart/TitlecaseOptionsV1.g.dart @@ -41,11 +41,6 @@ final class TitlecaseOptionsV1 { return TitlecaseOptionsV1._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XTitlecaseOptionsV1_default_options = - _capi>('ICU4XTitlecaseOptionsV1_default_options') - .asFunction<_TitlecaseOptionsV1Ffi Function()>(isLeaf: true); - @override bool operator ==(Object other) => other is TitlecaseOptionsV1 && @@ -58,3 +53,7 @@ final class TitlecaseOptionsV1 { _underlying.trailingCase, ]); } + +@ffi.Native<_TitlecaseOptionsV1Ffi Function()>(isLeaf: true, symbol: 'ICU4XTitlecaseOptionsV1_default_options') +// ignore: non_constant_identifier_names +external _TitlecaseOptionsV1Ffi _ICU4XTitlecaseOptionsV1_default_options(); diff --git a/ffi/capi/bindings/dart/UnicodeSetData.g.dart b/ffi/capi/bindings/dart/UnicodeSetData.g.dart index 340e7c73757..f56c701cde7 100644 --- a/ffi/capi/bindings/dart/UnicodeSetData.g.dart +++ b/ffi/capi/bindings/dart/UnicodeSetData.g.dart @@ -19,7 +19,7 @@ final class UnicodeSetData implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XUnicodeSetData_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XUnicodeSetData_destroy)); /// Checks whether the string is in the set. /// @@ -32,11 +32,6 @@ final class UnicodeSetData implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_contains = - _capi, ffi.Pointer, ffi.Size)>>('ICU4XUnicodeSetData_contains') - .asFunction, ffi.Pointer, int)>(isLeaf: true); - /// Checks whether the code point is in the set. /// /// See the [Rust documentation for `contains_char`](https://docs.rs/icu/latest/icu/properties/sets/struct.UnicodeSetDataBorrowed.html#method.contains_char) for more information. @@ -45,11 +40,6 @@ final class UnicodeSetData implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_contains_char = - _capi, ffi.Uint32)>>('ICU4XUnicodeSetData_contains_char') - .asFunction, Rune)>(isLeaf: true); - /// See the [Rust documentation for `basic_emoji`](https://docs.rs/icu/latest/icu/properties/sets/fn.basic_emoji.html) for more information. /// /// Throws [Error] on failure. @@ -61,11 +51,6 @@ final class UnicodeSetData implements ffi.Finalizable { return UnicodeSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_load_basic_emoji = - _capi)>>('ICU4XUnicodeSetData_load_basic_emoji') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `exemplars_main`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_main.html) for more information. /// /// Throws [Error] on failure. @@ -77,11 +62,6 @@ final class UnicodeSetData implements ffi.Finalizable { return UnicodeSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_load_exemplars_main = - _capi, ffi.Pointer)>>('ICU4XUnicodeSetData_load_exemplars_main') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `exemplars_auxiliary`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_auxiliary.html) for more information. /// /// Throws [Error] on failure. @@ -93,11 +73,6 @@ final class UnicodeSetData implements ffi.Finalizable { return UnicodeSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_load_exemplars_auxiliary = - _capi, ffi.Pointer)>>('ICU4XUnicodeSetData_load_exemplars_auxiliary') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `exemplars_punctuation`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_punctuation.html) for more information. /// /// Throws [Error] on failure. @@ -109,11 +84,6 @@ final class UnicodeSetData implements ffi.Finalizable { return UnicodeSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_load_exemplars_punctuation = - _capi, ffi.Pointer)>>('ICU4XUnicodeSetData_load_exemplars_punctuation') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `exemplars_numbers`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_numbers.html) for more information. /// /// Throws [Error] on failure. @@ -125,11 +95,6 @@ final class UnicodeSetData implements ffi.Finalizable { return UnicodeSetData._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_load_exemplars_numbers = - _capi, ffi.Pointer)>>('ICU4XUnicodeSetData_load_exemplars_numbers') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// See the [Rust documentation for `exemplars_index`](https://docs.rs/icu/latest/icu/properties/exemplar_chars/fn.exemplars_index.html) for more information. /// /// Throws [Error] on failure. @@ -140,9 +105,40 @@ final class UnicodeSetData implements ffi.Finalizable { } return UnicodeSetData._(result.union.ok); } - - // ignore: non_constant_identifier_names - static final _ICU4XUnicodeSetData_load_exemplars_index = - _capi, ffi.Pointer)>>('ICU4XUnicodeSetData_load_exemplars_index') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XUnicodeSetData_destroy(ffi.Pointer self); + +@ffi.Native, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_contains') +// ignore: non_constant_identifier_names +external bool _ICU4XUnicodeSetData_contains(ffi.Pointer self, ffi.Pointer sData, int sLength); + +@ffi.Native, ffi.Uint32)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_contains_char') +// ignore: non_constant_identifier_names +external bool _ICU4XUnicodeSetData_contains_char(ffi.Pointer self, Rune cp); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_basic_emoji') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_basic_emoji(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_main') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_main(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_auxiliary') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_auxiliary(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_punctuation') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_punctuation(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_numbers') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_numbers(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XUnicodeSetData_load_exemplars_index') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XUnicodeSetData_load_exemplars_index(ffi.Pointer provider, ffi.Pointer locale); diff --git a/ffi/capi/bindings/dart/WeekCalculator.g.dart b/ffi/capi/bindings/dart/WeekCalculator.g.dart index 69e382876a6..764ebd8bb07 100644 --- a/ffi/capi/bindings/dart/WeekCalculator.g.dart +++ b/ffi/capi/bindings/dart/WeekCalculator.g.dart @@ -15,7 +15,7 @@ final class WeekCalculator implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XWeekCalculator_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XWeekCalculator_destroy)); /// Creates a new [`WeekCalculator`] from locale data. /// @@ -30,22 +30,12 @@ final class WeekCalculator implements ffi.Finalizable { return WeekCalculator._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XWeekCalculator_create = - _capi, ffi.Pointer)>>('ICU4XWeekCalculator_create') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Additional information: [1](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday), [2](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.min_week_days) factory WeekCalculator.fromFirstDayOfWeekAndMinWeekDays(IsoWeekday firstWeekday, int minWeekDays) { final result = _ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(firstWeekday._underlying, minWeekDays); return WeekCalculator._(result); } - // ignore: non_constant_identifier_names - static final _ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days = - _capi Function(ffi.Int32, ffi.Uint8)>>('ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days') - .asFunction Function(int, int)>(isLeaf: true); - /// Returns the weekday that starts the week for this object's locale /// /// See the [Rust documentation for `first_weekday`](https://docs.rs/icu/latest/icu/calendar/week/struct.WeekCalculator.html#structfield.first_weekday) for more information. @@ -54,11 +44,6 @@ final class WeekCalculator implements ffi.Finalizable { return IsoWeekday.values.firstWhere((v) => v._underlying == result); } - // ignore: non_constant_identifier_names - static final _ICU4XWeekCalculator_first_weekday = - _capi)>>('ICU4XWeekCalculator_first_weekday') - .asFunction)>(isLeaf: true); - /// The minimum number of days overlapping a year required for a week to be /// considered part of that year /// @@ -67,9 +52,24 @@ final class WeekCalculator implements ffi.Finalizable { final result = _ICU4XWeekCalculator_min_week_days(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XWeekCalculator_min_week_days = - _capi)>>('ICU4XWeekCalculator_min_week_days') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWeekCalculator_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XWeekCalculator_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XWeekCalculator_create') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XWeekCalculator_create(ffi.Pointer provider, ffi.Pointer locale); + +@ffi.Native Function(ffi.Int32, ffi.Uint8)>(isLeaf: true, symbol: 'ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XWeekCalculator_create_from_first_day_of_week_and_min_week_days(int firstWeekday, int minWeekDays); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWeekCalculator_first_weekday') +// ignore: non_constant_identifier_names +external int _ICU4XWeekCalculator_first_weekday(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWeekCalculator_min_week_days') +// ignore: non_constant_identifier_names +external int _ICU4XWeekCalculator_min_week_days(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/WordBreakIteratorLatin1.g.dart b/ffi/capi/bindings/dart/WordBreakIteratorLatin1.g.dart index 00466950d70..9d77d79a080 100644 --- a/ffi/capi/bindings/dart/WordBreakIteratorLatin1.g.dart +++ b/ffi/capi/bindings/dart/WordBreakIteratorLatin1.g.dart @@ -13,7 +13,7 @@ final class WordBreakIteratorLatin1 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XWordBreakIteratorLatin1_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XWordBreakIteratorLatin1_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -24,11 +24,6 @@ final class WordBreakIteratorLatin1 implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorLatin1_next = - _capi)>>('ICU4XWordBreakIteratorLatin1_next') - .asFunction)>(isLeaf: true); - /// Return the status value of break boundary. /// /// See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information. @@ -37,11 +32,6 @@ final class WordBreakIteratorLatin1 implements ffi.Finalizable { return SegmenterWordType.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorLatin1_word_type = - _capi)>>('ICU4XWordBreakIteratorLatin1_word_type') - .asFunction)>(isLeaf: true); - /// Return true when break boundary is word-like such as letter/number/CJK /// /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information. @@ -49,9 +39,20 @@ final class WordBreakIteratorLatin1 implements ffi.Finalizable { final result = _ICU4XWordBreakIteratorLatin1_is_word_like(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorLatin1_is_word_like = - _capi)>>('ICU4XWordBreakIteratorLatin1_is_word_like') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorLatin1_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XWordBreakIteratorLatin1_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorLatin1_next') +// ignore: non_constant_identifier_names +external int _ICU4XWordBreakIteratorLatin1_next(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorLatin1_word_type') +// ignore: non_constant_identifier_names +external int _ICU4XWordBreakIteratorLatin1_word_type(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorLatin1_is_word_like') +// ignore: non_constant_identifier_names +external bool _ICU4XWordBreakIteratorLatin1_is_word_like(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/WordBreakIteratorUtf16.g.dart b/ffi/capi/bindings/dart/WordBreakIteratorUtf16.g.dart index 0e2ae4eef90..846778a5035 100644 --- a/ffi/capi/bindings/dart/WordBreakIteratorUtf16.g.dart +++ b/ffi/capi/bindings/dart/WordBreakIteratorUtf16.g.dart @@ -13,7 +13,7 @@ final class WordBreakIteratorUtf16 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XWordBreakIteratorUtf16_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XWordBreakIteratorUtf16_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -24,11 +24,6 @@ final class WordBreakIteratorUtf16 implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorUtf16_next = - _capi)>>('ICU4XWordBreakIteratorUtf16_next') - .asFunction)>(isLeaf: true); - /// Return the status value of break boundary. /// /// See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information. @@ -37,11 +32,6 @@ final class WordBreakIteratorUtf16 implements ffi.Finalizable { return SegmenterWordType.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorUtf16_word_type = - _capi)>>('ICU4XWordBreakIteratorUtf16_word_type') - .asFunction)>(isLeaf: true); - /// Return true when break boundary is word-like such as letter/number/CJK /// /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information. @@ -49,9 +39,20 @@ final class WordBreakIteratorUtf16 implements ffi.Finalizable { final result = _ICU4XWordBreakIteratorUtf16_is_word_like(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorUtf16_is_word_like = - _capi)>>('ICU4XWordBreakIteratorUtf16_is_word_like') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf16_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XWordBreakIteratorUtf16_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf16_next') +// ignore: non_constant_identifier_names +external int _ICU4XWordBreakIteratorUtf16_next(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf16_word_type') +// ignore: non_constant_identifier_names +external int _ICU4XWordBreakIteratorUtf16_word_type(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf16_is_word_like') +// ignore: non_constant_identifier_names +external bool _ICU4XWordBreakIteratorUtf16_is_word_like(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/WordBreakIteratorUtf8.g.dart b/ffi/capi/bindings/dart/WordBreakIteratorUtf8.g.dart index 71fe4cf2459..d128e78d540 100644 --- a/ffi/capi/bindings/dart/WordBreakIteratorUtf8.g.dart +++ b/ffi/capi/bindings/dart/WordBreakIteratorUtf8.g.dart @@ -13,7 +13,7 @@ final class WordBreakIteratorUtf8 implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XWordBreakIteratorUtf8_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XWordBreakIteratorUtf8_destroy)); /// Finds the next breakpoint. Returns -1 if at the end of the string or if the index is /// out of range of a 32-bit signed integer. @@ -24,11 +24,6 @@ final class WordBreakIteratorUtf8 implements ffi.Finalizable { return result; } - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorUtf8_next = - _capi)>>('ICU4XWordBreakIteratorUtf8_next') - .asFunction)>(isLeaf: true); - /// Return the status value of break boundary. /// /// See the [Rust documentation for `word_type`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.word_type) for more information. @@ -37,11 +32,6 @@ final class WordBreakIteratorUtf8 implements ffi.Finalizable { return SegmenterWordType.values[result]; } - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorUtf8_word_type = - _capi)>>('ICU4XWordBreakIteratorUtf8_word_type') - .asFunction)>(isLeaf: true); - /// Return true when break boundary is word-like such as letter/number/CJK /// /// See the [Rust documentation for `is_word_like`](https://docs.rs/icu/latest/icu/segmenter/struct.WordBreakIterator.html#method.is_word_like) for more information. @@ -49,9 +39,20 @@ final class WordBreakIteratorUtf8 implements ffi.Finalizable { final result = _ICU4XWordBreakIteratorUtf8_is_word_like(_underlying); return result; } - - // ignore: non_constant_identifier_names - static final _ICU4XWordBreakIteratorUtf8_is_word_like = - _capi)>>('ICU4XWordBreakIteratorUtf8_is_word_like') - .asFunction)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf8_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XWordBreakIteratorUtf8_destroy(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf8_next') +// ignore: non_constant_identifier_names +external int _ICU4XWordBreakIteratorUtf8_next(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf8_word_type') +// ignore: non_constant_identifier_names +external int _ICU4XWordBreakIteratorUtf8_word_type(ffi.Pointer self); + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordBreakIteratorUtf8_is_word_like') +// ignore: non_constant_identifier_names +external bool _ICU4XWordBreakIteratorUtf8_is_word_like(ffi.Pointer self); diff --git a/ffi/capi/bindings/dart/WordSegmenter.g.dart b/ffi/capi/bindings/dart/WordSegmenter.g.dart index 3b9127561e1..846e728de45 100644 --- a/ffi/capi/bindings/dart/WordSegmenter.g.dart +++ b/ffi/capi/bindings/dart/WordSegmenter.g.dart @@ -15,7 +15,7 @@ final class WordSegmenter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XWordSegmenter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XWordSegmenter_destroy)); /// Construct an [`WordSegmenter`] with automatically selecting the best available LSTM /// or dictionary payload data. @@ -34,11 +34,6 @@ final class WordSegmenter implements ffi.Finalizable { return WordSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XWordSegmenter_create_auto = - _capi)>>('ICU4XWordSegmenter_create_auto') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct an [`WordSegmenter`] with LSTM payload data for Burmese, Khmer, Lao, and /// Thai. /// @@ -56,11 +51,6 @@ final class WordSegmenter implements ffi.Finalizable { return WordSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XWordSegmenter_create_lstm = - _capi)>>('ICU4XWordSegmenter_create_lstm') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Construct an [`WordSegmenter`] with dictionary payload data for Chinese, Japanese, /// Burmese, Khmer, Lao, and Thai. /// @@ -75,11 +65,6 @@ final class WordSegmenter implements ffi.Finalizable { return WordSegmenter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XWordSegmenter_create_dictionary = - _capi)>>('ICU4XWordSegmenter_create_dictionary') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true); - /// Segments a string. /// /// Ill-formed input is treated as if errors had been replaced with REPLACEMENT CHARACTERs according @@ -93,9 +78,24 @@ final class WordSegmenter implements ffi.Finalizable { temp.releaseAll(); return WordBreakIteratorUtf16._(result); } - - // ignore: non_constant_identifier_names - static final _ICU4XWordSegmenter_segment_utf16 = - _capi Function(ffi.Pointer, ffi.Pointer, ffi.Size)>>('ICU4XWordSegmenter_segment_utf16') - .asFunction Function(ffi.Pointer, ffi.Pointer, int)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XWordSegmenter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XWordSegmenter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XWordSegmenter_create_auto') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XWordSegmenter_create_auto(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XWordSegmenter_create_lstm') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XWordSegmenter_create_lstm(ffi.Pointer provider); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XWordSegmenter_create_dictionary') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XWordSegmenter_create_dictionary(ffi.Pointer provider); + +@ffi.Native Function(ffi.Pointer, ffi.Pointer, ffi.Size)>(isLeaf: true, symbol: 'ICU4XWordSegmenter_segment_utf16') +// ignore: non_constant_identifier_names +external ffi.Pointer _ICU4XWordSegmenter_segment_utf16(ffi.Pointer self, ffi.Pointer inputData, int inputLength); diff --git a/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart b/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart index 3f6e25fc654..47ad197ae9e 100644 --- a/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart +++ b/ffi/capi/bindings/dart/ZonedDateTimeFormatter.g.dart @@ -15,7 +15,7 @@ final class ZonedDateTimeFormatter implements ffi.Finalizable { _finalizer.attach(this, _underlying.cast()); } - static final _finalizer = ffi.NativeFinalizer(_capi('ICU4XZonedDateTimeFormatter_destroy')); + static final _finalizer = ffi.NativeFinalizer(ffi.Native.addressOf(_ICU4XZonedDateTimeFormatter_destroy)); /// Creates a new [`ZonedDateTimeFormatter`] from locale data. /// @@ -33,11 +33,6 @@ final class ZonedDateTimeFormatter implements ffi.Finalizable { return ZonedDateTimeFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XZonedDateTimeFormatter_create_with_lengths = - _capi, ffi.Pointer, ffi.Int32, ffi.Int32)>>('ICU4XZonedDateTimeFormatter_create_with_lengths') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int, int)>(isLeaf: true); - /// Creates a new [`ZonedDateTimeFormatter`] from locale data. /// /// This function has `date_length` and `time_length` arguments and uses an ISO-8601 style @@ -54,11 +49,6 @@ final class ZonedDateTimeFormatter implements ffi.Finalizable { return ZonedDateTimeFormatter._(result.union.ok); } - // ignore: non_constant_identifier_names - static final _ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback = - _capi, ffi.Pointer, ffi.Int32, ffi.Int32, _IsoTimeZoneOptionsFfi)>>('ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback') - .asFunction<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, int, int, _IsoTimeZoneOptionsFfi)>(isLeaf: true); - /// Formats a [`DateTime`] and [`CustomTimeZone`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information. @@ -73,11 +63,6 @@ final class ZonedDateTimeFormatter implements ffi.Finalizable { return writeable.finalize(); } - // ignore: non_constant_identifier_names - static final _ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone = - _capi, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); - /// Formats a [`IsoDateTime`] and [`CustomTimeZone`] to a string. /// /// See the [Rust documentation for `format`](https://docs.rs/icu/latest/icu/datetime/struct.ZonedDateTimeFormatter.html#method.format) for more information. @@ -91,9 +76,24 @@ final class ZonedDateTimeFormatter implements ffi.Finalizable { } return writeable.finalize(); } - - // ignore: non_constant_identifier_names - static final _ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone = - _capi, ffi.Pointer, ffi.Pointer, ffi.Pointer)>>('ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone') - .asFunction<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true); } + +@ffi.Native)>(isLeaf: true, symbol: 'ICU4XZonedDateTimeFormatter_destroy') +// ignore: non_constant_identifier_names +external void _ICU4XZonedDateTimeFormatter_destroy(ffi.Pointer self); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32)>(isLeaf: true, symbol: 'ICU4XZonedDateTimeFormatter_create_with_lengths') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XZonedDateTimeFormatter_create_with_lengths(ffi.Pointer provider, ffi.Pointer locale, int dateLength, int timeLength); + +@ffi.Native<_ResultOpaqueInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Int32, ffi.Int32, _IsoTimeZoneOptionsFfi)>(isLeaf: true, symbol: 'ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback') +// ignore: non_constant_identifier_names +external _ResultOpaqueInt32 _ICU4XZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(ffi.Pointer provider, ffi.Pointer locale, int dateLength, int timeLength, _IsoTimeZoneOptionsFfi zoneOptions); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XZonedDateTimeFormatter_format_datetime_with_custom_time_zone(ffi.Pointer self, ffi.Pointer datetime, ffi.Pointer timeZone, ffi.Pointer writeable); + +@ffi.Native<_ResultVoidInt32 Function(ffi.Pointer, ffi.Pointer, ffi.Pointer, ffi.Pointer)>(isLeaf: true, symbol: 'ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone') +// ignore: non_constant_identifier_names +external _ResultVoidInt32 _ICU4XZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(ffi.Pointer self, ffi.Pointer datetime, ffi.Pointer timeZone, ffi.Pointer writeable); diff --git a/ffi/capi/bindings/dart/lib.g.dart b/ffi/capi/bindings/dart/lib.g.dart index 765e3b5a4cf..2103c120e91 100644 --- a/ffi/capi/bindings/dart/lib.g.dart +++ b/ffi/capi/bindings/dart/lib.g.dart @@ -149,9 +149,6 @@ part 'ZonedDateTimeFormatter.g.dart'; /// A [String] can be constructed from a [Rune] using [String.fromCharCode]. typedef Rune = int; -late final ffi.Pointer Function(String) _capi; -void init(String path) => _capi = ffi.DynamicLibrary.open(path).lookup; - // ignore: unused_element final _callocFree = core.Finalizer(ffi2.calloc.free); @@ -601,24 +598,28 @@ final class _SliceUtf8 extends ffi.Struct { final class _Writeable { final ffi.Pointer _underlying; - _Writeable() : _underlying = _create(0); - static final _create = - _capi Function(ffi.Size)>>('diplomat_buffer_writeable_create') - .asFunction Function(int)>(); - + _Writeable() : _underlying = _diplomat_buffer_writeable_create(0); + String finalize() { - final string = Utf8Decoder().convert(_getBytes(_underlying).asTypedList(_len(_underlying))); - _destroy(_underlying); + final string = Utf8Decoder().convert(_diplomat_buffer_writeable_get_bytes(_underlying).asTypedList(_diplomat_buffer_writeable_len(_underlying))); + _diplomat_buffer_writeable_destroy(_underlying); return string; } - static final _len = - _capi)>>('diplomat_buffer_writeable_len') - .asFunction)>(isLeaf: true); - - static final _getBytes = - _capi Function(ffi.Pointer)>>('diplomat_buffer_writeable_get_bytes') - .asFunction Function(ffi.Pointer)>(isLeaf: true); - static final _destroy = - _capi)>>('diplomat_buffer_writeable_destroy') - .asFunction)>(isLeaf: true); } + + +@ffi.Native Function(ffi.Size)>(symbol: 'diplomat_buffer_writeable_create', isLeaf: true) +// ignore: non_constant_identifier_names +external ffi.Pointer _diplomat_buffer_writeable_create(int len); + +@ffi.Native)>(symbol: 'diplomat_buffer_writeable_len', isLeaf: true) +// ignore: non_constant_identifier_names +external int _diplomat_buffer_writeable_len(ffi.Pointer ptr); + +@ffi.Native Function(ffi.Pointer)>(symbol: 'diplomat_buffer_writeable_get_bytes', isLeaf: true) +// ignore: non_constant_identifier_names +external ffi.Pointer _diplomat_buffer_writeable_get_bytes(ffi.Pointer ptr); + +@ffi.Native)>(symbol: 'diplomat_buffer_writeable_destroy', isLeaf: true) +// ignore: non_constant_identifier_names +external void _diplomat_buffer_writeable_destroy(ffi.Pointer ptr); diff --git a/ffi/dart/.gitignore b/ffi/dart/.gitignore index 8ece08cea7b..d80c4e77d6b 100644 --- a/ffi/dart/.gitignore +++ b/ffi/dart/.gitignore @@ -1,5 +1,3 @@ .dart_tool/ doc -lib/src -pubspec.lock -libicu_capi.so \ No newline at end of file +pubspec.lock \ No newline at end of file diff --git a/ffi/dart/Makefile b/ffi/dart/Makefile deleted file mode 100644 index 34d3ee643ae..00000000000 --- a/ffi/dart/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# This file is part of ICU4X. For terms of use, please see the file -# called LICENSE at the top level of the ICU4X source tree -# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). - -.DEFAULT_GOAL := build -FORCE: - -lib/src/lib.g.dart: - rm -rf lib/src - cp -r ../capi/bindings/dart lib/src - -../../target/release/libicu_capi.so: FORCE - cargo rustc -p icu_capi --release --crate-type=cdylib - -test/libicu_capi.so: ../../target/release/libicu_capi.so - cp ../../target/release/libicu_capi.so test/libicu_capi.so - -build: lib/src/lib.g.dart test/libicu_capi.so - -test: build - dart test diff --git a/ffi/dart/build.dart b/ffi/dart/build.dart new file mode 100644 index 00000000000..2d938bf5113 --- /dev/null +++ b/ffi/dart/build.dart @@ -0,0 +1,30 @@ +// This file is part of ICU4X. For terms of use, please see the file +// called LICENSE at the top level of the ICU4X source tree +// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + +import 'package:native_assets_cli/native_assets_cli.dart'; +import 'tool/build_libs.dart' show buildLib; + +void main(List args) async { + final config = await BuildConfig.fromArgs(args); + + final target = (config.target == Target.iOSArm64 && + config.targetIOSSdk == IOSSdk.iPhoneSimulator) + // This stands for Target.iOSArm64Simulator, see build_libs.dart + ? Target.iOSArm + : config.target; + + final linkMode = config.linkModePreference.preferredLinkMode; + + await BuildOutput( + assets: [ + Asset( + id: 'package:icu/src/lib.g.dart', + linkMode: linkMode, + target: target, + path: AssetRelativePath( + Uri.file(await buildLib(target, linkMode, config.outDir.path)))) + ], + dependencies: Dependencies([config.packageRoot.resolve('build.rs')]), + ).writeToFile(outDir: config.outDir); +} diff --git a/ffi/dart/lib/icu.dart b/ffi/dart/lib/icu.dart index 11dcc4b37a8..860247dab1c 100644 --- a/ffi/dart/lib/icu.dart +++ b/ffi/dart/lib/icu.dart @@ -1,7 +1 @@ -export 'src/lib.g.dart' hide init, Logger; -import 'src/lib.g.dart' as private show init, Logger; - -void init(String path) { - private.init(path); - private.Logger.initSimpleLogger(); -} \ No newline at end of file +export 'src/lib.g.dart'; diff --git a/ffi/dart/lib/src b/ffi/dart/lib/src new file mode 120000 index 00000000000..7aa8f88837e --- /dev/null +++ b/ffi/dart/lib/src @@ -0,0 +1 @@ +../../capi/bindings/dart/ \ No newline at end of file diff --git a/ffi/dart/pubspec.yaml b/ffi/dart/pubspec.yaml index ffaac122f0c..ee8650e28af 100644 --- a/ffi/dart/pubspec.yaml +++ b/ffi/dart/pubspec.yaml @@ -3,10 +3,11 @@ version: 0.0.0 repository: https://github.com/unicode-org/icu4x environment: - sdk: ^3.0.0 + sdk: ^3.3.0-279.1.beta dependencies: ffi: ^2.0.0 + native_assets_cli: ^0.3.2 dev_dependencies: lints: ^3.0.0 diff --git a/ffi/dart/test/icu_test.dart b/ffi/dart/test/icu_test.dart index 673338dfaa1..3b07a4be737 100644 --- a/ffi/dart/test/icu_test.dart +++ b/ffi/dart/test/icu_test.dart @@ -1,9 +1,8 @@ import 'package:icu/icu.dart'; -import 'package:path/path.dart' as path; import 'package:test/test.dart'; void main() { - init(path.absolute('test/libicu_capi.so')); + Logger.initSimpleLogger(); test('FixedDecimal.toString', () { final x = FixedDecimal.fromDoubleWithLowerMagnitude(1.49403, -7); @@ -27,24 +26,7 @@ void main() { expect(iterator.get.toString(), 'und'); }); - test('Struct equality', () { - expect( - LocaleFallbackConfig() - ..extensionKey = 'ca' - ..priority = LocaleFallbackPriority.region, - LocaleFallbackConfig() - ..extensionKey = 'ca' - ..priority = LocaleFallbackPriority.region); - expect( - LocaleFallbackConfig() - ..extensionKey = 'nu' - ..priority = LocaleFallbackPriority.region, - isNot(LocaleFallbackConfig() - ..extensionKey = 'ca' - ..priority = LocaleFallbackPriority.region)); - }); - - test('Runes', () { + test('Properties', () { Rune a = 'a'.runes.first; Rune emoji = '💡'.runes.first; @@ -55,4 +37,16 @@ void main() { Rune upperA = CaseMapper(DataProvider.compiled()).simpleUppercase(a); expect(String.fromCharCode(upperA), 'A'); }); + + test('ListFormatter', () { + final formatter = ListFormatter.andWithLength( + DataProvider.compiled(), Locale.fromString('es'), ListLength.wide); + final list = List() + ..push('España') + ..push('Francia') + ..push('Suiza') + ..push('Italia'); + + expect(formatter.format(list), 'España, Francia, Suiza e Italia'); + }); } diff --git a/ffi/dart/tool/build_libs.dart b/ffi/dart/tool/build_libs.dart new file mode 100644 index 00000000000..c5aa5854138 --- /dev/null +++ b/ffi/dart/tool/build_libs.dart @@ -0,0 +1,153 @@ +// This file is part of ICU4X. For terms of use, please see the file +// called LICENSE at the top level of the ICU4X source tree +// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). + +import 'package:native_assets_cli/native_assets_cli.dart'; +import 'dart:io'; + +const linuxTargets = [ + Target.linuxArm, + Target.linuxArm64, + Target.linuxIA32, + // There's no stable linker for this target + // Target.linuxRiscv32, + Target.linuxRiscv64, + Target.linuxX64, +]; + +const androidTargets = [ + Target.androidArm, + Target.androidArm64, + Target.androidIA32, + Target.androidX64, + // There's no stable linker for this target + // Target.androidRiscv64, +]; + +const fuchsiaTargets = [ + // Target.fuchsiaArm64, + // Target.fuchsiaX64, +]; + +const macTargets = [ + Target.macOSArm64, + Target.macOSX64, +]; + +const iosTargets = [ + // This target is meant to be 32-bit iOS, but that is not supported anymore. + // We're abusing it for 64-bit simulated, as that does not have a separate Dart + // target. + Target.iOSArm, + Target.iOSArm64, + Target.iOSX64, +]; + +const windowsTargets = [ + Target.windowsArm64, + Target.windowsIA32, + Target.windowsX64, +]; + +Future main(List args) async { + final binDir = args[0]; + + final List targets; + if (Platform.isLinux) { + targets = [...androidTargets, ...linuxTargets, ...fuchsiaTargets]; + } else if (Platform.isMacOS) { + targets = [...macTargets, ...iosTargets]; + } else if (Platform.isWindows) { + targets = windowsTargets; + } else { + throw 'Unsupported host'; + } + + await Directory(binDir).create(); + + for (var target in targets) { + print('Building $target...'); + for (final linkMode in LinkMode.values) { + try { + await buildLib(target, linkMode, binDir); + } catch (e) { + exitCode++; + print(e); + } + } + } +} + +Future buildLib(Target target, LinkMode linkMode, String outDir) async { + const dartToRustTargets = { + Target.androidArm: 'armv7-linux-androideabi', + Target.androidArm64: 'aarch64-linux-android', + Target.androidIA32: 'i686-linux-android', + Target.androidRiscv64: 'riscv64-linux-android', + Target.androidX64: 'x86_64-linux-android', + Target.fuchsiaArm64: 'aarch64-unknown-fuchsia', + Target.fuchsiaX64: 'x86_64-unknown-fuchsia', + Target.iOSArm: 'aarch64-apple-ios-sim', + Target.iOSArm64: 'aarch64-apple-ios', + Target.iOSX64: 'x86_64-apple-ios', + Target.linuxArm: 'armv7-unknown-linux-gnueabihf', + Target.linuxArm64: 'aarch64-unknown-linux-gnu', + Target.linuxIA32: 'i686-unknown-linux-gnu', + Target.linuxRiscv32: 'riscv32gc-unknown-linux-gnu', + Target.linuxRiscv64: 'riscv64gc-unknown-linux-gnu', + Target.linuxX64: 'x86_64-unknown-linux-gnu', + Target.macOSArm64: 'aarch64-apple-darwin', + Target.macOSX64: 'x86_64-apple-darwin', + Target.windowsArm64: 'aarch64-pc-windows-msvc', + Target.windowsIA32: 'i686-pc-windows-msvc', + Target.windowsX64: 'x86_64-pc-windows-msvc', + }; + + const noStdTargets = [ + Target.androidRiscv64, + Target.linuxRiscv32, + ]; + + final rustTarget = dartToRustTargets[target]!; + final isNoStd = noStdTargets.contains(target); + + if (!isNoStd) { + var rustup = await Process.run('rustup', ['target', 'add', rustTarget]); + + if (rustup.exitCode != 0) { + throw rustup.stderr; + } + } + + final cargo = await Process.run('cargo', [ + if (isNoStd) '+nightly', + 'rustc', + '-p=icu_capi', + '--crate-type=${linkMode == LinkMode.static ? 'staticlib' : 'cdylib'}', + '--release', + '--config=profile.release.panic="abort"', + '--config=profile.release.codegen-units=1', + '--no-default-features', + if (!isNoStd) + '--features=default_components,compiled_data,buffer_provider,logging,simple_logger', + if (isNoStd) + '--features=default_components,compiled_data,buffer_provider,libc-alloc,panic-handler', + if (isNoStd) '-Zbuild-std=core,alloc', + if (isNoStd) '-Zbuild-std-features=panic_immediate_abort', + '--target=$rustTarget', + ]); + + if (cargo.exitCode != 0) { + throw cargo.stderr; + } + + final outName = '$outDir/$target-$linkMode'; + + final targetDir = '${Platform.script.toFilePath().split('ffi')[0]}target'; + + await File( + '$targetDir/$rustTarget/release/${target.os.dylibFileName('icu_capi')}') + .copy(outName); + + return outName; +} diff --git a/tools/make/ffi.toml b/tools/make/ffi.toml index 56f80d1394d..56ae3d9c725 100644 --- a/tools/make/ffi.toml +++ b/tools/make/ffi.toml @@ -54,8 +54,12 @@ args = ["-C", "docs/tutorials/js-tiny", "test"] [tasks.test-dart] description = "Run Dart tests" category = "ICU4X Development" -command = "make" -args = ["-C", "ffi/dart", "test"] +cwd = "ffi/dart" +script_runner = "@duckscript" +script = ''' +exec --fail-on-error dart --enable-experiment=native-assets pub get +exec --fail-on-error dart --enable-experiment=native-assets test +''' # no_std tasks