Skip to content
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

Closed
asomers opened this issue Nov 29, 2022 · 1 comment · Fixed by #20
Closed

Move all FFI definitions out of this crate #18

asomers opened this issue Nov 29, 2022 · 1 comment · Fixed by #20
Assignees

Comments

@asomers
Copy link
Collaborator

asomers commented Nov 29, 2022

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.

@asomers asomers self-assigned this Nov 29, 2022
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
@asomers
Copy link
Collaborator Author

asomers commented Nov 30, 2022

See also rust-lang/libc#3022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant