Bug 1854031 - Part 3. Import icu_capi and icu_segmenter_data crate in tree. r=TYLin

By update-icu4x.sh script.

Depends on D192900

Differential Revision: https://phabricator.services.mozilla.com/D193880
This commit is contained in:
Makoto Kato 2023-12-04 09:02:28 +00:00
parent cc4f5bdadf
commit 652974aeed
1009 changed files with 74481 additions and 94 deletions

271
intl/icu_capi/Cargo.toml Normal file
View file

@ -0,0 +1,271 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.67"
name = "icu_capi"
version = "1.4.0"
authors = ["The ICU4X Project Developers"]
include = [
"js/**/*",
"c/**/*",
"cpp/**/*",
"src/**/*",
"tests/**/*",
"Cargo.toml",
"LICENSE",
"README.md",
]
description = "C interface to ICU4X"
homepage = "https://icu4x.unicode.org"
readme = "README.md"
categories = ["internationalization"]
license-file = "LICENSE"
repository = "https://github.com/unicode-org/icu4x"
[package.metadata.cargo-all-features]
denylist = [
"bench",
"cpp_default",
"wasm_default",
"provider_test",
]
max_combination_size = 2
[package.metadata.docs.rs]
all-features = true
[dependencies.diplomat]
version = "0.7"
[dependencies.diplomat-runtime]
version = "0.7"
[dependencies.fixed_decimal]
version = "0.5.5"
features = ["ryu"]
optional = true
default-features = false
[dependencies.icu_calendar]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_casemap]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_collator]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_collections]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_datetime]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_decimal]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_displaynames]
version = "0.11.2"
optional = true
default-features = false
[dependencies.icu_list]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_locid]
version = "~1.4.0"
default-features = false
[dependencies.icu_locid_transform]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_normalizer]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_plurals]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_properties]
version = "~1.4.0"
features = ["bidi"]
optional = true
default-features = false
[dependencies.icu_provider]
version = "~1.4.0"
default-features = false
[dependencies.icu_provider_adapters]
version = "~1.4.0"
default-features = false
[dependencies.icu_provider_blob]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.icu_segmenter]
version = "~1.4.0"
features = ["auto"]
optional = true
default-features = false
[dependencies.icu_timezone]
version = "~1.4.0"
optional = true
default-features = false
[dependencies.log]
version = "0.4"
optional = true
[dependencies.serde]
version = "1.0"
optional = true
default-features = false
[dependencies.tinystr]
version = "0.7.4"
default-features = false
[dependencies.unicode-bidi]
version = "0.3.13"
optional = true
default-features = false
[dependencies.writeable]
version = "0.5.4"
default-features = false
[features]
any_provider = []
buffer_provider = [
"dep:icu_provider_blob",
"dep:serde",
"icu_calendar?/serde",
"icu_casemap?/serde",
"icu_collator?/serde",
"icu_datetime?/serde",
"icu_decimal?/serde",
"icu_displaynames?/serde",
"icu_list?/serde",
"icu_locid_transform?/serde",
"icu_locid/serde",
"icu_normalizer?/serde",
"icu_plurals?/serde",
"icu_properties?/serde",
"icu_provider/serde",
"icu_provider_adapters/serde",
"icu_segmenter?/serde",
"icu_timezone?/serde",
]
compiled_data = [
"icu_segmenter?/compiled_data",
]
cpp_default = ["logging"]
default = [
"compiled_data",
"default_components",
"logging",
"simple_logger",
]
default_components = [
"icu_calendar",
"icu_casemap",
"icu_collator",
"icu_datetime",
"icu_decimal",
"icu_list",
"icu_locid_transform",
"icu_normalizer",
"icu_plurals",
"icu_properties",
"icu_segmenter",
"icu_timezone",
]
icu_calendar = ["dep:icu_calendar"]
icu_casemap = ["dep:icu_casemap"]
icu_collator = ["dep:icu_collator"]
icu_datetime = [
"dep:icu_datetime",
"dep:icu_calendar",
"dep:icu_timezone",
"dep:icu_decimal",
"dep:icu_plurals",
]
icu_decimal = [
"dep:icu_decimal",
"dep:fixed_decimal",
]
icu_displaynames = ["dep:icu_displaynames"]
icu_list = ["dep:icu_list"]
icu_locid_transform = ["dep:icu_locid_transform"]
icu_normalizer = ["dep:icu_normalizer"]
icu_plurals = [
"dep:icu_plurals",
"dep:fixed_decimal",
]
icu_properties = [
"dep:icu_properties",
"dep:icu_collections",
"dep:unicode-bidi",
]
icu_segmenter = ["dep:icu_segmenter"]
icu_timezone = [
"dep:icu_timezone",
"dep:icu_calendar",
]
logging = [
"icu_provider/logging",
"dep:log",
"diplomat-runtime/log",
]
provider_fs = [
"dep:icu_provider_fs",
"buffer_provider",
]
provider_test = ["compiled_data"]
simple_logger = [
"dep:simple_logger",
"logging",
]
wasm_default = ["logging"]
[target."cfg(not(any(target_arch = \"wasm32\", target_os = \"none\")))".dependencies.icu_provider_fs]
version = "~1.4.0"
optional = true
default-features = false
[target."cfg(not(target_arch = \"wasm32\"))".dependencies.simple_logger]
version = "4.1.0"
optional = true

44
intl/icu_capi/LICENSE Normal file
View file

@ -0,0 +1,44 @@
UNICODE LICENSE V3
COPYRIGHT AND PERMISSION NOTICE
Copyright © 2020-2023 Unicode, Inc.
NOTICE TO USER: Carefully read the following legal agreement. BY
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.
Portions of ICU4X may have been adapted from ICU4C and/or ICU4J.
ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others.

30
intl/icu_capi/README.md Normal file
View file

@ -0,0 +1,30 @@
# icu_capi [![crates.io](https://img.shields.io/crates/v/icu_capi)](https://crates.io/crates/icu_capi)
<!-- cargo-rdme start -->
This crate contains the source of truth for the [Diplomat](https://github.com/rust-diplomat/diplomat)-generated
FFI bindings. This generates the C, C++, JavaScript, and TypeScript bindings. This crate also contains the `extern "C"`
FFI for ICU4X.
While the types in this crate are public, APIs from this crate are *not intended to be used from Rust*
and as such this crate may unpredictably change its Rust API across compatible semver versions. The `extern "C"` APIs exposed
by this crate, while not directly documented, are stable within the same major semver version, as are the bindings exposed under
the `cpp/` and `js/` folders.
This crate may still be explored for documentation on docs.rs, and there are generated language-specific docs available as well.
C++ has sphinx docs in `cpp/docs/`, and the header files also contain documentation comments. The JS version has sphinx docs under
`js/docs`, and the TypeScript sources in `js/include` are compatible with `tsdoc`.
This crate is `no_std` and will not typically build as a staticlib on its own. If you wish to link to it you should prefer
using `icu_capi_staticlib`, or for more esoteric platforms you may write a shim crate depending on this crate that hooks in
an allocator and panic hook.
More information on using ICU4X from C++ can be found in [our tutorial].
[our tutorial]: https://github.com/unicode-org/icu4x/blob/main/docs/tutorials/cpp.md
<!-- cargo-rdme end -->
## More Information
For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x).

17
intl/icu_capi/c/README.md Normal file
View file

@ -0,0 +1,17 @@
# C FFI for ICU4X
This folder contains the C FFI for ICU4X. To re-generate the bindings run:
```sh
cargo make diplomat-gen-c
```
Or re-generate all of the bindings:
```sh
cargo make diplomat-gen
```
## More Information
For more information on development, authorship, contributing etc. please visit [`ICU4X home page`](https://github.com/unicode-org/icu4x).

View file

@ -0,0 +1,2 @@
a.out
a.out.dSYM

View file

@ -0,0 +1,26 @@
# 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 := test
.PHONY: build test
FORCE:
ALL_HEADERS := $(wildcard ../../include/*.h)
$(ALL_HEADERS):
../../../../../target/debug/libicu_capi_staticlib.a: FORCE
cargo build -p icu_capi_staticlib
a.out: ../../../../../target/debug/libicu_capi_staticlib.a $(ALL_HEADERS) test.c
gcc test.c ../../../../../target/debug/libicu_capi_staticlib.a -ldl -lpthread -lm -g
build: a.out
test: build
./a.out
clean:
git clean -xf *
rm -f ../../../../../target/debug/libicu_capi_staticlib.a

View file

@ -0,0 +1,98 @@
// 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 ).
#include "../../include/ICU4XFixedDecimalFormatter.h"
#include "../../include/ICU4XLogger.h"
#include <string.h>
#include <stdio.h>
int main() {
ICU4XLogger_init_simple_logger();
diplomat_result_box_ICU4XLocale_ICU4XError locale_result = ICU4XLocale_create_from_string("bn", 2);
if (!locale_result.is_ok) {
return 1;
}
ICU4XLocale* locale = locale_result.ok;
ICU4XDataProvider* provider = ICU4XDataProvider_create_compiled();
ICU4XFixedDecimal* decimal = ICU4XFixedDecimal_create_from_u64(1000007);
diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError fdf_result =
ICU4XFixedDecimalFormatter_create_with_grouping_strategy(provider, locale, ICU4XFixedDecimalGroupingStrategy_Auto);
if (!fdf_result.is_ok) {
printf("Failed to create FixedDecimalFormatter\n");
return 1;
}
ICU4XFixedDecimalFormatter* fdf = fdf_result.ok;
char output[40];
DiplomatWriteable write = diplomat_simple_writeable(output, 40);
bool success = ICU4XFixedDecimalFormatter_format(fdf, decimal, &write).is_ok;
if (!success) {
printf("Failed to write result of FixedDecimalFormatter::format to string.\n");
return 1;
}
printf("Output is %s\n", output);
const char* expected = u8"১০,,";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XFixedDecimal_multiply_pow10(decimal, 2);
if (!success) {
printf("Failed to multiply FixedDecimal\n");
return 1;
}
ICU4XFixedDecimal_set_sign(decimal, ICU4XFixedDecimalSign_Negative);
write = diplomat_simple_writeable(output, 40);
success = ICU4XFixedDecimalFormatter_format(fdf, decimal, &write).is_ok;
if (!success) {
printf("Failed to write result of FixedDecimalFormatter::format to string.\n");
return 1;
}
printf("Output x100 and negated is %s\n", output);
expected = u8"-১০,,,";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XFixedDecimal_destroy(decimal);
diplomat_result_box_ICU4XFixedDecimal_ICU4XError fd_result = ICU4XFixedDecimal_create_from_string("1000007.070", 11);
if (!fd_result.is_ok) {
printf("Failed to create FixedDecimal from string.\n");
return 1;
}
decimal = fd_result.ok;
write = diplomat_simple_writeable(output, 40);
success = ICU4XFixedDecimalFormatter_format(fdf, decimal, &write).is_ok;
if (!success) {
printf("Failed to write result of FixedDecimalFormatter::format to string.\n");
return 1;
}
printf("Output is %s\n", output);
expected = u8"১০,,.";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XFixedDecimal_destroy(decimal);
ICU4XFixedDecimalFormatter_destroy(fdf);
ICU4XLocale_destroy(locale);
ICU4XDataProvider_destroy(provider);
return 0;
}

View file

@ -0,0 +1,8 @@
a.out
optim*
*.i64
*.dot
*.elf
*.o
a.out.dSYM
baked_data

View file

@ -0,0 +1,83 @@
# 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 ).
# PLEASE KEEP THIS FILE IN SYNC WITH ../segmenter_tiny/Makefile
.DEFAULT_GOAL := test
.PHONY: build test
FORCE:
ALL_HEADERS := $(wildcard ../../include/*.h)
ICU4X_NIGHTLY_TOOLCHAIN ?= "nightly-2022-12-26"
$(ALL_HEADERS):
GCC := gcc
CLANG := clang-15
LLD := lld-15
baked_data/macros.rs:
cargo run -p icu_datagen -- --locales en bn --keys all --fallback preresolved --format mod --out baked_data --overwrite
crate/target/debug/libcrate.a: FORCE
cd crate && cargo build --features std
crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a: FORCE baked_data/macros.rs
rustup toolchain install ${ICU4X_NIGHTLY_TOOLCHAIN}
rustup component add rust-src --toolchain ${ICU4X_NIGHTLY_TOOLCHAIN}
cd crate && \
RUSTFLAGS="-Clinker-plugin-lto -Clinker=$(CLANG) -Ccodegen-units=1 -Clink-arg=-flto -Cpanic=abort" ICU4X_DATA_DIR=$(shell pwd)/baked_data cargo +${ICU4X_NIGHTLY_TOOLCHAIN} build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu
crate/target/x86_64-unknown-linux-gnu/release/libcrate.a: FORCE baked_data/macros.rs
rustup toolchain install ${ICU4X_NIGHTLY_TOOLCHAIN}
rustup component add rust-src --toolchain ${ICU4X_NIGHTLY_TOOLCHAIN}
cd crate && \
RUSTFLAGS="-Clto -Cembed-bitcode -Clinker-plugin-lto -Clinker=$(CLANG) -Ccodegen-units=1 -Clink-arg=-flto -Cpanic=abort -Copt-level=s" ICU4X_DATA_DIR=$(shell pwd)/baked_data cargo +${ICU4X_NIGHTLY_TOOLCHAIN} build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu --release
# Naive target: no optimizations, full std
optim0.elf: crate/target/debug/libcrate.a $(ALL_HEADERS) test.c
$(GCC) test.c crate/target/debug/libcrate.a -ldl -lpthread -lm -g -o optim0.elf
# optim.elf: gcc with maximum link-time code stripping (gc-sections and strip-all)
optim1.elf: crate/target/debug/libcrate.a $(ALL_HEADERS) test.c
$(GCC) -fdata-sections -ffunction-sections test.c crate/target/debug/libcrate.a -ldl -lpthread -lm -g -o optim1.elf -Wl,--gc-sections -Wl,--strip-all
# optim2.elf: clang single-step with gc-sections
optim2.elf: crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a $(ALL_HEADERS) test.c
$(CLANG) -flto -fdata-sections -ffunction-sections test.c crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a -g -o optim2.elf -Wl,--gc-sections
optim3.o: $(ALL_HEADERS) test.c
$(CLANG) -c -flto=thin -fdata-sections -ffunction-sections --target=x86_64-unknown-linux-gnu test.c -g -o optim3.o
# optim3.elf: clang two-step with lld, debug mode
optim3.elf: optim3.o crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a
$(CLANG) -flto=thin -fuse-ld=$(LLD) -L . -o optim3.elf optim3.o crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a -Wl,--gc-sections
optim4.o: $(ALL_HEADERS) test.c
$(CLANG) -c -flto=thin -fdata-sections -ffunction-sections --target=x86_64-unknown-linux-gnu test.c -g -o optim4.o
# optim4.elf: clang two-step with lld, release mode with debug symbols
optim4.elf: optim4.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a
$(CLANG) -flto=thin -fuse-ld=$(LLD) -L . -o optim4.elf optim4.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a -Wl,--gc-sections
optim5.o: $(ALL_HEADERS) test.c
$(CLANG) -c -flto=thin -fdata-sections -ffunction-sections --target=x86_64-unknown-linux-gnu test.c -o optim5.o
# optim5.elf: clang two-step with lld, release mode stripped of debug symbols
optim5.elf: optim5.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a
$(CLANG) -flto=thin -fuse-ld=$(LLD) -L . -o optim5.elf optim5.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a -Wl,--gc-sections -Wl,--strip-all
build: optim0.elf optim1.elf optim2.elf optim3.elf optim4.elf optim5.elf
ls -l optim*.elf
test: build
./optim0.elf bn
./optim1.elf bn
./optim2.elf bn
./optim2.elf bn
./optim4.elf bn
./optim5.elf bn
clean:
git clean -xf *

View file

@ -0,0 +1,8 @@
# Tiny FixedDecimal FFI Demo
This example contains tooling to build a size-optimized binary using FixedDecimal and FixedDecimalFormatter in C over FFI.
Prerequisites: `clang` and `lld` 14. `apt-get install clang lld` *might* work, but if you run into errors, refer to the following thread for tips:
https://github.com/rust-lang/rust/issues/60059

View file

@ -0,0 +1,54 @@
// 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 ).
#include "../../include/ICU4XFixedDecimalFormatter.h"
#include <string.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
if (argc != 2) {
printf("Usage: %s <language>\n", argv[0]);
return 1;
}
ICU4XLocale* locale = ICU4XLocale_create_und();
if (!ICU4XLocale_set_language(locale, argv[1], strlen(argv[1])).is_ok) {
printf("Invalid language tag \"%s\"\n", argv[1]);
return 1;
}
ICU4XDataProvider* provider = ICU4XDataProvider_create_compiled();
ICU4XFixedDecimal* decimal = ICU4XFixedDecimal_create_from_u64(1000007);
diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError fdf_result =
ICU4XFixedDecimalFormatter_create_with_grouping_strategy(provider, locale, ICU4XFixedDecimalGroupingStrategy_Auto);
if (!fdf_result.is_ok) {
printf("Failed to create FixedDecimalFormatter\n");
return 1;
}
ICU4XFixedDecimalFormatter* fdf = fdf_result.ok;
char output[40];
DiplomatWriteable write = diplomat_simple_writeable(output, 40);
bool success = ICU4XFixedDecimalFormatter_format(fdf, decimal, &write).is_ok;
if (!success) {
printf("Failed to write result of FixedDecimalFormatter::format to string.\n");
return 1;
}
printf("Output is %s\n", output);
const char* expected = u8"১০,,";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XFixedDecimal_destroy(decimal);
ICU4XFixedDecimalFormatter_destroy(fdf);
ICU4XLocale_destroy(locale);
ICU4XDataProvider_destroy(provider);
return 0;
}

View file

@ -0,0 +1,2 @@
a.out
a.out.dSYM

View file

@ -0,0 +1,26 @@
# 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 := test
.PHONY: build test
FORCE:
ALL_HEADERS := $(wildcard ../../include/*.h)
$(ALL_HEADERS):
../../../../../target/debug/libicu_capi_staticlib.a: FORCE
cargo build -p icu_capi_staticlib
a.out: ../../../../../target/debug/libicu_capi_staticlib.a $(ALL_HEADERS) test.c
gcc test.c ../../../../../target/debug/libicu_capi_staticlib.a -ldl -lpthread -lm -g
build: a.out
test: build
./a.out
clean:
git clean -xf *
rm -f ../../../../../target/debug/libicu_capi_staticlib.a

View file

@ -0,0 +1,267 @@
// 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 ).
#include "../../include/ICU4XLocaleCanonicalizer.h"
#include "../../include/ICU4XLocaleExpander.h"
#include "../../include/ICU4XLogger.h"
#include <string.h>
#include <stdio.h>
/**
* A helper for testing the locale with nice error messages.
*/
bool test_locale(ICU4XLocale* locale, const char* message, const char* expected) {
char output[40];
// Test setters
DiplomatWriteable write = diplomat_simple_writeable(output, 40);
diplomat_result_void_ICU4XError result = ICU4XLocale_to_string(locale, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for %s is \"%s\"\n", message, output);
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return false;
}
return true;
}
ICU4XLocale* get_locale(const char* localeText) {
diplomat_result_box_ICU4XLocale_ICU4XError locale_result = ICU4XLocale_create_from_string(localeText, strlen(localeText));
if (!locale_result.is_ok) {
printf("Could not create locale from: %s", localeText);
}
return locale_result.ok;
}
int main() {
ICU4XLogger_init_simple_logger();
char output[40];
// Test creating a locale.
DiplomatWriteable write = diplomat_simple_writeable(output, 40);
diplomat_result_box_ICU4XLocale_ICU4XError locale_result = ICU4XLocale_create_from_string("ar", 2);
if (!locale_result.is_ok) {
return 1;
}
ICU4XLocale* locale = locale_result.ok;
diplomat_result_void_ICU4XError result = ICU4XLocale_to_string(locale, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for a basic locale is %s\n", output);
const char* expected = u8"ar";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XLocale_destroy(locale);
// Test some accessors.
write = diplomat_simple_writeable(output, 40);
locale_result = ICU4XLocale_create_from_string("fr-FR-u-hc-h23", 14);
if (!locale_result.is_ok) {
return 1;
}
locale = locale_result.ok;
result = ICU4XLocale_language(locale, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for the language is %s\n", output);
expected = u8"fr";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
write = diplomat_simple_writeable(output, 40);
result = ICU4XLocale_region(locale, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for the region is %s\n", output);
expected = u8"FR";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
write = diplomat_simple_writeable(output, 40);
result = ICU4XLocale_get_unicode_extension(locale, "hc", 2, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for the extension is %s\n", output);
expected = u8"h23";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
result = ICU4XLocale_get_unicode_extension(locale, "ca", 2, &write);
if (!(!result.is_ok && result.err == ICU4XError_LocaleUndefinedSubtagError)) {
return 1;
}
// Test setting the language
write = diplomat_simple_writeable(output, 40);
const char* str = "fr-FR-u-hc-h23";
locale_result = ICU4XLocale_create_from_string(str, strlen(str));
if (!locale_result.is_ok) {
printf("Could not create the locale.");
return 1;
}
locale = locale_result.ok;
str = "zh";
result = ICU4XLocale_set_language(locale, str, strlen(str));
if (!result.is_ok) {
printf("Could not set the language tag.");
return 1;
}
if (!test_locale(locale, "setting the language tag", "zh-FR-u-hc-h23")) {
return 1;
}
ICU4XLocale_destroy(locale);
// Test setting the region
write = diplomat_simple_writeable(output, 40);
str = "es-ES-u-hc-h23";
locale_result = ICU4XLocale_create_from_string(str, strlen(str));
if (!locale_result.is_ok) {
printf("Could not create the locale.");
return 1;
}
locale = locale_result.ok;
if (!test_locale(locale, "The region starts as es-ES", "es-ES-u-hc-h23")) {
return 1;
}
str = "MX";
result = ICU4XLocale_set_region(locale, str, strlen(str));
if (!result.is_ok) {
printf("Could not set the region.");
return 1;
}
if (!test_locale(locale, "setting the region", "es-MX-u-hc-h23")) {
return 1;
}
ICU4XLocale_destroy(locale);
// Test setting the script
write = diplomat_simple_writeable(output, 40);
str = "en-US";
locale_result = ICU4XLocale_create_from_string(str, strlen(str));
if (!locale_result.is_ok) {
printf("Could not create the locale.");
return 1;
}
locale = locale_result.ok;
if (!test_locale(locale, "initial script-less locale", "en-US")) {
return 1;
}
str = "Latn";
result = ICU4XLocale_set_script(locale, str, strlen(str));
if (!result.is_ok) {
printf("Could not set the script.");
return 1;
}
if (!test_locale(locale, "setting the script", "en-Latn-US")) {
return 1;
}
result = ICU4XLocale_set_script(locale, "", 0);
if (!result.is_ok) {
printf("Could not set the script.");
return 1;
}
if (!test_locale(locale, "removing the script", "en-US")) {
return 1;
}
ICU4XLocale_destroy(locale);
// Create a LocaleCanonicalizer and LocaleExpander.
ICU4XDataProvider* provider = ICU4XDataProvider_create_compiled();
diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError result2 = ICU4XLocaleCanonicalizer_create(provider);
if (!result2.is_ok) {
printf("Could not construct Locale Canonicalizer");
return 1;
}
ICU4XLocaleCanonicalizer* lc = result2.ok;
diplomat_result_box_ICU4XLocaleExpander_ICU4XError result3 = ICU4XLocaleExpander_create(provider);
if (!result3.is_ok) {
printf("Could not construct Locale Canonicalizer");
return 1;
}
ICU4XLocaleExpander* le = result3.ok;
// Test maximize.
write = diplomat_simple_writeable(output, 40);
locale_result = ICU4XLocale_create_from_string("und", 3);
if (!locale_result.is_ok) {
printf("Could not create the locale.");
return 1;
}
locale = locale_result.ok;
ICU4XLocaleExpander_maximize(le, locale);
result = ICU4XLocale_to_string(locale, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for maximizing is %s\n", output);
expected = u8"en-Latn-US";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XLocale_destroy(locale);
// Test minimize.
write = diplomat_simple_writeable(output, 40);
locale_result = ICU4XLocale_create_from_string("zh-Hant", 7);
if (!locale_result.is_ok) {
printf("Could not create the locale.");
return 1;
}
locale = locale_result.ok;
ICU4XLocaleExpander_minimize(le, locale);
result = ICU4XLocale_to_string(locale, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for minimizing is %s\n", output);
expected = u8"zh-TW";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XLocale_destroy(locale);
// Test canonicalize.
write = diplomat_simple_writeable(output, 40);
locale_result = ICU4XLocale_create_from_string("no-nynorsk", 10);
if (!locale_result.is_ok) {
printf("Could not create the locale.");
return 1;
}
locale = locale_result.ok;
ICU4XLocaleCanonicalizer_canonicalize(lc, locale);
result = ICU4XLocale_to_string(locale, &write);
if (!result.is_ok) {
return 1;
}
printf("Output for canonicalizing is %s\n", output);
expected = u8"nn";
if (strcmp(output, expected) != 0) {
printf("Output does not match expected output!\n");
return 1;
}
ICU4XLocale_destroy(locale);
ICU4XLocaleCanonicalizer_destroy(lc);
ICU4XLocaleExpander_destroy(le);
return 0;
}

View file

@ -0,0 +1,2 @@
a.out
a.out.dSYM

View file

@ -0,0 +1,26 @@
# 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 := test
.PHONY: build test
FORCE:
ALL_HEADERS := $(wildcard ../../include/*.h)
$(ALL_HEADERS):
../../../../../target/debug/libicu_capi_staticlib.a: FORCE
cargo build -p icu_capi_staticlib
a.out: ../../../../../target/debug/libicu_capi_staticlib.a $(ALL_HEADERS) test.c
gcc test.c ../../../../../target/debug/libicu_capi_staticlib.a -ldl -lpthread -lm -g
build: a.out
test: build
./a.out
clean:
git clean -xf *
rm -f ../../../../../target/debug/libicu_capi_staticlib.a

View file

@ -0,0 +1,70 @@
// 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 ).
#include "../../include/ICU4XPluralRules.h"
#include "../../include/ICU4XLogger.h"
#include <string.h>
#include <stdio.h>
int main() {
ICU4XLogger_init_simple_logger();
diplomat_result_box_ICU4XLocale_ICU4XError locale_result = ICU4XLocale_create_from_string("ar", 2);
if (!locale_result.is_ok) {
return 1;
}
ICU4XLocale* locale = locale_result.ok;
ICU4XDataProvider* provider = ICU4XDataProvider_create_compiled();
diplomat_result_box_ICU4XPluralRules_ICU4XError plural_result = ICU4XPluralRules_create_cardinal(provider, locale);
if (!plural_result.is_ok) {
printf("Failed to create PluralRules\n");
return 1;
}
ICU4XPluralRules* rules = plural_result.ok;
ICU4XPluralCategories categories = ICU4XPluralRules_categories(rules);
printf("Plural Category zero (should be true): %s\n", categories.zero ? "true" : "false");
printf("Plural Category one (should be true): %s\n", categories.one ? "true" : "false");
printf("Plural Category two (should be true): %s\n", categories.two ? "true" : "false");
printf("Plural Category few (should be true): %s\n", categories.few ? "true" : "false");
printf("Plural Category many (should be true): %s\n", categories.many ? "true" : "false");
printf("Plural Category other (should be true): %s\n", categories.other ? "true" : "false");
diplomat_result_box_ICU4XPluralOperands_ICU4XError op1_result = ICU4XPluralOperands_create_from_string("3", 1);
if (!op1_result.is_ok) {
printf("Failed to create PluralOperands from string\n");
return 1;
}
ICU4XPluralCategory cat1 = ICU4XPluralRules_category_for(rules, op1_result.ok);
printf("Plural Category %d (should be %d)\n", (int)cat1, (int)ICU4XPluralCategory_Few);
diplomat_result_box_ICU4XPluralOperands_ICU4XError op2_result = ICU4XPluralOperands_create_from_string("1011.0", 6);
if (!op2_result.is_ok) {
printf("Failed to create PluralOperands from string\n");
return 1;
}
ICU4XPluralCategory cat2 = ICU4XPluralRules_category_for(rules, op2_result.ok);
printf("Plural Category %d (should be %d)\n", (int)cat2, (int)ICU4XPluralCategory_Many);
ICU4XPluralRules_destroy(rules);
ICU4XDataProvider_destroy(provider);
ICU4XLocale_destroy(locale);
if (!categories.zero) { return 1; }
if (!categories.one) { return 1; }
if (!categories.two) { return 1; }
if (!categories.few) { return 1; }
if (!categories.many) { return 1; }
if (!categories.other) { return 1; }
if (cat1 != ICU4XPluralCategory_Few) { return 1; }
if (cat2 != ICU4XPluralCategory_Many) { return 1; }
return 0;
}

View file

@ -0,0 +1,8 @@
a.out
optim*
*.i64
*.dot
*.elf
*.o
a.out.dSYM
baked_data

View file

@ -0,0 +1,80 @@
# 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 ).
# PLEASE KEEP THIS FILE IN SYNC WITH ../fixeddecimal_tiny/Makefile
.DEFAULT_GOAL := test
.PHONY: build test
FORCE:
ALL_HEADERS := $(wildcard ../../include/*.h)
ICU4X_NIGHTLY_TOOLCHAIN ?= "nightly-2022-12-26"
$(ALL_HEADERS):
GCC := gcc
CLANG := clang-15
LLD := lld-15
crate/target/debug/libcrate.a: FORCE
cd crate && cargo build --features std
crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a: FORCE
rustup toolchain install ${ICU4X_NIGHTLY_TOOLCHAIN}
rustup component add rust-src --toolchain ${ICU4X_NIGHTLY_TOOLCHAIN}
cd crate && \
RUSTFLAGS="-Clinker-plugin-lto -Clinker=$(CLANG) -Ccodegen-units=1 -Clink-arg=-flto -Cpanic=abort" cargo +${ICU4X_NIGHTLY_TOOLCHAIN} build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu
crate/target/x86_64-unknown-linux-gnu/release/libcrate.a: FORCE
rustup toolchain install ${ICU4X_NIGHTLY_TOOLCHAIN}
rustup component add rust-src --toolchain ${ICU4X_NIGHTLY_TOOLCHAIN}
cd crate && \
RUSTFLAGS="-Clto -Cembed-bitcode -Clinker-plugin-lto -Clinker=$(CLANG) -Ccodegen-units=1 -Clink-arg=-flto -Cpanic=abort -Copt-level=s" cargo +${ICU4X_NIGHTLY_TOOLCHAIN} build -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target x86_64-unknown-linux-gnu --release
# Naive target: no optimizations, full std
optim0.elf: crate/target/debug/libcrate.a $(ALL_HEADERS) test.c
$(GCC) test.c crate/target/debug/libcrate.a -ldl -lpthread -lm -g -o optim0.elf
# optim.elf: gcc with maximum link-time code stripping (gc-sections and strip-all)
optim1.elf: crate/target/debug/libcrate.a $(ALL_HEADERS) test.c
$(GCC) -fdata-sections -ffunction-sections test.c crate/target/debug/libcrate.a -ldl -lpthread -lm -g -o optim1.elf -Wl,--gc-sections -Wl,--strip-all
# optim2.elf: clang single-step with gc-sections
optim2.elf: crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a $(ALL_HEADERS) test.c
$(CLANG) -flto -fdata-sections -ffunction-sections test.c crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a -g -o optim2.elf -Wl,--gc-sections
optim3.o: $(ALL_HEADERS) test.c
$(CLANG) -c -flto=thin -fdata-sections -ffunction-sections --target=x86_64-unknown-linux-gnu test.c -g -o optim3.o
# optim3.elf: clang two-step with lld, debug mode
optim3.elf: optim3.o crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a
$(CLANG) -flto=thin -fuse-ld=$(LLD) -L . -o optim3.elf optim3.o crate/target/x86_64-unknown-linux-gnu/debug/libcrate.a -Wl,--gc-sections
optim4.o: $(ALL_HEADERS) test.c
$(CLANG) -c -flto=thin -fdata-sections -ffunction-sections --target=x86_64-unknown-linux-gnu test.c -g -o optim4.o
# optim4.elf: clang two-step with lld, release mode with debug symbols
optim4.elf: optim4.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a
$(CLANG) -flto=thin -fuse-ld=$(LLD) -L . -o optim4.elf optim4.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a -Wl,--gc-sections
optim5.o: $(ALL_HEADERS) test.c
$(CLANG) -c -flto=thin -fdata-sections -ffunction-sections --target=x86_64-unknown-linux-gnu test.c -o optim5.o
# optim5.elf: clang two-step with lld, release mode stripped of debug symbols
optim5.elf: optim5.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a
$(CLANG) -flto=thin -fuse-ld=$(LLD) -L . -o optim5.elf optim5.o crate/target/x86_64-unknown-linux-gnu/release/libcrate.a -Wl,--gc-sections -Wl,--strip-all
build: optim0.elf optim1.elf optim2.elf optim3.elf optim4.elf optim5.elf
ls -l optim*.elf
test: build
./optim0.elf
./optim1.elf
./optim2.elf
./optim2.elf
./optim4.elf
./optim5.elf
clean:
git clean -xf *

View file

@ -0,0 +1,5 @@
# Tiny Segmenter FFI Demo
This example contains tooling to build a size-optimized binary using Segmenter in C over FFI.
For more information and prerequisites, see ../fixeddecimal_tiny/README.md

View file

@ -0,0 +1,42 @@
// 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 ).
#include "../../include/ICU4XLineSegmenter.h"
#include <string.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
ICU4XDataProvider* provider = ICU4XDataProvider_create_compiled();
diplomat_result_box_ICU4XLineSegmenter_ICU4XError segmenter_result = ICU4XLineSegmenter_create_auto(provider);
if (!segmenter_result.is_ok) {
printf("Failed to create ICU4XLineSegmenter\n");
return 1;
}
ICU4XLineSegmenter* segmenter = segmenter_result.ok;
char output[40];
DiplomatWriteable write = diplomat_simple_writeable(output, 40);
const char* data = "อักษรไทย เป็นอักษรที่ใช้เขียนภาษาไทยและภาษาของกลุ่มชาติพันธุ์ต่างๆ เช่น คำเมือง, อีสาน, ภาษาไทยใต้, มลายูปัตตานี เป็นต้น ในประเทศไทย มีพยัญชนะ 44 รูป สระ 21 รูป วรรณยุกต์ 4 รูป และเครื่องหมายอื่น ๆ อีกจำนวนหนึ่ง";
ICU4XLineBreakIteratorUtf8* iter = ICU4XLineSegmenter_segment_utf8(segmenter, data, strlen(data));
printf("Breakpoints:");
while (true) {
int32_t breakpoint = ICU4XLineBreakIteratorUtf8_next(iter);
if (breakpoint == -1) {
break;
}
printf(" %d", breakpoint);
}
printf("\n");
ICU4XLineBreakIteratorUtf8_destroy(iter);
ICU4XLineSegmenter_destroy(segmenter);
ICU4XDataProvider_destroy(provider);
return 0;
}

View file

@ -0,0 +1,30 @@
#ifndef CodePointRangeIterator_H
#define CodePointRangeIterator_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct CodePointRangeIterator CodePointRangeIterator;
#ifdef __cplusplus
} // namespace capi
#endif
#include "CodePointRangeIteratorResult.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
CodePointRangeIteratorResult CodePointRangeIterator_next(CodePointRangeIterator* self);
void CodePointRangeIterator_destroy(CodePointRangeIterator* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef CodePointRangeIteratorResult_H
#define CodePointRangeIteratorResult_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct CodePointRangeIteratorResult {
uint32_t start;
uint32_t end;
bool done;
} CodePointRangeIteratorResult;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void CodePointRangeIteratorResult_destroy(CodePointRangeIteratorResult* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,55 @@
#ifndef ICU4XAnyCalendarKind_H
#define ICU4XAnyCalendarKind_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XAnyCalendarKind {
ICU4XAnyCalendarKind_Iso = 0,
ICU4XAnyCalendarKind_Gregorian = 1,
ICU4XAnyCalendarKind_Buddhist = 2,
ICU4XAnyCalendarKind_Japanese = 3,
ICU4XAnyCalendarKind_JapaneseExtended = 4,
ICU4XAnyCalendarKind_Ethiopian = 5,
ICU4XAnyCalendarKind_EthiopianAmeteAlem = 6,
ICU4XAnyCalendarKind_Indian = 7,
ICU4XAnyCalendarKind_Coptic = 8,
ICU4XAnyCalendarKind_Dangi = 9,
ICU4XAnyCalendarKind_Chinese = 10,
ICU4XAnyCalendarKind_Hebrew = 11,
ICU4XAnyCalendarKind_IslamicCivil = 12,
ICU4XAnyCalendarKind_IslamicObservational = 13,
ICU4XAnyCalendarKind_IslamicTabular = 14,
ICU4XAnyCalendarKind_IslamicUmmAlQura = 15,
ICU4XAnyCalendarKind_Persian = 16,
ICU4XAnyCalendarKind_Roc = 17,
} ICU4XAnyCalendarKind;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XLocale.h"
#include "diplomat_result_ICU4XAnyCalendarKind_void.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_ICU4XAnyCalendarKind_void ICU4XAnyCalendarKind_get_for_locale(const ICU4XLocale* locale);
diplomat_result_ICU4XAnyCalendarKind_void ICU4XAnyCalendarKind_get_for_bcp47(const char* s_data, size_t s_len);
diplomat_result_void_ICU4XError ICU4XAnyCalendarKind_bcp47(ICU4XAnyCalendarKind self, DiplomatWriteable* write);
void ICU4XAnyCalendarKind_destroy(ICU4XAnyCalendarKind* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,34 @@
#ifndef ICU4XBcp47ToIanaMapper_H
#define ICU4XBcp47ToIanaMapper_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XBcp47ToIanaMapper ICU4XBcp47ToIanaMapper;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XBcp47ToIanaMapper_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XBcp47ToIanaMapper_ICU4XError ICU4XBcp47ToIanaMapper_create(const ICU4XDataProvider* provider);
diplomat_result_void_ICU4XError ICU4XBcp47ToIanaMapper_get(const ICU4XBcp47ToIanaMapper* self, const char* value_data, size_t value_len, DiplomatWriteable* write);
void ICU4XBcp47ToIanaMapper_destroy(ICU4XBcp47ToIanaMapper* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,45 @@
#ifndef ICU4XBidi_H
#define ICU4XBidi_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XBidi ICU4XBidi;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XBidi_ICU4XError.h"
#include "ICU4XBidiInfo.h"
#include "ICU4XReorderedIndexMap.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XBidi_ICU4XError ICU4XBidi_create(const ICU4XDataProvider* provider);
ICU4XBidiInfo* ICU4XBidi_for_text(const ICU4XBidi* self, const char* text_data, size_t text_len, uint8_t default_level);
ICU4XReorderedIndexMap* ICU4XBidi_reorder_visual(const ICU4XBidi* self, const uint8_t* levels_data, size_t levels_len);
bool ICU4XBidi_level_is_rtl(uint8_t level);
bool ICU4XBidi_level_is_ltr(uint8_t level);
uint8_t ICU4XBidi_level_rtl();
uint8_t ICU4XBidi_level_ltr();
void ICU4XBidi_destroy(ICU4XBidi* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XBidiDirection_H
#define ICU4XBidiDirection_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XBidiDirection {
ICU4XBidiDirection_Ltr = 0,
ICU4XBidiDirection_Rtl = 1,
ICU4XBidiDirection_Mixed = 2,
} ICU4XBidiDirection;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XBidiDirection_destroy(ICU4XBidiDirection* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,36 @@
#ifndef ICU4XBidiInfo_H
#define ICU4XBidiInfo_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XBidiInfo ICU4XBidiInfo;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XBidiParagraph.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
size_t ICU4XBidiInfo_paragraph_count(const ICU4XBidiInfo* self);
ICU4XBidiParagraph* ICU4XBidiInfo_paragraph_at(const ICU4XBidiInfo* self, size_t n);
size_t ICU4XBidiInfo_size(const ICU4XBidiInfo* self);
uint8_t ICU4XBidiInfo_level_at(const ICU4XBidiInfo* self, size_t pos);
void ICU4XBidiInfo_destroy(ICU4XBidiInfo* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,43 @@
#ifndef ICU4XBidiParagraph_H
#define ICU4XBidiParagraph_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XBidiParagraph ICU4XBidiParagraph;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_void_ICU4XError.h"
#include "ICU4XBidiDirection.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_void_ICU4XError ICU4XBidiParagraph_set_paragraph_in_text(ICU4XBidiParagraph* self, size_t n);
ICU4XBidiDirection ICU4XBidiParagraph_direction(const ICU4XBidiParagraph* self);
size_t ICU4XBidiParagraph_size(const ICU4XBidiParagraph* self);
size_t ICU4XBidiParagraph_range_start(const ICU4XBidiParagraph* self);
size_t ICU4XBidiParagraph_range_end(const ICU4XBidiParagraph* self);
diplomat_result_void_ICU4XError ICU4XBidiParagraph_reorder_line(const ICU4XBidiParagraph* self, size_t range_start, size_t range_end, DiplomatWriteable* out);
uint8_t ICU4XBidiParagraph_level_at(const ICU4XBidiParagraph* self, size_t pos);
void ICU4XBidiParagraph_destroy(ICU4XBidiParagraph* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,37 @@
#ifndef ICU4XCalendar_H
#define ICU4XCalendar_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCalendar ICU4XCalendar;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "diplomat_result_box_ICU4XCalendar_ICU4XError.h"
#include "ICU4XAnyCalendarKind.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCalendar_ICU4XError ICU4XCalendar_create_for_locale(const ICU4XDataProvider* provider, const ICU4XLocale* locale);
diplomat_result_box_ICU4XCalendar_ICU4XError ICU4XCalendar_create_for_kind(const ICU4XDataProvider* provider, ICU4XAnyCalendarKind kind);
ICU4XAnyCalendarKind ICU4XCalendar_kind(const ICU4XCalendar* self);
void ICU4XCalendar_destroy(ICU4XCalendar* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,35 @@
#ifndef ICU4XCanonicalCombiningClassMap_H
#define ICU4XCanonicalCombiningClassMap_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCanonicalCombiningClassMap ICU4XCanonicalCombiningClassMap;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCanonicalCombiningClassMap_ICU4XError ICU4XCanonicalCombiningClassMap_create(const ICU4XDataProvider* provider);
uint8_t ICU4XCanonicalCombiningClassMap_get(const ICU4XCanonicalCombiningClassMap* self, char32_t ch);
uint8_t ICU4XCanonicalCombiningClassMap_get32(const ICU4XCanonicalCombiningClassMap* self, uint32_t ch);
void ICU4XCanonicalCombiningClassMap_destroy(ICU4XCanonicalCombiningClassMap* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,33 @@
#ifndef ICU4XCanonicalComposition_H
#define ICU4XCanonicalComposition_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCanonicalComposition ICU4XCanonicalComposition;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCanonicalComposition_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCanonicalComposition_ICU4XError ICU4XCanonicalComposition_create(const ICU4XDataProvider* provider);
char32_t ICU4XCanonicalComposition_compose(const ICU4XCanonicalComposition* self, char32_t starter, char32_t second);
void ICU4XCanonicalComposition_destroy(ICU4XCanonicalComposition* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,34 @@
#ifndef ICU4XCanonicalDecomposition_H
#define ICU4XCanonicalDecomposition_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCanonicalDecomposition ICU4XCanonicalDecomposition;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError.h"
#include "ICU4XDecomposed.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCanonicalDecomposition_ICU4XError ICU4XCanonicalDecomposition_create(const ICU4XDataProvider* provider);
ICU4XDecomposed ICU4XCanonicalDecomposition_decompose(const ICU4XCanonicalDecomposition* self, char32_t c);
void ICU4XCanonicalDecomposition_destroy(ICU4XCanonicalDecomposition* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,36 @@
#ifndef ICU4XCaseMapCloser_H
#define ICU4XCaseMapCloser_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCaseMapCloser ICU4XCaseMapCloser;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCaseMapCloser_ICU4XError.h"
#include "ICU4XCodePointSetBuilder.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCaseMapCloser_ICU4XError ICU4XCaseMapCloser_create(const ICU4XDataProvider* provider);
void ICU4XCaseMapCloser_add_case_closure_to(const ICU4XCaseMapCloser* self, char32_t c, ICU4XCodePointSetBuilder* builder);
bool ICU4XCaseMapCloser_add_string_case_closure_to(const ICU4XCaseMapCloser* self, const char* s_data, size_t s_len, ICU4XCodePointSetBuilder* builder);
void ICU4XCaseMapCloser_destroy(ICU4XCaseMapCloser* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,57 @@
#ifndef ICU4XCaseMapper_H
#define ICU4XCaseMapper_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCaseMapper ICU4XCaseMapper;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCaseMapper_ICU4XError.h"
#include "ICU4XLocale.h"
#include "diplomat_result_void_ICU4XError.h"
#include "ICU4XTitlecaseOptionsV1.h"
#include "ICU4XCodePointSetBuilder.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCaseMapper_ICU4XError ICU4XCaseMapper_create(const ICU4XDataProvider* provider);
diplomat_result_void_ICU4XError ICU4XCaseMapper_lowercase(const ICU4XCaseMapper* self, const char* s_data, size_t s_len, const ICU4XLocale* locale, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XCaseMapper_uppercase(const ICU4XCaseMapper* self, const char* s_data, size_t s_len, const ICU4XLocale* locale, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XCaseMapper_titlecase_segment_with_only_case_data_v1(const ICU4XCaseMapper* self, const char* s_data, size_t s_len, const ICU4XLocale* locale, ICU4XTitlecaseOptionsV1 options, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XCaseMapper_fold(const ICU4XCaseMapper* self, const char* s_data, size_t s_len, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XCaseMapper_fold_turkic(const ICU4XCaseMapper* self, const char* s_data, size_t s_len, DiplomatWriteable* write);
void ICU4XCaseMapper_add_case_closure_to(const ICU4XCaseMapper* self, char32_t c, ICU4XCodePointSetBuilder* builder);
char32_t ICU4XCaseMapper_simple_lowercase(const ICU4XCaseMapper* self, char32_t ch);
char32_t ICU4XCaseMapper_simple_uppercase(const ICU4XCaseMapper* self, char32_t ch);
char32_t ICU4XCaseMapper_simple_titlecase(const ICU4XCaseMapper* self, char32_t ch);
char32_t ICU4XCaseMapper_simple_fold(const ICU4XCaseMapper* self, char32_t ch);
char32_t ICU4XCaseMapper_simple_fold_turkic(const ICU4XCaseMapper* self, char32_t ch);
void ICU4XCaseMapper_destroy(ICU4XCaseMapper* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,43 @@
#ifndef ICU4XCodePointMapData16_H
#define ICU4XCodePointMapData16_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCodePointMapData16 ICU4XCodePointMapData16;
#ifdef __cplusplus
} // namespace capi
#endif
#include "CodePointRangeIterator.h"
#include "ICU4XCodePointSetData.h"
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCodePointMapData16_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
uint16_t ICU4XCodePointMapData16_get(const ICU4XCodePointMapData16* self, char32_t cp);
uint16_t ICU4XCodePointMapData16_get32(const ICU4XCodePointMapData16* self, uint32_t cp);
CodePointRangeIterator* ICU4XCodePointMapData16_iter_ranges_for_value(const ICU4XCodePointMapData16* self, uint16_t value);
CodePointRangeIterator* ICU4XCodePointMapData16_iter_ranges_for_value_complemented(const ICU4XCodePointMapData16* self, uint16_t value);
ICU4XCodePointSetData* ICU4XCodePointMapData16_get_set_for_value(const ICU4XCodePointMapData16* self, uint16_t value);
diplomat_result_box_ICU4XCodePointMapData16_ICU4XError ICU4XCodePointMapData16_load_script(const ICU4XDataProvider* provider);
void ICU4XCodePointMapData16_destroy(ICU4XCodePointMapData16* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,61 @@
#ifndef ICU4XCodePointMapData8_H
#define ICU4XCodePointMapData8_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCodePointMapData8 ICU4XCodePointMapData8;
#ifdef __cplusplus
} // namespace capi
#endif
#include "CodePointRangeIterator.h"
#include "ICU4XCodePointSetData.h"
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCodePointMapData8_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
uint8_t ICU4XCodePointMapData8_get(const ICU4XCodePointMapData8* self, char32_t cp);
uint8_t ICU4XCodePointMapData8_get32(const ICU4XCodePointMapData8* self, uint32_t cp);
uint32_t ICU4XCodePointMapData8_general_category_to_mask(uint8_t gc);
CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_value(const ICU4XCodePointMapData8* self, uint8_t value);
CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_value_complemented(const ICU4XCodePointMapData8* self, uint8_t value);
CodePointRangeIterator* ICU4XCodePointMapData8_iter_ranges_for_mask(const ICU4XCodePointMapData8* self, uint32_t mask);
ICU4XCodePointSetData* ICU4XCodePointMapData8_get_set_for_value(const ICU4XCodePointMapData8* self, uint8_t value);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_general_category(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_bidi_class(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_east_asian_width(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_indic_syllabic_category(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_line_break(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_try_grapheme_cluster_break(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_word_break(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointMapData8_ICU4XError ICU4XCodePointMapData8_load_sentence_break(const ICU4XDataProvider* provider);
void ICU4XCodePointMapData8_destroy(ICU4XCodePointMapData8* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,64 @@
#ifndef ICU4XCodePointSetBuilder_H
#define ICU4XCodePointSetBuilder_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCodePointSetBuilder ICU4XCodePointSetBuilder;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XCodePointSetData.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
ICU4XCodePointSetBuilder* ICU4XCodePointSetBuilder_create();
ICU4XCodePointSetData* ICU4XCodePointSetBuilder_build(ICU4XCodePointSetBuilder* self);
void ICU4XCodePointSetBuilder_complement(ICU4XCodePointSetBuilder* self);
bool ICU4XCodePointSetBuilder_is_empty(const ICU4XCodePointSetBuilder* self);
void ICU4XCodePointSetBuilder_add_char(ICU4XCodePointSetBuilder* self, char32_t ch);
void ICU4XCodePointSetBuilder_add_u32(ICU4XCodePointSetBuilder* self, uint32_t ch);
void ICU4XCodePointSetBuilder_add_inclusive_range(ICU4XCodePointSetBuilder* self, char32_t start, char32_t end);
void ICU4XCodePointSetBuilder_add_inclusive_range_u32(ICU4XCodePointSetBuilder* self, uint32_t start, uint32_t end);
void ICU4XCodePointSetBuilder_add_set(ICU4XCodePointSetBuilder* self, const ICU4XCodePointSetData* data);
void ICU4XCodePointSetBuilder_remove_char(ICU4XCodePointSetBuilder* self, char32_t ch);
void ICU4XCodePointSetBuilder_remove_inclusive_range(ICU4XCodePointSetBuilder* self, char32_t start, char32_t end);
void ICU4XCodePointSetBuilder_remove_set(ICU4XCodePointSetBuilder* self, const ICU4XCodePointSetData* data);
void ICU4XCodePointSetBuilder_retain_char(ICU4XCodePointSetBuilder* self, char32_t ch);
void ICU4XCodePointSetBuilder_retain_inclusive_range(ICU4XCodePointSetBuilder* self, char32_t start, char32_t end);
void ICU4XCodePointSetBuilder_retain_set(ICU4XCodePointSetBuilder* self, const ICU4XCodePointSetData* data);
void ICU4XCodePointSetBuilder_complement_char(ICU4XCodePointSetBuilder* self, char32_t ch);
void ICU4XCodePointSetBuilder_complement_inclusive_range(ICU4XCodePointSetBuilder* self, char32_t start, char32_t end);
void ICU4XCodePointSetBuilder_complement_set(ICU4XCodePointSetBuilder* self, const ICU4XCodePointSetData* data);
void ICU4XCodePointSetBuilder_destroy(ICU4XCodePointSetBuilder* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,172 @@
#ifndef ICU4XCodePointSetData_H
#define ICU4XCodePointSetData_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCodePointSetData ICU4XCodePointSetData;
#ifdef __cplusplus
} // namespace capi
#endif
#include "CodePointRangeIterator.h"
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XCodePointSetData_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
bool ICU4XCodePointSetData_contains(const ICU4XCodePointSetData* self, char32_t cp);
bool ICU4XCodePointSetData_contains32(const ICU4XCodePointSetData* self, uint32_t cp);
CodePointRangeIterator* ICU4XCodePointSetData_iter_ranges(const ICU4XCodePointSetData* self);
CodePointRangeIterator* ICU4XCodePointSetData_iter_ranges_complemented(const ICU4XCodePointSetData* self);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_for_general_category_group(const ICU4XDataProvider* provider, uint32_t group);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ascii_hex_digit(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_alnum(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_alphabetic(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_bidi_control(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_bidi_mirrored(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_blank(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_cased(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_case_ignorable(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_full_composition_exclusion(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_casefolded(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_casemapped(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_nfkc_casefolded(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_lowercased(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_titlecased(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_changes_when_uppercased(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_dash(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_deprecated(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_default_ignorable_code_point(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_diacritic(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_modifier_base(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_component(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_modifier(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_emoji_presentation(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_extender(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_extended_pictographic(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_graph(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_base(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_extend(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_grapheme_link(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_hex_digit(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_hyphen(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_id_continue(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ideographic(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_id_start(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ids_binary_operator(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_ids_trinary_operator(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_join_control(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_logical_order_exception(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_lowercase(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_math(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_noncharacter_code_point(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfc_inert(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfd_inert(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfkc_inert(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_nfkd_inert(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_pattern_syntax(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_pattern_white_space(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_prepended_concatenation_mark(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_print(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_quotation_mark(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_radical(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_regional_indicator(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_soft_dotted(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_segment_starter(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_case_sensitive(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_sentence_terminal(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_terminal_punctuation(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_unified_ideograph(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_uppercase(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_variation_selector(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_white_space(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xdigit(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xid_continue(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_xid_start(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XCodePointSetData_ICU4XError ICU4XCodePointSetData_load_for_ecma262(const ICU4XDataProvider* provider, const char* property_name_data, size_t property_name_len);
void ICU4XCodePointSetData_destroy(ICU4XCodePointSetData* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,40 @@
#ifndef ICU4XCollator_H
#define ICU4XCollator_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCollator ICU4XCollator;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XCollatorOptionsV1.h"
#include "diplomat_result_box_ICU4XCollator_ICU4XError.h"
#include "ICU4XOrdering.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCollator_ICU4XError ICU4XCollator_create_v1(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XCollatorOptionsV1 options);
ICU4XOrdering ICU4XCollator_compare(const ICU4XCollator* self, const char* left_data, size_t left_len, const char* right_data, size_t right_len);
ICU4XOrdering ICU4XCollator_compare_valid_utf8(const ICU4XCollator* self, const char* left_data, size_t left_len, const char* right_data, size_t right_len);
ICU4XOrdering ICU4XCollator_compare_utf16(const ICU4XCollator* self, const uint16_t* left_data, size_t left_len, const uint16_t* right_data, size_t right_len);
void ICU4XCollator_destroy(ICU4XCollator* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XCollatorAlternateHandling_H
#define ICU4XCollatorAlternateHandling_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XCollatorAlternateHandling {
ICU4XCollatorAlternateHandling_Auto = 0,
ICU4XCollatorAlternateHandling_NonIgnorable = 1,
ICU4XCollatorAlternateHandling_Shifted = 2,
} ICU4XCollatorAlternateHandling;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorAlternateHandling_destroy(ICU4XCollatorAlternateHandling* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XCollatorBackwardSecondLevel_H
#define ICU4XCollatorBackwardSecondLevel_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XCollatorBackwardSecondLevel {
ICU4XCollatorBackwardSecondLevel_Auto = 0,
ICU4XCollatorBackwardSecondLevel_Off = 1,
ICU4XCollatorBackwardSecondLevel_On = 2,
} ICU4XCollatorBackwardSecondLevel;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorBackwardSecondLevel_destroy(ICU4XCollatorBackwardSecondLevel* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,33 @@
#ifndef ICU4XCollatorCaseFirst_H
#define ICU4XCollatorCaseFirst_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XCollatorCaseFirst {
ICU4XCollatorCaseFirst_Auto = 0,
ICU4XCollatorCaseFirst_Off = 1,
ICU4XCollatorCaseFirst_LowerFirst = 2,
ICU4XCollatorCaseFirst_UpperFirst = 3,
} ICU4XCollatorCaseFirst;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorCaseFirst_destroy(ICU4XCollatorCaseFirst* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XCollatorCaseLevel_H
#define ICU4XCollatorCaseLevel_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XCollatorCaseLevel {
ICU4XCollatorCaseLevel_Auto = 0,
ICU4XCollatorCaseLevel_Off = 1,
ICU4XCollatorCaseLevel_On = 2,
} ICU4XCollatorCaseLevel;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorCaseLevel_destroy(ICU4XCollatorCaseLevel* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,34 @@
#ifndef ICU4XCollatorMaxVariable_H
#define ICU4XCollatorMaxVariable_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XCollatorMaxVariable {
ICU4XCollatorMaxVariable_Auto = 0,
ICU4XCollatorMaxVariable_Space = 1,
ICU4XCollatorMaxVariable_Punctuation = 2,
ICU4XCollatorMaxVariable_Symbol = 3,
ICU4XCollatorMaxVariable_Currency = 4,
} ICU4XCollatorMaxVariable;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorMaxVariable_destroy(ICU4XCollatorMaxVariable* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XCollatorNumeric_H
#define ICU4XCollatorNumeric_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XCollatorNumeric {
ICU4XCollatorNumeric_Auto = 0,
ICU4XCollatorNumeric_Off = 1,
ICU4XCollatorNumeric_On = 2,
} ICU4XCollatorNumeric;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorNumeric_destroy(ICU4XCollatorNumeric* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,50 @@
#ifndef ICU4XCollatorOptionsV1_H
#define ICU4XCollatorOptionsV1_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#include "ICU4XCollatorStrength.h"
#include "ICU4XCollatorAlternateHandling.h"
#include "ICU4XCollatorCaseFirst.h"
#include "ICU4XCollatorMaxVariable.h"
#include "ICU4XCollatorCaseLevel.h"
#include "ICU4XCollatorNumeric.h"
#include "ICU4XCollatorBackwardSecondLevel.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCollatorOptionsV1 {
ICU4XCollatorStrength strength;
ICU4XCollatorAlternateHandling alternate_handling;
ICU4XCollatorCaseFirst case_first;
ICU4XCollatorMaxVariable max_variable;
ICU4XCollatorCaseLevel case_level;
ICU4XCollatorNumeric numeric;
ICU4XCollatorBackwardSecondLevel backward_second_level;
} ICU4XCollatorOptionsV1;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XCollatorStrength.h"
#include "ICU4XCollatorAlternateHandling.h"
#include "ICU4XCollatorCaseFirst.h"
#include "ICU4XCollatorMaxVariable.h"
#include "ICU4XCollatorCaseLevel.h"
#include "ICU4XCollatorNumeric.h"
#include "ICU4XCollatorBackwardSecondLevel.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorOptionsV1_destroy(ICU4XCollatorOptionsV1* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,35 @@
#ifndef ICU4XCollatorStrength_H
#define ICU4XCollatorStrength_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XCollatorStrength {
ICU4XCollatorStrength_Auto = 0,
ICU4XCollatorStrength_Primary = 1,
ICU4XCollatorStrength_Secondary = 2,
ICU4XCollatorStrength_Tertiary = 3,
ICU4XCollatorStrength_Quaternary = 4,
ICU4XCollatorStrength_Identical = 5,
} ICU4XCollatorStrength;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XCollatorStrength_destroy(ICU4XCollatorStrength* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,38 @@
#ifndef ICU4XComposingNormalizer_H
#define ICU4XComposingNormalizer_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XComposingNormalizer ICU4XComposingNormalizer;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XComposingNormalizer_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XComposingNormalizer_ICU4XError ICU4XComposingNormalizer_create_nfc(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XComposingNormalizer_ICU4XError ICU4XComposingNormalizer_create_nfkc(const ICU4XDataProvider* provider);
diplomat_result_void_ICU4XError ICU4XComposingNormalizer_normalize(const ICU4XComposingNormalizer* self, const char* s_data, size_t s_len, DiplomatWriteable* write);
bool ICU4XComposingNormalizer_is_normalized(const ICU4XComposingNormalizer* self, const char* s_data, size_t s_len);
void ICU4XComposingNormalizer_destroy(ICU4XComposingNormalizer* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,84 @@
#ifndef ICU4XCustomTimeZone_H
#define ICU4XCustomTimeZone_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XCustomTimeZone ICU4XCustomTimeZone;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_box_ICU4XCustomTimeZone_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#include "diplomat_result_int32_t_ICU4XError.h"
#include "diplomat_result_bool_ICU4XError.h"
#include "ICU4XIanaToBcp47Mapper.h"
#include "ICU4XMetazoneCalculator.h"
#include "ICU4XIsoDateTime.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XCustomTimeZone_ICU4XError ICU4XCustomTimeZone_create_from_string(const char* s_data, size_t s_len);
ICU4XCustomTimeZone* ICU4XCustomTimeZone_create_empty();
ICU4XCustomTimeZone* ICU4XCustomTimeZone_create_utc();
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_gmt_offset_seconds(ICU4XCustomTimeZone* self, int32_t offset_seconds);
void ICU4XCustomTimeZone_clear_gmt_offset(ICU4XCustomTimeZone* self);
diplomat_result_int32_t_ICU4XError ICU4XCustomTimeZone_gmt_offset_seconds(const ICU4XCustomTimeZone* self);
diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_gmt_offset_positive(const ICU4XCustomTimeZone* self);
diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_gmt_offset_zero(const ICU4XCustomTimeZone* self);
diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_gmt_offset_has_minutes(const ICU4XCustomTimeZone* self);
diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_gmt_offset_has_seconds(const ICU4XCustomTimeZone* self);
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_time_zone_id(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len);
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_iana_time_zone_id(ICU4XCustomTimeZone* self, const ICU4XIanaToBcp47Mapper* mapper, const char* id_data, size_t id_len);
void ICU4XCustomTimeZone_clear_time_zone_id(ICU4XCustomTimeZone* self);
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_time_zone_id(const ICU4XCustomTimeZone* self, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_metazone_id(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len);
void ICU4XCustomTimeZone_clear_metazone_id(ICU4XCustomTimeZone* self);
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_metazone_id(const ICU4XCustomTimeZone* self, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_try_set_zone_variant(ICU4XCustomTimeZone* self, const char* id_data, size_t id_len);
void ICU4XCustomTimeZone_clear_zone_variant(ICU4XCustomTimeZone* self);
diplomat_result_void_ICU4XError ICU4XCustomTimeZone_zone_variant(const ICU4XCustomTimeZone* self, DiplomatWriteable* write);
void ICU4XCustomTimeZone_set_standard_time(ICU4XCustomTimeZone* self);
void ICU4XCustomTimeZone_set_daylight_time(ICU4XCustomTimeZone* self);
diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_standard_time(const ICU4XCustomTimeZone* self);
diplomat_result_bool_ICU4XError ICU4XCustomTimeZone_is_daylight_time(const ICU4XCustomTimeZone* self);
void ICU4XCustomTimeZone_maybe_calculate_metazone(ICU4XCustomTimeZone* self, const ICU4XMetazoneCalculator* metazone_calculator, const ICU4XIsoDateTime* local_datetime);
void ICU4XCustomTimeZone_destroy(ICU4XCustomTimeZone* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,48 @@
#ifndef ICU4XDataProvider_H
#define ICU4XDataProvider_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDataProvider ICU4XDataProvider;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_box_ICU4XDataProvider_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#include "ICU4XLocaleFallbacker.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
ICU4XDataProvider* ICU4XDataProvider_create_compiled();
diplomat_result_box_ICU4XDataProvider_ICU4XError ICU4XDataProvider_create_fs(const char* path_data, size_t path_len);
ICU4XDataProvider* ICU4XDataProvider_create_test();
diplomat_result_box_ICU4XDataProvider_ICU4XError ICU4XDataProvider_create_from_byte_slice(const uint8_t* blob_data, size_t blob_len);
ICU4XDataProvider* ICU4XDataProvider_create_empty();
diplomat_result_void_ICU4XError ICU4XDataProvider_fork_by_key(ICU4XDataProvider* self, ICU4XDataProvider* other);
diplomat_result_void_ICU4XError ICU4XDataProvider_fork_by_locale(ICU4XDataProvider* self, ICU4XDataProvider* other);
diplomat_result_void_ICU4XError ICU4XDataProvider_enable_locale_fallback(ICU4XDataProvider* self);
diplomat_result_void_ICU4XError ICU4XDataProvider_enable_locale_fallback_with(ICU4XDataProvider* self, const ICU4XLocaleFallbacker* fallbacker);
void ICU4XDataProvider_destroy(ICU4XDataProvider* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,30 @@
#ifndef ICU4XDataStruct_H
#define ICU4XDataStruct_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDataStruct ICU4XDataStruct;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_box_ICU4XDataStruct_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XDataStruct_ICU4XError ICU4XDataStruct_create_decimal_symbols_v1(const char* plus_sign_prefix_data, size_t plus_sign_prefix_len, const char* plus_sign_suffix_data, size_t plus_sign_suffix_len, const char* minus_sign_prefix_data, size_t minus_sign_prefix_len, const char* minus_sign_suffix_data, size_t minus_sign_suffix_len, const char* decimal_separator_data, size_t decimal_separator_len, const char* grouping_separator_data, size_t grouping_separator_len, uint8_t primary_group_size, uint8_t secondary_group_size, uint8_t min_group_size, const char32_t* digits_data, size_t digits_len);
void ICU4XDataStruct_destroy(ICU4XDataStruct* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,66 @@
#ifndef ICU4XDate_H
#define ICU4XDate_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDate ICU4XDate;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XCalendar.h"
#include "diplomat_result_box_ICU4XDate_ICU4XError.h"
#include "ICU4XIsoDate.h"
#include "ICU4XIsoWeekday.h"
#include "ICU4XWeekCalculator.h"
#include "diplomat_result_ICU4XWeekOf_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XDate_ICU4XError ICU4XDate_create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, const ICU4XCalendar* calendar);
diplomat_result_box_ICU4XDate_ICU4XError ICU4XDate_create_from_codes_in_calendar(const char* era_code_data, size_t era_code_len, int32_t year, const char* month_code_data, size_t month_code_len, uint8_t day, const ICU4XCalendar* calendar);
ICU4XDate* ICU4XDate_to_calendar(const ICU4XDate* self, const ICU4XCalendar* calendar);
ICU4XIsoDate* ICU4XDate_to_iso(const ICU4XDate* self);
uint32_t ICU4XDate_day_of_month(const ICU4XDate* self);
ICU4XIsoWeekday ICU4XDate_day_of_week(const ICU4XDate* self);
uint32_t ICU4XDate_week_of_month(const ICU4XDate* self, ICU4XIsoWeekday first_weekday);
diplomat_result_ICU4XWeekOf_ICU4XError ICU4XDate_week_of_year(const ICU4XDate* self, const ICU4XWeekCalculator* calculator);
uint32_t ICU4XDate_ordinal_month(const ICU4XDate* self);
diplomat_result_void_ICU4XError ICU4XDate_month_code(const ICU4XDate* self, DiplomatWriteable* write);
int32_t ICU4XDate_year_in_era(const ICU4XDate* self);
diplomat_result_void_ICU4XError ICU4XDate_era(const ICU4XDate* self, DiplomatWriteable* write);
uint8_t ICU4XDate_months_in_year(const ICU4XDate* self);
uint8_t ICU4XDate_days_in_month(const ICU4XDate* self);
uint16_t ICU4XDate_days_in_year(const ICU4XDate* self);
ICU4XCalendar* ICU4XDate_calendar(const ICU4XDate* self);
void ICU4XDate_destroy(ICU4XDate* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,46 @@
#ifndef ICU4XDateFormatter_H
#define ICU4XDateFormatter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDateFormatter ICU4XDateFormatter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XDateLength.h"
#include "diplomat_result_box_ICU4XDateFormatter_ICU4XError.h"
#include "ICU4XDate.h"
#include "diplomat_result_void_ICU4XError.h"
#include "ICU4XIsoDate.h"
#include "ICU4XDateTime.h"
#include "ICU4XIsoDateTime.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XDateFormatter_ICU4XError ICU4XDateFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length);
diplomat_result_void_ICU4XError ICU4XDateFormatter_format_date(const ICU4XDateFormatter* self, const ICU4XDate* value, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XDateFormatter_format_iso_date(const ICU4XDateFormatter* self, const ICU4XIsoDate* value, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XDateFormatter_format_datetime(const ICU4XDateFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XDateFormatter_format_iso_datetime(const ICU4XDateFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write);
void ICU4XDateFormatter_destroy(ICU4XDateFormatter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,33 @@
#ifndef ICU4XDateLength_H
#define ICU4XDateLength_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XDateLength {
ICU4XDateLength_Full = 0,
ICU4XDateLength_Long = 1,
ICU4XDateLength_Medium = 2,
ICU4XDateLength_Short = 3,
} ICU4XDateLength;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XDateLength_destroy(ICU4XDateLength* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,82 @@
#ifndef ICU4XDateTime_H
#define ICU4XDateTime_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDateTime ICU4XDateTime;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XCalendar.h"
#include "diplomat_result_box_ICU4XDateTime_ICU4XError.h"
#include "ICU4XDate.h"
#include "ICU4XTime.h"
#include "ICU4XIsoDateTime.h"
#include "ICU4XIsoWeekday.h"
#include "ICU4XWeekCalculator.h"
#include "diplomat_result_ICU4XWeekOf_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XDateTime_ICU4XError ICU4XDateTime_create_from_iso_in_calendar(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar* calendar);
diplomat_result_box_ICU4XDateTime_ICU4XError ICU4XDateTime_create_from_codes_in_calendar(const char* era_code_data, size_t era_code_len, int32_t year, const char* month_code_data, size_t month_code_len, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond, const ICU4XCalendar* calendar);
ICU4XDateTime* ICU4XDateTime_create_from_date_and_time(const ICU4XDate* date, const ICU4XTime* time);
ICU4XDate* ICU4XDateTime_date(const ICU4XDateTime* self);
ICU4XTime* ICU4XDateTime_time(const ICU4XDateTime* self);
ICU4XIsoDateTime* ICU4XDateTime_to_iso(const ICU4XDateTime* self);
ICU4XDateTime* ICU4XDateTime_to_calendar(const ICU4XDateTime* self, const ICU4XCalendar* calendar);
uint8_t ICU4XDateTime_hour(const ICU4XDateTime* self);
uint8_t ICU4XDateTime_minute(const ICU4XDateTime* self);
uint8_t ICU4XDateTime_second(const ICU4XDateTime* self);
uint32_t ICU4XDateTime_nanosecond(const ICU4XDateTime* self);
uint32_t ICU4XDateTime_day_of_month(const ICU4XDateTime* self);
ICU4XIsoWeekday ICU4XDateTime_day_of_week(const ICU4XDateTime* self);
uint32_t ICU4XDateTime_week_of_month(const ICU4XDateTime* self, ICU4XIsoWeekday first_weekday);
diplomat_result_ICU4XWeekOf_ICU4XError ICU4XDateTime_week_of_year(const ICU4XDateTime* self, const ICU4XWeekCalculator* calculator);
uint32_t ICU4XDateTime_ordinal_month(const ICU4XDateTime* self);
diplomat_result_void_ICU4XError ICU4XDateTime_month_code(const ICU4XDateTime* self, DiplomatWriteable* write);
int32_t ICU4XDateTime_year_in_era(const ICU4XDateTime* self);
diplomat_result_void_ICU4XError ICU4XDateTime_era(const ICU4XDateTime* self, DiplomatWriteable* write);
uint8_t ICU4XDateTime_months_in_year(const ICU4XDateTime* self);
uint8_t ICU4XDateTime_days_in_month(const ICU4XDateTime* self);
uint16_t ICU4XDateTime_days_in_year(const ICU4XDateTime* self);
ICU4XCalendar* ICU4XDateTime_calendar(const ICU4XDateTime* self);
void ICU4XDateTime_destroy(ICU4XDateTime* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,41 @@
#ifndef ICU4XDateTimeFormatter_H
#define ICU4XDateTimeFormatter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDateTimeFormatter ICU4XDateTimeFormatter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XDateLength.h"
#include "ICU4XTimeLength.h"
#include "diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError.h"
#include "ICU4XDateTime.h"
#include "diplomat_result_void_ICU4XError.h"
#include "ICU4XIsoDateTime.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XDateTimeFormatter_ICU4XError ICU4XDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length);
diplomat_result_void_ICU4XError ICU4XDateTimeFormatter_format_datetime(const ICU4XDateTimeFormatter* self, const ICU4XDateTime* value, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XDateTimeFormatter_format_iso_datetime(const ICU4XDateTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write);
void ICU4XDateTimeFormatter_destroy(ICU4XDateTimeFormatter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,31 @@
#ifndef ICU4XDecomposed_H
#define ICU4XDecomposed_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDecomposed {
char32_t first;
char32_t second;
} ICU4XDecomposed;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XDecomposed_destroy(ICU4XDecomposed* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,38 @@
#ifndef ICU4XDecomposingNormalizer_H
#define ICU4XDecomposingNormalizer_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDecomposingNormalizer ICU4XDecomposingNormalizer;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError ICU4XDecomposingNormalizer_create_nfd(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XDecomposingNormalizer_ICU4XError ICU4XDecomposingNormalizer_create_nfkd(const ICU4XDataProvider* provider);
diplomat_result_void_ICU4XError ICU4XDecomposingNormalizer_normalize(const ICU4XDecomposingNormalizer* self, const char* s_data, size_t s_len, DiplomatWriteable* write);
bool ICU4XDecomposingNormalizer_is_normalized(const ICU4XDecomposingNormalizer* self, const char* s_data, size_t s_len);
void ICU4XDecomposingNormalizer_destroy(ICU4XDecomposingNormalizer* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,31 @@
#ifndef ICU4XDisplayNamesFallback_H
#define ICU4XDisplayNamesFallback_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XDisplayNamesFallback {
ICU4XDisplayNamesFallback_Code = 0,
ICU4XDisplayNamesFallback_None = 1,
} ICU4XDisplayNamesFallback;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XDisplayNamesFallback_destroy(ICU4XDisplayNamesFallback* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,38 @@
#ifndef ICU4XDisplayNamesOptionsV1_H
#define ICU4XDisplayNamesOptionsV1_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#include "ICU4XDisplayNamesStyle.h"
#include "ICU4XDisplayNamesFallback.h"
#include "ICU4XLanguageDisplay.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XDisplayNamesOptionsV1 {
ICU4XDisplayNamesStyle style;
ICU4XDisplayNamesFallback fallback;
ICU4XLanguageDisplay language_display;
} ICU4XDisplayNamesOptionsV1;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDisplayNamesStyle.h"
#include "ICU4XDisplayNamesFallback.h"
#include "ICU4XLanguageDisplay.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XDisplayNamesOptionsV1_destroy(ICU4XDisplayNamesOptionsV1* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,34 @@
#ifndef ICU4XDisplayNamesStyle_H
#define ICU4XDisplayNamesStyle_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XDisplayNamesStyle {
ICU4XDisplayNamesStyle_Auto = 0,
ICU4XDisplayNamesStyle_Narrow = 1,
ICU4XDisplayNamesStyle_Short = 2,
ICU4XDisplayNamesStyle_Long = 3,
ICU4XDisplayNamesStyle_Menu = 4,
} ICU4XDisplayNamesStyle;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XDisplayNamesStyle_destroy(ICU4XDisplayNamesStyle* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,84 @@
#ifndef ICU4XError_H
#define ICU4XError_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XError {
ICU4XError_UnknownError = 0,
ICU4XError_WriteableError = 1,
ICU4XError_OutOfBoundsError = 2,
ICU4XError_DataMissingDataKeyError = 256,
ICU4XError_DataMissingVariantError = 257,
ICU4XError_DataMissingLocaleError = 258,
ICU4XError_DataNeedsVariantError = 259,
ICU4XError_DataNeedsLocaleError = 260,
ICU4XError_DataExtraneousLocaleError = 261,
ICU4XError_DataFilteredResourceError = 262,
ICU4XError_DataMismatchedTypeError = 263,
ICU4XError_DataMissingPayloadError = 264,
ICU4XError_DataInvalidStateError = 265,
ICU4XError_DataCustomError = 266,
ICU4XError_DataIoError = 267,
ICU4XError_DataUnavailableBufferFormatError = 268,
ICU4XError_DataMismatchedAnyBufferError = 269,
ICU4XError_LocaleUndefinedSubtagError = 512,
ICU4XError_LocaleParserLanguageError = 513,
ICU4XError_LocaleParserSubtagError = 514,
ICU4XError_LocaleParserExtensionError = 515,
ICU4XError_DataStructValidityError = 768,
ICU4XError_PropertyUnknownScriptIdError = 1024,
ICU4XError_PropertyUnknownGeneralCategoryGroupError = 1025,
ICU4XError_PropertyUnexpectedPropertyNameError = 1026,
ICU4XError_FixedDecimalLimitError = 1280,
ICU4XError_FixedDecimalSyntaxError = 1281,
ICU4XError_PluralsParserError = 1536,
ICU4XError_CalendarParseError = 1792,
ICU4XError_CalendarOverflowError = 1793,
ICU4XError_CalendarUnderflowError = 1794,
ICU4XError_CalendarOutOfRangeError = 1795,
ICU4XError_CalendarUnknownEraError = 1796,
ICU4XError_CalendarUnknownMonthCodeError = 1797,
ICU4XError_CalendarMissingInputError = 1798,
ICU4XError_CalendarUnknownKindError = 1799,
ICU4XError_CalendarMissingError = 1800,
ICU4XError_DateTimePatternError = 2048,
ICU4XError_DateTimeMissingInputFieldError = 2049,
ICU4XError_DateTimeSkeletonError = 2050,
ICU4XError_DateTimeUnsupportedFieldError = 2051,
ICU4XError_DateTimeUnsupportedOptionsError = 2052,
ICU4XError_DateTimeMissingWeekdaySymbolError = 2053,
ICU4XError_DateTimeMissingMonthSymbolError = 2054,
ICU4XError_DateTimeFixedDecimalError = 2055,
ICU4XError_DateTimeMismatchedCalendarError = 2056,
ICU4XError_TinyStrTooLargeError = 2304,
ICU4XError_TinyStrContainsNullError = 2305,
ICU4XError_TinyStrNonAsciiError = 2306,
ICU4XError_TimeZoneOffsetOutOfBoundsError = 2560,
ICU4XError_TimeZoneInvalidOffsetError = 2561,
ICU4XError_TimeZoneMissingInputError = 2562,
ICU4XError_TimeZoneInvalidIdError = 2563,
ICU4XError_NormalizerFutureExtensionError = 2816,
ICU4XError_NormalizerValidationError = 2817,
} ICU4XError;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XError_destroy(ICU4XError* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,101 @@
#ifndef ICU4XFixedDecimal_H
#define ICU4XFixedDecimal_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XFixedDecimal ICU4XFixedDecimal;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_box_ICU4XFixedDecimal_ICU4XError.h"
#include "ICU4XFixedDecimalSign.h"
#include "ICU4XFixedDecimalSignDisplay.h"
#include "diplomat_result_void_void.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_i32(int32_t v);
ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_u32(uint32_t v);
ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_i64(int64_t v);
ICU4XFixedDecimal* ICU4XFixedDecimal_create_from_u64(uint64_t v);
diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_integer_precision(double f);
diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_lower_magnitude(double f, int16_t magnitude);
diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_significant_digits(double f, uint8_t digits);
diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_f64_with_floating_precision(double f);
diplomat_result_box_ICU4XFixedDecimal_ICU4XError ICU4XFixedDecimal_create_from_string(const char* v_data, size_t v_len);
uint8_t ICU4XFixedDecimal_digit_at(const ICU4XFixedDecimal* self, int16_t magnitude);
int16_t ICU4XFixedDecimal_magnitude_start(const ICU4XFixedDecimal* self);
int16_t ICU4XFixedDecimal_magnitude_end(const ICU4XFixedDecimal* self);
int16_t ICU4XFixedDecimal_nonzero_magnitude_start(const ICU4XFixedDecimal* self);
int16_t ICU4XFixedDecimal_nonzero_magnitude_end(const ICU4XFixedDecimal* self);
bool ICU4XFixedDecimal_is_zero(const ICU4XFixedDecimal* self);
void ICU4XFixedDecimal_multiply_pow10(ICU4XFixedDecimal* self, int16_t power);
ICU4XFixedDecimalSign ICU4XFixedDecimal_sign(const ICU4XFixedDecimal* self);
void ICU4XFixedDecimal_set_sign(ICU4XFixedDecimal* self, ICU4XFixedDecimalSign sign);
void ICU4XFixedDecimal_apply_sign_display(ICU4XFixedDecimal* self, ICU4XFixedDecimalSignDisplay sign_display);
void ICU4XFixedDecimal_trim_start(ICU4XFixedDecimal* self);
void ICU4XFixedDecimal_trim_end(ICU4XFixedDecimal* self);
void ICU4XFixedDecimal_pad_start(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_pad_end(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_set_max_position(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_trunc(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_half_trunc(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_expand(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_half_expand(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_ceil(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_half_ceil(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_floor(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_half_floor(ICU4XFixedDecimal* self, int16_t position);
void ICU4XFixedDecimal_half_even(ICU4XFixedDecimal* self, int16_t position);
diplomat_result_void_void ICU4XFixedDecimal_concatenate_end(ICU4XFixedDecimal* self, ICU4XFixedDecimal* other);
void ICU4XFixedDecimal_to_string(const ICU4XFixedDecimal* self, DiplomatWriteable* to);
void ICU4XFixedDecimal_destroy(ICU4XFixedDecimal* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,40 @@
#ifndef ICU4XFixedDecimalFormatter_H
#define ICU4XFixedDecimalFormatter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XFixedDecimalFormatter ICU4XFixedDecimalFormatter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XFixedDecimalGroupingStrategy.h"
#include "diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError.h"
#include "ICU4XDataStruct.h"
#include "ICU4XFixedDecimal.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError ICU4XFixedDecimalFormatter_create_with_grouping_strategy(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XFixedDecimalGroupingStrategy grouping_strategy);
diplomat_result_box_ICU4XFixedDecimalFormatter_ICU4XError ICU4XFixedDecimalFormatter_create_with_decimal_symbols_v1(const ICU4XDataStruct* data_struct, ICU4XFixedDecimalGroupingStrategy grouping_strategy);
diplomat_result_void_ICU4XError ICU4XFixedDecimalFormatter_format(const ICU4XFixedDecimalFormatter* self, const ICU4XFixedDecimal* value, DiplomatWriteable* write);
void ICU4XFixedDecimalFormatter_destroy(ICU4XFixedDecimalFormatter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,33 @@
#ifndef ICU4XFixedDecimalGroupingStrategy_H
#define ICU4XFixedDecimalGroupingStrategy_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XFixedDecimalGroupingStrategy {
ICU4XFixedDecimalGroupingStrategy_Auto = 0,
ICU4XFixedDecimalGroupingStrategy_Never = 1,
ICU4XFixedDecimalGroupingStrategy_Always = 2,
ICU4XFixedDecimalGroupingStrategy_Min2 = 3,
} ICU4XFixedDecimalGroupingStrategy;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XFixedDecimalGroupingStrategy_destroy(ICU4XFixedDecimalGroupingStrategy* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XFixedDecimalSign_H
#define ICU4XFixedDecimalSign_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XFixedDecimalSign {
ICU4XFixedDecimalSign_None = 0,
ICU4XFixedDecimalSign_Negative = 1,
ICU4XFixedDecimalSign_Positive = 2,
} ICU4XFixedDecimalSign;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XFixedDecimalSign_destroy(ICU4XFixedDecimalSign* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,34 @@
#ifndef ICU4XFixedDecimalSignDisplay_H
#define ICU4XFixedDecimalSignDisplay_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XFixedDecimalSignDisplay {
ICU4XFixedDecimalSignDisplay_Auto = 0,
ICU4XFixedDecimalSignDisplay_Never = 1,
ICU4XFixedDecimalSignDisplay_Always = 2,
ICU4XFixedDecimalSignDisplay_ExceptZero = 3,
ICU4XFixedDecimalSignDisplay_Negative = 4,
} ICU4XFixedDecimalSignDisplay;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XFixedDecimalSignDisplay_destroy(ICU4XFixedDecimalSignDisplay* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,35 @@
#ifndef ICU4XGeneralCategoryNameToMaskMapper_H
#define ICU4XGeneralCategoryNameToMaskMapper_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGeneralCategoryNameToMaskMapper ICU4XGeneralCategoryNameToMaskMapper;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
uint32_t ICU4XGeneralCategoryNameToMaskMapper_get_strict(const ICU4XGeneralCategoryNameToMaskMapper* self, const char* name_data, size_t name_len);
uint32_t ICU4XGeneralCategoryNameToMaskMapper_get_loose(const ICU4XGeneralCategoryNameToMaskMapper* self, const char* name_data, size_t name_len);
diplomat_result_box_ICU4XGeneralCategoryNameToMaskMapper_ICU4XError ICU4XGeneralCategoryNameToMaskMapper_load(const ICU4XDataProvider* provider);
void ICU4XGeneralCategoryNameToMaskMapper_destroy(ICU4XGeneralCategoryNameToMaskMapper* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,29 @@
#ifndef ICU4XGraphemeClusterBreakIteratorLatin1_H
#define ICU4XGraphemeClusterBreakIteratorLatin1_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGraphemeClusterBreakIteratorLatin1 ICU4XGraphemeClusterBreakIteratorLatin1;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
int32_t ICU4XGraphemeClusterBreakIteratorLatin1_next(ICU4XGraphemeClusterBreakIteratorLatin1* self);
void ICU4XGraphemeClusterBreakIteratorLatin1_destroy(ICU4XGraphemeClusterBreakIteratorLatin1* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,29 @@
#ifndef ICU4XGraphemeClusterBreakIteratorUtf16_H
#define ICU4XGraphemeClusterBreakIteratorUtf16_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGraphemeClusterBreakIteratorUtf16 ICU4XGraphemeClusterBreakIteratorUtf16;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
int32_t ICU4XGraphemeClusterBreakIteratorUtf16_next(ICU4XGraphemeClusterBreakIteratorUtf16* self);
void ICU4XGraphemeClusterBreakIteratorUtf16_destroy(ICU4XGraphemeClusterBreakIteratorUtf16* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,29 @@
#ifndef ICU4XGraphemeClusterBreakIteratorUtf8_H
#define ICU4XGraphemeClusterBreakIteratorUtf8_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGraphemeClusterBreakIteratorUtf8 ICU4XGraphemeClusterBreakIteratorUtf8;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
int32_t ICU4XGraphemeClusterBreakIteratorUtf8_next(ICU4XGraphemeClusterBreakIteratorUtf8* self);
void ICU4XGraphemeClusterBreakIteratorUtf8_destroy(ICU4XGraphemeClusterBreakIteratorUtf8* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,40 @@
#ifndef ICU4XGraphemeClusterSegmenter_H
#define ICU4XGraphemeClusterSegmenter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGraphemeClusterSegmenter ICU4XGraphemeClusterSegmenter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError.h"
#include "ICU4XGraphemeClusterBreakIteratorUtf8.h"
#include "ICU4XGraphemeClusterBreakIteratorUtf16.h"
#include "ICU4XGraphemeClusterBreakIteratorLatin1.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XGraphemeClusterSegmenter_ICU4XError ICU4XGraphemeClusterSegmenter_create(const ICU4XDataProvider* provider);
ICU4XGraphemeClusterBreakIteratorUtf8* ICU4XGraphemeClusterSegmenter_segment_utf8(const ICU4XGraphemeClusterSegmenter* self, const char* input_data, size_t input_len);
ICU4XGraphemeClusterBreakIteratorUtf16* ICU4XGraphemeClusterSegmenter_segment_utf16(const ICU4XGraphemeClusterSegmenter* self, const uint16_t* input_data, size_t input_len);
ICU4XGraphemeClusterBreakIteratorLatin1* ICU4XGraphemeClusterSegmenter_segment_latin1(const ICU4XGraphemeClusterSegmenter* self, const uint8_t* input_data, size_t input_len);
void ICU4XGraphemeClusterSegmenter_destroy(ICU4XGraphemeClusterSegmenter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,40 @@
#ifndef ICU4XGregorianDateFormatter_H
#define ICU4XGregorianDateFormatter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGregorianDateFormatter ICU4XGregorianDateFormatter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XDateLength.h"
#include "diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError.h"
#include "ICU4XIsoDate.h"
#include "diplomat_result_void_ICU4XError.h"
#include "ICU4XIsoDateTime.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XGregorianDateFormatter_ICU4XError ICU4XGregorianDateFormatter_create_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength length);
diplomat_result_void_ICU4XError ICU4XGregorianDateFormatter_format_iso_date(const ICU4XGregorianDateFormatter* self, const ICU4XIsoDate* value, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XGregorianDateFormatter_format_iso_datetime(const ICU4XGregorianDateFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write);
void ICU4XGregorianDateFormatter_destroy(ICU4XGregorianDateFormatter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,38 @@
#ifndef ICU4XGregorianDateTimeFormatter_H
#define ICU4XGregorianDateTimeFormatter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGregorianDateTimeFormatter ICU4XGregorianDateTimeFormatter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XDateLength.h"
#include "ICU4XTimeLength.h"
#include "diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError.h"
#include "ICU4XIsoDateTime.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XGregorianDateTimeFormatter_ICU4XError ICU4XGregorianDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length);
diplomat_result_void_ICU4XError ICU4XGregorianDateTimeFormatter_format_iso_datetime(const ICU4XGregorianDateTimeFormatter* self, const ICU4XIsoDateTime* value, DiplomatWriteable* write);
void ICU4XGregorianDateTimeFormatter_destroy(ICU4XGregorianDateTimeFormatter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,42 @@
#ifndef ICU4XGregorianZonedDateTimeFormatter_H
#define ICU4XGregorianZonedDateTimeFormatter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XGregorianZonedDateTimeFormatter ICU4XGregorianZonedDateTimeFormatter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XDateLength.h"
#include "ICU4XTimeLength.h"
#include "diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError.h"
#include "ICU4XIsoTimeZoneOptions.h"
#include "ICU4XIsoDateTime.h"
#include "ICU4XCustomTimeZone.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError ICU4XGregorianZonedDateTimeFormatter_create_with_lengths(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length);
diplomat_result_box_ICU4XGregorianZonedDateTimeFormatter_ICU4XError ICU4XGregorianZonedDateTimeFormatter_create_with_lengths_and_iso_8601_time_zone_fallback(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XDateLength date_length, ICU4XTimeLength time_length, ICU4XIsoTimeZoneOptions zone_options);
diplomat_result_void_ICU4XError ICU4XGregorianZonedDateTimeFormatter_format_iso_datetime_with_custom_time_zone(const ICU4XGregorianZonedDateTimeFormatter* self, const ICU4XIsoDateTime* datetime, const ICU4XCustomTimeZone* time_zone, DiplomatWriteable* write);
void ICU4XGregorianZonedDateTimeFormatter_destroy(ICU4XGregorianZonedDateTimeFormatter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,31 @@
#ifndef ICU4XIanaToBcp47Mapper_H
#define ICU4XIanaToBcp47Mapper_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XIanaToBcp47Mapper ICU4XIanaToBcp47Mapper;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XIanaToBcp47Mapper_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XIanaToBcp47Mapper_ICU4XError ICU4XIanaToBcp47Mapper_create(const ICU4XDataProvider* provider);
void ICU4XIanaToBcp47Mapper_destroy(ICU4XIanaToBcp47Mapper* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,61 @@
#ifndef ICU4XIsoDate_H
#define ICU4XIsoDate_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XIsoDate ICU4XIsoDate;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_box_ICU4XIsoDate_ICU4XError.h"
#include "ICU4XCalendar.h"
#include "ICU4XDate.h"
#include "ICU4XIsoWeekday.h"
#include "ICU4XWeekCalculator.h"
#include "diplomat_result_ICU4XWeekOf_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XIsoDate_ICU4XError ICU4XIsoDate_create(int32_t year, uint8_t month, uint8_t day);
ICU4XIsoDate* ICU4XIsoDate_create_for_unix_epoch();
ICU4XDate* ICU4XIsoDate_to_calendar(const ICU4XIsoDate* self, const ICU4XCalendar* calendar);
ICU4XDate* ICU4XIsoDate_to_any(const ICU4XIsoDate* self);
uint32_t ICU4XIsoDate_day_of_month(const ICU4XIsoDate* self);
ICU4XIsoWeekday ICU4XIsoDate_day_of_week(const ICU4XIsoDate* self);
uint32_t ICU4XIsoDate_week_of_month(const ICU4XIsoDate* self, ICU4XIsoWeekday first_weekday);
diplomat_result_ICU4XWeekOf_ICU4XError ICU4XIsoDate_week_of_year(const ICU4XIsoDate* self, const ICU4XWeekCalculator* calculator);
uint32_t ICU4XIsoDate_month(const ICU4XIsoDate* self);
int32_t ICU4XIsoDate_year(const ICU4XIsoDate* self);
bool ICU4XIsoDate_is_in_leap_year(const ICU4XIsoDate* self);
uint8_t ICU4XIsoDate_months_in_year(const ICU4XIsoDate* self);
uint8_t ICU4XIsoDate_days_in_month(const ICU4XIsoDate* self);
uint16_t ICU4XIsoDate_days_in_year(const ICU4XIsoDate* self);
void ICU4XIsoDate_destroy(ICU4XIsoDate* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,79 @@
#ifndef ICU4XIsoDateTime_H
#define ICU4XIsoDateTime_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XIsoDateTime ICU4XIsoDateTime;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_box_ICU4XIsoDateTime_ICU4XError.h"
#include "ICU4XIsoDate.h"
#include "ICU4XTime.h"
#include "ICU4XDateTime.h"
#include "ICU4XCalendar.h"
#include "ICU4XIsoWeekday.h"
#include "ICU4XWeekCalculator.h"
#include "diplomat_result_ICU4XWeekOf_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XIsoDateTime_ICU4XError ICU4XIsoDateTime_create(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, uint32_t nanosecond);
ICU4XIsoDateTime* ICU4XIsoDateTime_crate_from_date_and_time(const ICU4XIsoDate* date, const ICU4XTime* time);
ICU4XIsoDateTime* ICU4XIsoDateTime_create_from_minutes_since_local_unix_epoch(int32_t minutes);
ICU4XIsoDate* ICU4XIsoDateTime_date(const ICU4XIsoDateTime* self);
ICU4XTime* ICU4XIsoDateTime_time(const ICU4XIsoDateTime* self);
ICU4XDateTime* ICU4XIsoDateTime_to_any(const ICU4XIsoDateTime* self);
int32_t ICU4XIsoDateTime_minutes_since_local_unix_epoch(const ICU4XIsoDateTime* self);
ICU4XDateTime* ICU4XIsoDateTime_to_calendar(const ICU4XIsoDateTime* self, const ICU4XCalendar* calendar);
uint8_t ICU4XIsoDateTime_hour(const ICU4XIsoDateTime* self);
uint8_t ICU4XIsoDateTime_minute(const ICU4XIsoDateTime* self);
uint8_t ICU4XIsoDateTime_second(const ICU4XIsoDateTime* self);
uint32_t ICU4XIsoDateTime_nanosecond(const ICU4XIsoDateTime* self);
uint32_t ICU4XIsoDateTime_day_of_month(const ICU4XIsoDateTime* self);
ICU4XIsoWeekday ICU4XIsoDateTime_day_of_week(const ICU4XIsoDateTime* self);
uint32_t ICU4XIsoDateTime_week_of_month(const ICU4XIsoDateTime* self, ICU4XIsoWeekday first_weekday);
diplomat_result_ICU4XWeekOf_ICU4XError ICU4XIsoDateTime_week_of_year(const ICU4XIsoDateTime* self, const ICU4XWeekCalculator* calculator);
uint32_t ICU4XIsoDateTime_month(const ICU4XIsoDateTime* self);
int32_t ICU4XIsoDateTime_year(const ICU4XIsoDateTime* self);
bool ICU4XIsoDateTime_is_in_leap_year(const ICU4XIsoDateTime* self);
uint8_t ICU4XIsoDateTime_months_in_year(const ICU4XIsoDateTime* self);
uint8_t ICU4XIsoDateTime_days_in_month(const ICU4XIsoDateTime* self);
uint16_t ICU4XIsoDateTime_days_in_year(const ICU4XIsoDateTime* self);
void ICU4XIsoDateTime_destroy(ICU4XIsoDateTime* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,33 @@
#ifndef ICU4XIsoTimeZoneFormat_H
#define ICU4XIsoTimeZoneFormat_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XIsoTimeZoneFormat {
ICU4XIsoTimeZoneFormat_Basic = 0,
ICU4XIsoTimeZoneFormat_Extended = 1,
ICU4XIsoTimeZoneFormat_UtcBasic = 2,
ICU4XIsoTimeZoneFormat_UtcExtended = 3,
} ICU4XIsoTimeZoneFormat;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XIsoTimeZoneFormat_destroy(ICU4XIsoTimeZoneFormat* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,31 @@
#ifndef ICU4XIsoTimeZoneMinuteDisplay_H
#define ICU4XIsoTimeZoneMinuteDisplay_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XIsoTimeZoneMinuteDisplay {
ICU4XIsoTimeZoneMinuteDisplay_Required = 0,
ICU4XIsoTimeZoneMinuteDisplay_Optional = 1,
} ICU4XIsoTimeZoneMinuteDisplay;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XIsoTimeZoneMinuteDisplay_destroy(ICU4XIsoTimeZoneMinuteDisplay* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,38 @@
#ifndef ICU4XIsoTimeZoneOptions_H
#define ICU4XIsoTimeZoneOptions_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#include "ICU4XIsoTimeZoneFormat.h"
#include "ICU4XIsoTimeZoneMinuteDisplay.h"
#include "ICU4XIsoTimeZoneSecondDisplay.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XIsoTimeZoneOptions {
ICU4XIsoTimeZoneFormat format;
ICU4XIsoTimeZoneMinuteDisplay minutes;
ICU4XIsoTimeZoneSecondDisplay seconds;
} ICU4XIsoTimeZoneOptions;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XIsoTimeZoneFormat.h"
#include "ICU4XIsoTimeZoneMinuteDisplay.h"
#include "ICU4XIsoTimeZoneSecondDisplay.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XIsoTimeZoneOptions_destroy(ICU4XIsoTimeZoneOptions* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,31 @@
#ifndef ICU4XIsoTimeZoneSecondDisplay_H
#define ICU4XIsoTimeZoneSecondDisplay_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XIsoTimeZoneSecondDisplay {
ICU4XIsoTimeZoneSecondDisplay_Optional = 0,
ICU4XIsoTimeZoneSecondDisplay_Never = 1,
} ICU4XIsoTimeZoneSecondDisplay;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XIsoTimeZoneSecondDisplay_destroy(ICU4XIsoTimeZoneSecondDisplay* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,36 @@
#ifndef ICU4XIsoWeekday_H
#define ICU4XIsoWeekday_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XIsoWeekday {
ICU4XIsoWeekday_Monday = 1,
ICU4XIsoWeekday_Tuesday = 2,
ICU4XIsoWeekday_Wednesday = 3,
ICU4XIsoWeekday_Thursday = 4,
ICU4XIsoWeekday_Friday = 5,
ICU4XIsoWeekday_Saturday = 6,
ICU4XIsoWeekday_Sunday = 7,
} ICU4XIsoWeekday;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XIsoWeekday_destroy(ICU4XIsoWeekday* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,31 @@
#ifndef ICU4XLanguageDisplay_H
#define ICU4XLanguageDisplay_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XLanguageDisplay {
ICU4XLanguageDisplay_Dialect = 0,
ICU4XLanguageDisplay_Standard = 1,
} ICU4XLanguageDisplay;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XLanguageDisplay_destroy(ICU4XLanguageDisplay* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XLeadingAdjustment_H
#define ICU4XLeadingAdjustment_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XLeadingAdjustment {
ICU4XLeadingAdjustment_Auto = 0,
ICU4XLeadingAdjustment_None = 1,
ICU4XLeadingAdjustment_ToCased = 2,
} ICU4XLeadingAdjustment;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XLeadingAdjustment_destroy(ICU4XLeadingAdjustment* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,29 @@
#ifndef ICU4XLineBreakIteratorLatin1_H
#define ICU4XLineBreakIteratorLatin1_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLineBreakIteratorLatin1 ICU4XLineBreakIteratorLatin1;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
int32_t ICU4XLineBreakIteratorLatin1_next(ICU4XLineBreakIteratorLatin1* self);
void ICU4XLineBreakIteratorLatin1_destroy(ICU4XLineBreakIteratorLatin1* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,29 @@
#ifndef ICU4XLineBreakIteratorUtf16_H
#define ICU4XLineBreakIteratorUtf16_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLineBreakIteratorUtf16 ICU4XLineBreakIteratorUtf16;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
int32_t ICU4XLineBreakIteratorUtf16_next(ICU4XLineBreakIteratorUtf16* self);
void ICU4XLineBreakIteratorUtf16_destroy(ICU4XLineBreakIteratorUtf16* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,29 @@
#ifndef ICU4XLineBreakIteratorUtf8_H
#define ICU4XLineBreakIteratorUtf8_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLineBreakIteratorUtf8 ICU4XLineBreakIteratorUtf8;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
int32_t ICU4XLineBreakIteratorUtf8_next(ICU4XLineBreakIteratorUtf8* self);
void ICU4XLineBreakIteratorUtf8_destroy(ICU4XLineBreakIteratorUtf8* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,36 @@
#ifndef ICU4XLineBreakOptionsV1_H
#define ICU4XLineBreakOptionsV1_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#include "ICU4XLineBreakStrictness.h"
#include "ICU4XLineBreakWordOption.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLineBreakOptionsV1 {
ICU4XLineBreakStrictness strictness;
ICU4XLineBreakWordOption word_option;
bool ja_zh;
} ICU4XLineBreakOptionsV1;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XLineBreakStrictness.h"
#include "ICU4XLineBreakWordOption.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XLineBreakOptionsV1_destroy(ICU4XLineBreakOptionsV1* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,33 @@
#ifndef ICU4XLineBreakStrictness_H
#define ICU4XLineBreakStrictness_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XLineBreakStrictness {
ICU4XLineBreakStrictness_Loose = 0,
ICU4XLineBreakStrictness_Normal = 1,
ICU4XLineBreakStrictness_Strict = 2,
ICU4XLineBreakStrictness_Anywhere = 3,
} ICU4XLineBreakStrictness;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XLineBreakStrictness_destroy(ICU4XLineBreakStrictness* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XLineBreakWordOption_H
#define ICU4XLineBreakWordOption_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XLineBreakWordOption {
ICU4XLineBreakWordOption_Normal = 0,
ICU4XLineBreakWordOption_BreakAll = 1,
ICU4XLineBreakWordOption_KeepAll = 2,
} ICU4XLineBreakWordOption;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XLineBreakWordOption_destroy(ICU4XLineBreakWordOption* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,51 @@
#ifndef ICU4XLineSegmenter_H
#define ICU4XLineSegmenter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLineSegmenter ICU4XLineSegmenter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XLineSegmenter_ICU4XError.h"
#include "ICU4XLineBreakOptionsV1.h"
#include "ICU4XLineBreakIteratorUtf8.h"
#include "ICU4XLineBreakIteratorUtf16.h"
#include "ICU4XLineBreakIteratorLatin1.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_auto(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_lstm(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_dictionary(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_auto_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options);
diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_lstm_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options);
diplomat_result_box_ICU4XLineSegmenter_ICU4XError ICU4XLineSegmenter_create_dictionary_with_options_v1(const ICU4XDataProvider* provider, ICU4XLineBreakOptionsV1 options);
ICU4XLineBreakIteratorUtf8* ICU4XLineSegmenter_segment_utf8(const ICU4XLineSegmenter* self, const char* input_data, size_t input_len);
ICU4XLineBreakIteratorUtf16* ICU4XLineSegmenter_segment_utf16(const ICU4XLineSegmenter* self, const uint16_t* input_data, size_t input_len);
ICU4XLineBreakIteratorLatin1* ICU4XLineSegmenter_segment_latin1(const ICU4XLineSegmenter* self, const uint8_t* input_data, size_t input_len);
void ICU4XLineSegmenter_destroy(ICU4XLineSegmenter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,35 @@
#ifndef ICU4XList_H
#define ICU4XList_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XList ICU4XList;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
ICU4XList* ICU4XList_create();
ICU4XList* ICU4XList_create_with_capacity(size_t capacity);
void ICU4XList_push(ICU4XList* self, const char* val_data, size_t val_len);
size_t ICU4XList_len(const ICU4XList* self);
void ICU4XList_destroy(ICU4XList* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,41 @@
#ifndef ICU4XListFormatter_H
#define ICU4XListFormatter_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XListFormatter ICU4XListFormatter;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "ICU4XLocale.h"
#include "ICU4XListLength.h"
#include "diplomat_result_box_ICU4XListFormatter_ICU4XError.h"
#include "ICU4XList.h"
#include "diplomat_result_void_ICU4XError.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_and_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length);
diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_or_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length);
diplomat_result_box_ICU4XListFormatter_ICU4XError ICU4XListFormatter_create_unit_with_length(const ICU4XDataProvider* provider, const ICU4XLocale* locale, ICU4XListLength length);
diplomat_result_void_ICU4XError ICU4XListFormatter_format(const ICU4XListFormatter* self, const ICU4XList* list, DiplomatWriteable* write);
void ICU4XListFormatter_destroy(ICU4XListFormatter* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XListLength_H
#define ICU4XListLength_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XListLength {
ICU4XListLength_Wide = 0,
ICU4XListLength_Short = 1,
ICU4XListLength_Narrow = 2,
} ICU4XListLength;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XListLength_destroy(ICU4XListLength* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,64 @@
#ifndef ICU4XLocale_H
#define ICU4XLocale_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLocale ICU4XLocale;
#ifdef __cplusplus
} // namespace capi
#endif
#include "diplomat_result_box_ICU4XLocale_ICU4XError.h"
#include "diplomat_result_void_ICU4XError.h"
#include "ICU4XOrdering.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XLocale_ICU4XError ICU4XLocale_create_from_string(const char* name_data, size_t name_len);
ICU4XLocale* ICU4XLocale_create_und();
ICU4XLocale* ICU4XLocale_clone(const ICU4XLocale* self);
diplomat_result_void_ICU4XError ICU4XLocale_basename(const ICU4XLocale* self, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XLocale_get_unicode_extension(const ICU4XLocale* self, const char* bytes_data, size_t bytes_len, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XLocale_language(const ICU4XLocale* self, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XLocale_set_language(ICU4XLocale* self, const char* bytes_data, size_t bytes_len);
diplomat_result_void_ICU4XError ICU4XLocale_region(const ICU4XLocale* self, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XLocale_set_region(ICU4XLocale* self, const char* bytes_data, size_t bytes_len);
diplomat_result_void_ICU4XError ICU4XLocale_script(const ICU4XLocale* self, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XLocale_set_script(ICU4XLocale* self, const char* bytes_data, size_t bytes_len);
diplomat_result_void_ICU4XError ICU4XLocale_canonicalize(const char* bytes_data, size_t bytes_len, DiplomatWriteable* write);
diplomat_result_void_ICU4XError ICU4XLocale_to_string(const ICU4XLocale* self, DiplomatWriteable* write);
bool ICU4XLocale_normalizing_eq(const ICU4XLocale* self, const char* other_data, size_t other_len);
ICU4XOrdering ICU4XLocale_strict_cmp(const ICU4XLocale* self, const char* other_data, size_t other_len);
ICU4XLocale* ICU4XLocale_create_en();
ICU4XLocale* ICU4XLocale_create_bn();
void ICU4XLocale_destroy(ICU4XLocale* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,37 @@
#ifndef ICU4XLocaleCanonicalizer_H
#define ICU4XLocaleCanonicalizer_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLocaleCanonicalizer ICU4XLocaleCanonicalizer;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError.h"
#include "ICU4XLocale.h"
#include "ICU4XTransformResult.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError ICU4XLocaleCanonicalizer_create(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XLocaleCanonicalizer_ICU4XError ICU4XLocaleCanonicalizer_create_extended(const ICU4XDataProvider* provider);
ICU4XTransformResult ICU4XLocaleCanonicalizer_canonicalize(const ICU4XLocaleCanonicalizer* self, ICU4XLocale* locale);
void ICU4XLocaleCanonicalizer_destroy(ICU4XLocaleCanonicalizer* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,32 @@
#ifndef ICU4XLocaleDirection_H
#define ICU4XLocaleDirection_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef enum ICU4XLocaleDirection {
ICU4XLocaleDirection_LeftToRight = 0,
ICU4XLocaleDirection_RightToLeft = 1,
ICU4XLocaleDirection_Unknown = 2,
} ICU4XLocaleDirection;
#ifdef __cplusplus
} // namespace capi
#endif
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
void ICU4XLocaleDirection_destroy(ICU4XLocaleDirection* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

View file

@ -0,0 +1,42 @@
#ifndef ICU4XLocaleDirectionality_H
#define ICU4XLocaleDirectionality_H
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "diplomat_runtime.h"
#ifdef __cplusplus
namespace capi {
#endif
typedef struct ICU4XLocaleDirectionality ICU4XLocaleDirectionality;
#ifdef __cplusplus
} // namespace capi
#endif
#include "ICU4XDataProvider.h"
#include "diplomat_result_box_ICU4XLocaleDirectionality_ICU4XError.h"
#include "ICU4XLocaleExpander.h"
#include "ICU4XLocale.h"
#include "ICU4XLocaleDirection.h"
#ifdef __cplusplus
namespace capi {
extern "C" {
#endif
diplomat_result_box_ICU4XLocaleDirectionality_ICU4XError ICU4XLocaleDirectionality_create(const ICU4XDataProvider* provider);
diplomat_result_box_ICU4XLocaleDirectionality_ICU4XError ICU4XLocaleDirectionality_create_with_expander(const ICU4XDataProvider* provider, const ICU4XLocaleExpander* expander);
ICU4XLocaleDirection ICU4XLocaleDirectionality_get(const ICU4XLocaleDirectionality* self, const ICU4XLocale* locale);
bool ICU4XLocaleDirectionality_is_left_to_right(const ICU4XLocaleDirectionality* self, const ICU4XLocale* locale);
bool ICU4XLocaleDirectionality_is_right_to_left(const ICU4XLocaleDirectionality* self, const ICU4XLocale* locale);
void ICU4XLocaleDirectionality_destroy(ICU4XLocaleDirectionality* self);
#ifdef __cplusplus
} // extern "C"
} // namespace capi
#endif
#endif

Some files were not shown because too many files have changed in this diff Show more