aboutsummaryrefslogtreecommitdiffstats
path: root/cbindgen.toml
AgeCommit message (Collapse)Author
2018-11-22Add licenseTeddy Wing
2018-10-27Clean up `cbindgen.toml`Teddy Wing
Remove some unnecessary things. We aren't using `MapKind` any more, so it can be removed.
2018-10-27cbindgen.toml: Add include guard to header fileTeddy Wing
2018-08-28cbindgen.toml: Prefix enum variants with enum nameTeddy Wing
For better namespacing and local context information. Thank goodness 'cbindgen' supports this.
2018-08-26Link library with a test C programTeddy Wing
Make a test `includer.c` program that includes the Rust library and calls our `c_run_key_action()` to see if it actually works. Currently it doesn't, we get `(null)` printed to stdout. Add a Makefile with the build command for the C program. cbindgen.toml: Remove `KeyActionResult` from exported types, as the `Option` field it contains caused `gcc` to complain. cocoa_bridge.rs: * Comment out all 'cocoa' crate related code as the 'cocoa' code was interfering with GCC compilation as a result of my not linking to Cocoa frameworks. * Add a new test map definition that corresponds with the one we look for in `includer.c`. parser.rs: Add `#[repr(C)]` to `MapKind` because it needs to be exported in the library and generated into our C header file.
2018-08-25Generate a partial C header for our FFI APITeddy Wing
* Add the 'cbindgen' crate to help us auto-generate a C header for our exported FFI enums/structs/functions * Add a `build.rs` to generate the C header using cbindgen * Add a rough config for 'cbindgen' * Export everything from the `cocoa_bridge` crate to include the `KeyActionResult` struct * Commit the C header generated by 'cbindgen' Looks promising. We do, however, have some things to correct. We can't use `Option` in C, for instance, so we'll need to fix that in our `KeyActionResult`. Similarly, we need to rework the `run_key_action()` function to make it accessible as a C interface. Right now it returns an `Option`, which isn't going to work, and I'm not sure if the slice input translates. That (any maybe more) is why it doesn't get generated by 'cbindgen' into the header output file.