Skip to content

Commit

Permalink
copyfile apple api update
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Sep 9, 2023
1 parent 8356615 commit 0f66767
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
18 changes: 18 additions & 0 deletions libc-test/semver/apple.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@ COPYFILE_SECURITY
COPYFILE_SKIP
COPYFILE_START
COPYFILE_STAT
COPYFILE_STATE_BSIZE
COPYFILE_STATE_COPIED
COPYFILE_STATE_DST_BSIZE
COPYFILE_STATE_DST_FD
COPYFILE_STATE_DST_FILENAME
COPYFILE_STATE_QUARANTINE
COPYFILE_STATE_SRC_BSIZE
COPYFILE_STATE_SRC_FD
COPYFILE_STATE_SRC_FILENAME
COPYFILE_STATE_STATUS_CB
COPYFILE_STATE_STATUS_CTX
COPYFILE_STATE_XATTRNAME
COPYFILE_STATE_WAS_CLONED
COPYFILE_VERBOSE
COPYFILE_UNLINK
COPYFILE_XATTR
Expand Down Expand Up @@ -1844,7 +1857,12 @@ cmsghdr
confstr
connectx
copyfile
copyfile_callback_t
copyfile_flags_t
copyfile_state_alloc
copyfile_state_free
copyfile_state_get
copyfile_state_set
cpu_subtype_t
cpu_type_t
ctime
Expand Down
27 changes: 27 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ pub type CCRNGStatus = ::CCCryptorStatus;

pub type copyfile_state_t = *mut ::c_void;
pub type copyfile_flags_t = u32;
pub type copyfile_callback_t = ::Option<
extern "C" fn(
::c_int,
::c_int,
copyfile_state_t,
*const ::c_char,
*const ::c_char,
*mut ::c_void,
) -> ::c_int,
>;

pub type attrgroup_t = u32;
pub type vol_capabilities_set_t = [u32; 4];
Expand Down Expand Up @@ -4911,6 +4921,19 @@ pub const COPYFILE_PROGRESS: ::c_int = 4;
pub const COPYFILE_CONTINUE: ::c_int = 0;
pub const COPYFILE_SKIP: ::c_int = 1;
pub const COPYFILE_QUIT: ::c_int = 2;
pub const COPYFILE_STATE_SRC_FD: ::c_int = 1;
pub const COPYFILE_STATE_SRC_FILENAME: ::c_int = 2;
pub const COPYFILE_STATE_DST_FD: ::c_int = 3;
pub const COPYFILE_STATE_DST_FILENAME: ::c_int = 4;
pub const COPYFILE_STATE_QUARANTINE: ::c_int = 5;
pub const COPYFILE_STATE_STATUS_CB: ::c_int = 6;
pub const COPYFILE_STATE_STATUS_CTX: ::c_int = 7;
pub const COPYFILE_STATE_COPIED: ::c_int = 8;
pub const COPYFILE_STATE_XATTRNAME: ::c_int = 9;
pub const COPYFILE_STATE_WAS_CLONED: ::c_int = 10;
pub const COPYFILE_STATE_SRC_BSIZE: ::c_int = 11;
pub const COPYFILE_STATE_DST_BSIZE: ::c_int = 12;
pub const COPYFILE_STATE_BSIZE: ::c_int = 13;

// <sys/attr.h>
pub const ATTR_BIT_MAP_COUNT: ::c_ushort = 5;
Expand Down Expand Up @@ -5819,6 +5842,10 @@ extern "C" {
state: copyfile_state_t,
flags: copyfile_flags_t,
) -> ::c_int;
pub fn copyfile_state_free(s: copyfile_state_t) -> ::c_int;
pub fn copyfile_state_alloc() -> copyfile_state_t;
pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;

// Added in macOS 10.13
// ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1
Expand Down

0 comments on commit 0f66767

Please sign in to comment.