Skip to content

Commit e3e237d

Browse files
committed
Auto merge of #3346 - devnexen:copyfile_apple_upd, r=JohnTitor
copyfile apple api update
2 parents d453f92 + 0f66767 commit e3e237d

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

libc-test/semver/apple.txt

+18
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,19 @@ COPYFILE_SECURITY
245245
COPYFILE_SKIP
246246
COPYFILE_START
247247
COPYFILE_STAT
248+
COPYFILE_STATE_BSIZE
249+
COPYFILE_STATE_COPIED
250+
COPYFILE_STATE_DST_BSIZE
251+
COPYFILE_STATE_DST_FD
252+
COPYFILE_STATE_DST_FILENAME
253+
COPYFILE_STATE_QUARANTINE
254+
COPYFILE_STATE_SRC_BSIZE
255+
COPYFILE_STATE_SRC_FD
256+
COPYFILE_STATE_SRC_FILENAME
257+
COPYFILE_STATE_STATUS_CB
258+
COPYFILE_STATE_STATUS_CTX
259+
COPYFILE_STATE_XATTRNAME
260+
COPYFILE_STATE_WAS_CLONED
248261
COPYFILE_VERBOSE
249262
COPYFILE_UNLINK
250263
COPYFILE_XATTR
@@ -1844,7 +1857,12 @@ cmsghdr
18441857
confstr
18451858
connectx
18461859
copyfile
1860+
copyfile_callback_t
18471861
copyfile_flags_t
1862+
copyfile_state_alloc
1863+
copyfile_state_free
1864+
copyfile_state_get
1865+
copyfile_state_set
18481866
cpu_subtype_t
18491867
cpu_type_t
18501868
ctime

src/unix/bsd/apple/mod.rs

+27
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,16 @@ pub type CCRNGStatus = ::CCCryptorStatus;
145145

146146
pub type copyfile_state_t = *mut ::c_void;
147147
pub type copyfile_flags_t = u32;
148+
pub type copyfile_callback_t = ::Option<
149+
extern "C" fn(
150+
::c_int,
151+
::c_int,
152+
copyfile_state_t,
153+
*const ::c_char,
154+
*const ::c_char,
155+
*mut ::c_void,
156+
) -> ::c_int,
157+
>;
148158

149159
pub type attrgroup_t = u32;
150160
pub type vol_capabilities_set_t = [u32; 4];
@@ -4911,6 +4921,19 @@ pub const COPYFILE_PROGRESS: ::c_int = 4;
49114921
pub const COPYFILE_CONTINUE: ::c_int = 0;
49124922
pub const COPYFILE_SKIP: ::c_int = 1;
49134923
pub const COPYFILE_QUIT: ::c_int = 2;
4924+
pub const COPYFILE_STATE_SRC_FD: ::c_int = 1;
4925+
pub const COPYFILE_STATE_SRC_FILENAME: ::c_int = 2;
4926+
pub const COPYFILE_STATE_DST_FD: ::c_int = 3;
4927+
pub const COPYFILE_STATE_DST_FILENAME: ::c_int = 4;
4928+
pub const COPYFILE_STATE_QUARANTINE: ::c_int = 5;
4929+
pub const COPYFILE_STATE_STATUS_CB: ::c_int = 6;
4930+
pub const COPYFILE_STATE_STATUS_CTX: ::c_int = 7;
4931+
pub const COPYFILE_STATE_COPIED: ::c_int = 8;
4932+
pub const COPYFILE_STATE_XATTRNAME: ::c_int = 9;
4933+
pub const COPYFILE_STATE_WAS_CLONED: ::c_int = 10;
4934+
pub const COPYFILE_STATE_SRC_BSIZE: ::c_int = 11;
4935+
pub const COPYFILE_STATE_DST_BSIZE: ::c_int = 12;
4936+
pub const COPYFILE_STATE_BSIZE: ::c_int = 13;
49144937

49154938
// <sys/attr.h>
49164939
pub const ATTR_BIT_MAP_COUNT: ::c_ushort = 5;
@@ -5819,6 +5842,10 @@ extern "C" {
58195842
state: copyfile_state_t,
58205843
flags: copyfile_flags_t,
58215844
) -> ::c_int;
5845+
pub fn copyfile_state_free(s: copyfile_state_t) -> ::c_int;
5846+
pub fn copyfile_state_alloc() -> copyfile_state_t;
5847+
pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut ::c_void) -> ::c_int;
5848+
pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const ::c_void) -> ::c_int;
58225849

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

0 commit comments

Comments
 (0)