Documentation
/*
==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--

UDSx

Copyright (C) 2019, 2021-2023  Anonymous

There are several releases over multiple years,
they are listed as ranges, such as: "2021-2023".

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--::--
*/

//! # UDSx
//!
//! ## Project
//!
//! - License: GNU Lesser General Public License, either version 3, or (at your option) any later version.
//! - _This project follows [Semantic Versioning 2.0.0]_
//!
//! ## Features
//!
//! This project provides some extensions for Unix domain sockets, via [`UdsxUnixStream`][trait:UdsxUnixStream].
//!
//! Currently, nightly Rust is required.
//!
//! [Semantic Versioning 2.0.0]: https://semver.org/spec/v2.0.0.html
//!
//! [trait:UdsxUnixStream]: trait.UdsxUnixStream.html

#![warn(missing_docs)]

// TODO: remove these when related APIs are stabilized
#![feature(unix_socket_ancillary_data)]

// ╔═════════════════╗
// ║   IDENTIFIERS   ║
// ╚═════════════════╝

macro_rules! code_name  { () => { "udsx" }}
macro_rules! version    { () => { "0.14.0" }}

/// # Crate name
pub const NAME: &str = "UDSx";

/// # Crate code name
pub const CODE_NAME: &str = code_name!();

/// # ID of this crate
pub const ID: &str = concat!(
    "3df68c92-3aef9c8a-620269e5-31b3c45d-0dd34f4c-2a7dce4e-33c12966-4e5631cb-",
    "617e5279-d901a7b2-593e6f06-5e9c1de0-f4af1b84-f3057770-b6558c66-da0d4efe",
);

/// # Crate version
pub const VERSION: &str = version!();

/// # Crate release date (year/month/day)
pub const RELEASE_DATE: (u16, u8, u8) = (2023, 2, 8);

/// # Tag, which can be used for logging...
pub const TAG: &str = concat!(code_name!(), "::3df68c92::", version!());

// ╔════════════════════╗
// ║   IMPLEMENTATION   ║
// ╚════════════════════╝

/// # Wrapper for format!(), which prefixes your optional message with: crate::TAG, module_path!(), line!()
macro_rules! __ {
    ($($arg: tt)+) => {
        format!("[{tag}][{module_path}-{line}] {msg}", tag=crate::TAG, module_path=module_path!(), line=line!(), msg=format!($($arg)+))
    };
    () => {
        __!("(internal error)")
    };
}

pub mod version_info;

#[cfg(unix)]
mod udsx_unix_stream;

#[cfg(unix)]
pub use self::udsx_unix_stream::*;

/// # Result type used in this crate
pub type Result<T> = std::io::Result<T>;

#[test]
fn test_crate_version() {
    assert_eq!(VERSION, env!("CARGO_PKG_VERSION"));
}