-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement runtime binding generation #923
Draft
kang-sw
wants to merge
19
commits into
mozilla:master
Choose a base branch
from
kang-sw:feature/generate-dynamic
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
Implement backend for C runtime binding generation wip implement c dynamic backend
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.
As subsequent implementation of PR #853, implements C language backend for generating dynamic language bindings on runtime.
Two new structs are defined and exposed to public:
CDynamicBindingBackend
CDynamicBindingConfig
And user can use this to generate runtime-loadable C binding instead of static binding using following scheme.
This will generate global symbols and functions as loadable fields within the struct named as user provided
USER_API_STRUCT
string.The generated loader methods will accept the Api definition struct and user-provided platform-agnostic API loader interface structure. Basically the generated loader methods is invisible to user. Once the user writes
#define INCLUDE_CBINDGEN_LOADER_{USER_API_STRUCT}
prior to the inclusion of generated header, then the loader methods is visible to the user as inline function.Outputs with
USER_API_STRUCT
as"MyApiStruct"
C Backend
CDynamic Backend
TODOs
CDynamic
be merged into crate-wiseConfig
?