mirror of
https://github.com/lahfir/agent-desktop.git
synced 2026-08-04 21:20:48 +00:00
Closes P2 todo 011. Reference docs and the crate-level rustdoc had drifted against shipped APIs: - ownership.md table still listed the removed raw-array list surface (`ad_list_apps(... &apps, &count)`, `ad_free_apps`, `ad_free_window`, `ad_free_windows`, `ad_free_surfaces`) that Unit 5 replaced with opaque list handles. - build-and-link.md's minimal C example used the same stale API. - error-handling.md still called `ad_free_window` (renamed to `ad_release_window_fields` in Unit 5). - threading.md described debug-only `debug_assert!` with release-build UB, but todo 002 made the check runtime-enforced in every profile. - lib.rs crate-level rustdoc repeated the same debug/release phrasing. Rewrite all four reference pages and the lib.rs rustdoc against what actually ships: ownership.md: - Full opaque-list entry per type (Apps/Windows/Surfaces/Notifications). - AdImageBuffer accessor pattern documented. - ad_free_handle: *mut AdNativeHandle, zero-on-success double-free safety. - Out-param zeroing happens before guards, not after (todo 006 contract). threading.md: - "Runtime, every build profile" — no debug/release split. - Full exempt list: lists accessors, image-buffer accessors, release_window_fields, free_handle, free_tree, free_action_result, free_string. build-and-link.md: - C example now uses `ad_list_apps(adapter, &list)` + `ad_app_list_count/_get/_free`. error-handling.md: - `ad_free_window` → `ad_release_window_fields`. - Comment clarified to reflect out-param zero-init. lib.rs //! rustdoc: - Matches threading.md's runtime-enforced phrasing and exempt list. - cbindgen propagates to agent_desktop.h so header consumers see the right contract. 85 FFI tests pass, clippy clean. |
||
|---|---|---|
| .. | ||
| core | ||
| ffi | ||
| linux | ||
| macos | ||
| windows | ||