1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//! Raw Rust bindings to the `libevent` C library.
//!
//! Bindings are generated with [Rust-Bindgen](https://github.com/rust-lang/rust-bindgen)
//! which means there are a number of quirks.
//!
//! - Enums are a constants in the form of `enum_name_ENUM_FIELD`
//! - Functions are named the same as the C code and don't follow Rust naming schemes.
//! - Uses C strings. See `CStr` in the Rust standard library.

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(clippy::unreadable_literal)]
#![allow(clippy::redundant_static_lifetimes)]

include!(concat!(env!("OUT_DIR"), "/bindings.rs"));

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn constant_access() {
        assert_eq!(EVENT_LOG_MSG, 1);
        assert_eq!(IPPORT_RESERVED, 1024);
    }
}