Repository navigation
docs: use real C API names in the plugin snippets - #322
Open
shubhamrai9122-creator wants to merge 1 commit into
Open
shubhamrai9122-creator wants to merge 1 commit into
shubhamrai9122-creator wants to merge 1 commit into
Conversation
Some C snippets use names that don't exist in the WasmEdge C API, so they fail to compile when copied: - Use WasmEdge_ModuleInstanceContext instead of WasmEdge_ModuleInstance. - Use WasmEdge_Result_Fail instead of WasmEdge_Result_Error. - Use WasmEdge_ValTypeIsI32(In[i].Type) instead of comparing the type with WasmEdge_ValType_I32, because WasmEdge_ValType is now a struct. The Chinese copies get the same changes. Fixes: WasmEdge#320 Assisted-by: Claude (Anthropic) Signed-off-by: Shubham Kumar <shubhamrai9122@gmail.com>
shubhamrai9122-creator
requested review from
alabulei1,
hydai and
juntao
as code owners
November 2, 2026 19:56
This branch has not been deployed
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.
Explanation
Some C snippets in the docs use API names that don't exist, so they fail to compile when copied.
Related issue
Closes #320
What type of PR is this
/kind documentation
Proposed Changes
WasmEdge_ModuleInstanceContextinstead ofWasmEdge_ModuleInstance.WasmEdge_Result_Failinstead ofWasmEdge_Result_Error.WasmEdge_ValTypeIsI32(In[i].Type)instead of comparing the type withWasmEdge_ValType_I32.I checked the corrected snippets against the current headers with
clang -fsyntax-only. The old names give 9 errors, and the corrected ones give none.This contribution was developed with assistance from Claude (Anthropic).