native
native copied to clipboard
FFIgenPad
This is a PR for adding FFIgenPad (a GSoC proposal)
- Bulk of the code is directly lifted from ffigen 14-wip, some major changes are
@Nativebindings instead of DynamicLibrary cause of dart2wasm- use of a wrapper.c (used to make functions that play well with pointers) cause dart2wasm currently doesn't play well with structs
- header_parser/clang_bindings/clang_types.dart and header_parser/clang_bindings/clang_wrapper.dart aim to provide 1:1 parity with clang_types and the
Clangclass in ffigen respectively, this leads to the only changes in many files being the import paths
- parts which are constant and independent, (like most of lib/src/strings.dart) are exported directly from ffigen
- The website is located in the web directory, currently uses nodejs.
FFIgenPad also requires a wasm build of libclang, bundled with wrapper.c, which currently is being tracked with git but there are no instructions on how to setup and build it, I'll probably add it soon though.
- [x] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:
- See our contributor guide for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before creating a PR.
- Contributions to our repos should follow the Dart style guide and use
dart format. - Most changes should add an entry to the changelog and may need to rev the pubspec package version.
- Changes to packages require corresponding tests.
Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.