Update bitflags to 0.7

This commit is contained in:
Simon Sapin 2017-02-16 16:18:44 +01:00
parent 7a91a816c5
commit e47d55c3be
22 changed files with 54 additions and 54 deletions

View File

@ -52,7 +52,7 @@ For example,
```rust
libc_bitflags!{
flags ProtFlags: libc::c_int {
pub flags ProtFlags: libc::c_int {
PROT_NONE,
PROT_READ,
PROT_WRITE,

View File

@ -23,7 +23,7 @@ signalfd = []
[dependencies]
libc = { git = "https://github.com/rust-lang/libc" }
bitflags = "0.4"
bitflags = "0.7"
cfg-if = "0.1.0"
void = "1.0.2"

View File

@ -138,7 +138,7 @@ mod consts {
use libc::{self, c_int, c_uint};
bitflags! {
flags SpliceFFlags: c_uint {
pub flags SpliceFFlags: c_uint {
const SPLICE_F_MOVE = libc::SPLICE_F_MOVE,
const SPLICE_F_NONBLOCK = libc::SPLICE_F_NONBLOCK,
const SPLICE_F_MORE = libc::SPLICE_F_MORE,
@ -147,7 +147,7 @@ mod consts {
}
bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0o00000003,
const O_RDONLY = 0o00000000,
const O_WRONLY = 0o00000001,
@ -173,13 +173,13 @@ mod consts {
);
bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
bitflags!(
flags SealFlag: c_int {
pub flags SealFlag: c_int {
const F_SEAL_SEAL = 1,
const F_SEAL_SHRINK = 2,
const F_SEAL_GROW = 4,
@ -194,7 +194,7 @@ mod consts {
use libc::c_int;
bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
@ -216,7 +216,7 @@ mod consts {
);
bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
@ -227,7 +227,7 @@ mod consts {
use libc::c_int;
bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
@ -253,7 +253,7 @@ mod consts {
);
bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
@ -264,7 +264,7 @@ mod consts {
use libc::c_int;
bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
@ -294,7 +294,7 @@ mod consts {
);
bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
@ -305,7 +305,7 @@ mod consts {
use libc::c_int;
bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
@ -329,7 +329,7 @@ mod consts {
);
bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);

View File

@ -7,7 +7,7 @@
/// # Example
/// ```
/// libc_bitflags!{
/// flags ProtFlags: libc::c_int {
/// pub flags ProtFlags: libc::c_int {
/// PROT_NONE,
/// PROT_READ,
/// PROT_WRITE,

View File

@ -3,7 +3,7 @@ use libc;
use {Errno, Result, NixPath};
bitflags!(
flags MsFlags: c_ulong {
pub flags MsFlags: c_ulong {
const MS_RDONLY = 1 << 0, // Mount read-only
const MS_NOSUID = 1 << 1, // Ignore suid and sgid bits
const MS_NODEV = 1 << 2, // Disallow access to device special files
@ -42,7 +42,7 @@ bitflags!(
);
bitflags!(
flags MntFlags: c_int {
pub flags MntFlags: c_int {
const MNT_FORCE = 1 << 0,
const MNT_DETACH = 1 << 1,
const MNT_EXPIRE = 1 << 2

View File

@ -10,7 +10,7 @@ use sys::stat::Mode;
use std::mem;
libc_bitflags!{
flags MQ_OFlag: libc::c_int {
pub flags MQ_OFlag: libc::c_int {
O_RDONLY,
O_WRONLY,
O_RDWR,
@ -22,7 +22,7 @@ libc_bitflags!{
}
libc_bitflags!{
flags FdFlag: libc::c_int {
pub flags FdFlag: libc::c_int {
FD_CLOEXEC,
}
}

View File

@ -24,7 +24,7 @@ impl PollFd {
}
libc_bitflags! {
flags EventFlags: libc::c_short {
pub flags EventFlags: libc::c_short {
POLLIN,
POLLPRI,
POLLOUT,

View File

@ -7,7 +7,7 @@ use {Errno, Error, Result};
// For some functions taking with a parameter of type CloneFlags,
// only a subset of these flags have an effect.
libc_bitflags!{
flags CloneFlags: libc::c_int {
pub flags CloneFlags: libc::c_int {
CLONE_VM,
CLONE_FS,
CLONE_FILES,

View File

@ -7,7 +7,7 @@ use ::Error;
bitflags!(
#[repr(C)]
flags EpollFlags: u32 {
pub flags EpollFlags: u32 {
const EPOLLIN = 0x001,
const EPOLLPRI = 0x002,
const EPOLLOUT = 0x004,
@ -35,7 +35,7 @@ pub enum EpollOp {
}
libc_bitflags!{
flags EpollCreateFlags: c_int {
pub flags EpollCreateFlags: c_int {
EPOLL_CLOEXEC,
}
}

View File

@ -78,7 +78,7 @@ pub type type_of_event_flag = u16;
#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
pub type type_of_event_flag = u32;
libc_bitflags!{
flags EventFlag: type_of_event_flag {
pub flags EventFlag: type_of_event_flag {
EV_ADD,
EV_CLEAR,
EV_DELETE,
@ -106,7 +106,7 @@ libc_bitflags!{
}
bitflags!(
flags FilterFlag: u32 {
pub flags FilterFlag: u32 {
#[cfg(any(target_os = "macos", target_os = "ios"))]
const NOTE_ABSOLUTE = libc::NOTE_ABSOLUTE,
const NOTE_ATTRIB = libc::NOTE_ATTRIB,

View File

@ -3,7 +3,7 @@ use std::os::unix::io::RawFd;
use {Errno, Result};
libc_bitflags! {
flags EfdFlags: libc::c_int {
pub flags EfdFlags: libc::c_int {
EFD_CLOEXEC, // Since Linux 2.6.27
EFD_NONBLOCK, // Since Linux 2.6.27
EFD_SEMAPHORE, // Since Linux 2.6.30

View File

@ -4,7 +4,7 @@ use {Errno, Result};
use std::ffi::CStr;
bitflags!(
flags MemFdCreateFlag: libc::c_uint {
pub flags MemFdCreateFlag: libc::c_uint {
const MFD_CLOEXEC = 0x0001,
const MFD_ALLOW_SEALING = 0x0002,
}

View File

@ -7,7 +7,7 @@ use std::os::unix::io::RawFd;
pub use self::consts::*;
libc_bitflags!{
flags ProtFlags: libc::c_int {
pub flags ProtFlags: libc::c_int {
PROT_NONE,
PROT_READ,
PROT_WRITE,
@ -24,7 +24,7 @@ mod consts {
use libc::{self, c_int};
bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
@ -65,7 +65,7 @@ mod consts {
bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC,
const MS_INVALIDATE = libc::MS_INVALIDATE,
const MS_SYNC = libc::MS_SYNC,
@ -81,7 +81,7 @@ mod consts {
use libc::{self, c_int};
bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
@ -106,7 +106,7 @@ mod consts {
pub const MADV_CAN_REUSE : MmapAdvise = 9;
bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC, /* [MF|SIO] return immediately */
const MS_INVALIDATE = libc::MS_INVALIDATE, /* [MF|SIO] invalidate all cached data */
const MS_KILLPAGES = libc::MS_KILLPAGES, /* invalidate pages, leave mapped */
@ -123,7 +123,7 @@ mod consts {
use libc::{self, c_int};
bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
@ -161,7 +161,7 @@ mod consts {
pub const MADV_SETMAP : MmapAdvise = 11; /* set page table directory page for map */
bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC, /* [MF|SIO] return immediately */
const MS_INVALIDATE = libc::MS_INVALIDATE, /* [MF|SIO] invalidate all cached data */
#[cfg(not(target_os = "dragonfly"))]

View File

@ -41,7 +41,7 @@ pub mod quota {
bitflags!(
#[derive(Default)]
flags QuotaValidFlags: u32 {
pub flags QuotaValidFlags: u32 {
const QIF_BLIMITS = 1,
const QIF_SPACE = 2,
const QIF_ILIMITS = 4,

View File

@ -197,7 +197,7 @@ pub const SIGPOLL : Signal = SIGIO;
pub const SIGUNUSED : Signal = SIGSYS;
bitflags!{
flags SaFlags: libc::c_int {
pub flags SaFlags: libc::c_int {
const SA_NOCLDSTOP = libc::SA_NOCLDSTOP,
const SA_NOCLDWAIT = libc::SA_NOCLDWAIT,
const SA_NODEFER = libc::SA_NODEFER,

View File

@ -26,7 +26,7 @@ use std::mem;
bitflags!{
flags SfdFlags: libc::c_int {
pub flags SfdFlags: libc::c_int {
const SFD_NONBLOCK = libc::SFD_NONBLOCK,
const SFD_CLOEXEC = libc::SFD_CLOEXEC,
}

View File

@ -90,7 +90,7 @@ mod os {
// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags: libc::c_int {
const MSG_OOB = 0x0001,
const MSG_PEEK = 0x0002,
const MSG_CTRUNC = 0x0008,
@ -232,7 +232,7 @@ mod os {
// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags: libc::c_int {
const MSG_OOB = 0x01,
const MSG_PEEK = 0x02,
const MSG_EOR = 0x08,
@ -318,7 +318,7 @@ mod os {
// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags: libc::c_int {
const MSG_OOB = 0x01,
const MSG_PEEK = 0x02,
const MSG_DONTWAIT = 0x80,

View File

@ -64,7 +64,7 @@ pub enum SockType {
// Extra flags - Supported by Linux 2.6.27, normalized on other platforms
bitflags!(
flags SockFlag: c_int {
pub flags SockFlag: c_int {
const SOCK_NONBLOCK = 0o0004000,
const SOCK_CLOEXEC = 0o2000000
}

View File

@ -17,7 +17,7 @@ mod ffi {
}
bitflags!(
flags SFlag: mode_t {
pub flags SFlag: mode_t {
const S_IFIFO = libc::S_IFIFO,
const S_IFCHR = libc::S_IFCHR,
const S_IFDIR = libc::S_IFDIR,
@ -30,7 +30,7 @@ bitflags!(
);
bitflags! {
flags Mode: mode_t {
pub flags Mode: mode_t {
const S_IRWXU = libc::S_IRWXU,
const S_IRUSR = libc::S_IRUSR,
const S_IWUSR = libc::S_IWUSR,

View File

@ -21,7 +21,7 @@ pub mod vfs {
/// Mount Flags
#[repr(C)]
#[derive(Default)]
flags FsFlags: c_ulong {
pub flags FsFlags: c_ulong {
/// Read Only
const RDONLY = 1,
/// Do not allow the set-uid bits to have an effect

View File

@ -146,7 +146,7 @@ mod ffi {
pub const NCCS: usize = 20;
bitflags! {
flags InputFlags: tcflag_t {
pub flags InputFlags: tcflag_t {
const IGNBRK = 0x00000001,
const BRKINT = 0x00000002,
const IGNPAR = 0x00000004,
@ -166,7 +166,7 @@ mod ffi {
}
bitflags! {
flags OutputFlags: tcflag_t {
pub flags OutputFlags: tcflag_t {
const OPOST = 0x00000001,
const ONLCR = 0x00000002,
const OXTABS = 0x00000004,
@ -175,7 +175,7 @@ mod ffi {
}
bitflags! {
flags ControlFlags: tcflag_t {
pub flags ControlFlags: tcflag_t {
const CIGNORE = 0x00000001,
const CSIZE = 0x00000300,
const CS5 = 0x00000000,
@ -199,7 +199,7 @@ mod ffi {
}
bitflags! {
flags LocalFlags: tcflag_t {
pub flags LocalFlags: tcflag_t {
const ECHOKE = 0x00000001,
const ECHOE = 0x00000002,
const ECHOK = 0x00000004,
@ -312,7 +312,7 @@ mod ffi {
pub const NCCS: usize = 32;
bitflags! {
flags InputFlags: tcflag_t {
pub flags InputFlags: tcflag_t {
const IGNBRK = 0x00000001,
const BRKINT = 0x00000002,
const IGNPAR = 0x00000004,
@ -331,14 +331,14 @@ mod ffi {
}
bitflags! {
flags OutputFlags: tcflag_t {
pub flags OutputFlags: tcflag_t {
const OPOST = 0x00000001,
const ONLCR = 0x00000004,
}
}
bitflags! {
flags ControlFlags: tcflag_t {
pub flags ControlFlags: tcflag_t {
const CSIZE = 0x00000030,
const CS5 = 0x00000000,
const CS6 = 0x00000010,
@ -357,7 +357,7 @@ mod ffi {
}
bitflags! {
flags LocalFlags: tcflag_t {
pub flags LocalFlags: tcflag_t {
const ECHOKE = 0x00000800,
const ECHOE = 0x00000010,
const ECHOK = 0x00000020,

View File

@ -14,7 +14,7 @@ mod ffi {
#[cfg(not(any(target_os = "linux",
target_os = "android")))]
bitflags!(
flags WaitPidFlag: c_int {
pub flags WaitPidFlag: c_int {
const WNOHANG = libc::WNOHANG,
const WUNTRACED = libc::WUNTRACED,
}
@ -23,7 +23,7 @@ bitflags!(
#[cfg(any(target_os = "linux",
target_os = "android"))]
bitflags!(
flags WaitPidFlag: c_int {
pub flags WaitPidFlag: c_int {
const WNOHANG = libc::WNOHANG,
const WUNTRACED = libc::WUNTRACED,
const WEXITED = libc::WEXITED,