|
1 | 1 | # WASI API |
2 | 2 |
|
3 | | -Development of the WASI API has now moved to the WASI CG Subgroup; see |
4 | | -the [github repository], including the [API documentation]. |
| 3 | +Development of WASI has moved to the WASI CG Subgroup; see the |
| 4 | +[WASI repository] and the [interfaces page on wasi.dev]. |
5 | 5 |
|
6 | | -[github repository]: https://github.com/WebAssembly/WASI/ |
7 | | -[API documentation]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md |
| 6 | +For Wasmtime embedders using the C API with the component model: |
| 7 | + |
| 8 | +* Add core WASI imports to your component linker with |
| 9 | + [`wasmtime_component_linker_add_wasip2`]. |
| 10 | +* If your component imports `wasi:http`, also add |
| 11 | + [`wasmtime_component_linker_add_wasi_http`]. |
| 12 | +* Configure store-local WASI state with [`wasmtime_context_set_wasi`], and |
| 13 | + initialize WASI HTTP with [`wasmtime_context_set_wasi_http`] (after WASI). |
| 14 | + |
| 15 | +See these headers for current signatures and feature-gating details: |
| 16 | + |
| 17 | +* [`wasmtime/component/linker.h`] |
| 18 | +* [`wasmtime/store.h`] |
| 19 | + |
| 20 | +For legacy preview1 documentation, see the [preview1 docs]. |
| 21 | + |
| 22 | +[WASI repository]: https://github.com/WebAssembly/wasi |
| 23 | +[interfaces page on wasi.dev]: https://wasi.dev/interfaces |
| 24 | +[`wasmtime_component_linker_add_wasip2`]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime/component/linker.h |
| 25 | +[`wasmtime_component_linker_add_wasi_http`]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime/component/linker.h |
| 26 | +[`wasmtime_context_set_wasi`]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime/store.h |
| 27 | +[`wasmtime_context_set_wasi_http`]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime/store.h |
| 28 | +[`wasmtime/component/linker.h`]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime/component/linker.h |
| 29 | +[`wasmtime/store.h`]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/c-api/include/wasmtime/store.h |
| 30 | +[preview1 docs]: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md |
0 commit comments