comparison libpam-sys/src/lib.rs @ 118:39760dfc9b3b

Detect PAM library based only on system lib; rename minimal lib to XSso. Also formats and assorted other cleanup.
author Paul Fisher <paul@pfish.zone>
date Sun, 29 Jun 2025 20:13:03 -0400
parents 2346fd501b7a
children
comparison
equal deleted inserted replaced
117:20f7712a6857 118:39760dfc9b3b
5 #![doc = concat!("This documentation was built for the **", __pam_impl_name__!(), "** implementation.")] 5 #![doc = concat!("This documentation was built for the **", __pam_impl_name__!(), "** implementation.")]
6 6
7 use libpam_sys_impls::{__pam_impl_enum__, __pam_impl_name__}; 7 use libpam_sys_impls::{__pam_impl_enum__, __pam_impl_name__};
8 8
9 mod constants; 9 mod constants;
10 mod functions;
10 pub mod helpers; 11 pub mod helpers;
11 mod structs; 12 mod structs;
12 13
13 /// A `cfg`-like attribute macro for code specific to one PAM implementation. 14 /// A `cfg`-like attribute macro for code specific to one PAM implementation.
14 /// 15 ///
28 /// fn do_something() { /* Illumos/Solaris-only code */ } 29 /// fn do_something() { /* Illumos/Solaris-only code */ }
29 /// 30 ///
30 /// #[cfg_pam_impl(not("Sun"))] 31 /// #[cfg_pam_impl(not("Sun"))]
31 /// fn do_something() { /* non-Illumos code */ } 32 /// fn do_something() { /* non-Illumos code */ }
32 /// 33 ///
33 /// #[cfg_pam_impl(any("LinuxPam", "MinimalOpenPam"))] 34 /// #[cfg_pam_impl(any("LinuxPam", "XSso"))]
34 /// fn do_something_else() { /* Linux-PAM or minimal OpenPAM */ } 35 /// fn do_something_else() { /* Linux-PAM or X/SSO-spec PAM */ }
35 /// 36 ///
36 /// #[cfg_pam_impl(not(any("Sun", "OpenPam")))] 37 /// #[cfg_pam_impl(not(any("Sun", "OpenPam")))]
37 /// fn do_a_third_thing() { /* Neither Sun nor OpenPAM */ } 38 /// fn do_a_third_thing() { /* Neither Sun nor OpenPAM */ }
38 /// 39 ///
39 /// #[cfg_pam_impl(any())] 40 /// #[cfg_pam_impl(any())]