-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jonathan Schwender <[email protected]>
- Loading branch information
Showing
14 changed files
with
771 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## 0.1.0 | ||
|
||
Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "ohos-rawfile-sys" | ||
version = "0.1.0" | ||
edition = "2021" | ||
description = "Raw Bindings to the rawfile API of OpenHarmony" | ||
license = "Apache-2.0" | ||
repository = "https://github.com/openharmony-rs/ohos-sys" | ||
keywords = ["OpenHarmony", "HarmonyOS", "ffi", "rawfile", "file"] | ||
readme = "README.md" | ||
|
||
[dependencies] | ||
document-features = { version = "0.2", optional = true } | ||
ohos-sys-opaque-types = { workspace = true} | ||
|
||
[features] | ||
default = [] | ||
|
||
api-10 = [] | ||
api-11 = ["api-10"] | ||
api-12 = ["api-11"] | ||
api-13 = ["api-12"] | ||
## Document available features when building the documentation | ||
document-features = ["dep:document-features"] | ||
|
||
[package.metadata.docs.rs] | ||
features = ["document-features"] | ||
targets = ["aarch64-unknown-linux-ohos", "armv7-unknown-linux-ohos", "x86_64-unknown-linux-ohos"] | ||
all-features = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# OpenHarmony rawfile bindings | ||
|
||
The OpenHarmony rawfile API allows the user to access so-called `rawfile`s that are bundled | ||
into the `hap` bundle. | ||
|
||
## License | ||
|
||
Licensed under the Apache-2.0 license, matching the license of OpenHarmony. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//! Bindings to the rawfile APIs | ||
//! | ||
//! ## Overview | ||
//! | ||
//! The OpenHarmony rawfile API allows the user to access so-called `rawfile`s that are bundled | ||
//! into the `hap` bundle. | ||
//! | ||
//! You can use the APIs to traverse, open, search for, read, and close raw files. | ||
//! The rawfile APIs are non-thread-safe. Only the close and open APIs are thread-safe. | ||
//! | ||
//! See also the [official rawfile documentation](https://docs.openharmony.cn/pages/v5.0/en/application-dev/reference/apis-localization-kit/rawfile.md). | ||
//! | ||
//! | ||
//! ## Feature flags | ||
#![cfg_attr( | ||
feature = "document-features", | ||
cfg_attr(doc, doc = ::document_features::document_features!()) | ||
)] | ||
#![cfg_attr(docsrs, feature(doc_cfg))] | ||
|
||
extern "C" {} | ||
|
||
mod raw_file_types_ffi; | ||
pub use raw_file_types_ffi::*; | ||
|
||
pub mod raw_dir; | ||
pub mod raw_file; | ||
pub mod raw_file_manager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mod raw_dir_ffi; | ||
pub use raw_dir_ffi::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// automatically generated by rust-bindgen 0.71.1 | ||
|
||
#![allow(non_upper_case_globals)] | ||
#![allow(non_camel_case_types)] | ||
#![allow(non_snake_case)] | ||
|
||
#[repr(C)] | ||
pub struct RawDir { | ||
_unused: [u8; 0], | ||
} | ||
extern "C" { | ||
/// Obtains the name of the file according to the index. | ||
/// | ||
/// You can use this method to traverse a raw file directory. | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `rawDir` - Indicates the pointer to [`RawDir`]. | ||
/// | ||
/// * `index` - Indicates the file index in [`RawDir`]. | ||
/// | ||
/// # Returns | ||
/// | ||
/// * Returns the name of the file according to the index, | ||
/// which can be passed to [`OH_ResourceManager_OpenRawFile`] as an input parameter; | ||
/// returns <b>NULL</b> if all files are returned. | ||
/// [`OH_ResourceManager_OpenRawFile`] | ||
/// Available since API-level: 8 | ||
/// | ||
/// Version: 1.0 | ||
pub fn OH_ResourceManager_GetRawFileName( | ||
rawDir: *mut RawDir, | ||
index: ::core::ffi::c_int, | ||
) -> *const ::core::ffi::c_char; | ||
/// get the count of the raw files in [`RawDir`]. | ||
/// | ||
/// You can use this method to get the valid index of [`OH_ResourceManager_GetRawFileName`]. | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `rawDir` - Indicates the pointer to [`RawDir`]. | ||
/// [`OH_ResourceManager_GetRawFileName`] | ||
/// Available since API-level: 8 | ||
/// | ||
/// Version: 1.0 | ||
pub fn OH_ResourceManager_GetRawFileCount(rawDir: *mut RawDir) -> ::core::ffi::c_int; | ||
/// Closes an opened [`RawDir`] and releases all associated resources. | ||
/// | ||
/// | ||
/// | ||
/// # Arguments | ||
/// | ||
/// * `rawDir` - Indicates the pointer to [`RawDir`]. | ||
/// [`OH_ResourceManager_OpenRawDir`] | ||
/// Available since API-level: 8 | ||
/// | ||
/// Version: 1.0 | ||
pub fn OH_ResourceManager_CloseRawDir(rawDir: *mut RawDir); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mod raw_file_ffi; | ||
pub use raw_file_ffi::*; |
Oops, something went wrong.