summaryrefslogtreecommitdiff
path: root/libsyslog/src/logopt.rs
blob: 381ab06109c18cb921a4e428e132fce1c0f338ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use {
    bitflags::bitflags,
    libsyslog_sys::*,
    std::os::raw::c_int,
};

bitflags! {
    /// Typesafe representation of syslog logopt bitflags.
    ///
    /// Pid    = [LOG_PID][`libsyslog_sys::LOG_PID`]  
    /// Cons   = [LOG_CONS][`libsyslog_sys::LOG_CONS`]  
    /// ODelay = [LOG_ODELAY][`libsyslog_sys::LOG_ODELAY`]  
    /// NDelay = [LOG_NDELAY][`libsyslog_sys::LOG_NDELAY`]  
    /// NoWait = [LOG_NOWAIT][`libsyslog_sys::LOG_NOWAIT`]  
    #[derive(Debug,Default)]
    pub struct Logopt: c_int {
        const Pid    = LOG_PID;
        const Cons   = LOG_CONS;
        const ODelay = LOG_ODELAY;
        const NDelay = LOG_NDELAY;
        const NoWait = LOG_NOWAIT;
        #[cfg(any(target_os = "freebsd", target_os = "netbsd"))]
        const PError = LOG_PERROR;
        #[cfg(target_os = "netbsd")]
        const PTrim  = LOG_PTRIM;
        #[cfg(target_os = "netbsd")]
        const NLogm  = LOG_NLOG;
    }
}