summaryrefslogtreecommitdiffstats
path: root/vendor/core-foundation-sys/src/bit_vector.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/core-foundation-sys/src/bit_vector.rs
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-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/bit_vector.rs')
-rw-r--r--vendor/core-foundation-sys/src/bit_vector.rs74
1 files changed, 74 insertions, 0 deletions
diff --git a/vendor/core-foundation-sys/src/bit_vector.rs b/vendor/core-foundation-sys/src/bit_vector.rs
new file mode 100644
index 000000000..f270c3d1d
--- /dev/null
+++ b/vendor/core-foundation-sys/src/bit_vector.rs
@@ -0,0 +1,74 @@
+// Copyright 2023 The Servo Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::os::raw::c_void;
+
+use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, UInt32, UInt8};
+
+#[repr(C)]
+pub struct __CFBitVector(c_void);
+
+pub type CFBitVectorRef = *const __CFBitVector;
+pub type CFMutableBitVectorRef = *mut __CFBitVector;
+pub type CFBit = UInt32;
+
+extern "C" {
+ /*
+ * CFBitVector.h
+ */
+
+ /* CFBitVector */
+ /* Creating a Bit Vector */
+ pub fn CFBitVectorCreate(
+ allocator: CFAllocatorRef,
+ bytes: *const UInt8,
+ numBits: CFIndex,
+ ) -> CFBitVectorRef;
+ pub fn CFBitVectorCreateCopy(allocator: CFAllocatorRef, bv: CFBitVectorRef) -> CFBitVectorRef;
+
+ /* Getting Information About a Bit Vector */
+ pub fn CFBitVectorContainsBit(bv: CFBitVectorRef, range: CFRange, value: CFBit) -> Boolean;
+ pub fn CFBitVectorGetBitAtIndex(bv: CFBitVectorRef, idx: CFIndex) -> CFBit;
+ pub fn CFBitVectorGetBits(bv: CFBitVectorRef, range: CFRange, bytes: *mut UInt8);
+ pub fn CFBitVectorGetCount(bv: CFBitVectorRef) -> CFIndex;
+ pub fn CFBitVectorGetCountOfBit(bv: CFBitVectorRef, range: CFRange, value: CFBit) -> CFIndex;
+ pub fn CFBitVectorGetFirstIndexOfBit(
+ bv: CFBitVectorRef,
+ range: CFRange,
+ value: CFBit,
+ ) -> CFIndex;
+ pub fn CFBitVectorGetLastIndexOfBit(
+ bv: CFBitVectorRef,
+ range: CFRange,
+ value: CFBit,
+ ) -> CFIndex;
+
+ /* Getting the CFBitVector Type ID */
+ pub fn CFBitVectorGetTypeID() -> CFTypeID;
+
+ /* CFMutableBitVector */
+ /* Creating a CFMutableBitVector Object */
+ pub fn CFBitVectorCreateMutable(
+ allocator: CFAllocatorRef,
+ capacity: CFIndex,
+ ) -> CFMutableBitVectorRef;
+ pub fn CFBitVectorCreateMutableCopy(
+ allocator: CFAllocatorRef,
+ capacity: CFIndex,
+ bv: CFBitVectorRef,
+ ) -> CFMutableBitVectorRef;
+
+ /* Modifying a Bit Vector */
+ pub fn CFBitVectorFlipBitAtIndex(bv: CFMutableBitVectorRef, idx: CFIndex);
+ pub fn CFBitVectorFlipBits(bv: CFMutableBitVectorRef, range: CFRange);
+ pub fn CFBitVectorSetAllBits(bv: CFMutableBitVectorRef, value: CFBit);
+ pub fn CFBitVectorSetBitAtIndex(bv: CFMutableBitVectorRef, idx: CFIndex, value: CFBit);
+ pub fn CFBitVectorSetBits(bv: CFMutableBitVectorRef, range: CFRange, value: CFBit);
+ pub fn CFBitVectorSetCount(bv: CFMutableBitVectorRef, count: CFIndex);
+}