libbtrfs 0.0.20

Rust library for working with the btrfs filesystem
Documentation
//! Type coercions for syscall arguments when using the syscalls crate
//! Note: cannot be defined as rust functions because some syscalls are defined as variadic functions
macro_rules! def {
    (ioctl ($fd:expr, $op:expr, $argp:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::ioctl,
            $fd as ::libc::c_int,
            $op as ::libc::Ioctl,
            $argp as *mut _
        )
    };

    (open ($pathname:expr, $flags:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::open,
            $pathname as *const ::libc::c_char,
            $flags as ::libc::c_int
        )
    };

    (open ($pathname:expr, $flags:expr, $mode:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::open,
            $pathname as *const ::libc::c_char,
            $flags as ::libc::c_int,
            $mode as ::libc::mode_t
        )
    };

    (openat ($dirfd:expr, $pathname:expr, $flags:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::openat,
            $dirfd as ::libc::c_int,
            $pathname as *const ::libc::c_char,
            $flags as ::libc::c_int
        )
    };

    (openat ($dirfd:expr, $pathname:expr, $flags:expr, $mode:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::openat,
            $dirfd as ::libc::c_int,
            $pathname as *const ::libc::c_char,
            $flags as ::libc::c_int,
            $mode as ::libc::mode_t
        )
    };

    (close ($fd:expr)) => {
        ::syscalls::syscall!(::syscalls::Sysno::close, $fd as ::libc::c_int)
    };

    (fstat ($fd:expr, $statbuf:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::statfs,
            $fd as ::libc::c_int,
            $statbuf as *mut ::libc::stat
        )
    };

    (statfs ($path:expr, $buf:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::statfs,
            $path as *const ::libc::c_char,
            $buf as *mut ::libc::statfs
        )
    };

    (fstatfs ($fd:expr, $buf:expr)) => {
        ::syscalls::syscall!(
            ::syscalls::Sysno::fstatfs,
            $fd as ::libc::c_int,
            $buf as *mut ::libc::statfs
        )
    };
}

pub(crate) use def;