13 releases (8 stable)

Uses old Rust 2015

3.0.1 Dec 1, 2023
3.0.0 Oct 21, 2023
2.0.2 Apr 7, 2018
2.0.0 Jan 4, 2018
0.1.2 Nov 21, 2015

#607 in Rust patterns

Download history 476/week @ 2023-12-17 597/week @ 2023-12-24 595/week @ 2023-12-31 688/week @ 2024-01-07 560/week @ 2024-01-14 627/week @ 2024-01-21 775/week @ 2024-01-28 693/week @ 2024-02-04 609/week @ 2024-02-11 799/week @ 2024-02-18 930/week @ 2024-02-25 843/week @ 2024-03-03 636/week @ 2024-03-10 700/week @ 2024-03-17 842/week @ 2024-03-24 741/week @ 2024-03-31

2,983 downloads per month
Used in 14 crates (3 directly)

MIT license

5KB

rust-c-types

Re-exports types defined in both libc and winapi, to reduce the amount of conditional compilation required in your code. Stop having to write code like this:

#[cfg(unix)]
use libc::some_type;

#[cfg(windows)]
use winapi::some_type;

Instead, write code like this:

use c_types::some_type;

Crates.io Build Status

Documentation

API documentation is here.

Contributing

This crate is non-exhaustive - I add types to it as and when I need them for my own projects.

If there's a type that could be included but isn't, there should be no problem adding it. Please open an issue or, even better, send a pull request.

Dependencies

~0–10MB
~77K SLoC