Skip to main content

eos_sys/
lib.rs

1#![allow(non_camel_case_types)]
2#![allow(non_snake_case)]
3#![allow(non_upper_case_globals)]
4#![allow(clippy::all)]
5
6//! Raw FFI bindings for the Epic Online Services (EOS) C SDK.
7//!
8//! `eos-sys` is the low-level layer in the EOS Rust stack:
9//!
10//! - `eos-sys`: raw, mostly 1:1 C bindings
11//! - `eos-rs`: higher-level safe wrappers built on top of `eos-sys`
12//!
13//! # Setup
14//!
15//! This crate does not bundle the EOS SDK binaries.
16//! You must provide the SDK root directory via:
17//!
18//! - `EOS_SDK_DIR=/path/to/EOS-SDK`
19//!
20//! The directory must contain:
21//!
22//! - `Include/`
23//! - `Lib/`
24//!
25//! On Windows, your final application also needs `EOSSDK-Win64-Shipping.dll`
26//! next to the executable at runtime.
27//!
28//! # Why No LLVM Requirement
29//!
30//! This crate intentionally ships pre-generated bindings in-source, so downstream
31//! users do not need LLVM/clang installed to compile.
32//!
33//! If you maintain bindings and want to regenerate them, build with:
34//!
35//! `cargo build -p eos-sys --no-default-features --features bindgen`
36//!
37//! # Safety
38//!
39//! This crate exposes raw FFI APIs and raw pointers/handles from EOS. Callers are
40//! responsible for:
41//!
42//! - pointer validity,
43//! - callback lifetime correctness,
44//! - calling the correct EOS `*_Release` APIs.
45//!
46//! For safer ownership/lifetime behavior, prefer `eos-rs` where possible.
47
48pub use libc::{c_char, c_double, c_float, c_int, c_longlong, c_short, c_uchar, c_uint, c_ulonglong, c_ushort, size_t};
49
50// By default we ship pre-generated bindings so downstream users don't need LLVM/clang.
51// If you need to regenerate: build with `--features eos-sys/bindgen`.
52#[cfg(feature = "prebuilt-bindings")]
53mod bindings;
54#[cfg(feature = "prebuilt-bindings")]
55pub use bindings::*;
56
57#[cfg(all(feature = "bindgen", not(feature = "prebuilt-bindings")))]
58include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
59