• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

rust-lang/libc: Raw bindings to platform APIs for Rust

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

rust-lang/libc

开源软件地址:

https://github.com/rust-lang/libc

开源编程语言:

Rust 98.3%

开源软件介绍:

libc - Raw FFI bindings to platforms' system libraries

GHA Status Cirrus CI Status Latest Version Documentation License

libc provides all of the definitions necessary to easily interoperate with C code (or "C-like" code) on each of the platforms that Rust supports. This includes type definitions (e.g. c_int), constants (e.g. EINVAL) as well as function headers (e.g. malloc).

This crate exports all underlying platform types, functions, and constants under the crate root, so all items are accessible as libc::foo. The types and values of all the exported APIs match the platform that libc is compiled for.

More detailed information about the design of this library can be found in its associated RFC.

Usage

Add the following to your Cargo.toml:

[dependencies]
libc = "0.2"

Features

  • std: by default libc links to the standard library. Disable this feature to remove this dependency and be able to use libc in #![no_std] crates.

  • extra_traits: all structs implemented in libc are Copy and Clone. This feature derives Debug, Eq, Hash, and PartialEq.

  • const-extern-fn: Changes some extern fns into const extern fns. This feature requires a nightly rustc.

  • deprecated: use_std is deprecated, and is equivalent to std.

Rust version support

The minimum supported Rust toolchain version is Rust 1.13.0 . APIs requiring newer Rust features are only available on newer Rust toolchains:

Feature Version
union 1.19.0
const mem::size_of 1.24.0
repr(align) 1.25.0
extra_traits 1.25.0
core::ffi::c_void 1.30.0
repr(packed(N)) 1.33.0
cfg(target_vendor) 1.33.0

Platform support

Platform-specific documentation (master branch).

See ci/build.sh for the platforms on which libc is guaranteed to build for each Rust toolchain. The test-matrix at GitHub Actions and Cirrus CI show the platforms in which libc tests are run.

License

This project is licensed under either of

at your option.

Contributing

We welcome all people who want to contribute. Please see the contributing instructions for more information.

Contributions in any form (issues, pull requests, etc.) to this project must adhere to Rust's Code of Conduct.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in libc by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
InteractiveBrokers/tws-api-public: Interactive Brokers TWS API发布时间:2022-04-02
下一篇:
Sponsor @piotrmurach on GitHub Sponsors · GitHub发布时间:2022-04-02
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap