diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 09:26:03 +0000 |
commit | 9918693037dce8aa4bb6f08741b6812923486c18 (patch) | |
tree | 21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/core-foundation-sys/src/array.rs | |
parent | Releasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff) | |
download | rustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip |
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/core-foundation-sys/src/array.rs')
-rw-r--r-- | vendor/core-foundation-sys/src/array.rs | 127 |
1 files changed, 101 insertions, 26 deletions
diff --git a/vendor/core-foundation-sys/src/array.rs b/vendor/core-foundation-sys/src/array.rs index c73896125..1e521b3e4 100644 --- a/vendor/core-foundation-sys/src/array.rs +++ b/vendor/core-foundation-sys/src/array.rs @@ -9,18 +9,19 @@ use std::os::raw::c_void; -use base::{CFRange, CFIndex, CFAllocatorRef, CFTypeID, Boolean, CFComparisonResult}; -use string::CFStringRef; +use crate::base::{Boolean, CFAllocatorRef, CFComparatorFunction, CFIndex, CFRange, CFTypeID}; +use crate::string::CFStringRef; -pub type CFArrayRetainCallBack = extern "C" fn(allocator: CFAllocatorRef, value: *const c_void) -> *const c_void; +pub type CFArrayRetainCallBack = + extern "C" fn(allocator: CFAllocatorRef, value: *const c_void) -> *const c_void; pub type CFArrayReleaseCallBack = extern "C" fn(allocator: CFAllocatorRef, value: *const c_void); pub type CFArrayCopyDescriptionCallBack = extern "C" fn(value: *const c_void) -> CFStringRef; -pub type CFArrayEqualCallBack = extern "C" fn(value1: *const c_void, value2: *const c_void) -> Boolean; +pub type CFArrayEqualCallBack = + extern "C" fn(value1: *const c_void, value2: *const c_void) -> Boolean; pub type CFArrayApplierFunction = extern "C" fn(value: *const c_void, context: *mut c_void); -pub type CFComparatorFunction = extern "C" fn(val1: *const c_void, val2: *const c_void) -> CFComparisonResult; #[repr(C)] -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct CFArrayCallBacks { pub version: CFIndex, pub retain: CFArrayRetainCallBack, @@ -35,33 +36,107 @@ pub struct __CFArray(c_void); pub type CFArrayRef = *const __CFArray; pub type CFMutableArrayRef = *mut __CFArray; -extern { +extern "C" { /* * CFArray.h */ + pub static kCFTypeArrayCallBacks: CFArrayCallBacks; - pub fn CFArrayGetTypeID() -> CFTypeID; - pub fn CFArrayCreate(allocator: CFAllocatorRef, values: *const *const c_void, numValues: CFIndex, callBacks: *const CFArrayCallBacks) -> CFArrayRef; - pub fn CFArrayCreateCopy(allocator: CFAllocatorRef , theArray: CFArrayRef) -> CFArrayRef; - pub fn CFArrayCreateMutable(allocator: CFAllocatorRef, capacity: CFIndex, callBacks: *const CFArrayCallBacks) -> CFMutableArrayRef; - pub fn CFArrayCreateMutableCopy(allocator: CFAllocatorRef, capacity: CFIndex, theArray: CFArrayRef)-> CFMutableArrayRef; + /* CFArray */ + /* Creating an Array */ + pub fn CFArrayCreate( + allocator: CFAllocatorRef, + values: *const *const c_void, + numValues: CFIndex, + callBacks: *const CFArrayCallBacks, + ) -> CFArrayRef; + pub fn CFArrayCreateCopy(allocator: CFAllocatorRef, theArray: CFArrayRef) -> CFArrayRef; + + /* Examining an Array */ + pub fn CFArrayBSearchValues( + theArray: CFArrayRef, + range: CFRange, + value: *const c_void, + comparator: CFComparatorFunction, + context: *mut c_void, + ) -> CFIndex; + pub fn CFArrayContainsValue( + theArray: CFArrayRef, + range: CFRange, + value: *const c_void, + ) -> Boolean; pub fn CFArrayGetCount(theArray: CFArrayRef) -> CFIndex; - pub fn CFArrayGetCountOfValue(theArray: CFArrayRef, range: CFRange, value: *const c_void) -> CFIndex; - pub fn CFArrayContainsValue(theArray: CFArrayRef, range: CFRange, value: *const c_void) -> Boolean; - pub fn CFArrayGetValueAtIndex(theArray: CFArrayRef, idx: CFIndex) -> *const c_void; + pub fn CFArrayGetCountOfValue( + theArray: CFArrayRef, + range: CFRange, + value: *const c_void, + ) -> CFIndex; + pub fn CFArrayGetFirstIndexOfValue( + theArray: CFArrayRef, + range: CFRange, + value: *const c_void, + ) -> CFIndex; + pub fn CFArrayGetLastIndexOfValue( + theArray: CFArrayRef, + range: CFRange, + value: *const c_void, + ) -> CFIndex; pub fn CFArrayGetValues(theArray: CFArrayRef, range: CFRange, values: *mut *const c_void); - pub fn CFArrayApplyFunction(theArray: CFArrayRef, range: CFRange, applier: CFArrayApplierFunction, context: *mut c_void); - pub fn CFArrayGetFirstIndexOfValue(theArray: CFArrayRef, range: CFRange, value: *const c_void) -> CFIndex; - pub fn CFArrayGetLastIndexOfValue(theArray: CFArrayRef, range: CFRange, value: *const c_void) -> CFIndex; - pub fn CFArrayBSearchValues(theArray: CFArrayRef, range: CFRange, value: *const c_void, comparator: CFComparatorFunction, context: *mut c_void) -> CFIndex; + pub fn CFArrayGetValueAtIndex(theArray: CFArrayRef, idx: CFIndex) -> *const c_void; + + /* Applying a Function to Elements */ + pub fn CFArrayApplyFunction( + theArray: CFArrayRef, + range: CFRange, + applier: CFArrayApplierFunction, + context: *mut c_void, + ); + + /* Getting the CFArray Type ID */ + pub fn CFArrayGetTypeID() -> CFTypeID; + + /* CFMutableArray */ + /* CFMutableArray Miscellaneous Functions */ + pub fn CFArrayAppendArray( + theArray: CFMutableArrayRef, + otherArray: CFArrayRef, + otherRange: CFRange, + ); pub fn CFArrayAppendValue(theArray: CFMutableArrayRef, value: *const c_void); - pub fn CFArrayInsertValueAtIndex(theArray: CFMutableArrayRef, idx: CFIndex, value: *const c_void); - pub fn CFArraySetValueAtIndex(theArray: CFMutableArrayRef, idx: CFIndex, value: *const c_void); - pub fn CFArrayRemoveValueAtIndex(theArray: CFMutableArrayRef, idx: CFIndex); + pub fn CFArrayCreateMutable( + allocator: CFAllocatorRef, + capacity: CFIndex, + callBacks: *const CFArrayCallBacks, + ) -> CFMutableArrayRef; + pub fn CFArrayCreateMutableCopy( + allocator: CFAllocatorRef, + capacity: CFIndex, + theArray: CFArrayRef, + ) -> CFMutableArrayRef; + pub fn CFArrayExchangeValuesAtIndices( + theArray: CFMutableArrayRef, + idx1: CFIndex, + idx2: CFIndex, + ); + pub fn CFArrayInsertValueAtIndex( + theArray: CFMutableArrayRef, + idx: CFIndex, + value: *const c_void, + ); pub fn CFArrayRemoveAllValues(theArray: CFMutableArrayRef); - pub fn CFArrayReplaceValues(theArray: CFMutableArrayRef, range: CFRange, newValues: *mut *const c_void, newCount: CFIndex); - pub fn CFArrayExchangeValuesAtIndices(theArray: CFMutableArrayRef, idx1: CFIndex, idx2: CFIndex); - pub fn CFArraySortValues(theArray: CFMutableArrayRef, range: CFRange, comparator: CFComparatorFunction, context: *mut c_void); - pub fn CFArrayAppendArray(theArray: CFMutableArrayRef, otherArray: CFArrayRef, otherRange: CFRange ); + pub fn CFArrayRemoveValueAtIndex(theArray: CFMutableArrayRef, idx: CFIndex); + pub fn CFArrayReplaceValues( + theArray: CFMutableArrayRef, + range: CFRange, + newValues: *mut *const c_void, + newCount: CFIndex, + ); + pub fn CFArraySetValueAtIndex(theArray: CFMutableArrayRef, idx: CFIndex, value: *const c_void); + pub fn CFArraySortValues( + theArray: CFMutableArrayRef, + range: CFRange, + comparator: CFComparatorFunction, + context: *mut c_void, + ); } |