libpam_sys/
lib.rs

1//! `libpam-sys` provides low-level access to LibPAM.
2//!
3//! Everything in here is directly as exported from the LibPAM library or
4//! its header files, with two exceptions:
5//!
6//! - The [`pam_impl`] submodule (and the associated [`pam_impl_name!`] macro),
7//!   which can be used to detect the current PAM implementation.
8//! - The [`aliases`] submodule, which contains convenient aliases
9//!   for callback types used in libpam, so you don't have to type
10//!   `unsafe extern "C" fn(this is so long)` all the time.
11#![doc = ""]
12#![doc = concat!("This documentation was built for the **", env!("LIBPAMSYS_IMPL"), "** implementation.")]
13//!
14//! You can override this **at build time** by setting the `LIBPAMSYS_IMPL`
15//! environment variable to one of the values of the [`pam_impl::PamImpl`] enum.
16//! For more information about configuration, see [the documentation of
17//! libpam-sys-impls](libpam_sys_impls::build_target_impl).
18#![allow(non_camel_case_types)]
19#![allow(unused_imports)]
20
21pub mod aliases;
22mod constants;
23mod ffi;
24#[doc(inline)]
25pub use crate::{constants::*, ffi::*};
26
27/// Information about the current PAM implementation (or the implementation
28/// that is being built for).
29pub mod pam_impl {
30    #[doc(inline)]
31    pub use libpam_sys_impls::{enable_pam_impl_cfg, pam_impl_cfg_string, PamImpl};
32
33    include!(concat!(env!("OUT_DIR"), "/pam_impl_consts.rs"));
34}