Implement runtime binding generation #923
Draft
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
?