Mercurial > crates > nonstick
diff src/constants.rs @ 103:dfcd96a74ac4 default tip
write a truly prodigious amount of documentation
adds a bunch of links to the OpenPAM man pages and the XSSO spec
as well as just a bunch of prose and stuff.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Wed, 25 Jun 2025 00:59:24 -0400 |
parents | efe2f5f8b5b2 |
children |
line wrap: on
line diff
--- a/src/constants.rs Tue Jun 24 18:11:38 2025 -0400 +++ b/src/constants.rs Wed Jun 25 00:59:24 2025 -0400 @@ -6,6 +6,7 @@ #[cfg(feature = "link")] use crate::libpam::pam_ffi; +use crate::{_linklist, _man7, _manbsd, _xsso}; use bitflags::bitflags; use libc::c_int; use num_enum::{IntoPrimitive, TryFromPrimitive}; @@ -145,11 +146,20 @@ } } -/// The Linux-PAM error return values. Success is an Ok [Result]. +/// The PAM error return codes. +/// +/// These are returned by most PAM functions if an error of some kind occurs. +/// +/// Instead of being an error code, success is represented by an Ok [`Result`]. /// -/// Most abbreviations (except `AuthTok` and `Max`) are now full words. -/// For more detailed information, see -/// `/usr/include/security/_pam_types.h`. +/// # References +/// +#[doc = _linklist!(pam: man7, manbsd)] +/// - [X/SSO error code specification][xsso] +/// +#[doc = _man7!(3 pam "RETURN_VALUES")] +#[doc = _manbsd!(3 pam "RETURN%20VALUES")] +#[doc = _xsso!("chap5.htm#tagcjh_06_02")] #[allow(non_camel_case_types, dead_code)] #[derive(Copy, Clone, Debug, PartialEq, TryFromPrimitive, IntoPrimitive)] #[non_exhaustive] // C might give us anything! @@ -228,9 +238,6 @@ } } -/// Returned when text that should not have any `\0` bytes in it does. -/// Analogous to [`std::ffi::NulError`], but the data it was created from -/// is borrowed. #[cfg(test)] mod tests { use super::*;