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

#576 in Rust patterns

Download history 600/week @ 2024-01-05 613/week @ 2024-01-12 605/week @ 2024-01-19 803/week @ 2024-01-26 721/week @ 2024-02-02 629/week @ 2024-02-09 667/week @ 2024-02-16 974/week @ 2024-02-23 866/week @ 2024-03-01 688/week @ 2024-03-08 642/week @ 2024-03-15 811/week @ 2024-03-22 657/week @ 2024-03-29 650/week @ 2024-04-05 657/week @ 2024-04-12 394/week @ 2024-04-19

2,497 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–8.5MB
~67K SLoC