diff options
Diffstat (limited to 'libsyslog/src/logopt.rs')
-rw-r--r-- | libsyslog/src/logopt.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libsyslog/src/logopt.rs b/libsyslog/src/logopt.rs new file mode 100644 index 0000000..381ab06 --- /dev/null +++ b/libsyslog/src/logopt.rs @@ -0,0 +1,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; + } +} |