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
Move all FFI definitions out of this crate #18
Comments
asomers
added a commit
to asomers/capsicum-rs
that referenced
this issue
Nov 29, 2022
Where possible, use libc's FFI definitions instead of our own. Partially addresses dlrobertson#18
asomers
added a commit
to asomers/capsicum-rs
that referenced
this issue
Nov 29, 2022
Where possible, use libc's FFI definitions instead of our own. Also, automatically derive PartialEq. Partially addresses dlrobertson#18
See also rust-lang/libc#3022 |
asomers
added a commit
to asomers/capsicum-rs
that referenced
this issue
Nov 30, 2022
dlrobertson
pushed a commit
that referenced
this issue
Dec 3, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's best practice to put FFI bindings in a separate crate, named *-sys. We should do something like that for capsicum.
https://doc.rust-lang.org/cargo/reference/build-scripts.html#-sys-packages
Futhermore, since Capsicum is part of FreeBSD's system C library, the correct place for these declarations is in the libc crate. That crate has the added advantage of a very good test suite to verify that the FFI functions are defined correctly. Therefore we should rely on libc's bindings. It already has bindings for most of Capsicum's functions.
The text was updated successfully, but these errors were encountered: