#libc #winapi

c-types

Re-exports of cross-platform types, gathered from libc and winapi

13 releases (8 stable)

Uses old Rust 2015

new 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

#596 in Rust patterns

Download history 1104/week @ 2023-08-12 889/week @ 2023-08-19 484/week @ 2023-08-26 412/week @ 2023-09-02 667/week @ 2023-09-09 629/week @ 2023-09-16 604/week @ 2023-09-23 352/week @ 2023-09-30 410/week @ 2023-10-07 642/week @ 2023-10-14 790/week @ 2023-10-21 528/week @ 2023-10-28 277/week @ 2023-11-04 785/week @ 2023-11-11 797/week @ 2023-11-18 679/week @ 2023-11-25

2,561 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–11MB
~85K SLoC