Crates.io | ohos-sys |
lib.rs | ohos-sys |
version | 0.4.0 |
source | src |
created_at | 2024-04-29 12:13:24.467428 |
updated_at | 2024-10-29 16:33:39.886576 |
description | Bindings to the native API of OpenHarmony OS |
homepage | |
repository | https://github.com/openharmony-rs/ohos-sys |
max_upload_size | |
id | 1224128 |
size | 142,772 |
FFI-bindings for the native API of OpenHarmony OS. See the documentation for a list of supported components. This crate is under active development, and not officially affiliated with OpenHarmony OS.
The current bindings are generated with bindgen
using scripts/generate_bindings.sh
.
A separate file is generated for each API version, and (assuming no breaking changes) the new additions are
manually copied to an apiXX_additions.rs
file, which is included as a module if feature = api-XX
is selected.
The generated file drawing_apiXX.rs
should be committed to version control, so we can easily rerun the script on a
patch-release for a given API-level and see what changed.
The file itself is however not needed, and will be excluded from crates.io
releases.
There are still quite a few OpenHarmony APIs missing. Feel free to contribute missing APIs, but be sure to adapt the script, so your bindings are reproducible! Please also check the following:
Copy
, Clone
and Debug
.C
mode. However, if a header file is not C-compliant
due to an issue of the OpenHarmony SDK, then setting libclang
to C++ mode is fine.bindgen
: We require at least bindgen 0.70.0, with the prettyplease
feature enabled.
You can install it by running cargo install bindgen-cli --features prettyplease
This crate is licensed under the Apache-2.0 license, matching the OpenHarmony OS SDK.