libevent_sys/lib.rs
1//! Raw Rust bindings to the `libevent` C library.
2//!
3//! Bindings are generated with [Rust-Bindgen](https://github.com/rust-lang/rust-bindgen)
4//! which means there are a number of quirks.
5//!
6//! - Enums are a constants in the form of `enum_name_ENUM_FIELD`
7//! - Functions are named the same as the C code and don't follow Rust naming schemes.
8//! - Uses C strings. See `CStr` in the Rust standard library.
9
10#![allow(non_upper_case_globals)]
11#![allow(non_camel_case_types)]
12#![allow(non_snake_case)]
13#![allow(clippy::unreadable_literal)]
14#![allow(clippy::redundant_static_lifetimes)]
15#![allow(clippy::missing_safety_doc)]
16
17include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
18
19#[cfg(test)]
20mod tests {
21 use super::*;
22
23 #[test]
24 fn constant_access() {
25 assert_eq!(EVENT_LOG_MSG, 1);
26 assert_eq!(IPPORT_RESERVED, 1024);
27 }
28}