feat: c module - #71
Open
richerfu wants to merge 4 commits into
Open
Conversation
Implements the @ohos-rs/ability native module contract in C99 with an SDL-style application model (AppInit/AppEvent/AppIterate/AppQuit on a dedicated application thread), the three bridge call modes (async / main-thread sync / worker sync over TSFN), C plugin registration for ArkTS-originated sync events, the full event surface (lifecycle, surface, input, IME, frame, avoid areas), and the built-in ohos.node plugin facade. Capabilities are gated by compile-time macros (OH_ABILITY_PLUGIN_NODE, OH_ABILITY_ENABLE_IME/DISPLAY) mirroring cargo features / SDL subsystems. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The C demo reuses the demo_native module name and the Rust demo's export surface (Index.d.ts), so the demo app is unchanged when its libdemo_native.so is swapped. Plugins live in src/plugins/<name>/ directories (Rust crates/plugin-* layout), each gated by its own OH_ABILITY_PLUGIN_* macro with explicit-error stubs when disabled: permission, files, url, resource (inbound plugin), webview (inbound plugin + demoweb scheme handler + window.test JS proxy), window and app-control (reserved). Build via scripts/build-c-demo.sh. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Compiles c_module (framework + demo) for arm64-v8a with the OHOS SDK on every PR, using the SDK-bundled cmake/ninja when present. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Repository layout, plugin switches table, and build instructions for c_module; AGENTS.md gets the C framework rules (napi value discipline, identifier validation, fail-closed dispatch, TSFN release duty). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.