core-foundation-sys-0.8.1/.cargo_vcs_info.json0000644000000001121373016264300150070ustar { "git": { "sha1": "4a26ac3970d2ac134f016d5e1d32e5dc7aae790e" } } core-foundation-sys-0.8.1/Cargo.toml0000644000000017341373016264300130200ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're # editing this file be aware that the upstream Cargo.toml # will likely look very different (and much more reasonable) [package] name = "core-foundation-sys" version = "0.8.1" authors = ["The Servo Project Developers"] build = "build.rs" description = "Bindings to Core Foundation for macOS" homepage = "https://github.com/servo/core-foundation-rs" license = "MIT / Apache-2.0" repository = "https://github.com/servo/core-foundation-rs" [package.metadata.docs.rs] default-target = "x86_64-apple-darwin" [dependencies] [features] mac_os_10_7_support = [] mac_os_10_8_features = [] core-foundation-sys-0.8.1/Cargo.toml.orig010064400007650000024000000010011373016252200164670ustar 00000000000000[package] name = "core-foundation-sys" description = "Bindings to Core Foundation for macOS" homepage = "https://github.com/servo/core-foundation-rs" repository = "https://github.com/servo/core-foundation-rs" version = "0.8.1" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" build = "build.rs" [dependencies] [features] mac_os_10_7_support = [] # backwards compatibility mac_os_10_8_features = [] # enables new features [package.metadata.docs.rs] default-target = "x86_64-apple-darwin" core-foundation-sys-0.8.1/LICENSE-APACHE010064400007650000024000000251371312102447300155400ustar 00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. core-foundation-sys-0.8.1/LICENSE-MIT010064400007650000024000000020531312102447300152400ustar 00000000000000Copyright (c) 2012-2013 Mozilla Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. core-foundation-sys-0.8.1/build.rs010064400007650000024000000011041314265071400152530ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. fn main() { if std::env::var("TARGET").unwrap().contains("-apple") { println!("cargo:rustc-link-lib=framework=CoreFoundation"); } } core-foundation-sys-0.8.1/src/array.rs010064400007650000024000000041521324406220200160570ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFRange, CFIndex, CFAllocatorRef, CFTypeID, Boolean}; use string::CFStringRef; 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; #[repr(C)] #[derive(Clone, Copy)] pub struct CFArrayCallBacks { pub version: CFIndex, pub retain: CFArrayRetainCallBack, pub release: CFArrayReleaseCallBack, pub copyDescription: CFArrayCopyDescriptionCallBack, pub equal: CFArrayEqualCallBack, } #[repr(C)] pub struct __CFArray(c_void); pub type CFArrayRef = *const __CFArray; extern { /* * CFArray.h */ pub static kCFTypeArrayCallBacks: CFArrayCallBacks; pub fn CFArrayCreate(allocator: CFAllocatorRef, values: *const *const c_void, numValues: CFIndex, callBacks: *const CFArrayCallBacks) -> CFArrayRef; pub fn CFArrayCreateCopy(allocator: CFAllocatorRef , theArray: CFArrayRef) -> CFArrayRef; // CFArrayBSearchValues // CFArrayContainsValue pub fn CFArrayGetCount(theArray: CFArrayRef) -> CFIndex; // CFArrayGetCountOfValue // CFArrayGetFirstIndexOfValue // CFArrayGetLastIndexOfValue pub fn CFArrayGetValues(theArray: CFArrayRef, range: CFRange, values: *mut *const c_void); pub fn CFArrayGetValueAtIndex(theArray: CFArrayRef, idx: CFIndex) -> *const c_void; // CFArrayApplyFunction pub fn CFArrayGetTypeID() -> CFTypeID; } core-foundation-sys-0.8.1/src/attributed_string.rs010064400007650000024000000033571366027130600205150ustar 00000000000000// Copyright 2013 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFTypeRef, CFIndex, CFRange, CFTypeID}; use string::CFStringRef; use dictionary::CFDictionaryRef; #[repr(C)] pub struct __CFAttributedString(c_void); pub type CFAttributedStringRef = *const __CFAttributedString; pub type CFMutableAttributedStringRef = *const __CFAttributedString; extern { /* CFAttributedString */ pub fn CFAttributedStringCreate( allocator: CFAllocatorRef, str: CFStringRef, attributes: CFDictionaryRef, ) -> CFAttributedStringRef; pub fn CFAttributedStringGetLength(astr: CFAttributedStringRef) -> CFIndex; pub fn CFAttributedStringGetTypeID() -> CFTypeID; /* CFMutableAttributedString */ pub fn CFAttributedStringCreateMutableCopy( allocator: CFAllocatorRef, max_length: CFIndex, astr: CFAttributedStringRef ) -> CFMutableAttributedStringRef; pub fn CFAttributedStringCreateMutable( allocator: CFAllocatorRef, max_length: CFIndex, ) -> CFMutableAttributedStringRef; pub fn CFAttributedStringReplaceString( astr: CFMutableAttributedStringRef, range: CFRange, replacement: CFStringRef); pub fn CFAttributedStringSetAttribute( astr: CFMutableAttributedStringRef, range: CFRange, attr_name: CFStringRef, value: CFTypeRef, ); } core-foundation-sys-0.8.1/src/base.rs010064400007650000024000000124641366027130600156710ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::cmp::Ordering; use std::os::raw::{c_uint, c_void, c_int}; use string::CFStringRef; pub type Boolean = u8; pub type mach_port_t = c_uint; pub type CFAllocatorRef = *const c_void; pub type CFNullRef = *const c_void; pub type CFTypeRef = *const c_void; pub type OSStatus = i32; pub type SInt32 = c_int; pub type CFTypeID = usize; pub type CFOptionFlags = usize; pub type CFHashCode = usize; pub type CFIndex = isize; #[repr(isize)] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CFComparisonResult { LessThan = -1, EqualTo = 0, GreaterThan = 1, } impl Into for CFComparisonResult { fn into(self) -> Ordering { match self { CFComparisonResult::LessThan => Ordering::Less, CFComparisonResult::EqualTo => Ordering::Equal, CFComparisonResult::GreaterThan => Ordering::Greater } } } #[repr(C)] #[derive(Clone, Copy)] pub struct CFRange { pub location: CFIndex, pub length: CFIndex } // for back-compat impl CFRange { pub fn init(location: CFIndex, length: CFIndex) -> CFRange { CFRange { location: location, length: length, } } } pub type CFAllocatorRetainCallBack = extern "C" fn(info: *mut c_void) -> *mut c_void; pub type CFAllocatorReleaseCallBack = extern "C" fn(info: *mut c_void); pub type CFAllocatorCopyDescriptionCallBack = extern "C" fn(info: *mut c_void) -> CFStringRef; pub type CFAllocatorAllocateCallBack = extern "C" fn(allocSize: CFIndex, hint: CFOptionFlags, info: *mut c_void) -> *mut c_void; pub type CFAllocatorReallocateCallBack = extern "C" fn(ptr: *mut c_void, newsize: CFIndex, hint: CFOptionFlags, info: *mut c_void) -> *mut c_void; pub type CFAllocatorDeallocateCallBack = extern "C" fn(ptr: *mut c_void, info: *mut c_void); pub type CFAllocatorPreferredSizeCallBack = extern "C" fn(size: CFIndex, hint: CFOptionFlags, info: *mut c_void) -> CFIndex; #[repr(C)] #[derive(Clone, Copy)] pub struct CFAllocatorContext { pub version: CFIndex, pub info: *mut c_void, pub retain: CFAllocatorRetainCallBack, pub release: CFAllocatorReleaseCallBack, pub copyDescription: CFAllocatorCopyDescriptionCallBack, pub allocate: CFAllocatorAllocateCallBack, pub reallocate: CFAllocatorReallocateCallBack, pub deallocate: CFAllocatorDeallocateCallBack, pub preferredSize: CFAllocatorPreferredSizeCallBack } /// Trait for all types which are Core Foundation reference types. pub trait TCFTypeRef { fn as_void_ptr(&self) -> *const c_void; unsafe fn from_void_ptr(ptr: *const c_void) -> Self; } impl TCFTypeRef for *const T { fn as_void_ptr(&self) -> *const c_void { (*self) as *const c_void } unsafe fn from_void_ptr(ptr: *const c_void) -> Self { ptr as *const T } } impl TCFTypeRef for *mut T { fn as_void_ptr(&self) -> *const c_void { (*self) as *const T as *const c_void } unsafe fn from_void_ptr(ptr: *const c_void) -> Self { ptr as *const T as *mut T } } /// Constant used by some functions to indicate failed searches. pub static kCFNotFound: CFIndex = -1; extern { /* * CFBase.h */ /* CFAllocator Reference */ pub static kCFAllocatorDefault: CFAllocatorRef; pub static kCFAllocatorSystemDefault: CFAllocatorRef; pub static kCFAllocatorMalloc: CFAllocatorRef; pub static kCFAllocatorMallocZone: CFAllocatorRef; pub static kCFAllocatorNull: CFAllocatorRef; pub static kCFAllocatorUseContext: CFAllocatorRef; pub fn CFAllocatorCreate(allocator: CFAllocatorRef, context: *mut CFAllocatorContext) -> CFAllocatorRef; pub fn CFAllocatorAllocate(allocator: CFAllocatorRef, size: CFIndex, hint: CFOptionFlags) -> *mut c_void; pub fn CFAllocatorDeallocate(allocator: CFAllocatorRef, ptr: *mut c_void); pub fn CFAllocatorGetPreferredSizeForSize(allocator: CFAllocatorRef, size: CFIndex, hint: CFOptionFlags) -> CFIndex; pub fn CFAllocatorReallocate(allocator: CFAllocatorRef, ptr: *mut c_void, newsize: CFIndex, hint: CFOptionFlags) -> *mut c_void; pub fn CFAllocatorGetDefault() -> CFAllocatorRef; pub fn CFAllocatorSetDefault(allocator: CFAllocatorRef); pub fn CFAllocatorGetContext(allocator: CFAllocatorRef, context: *mut CFAllocatorContext); pub fn CFAllocatorGetTypeID() -> CFTypeID; /* CFNull Reference */ pub static kCFNull: CFNullRef; /* CFType Reference */ //fn CFCopyTypeIDDescription //fn CFGetAllocator pub fn CFCopyDescription(cf: CFTypeRef) -> CFStringRef; pub fn CFEqual(cf1: CFTypeRef, cf2: CFTypeRef) -> Boolean; pub fn CFGetRetainCount(cf: CFTypeRef) -> CFIndex; pub fn CFGetTypeID(cf: CFTypeRef) -> CFTypeID; pub fn CFHash(cf: CFTypeRef) -> CFHashCode; //fn CFMakeCollectable pub fn CFRelease(cf: CFTypeRef); pub fn CFRetain(cf: CFTypeRef) -> CFTypeRef; pub fn CFShow(obj: CFTypeRef); /* Base Utilities Reference */ // N.B. Some things missing here. } core-foundation-sys-0.8.1/src/bundle.rs010064400007650000024000000026541366027130600162300ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFTypeID, CFAllocatorRef}; use url::CFURLRef; use dictionary::CFDictionaryRef; use string::CFStringRef; #[repr(C)] pub struct __CFBundle(c_void); pub type CFBundleRef = *mut __CFBundle; extern { /* * CFBundle.h */ pub fn CFBundleCreate(allocator: CFAllocatorRef, bundleURL: CFURLRef) -> CFBundleRef; pub fn CFBundleGetBundleWithIdentifier(bundleID: CFStringRef) -> CFBundleRef; pub fn CFBundleGetFunctionPointerForName(bundle: CFBundleRef, function_name: CFStringRef) -> *const c_void; pub fn CFBundleGetMainBundle() -> CFBundleRef; pub fn CFBundleGetInfoDictionary(bundle: CFBundleRef) -> CFDictionaryRef; pub fn CFBundleGetTypeID() -> CFTypeID; pub fn CFBundleCopyExecutableURL(bundle: CFBundleRef) -> CFURLRef; pub fn CFBundleCopyPrivateFrameworksURL(bundle: CFBundleRef) -> CFURLRef; pub fn CFBundleCopySharedSupportURL(bundle: CFBundleRef) -> CFURLRef; pub fn CFBundleCopyBundleURL(bundle: CFBundleRef) -> CFURLRef; } core-foundation-sys-0.8.1/src/characterset.rs010064400007650000024000000071341366027130300174220ustar 00000000000000// Copyright 2019 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID}; use data::CFDataRef; use string::{CFStringRef, UniChar}; pub type CFCharacterSetPredefinedSet = CFIndex; // Members of CFCharacterSetPredefinedSet enum pub static kCFCharacterSetControl: CFCharacterSetPredefinedSet = 1; pub static kCFCharacterSetWhitespace: CFCharacterSetPredefinedSet = 2; pub static kCFCharacterSetWhitespaceAndNewline: CFCharacterSetPredefinedSet = 3; pub static kCFCharacterSetDecimalDigit: CFCharacterSetPredefinedSet = 4; pub static kCFCharacterSetLetter: CFCharacterSetPredefinedSet = 5; pub static kCFCharacterSetLowercaseLetter: CFCharacterSetPredefinedSet = 6; pub static kCFCharacterSetUppercaseLetter: CFCharacterSetPredefinedSet = 7; pub static kCFCharacterSetNonBase: CFCharacterSetPredefinedSet = 8; pub static kCFCharacterSetDecomposable: CFCharacterSetPredefinedSet = 9; pub static kCFCharacterSetAlphaNumeric: CFCharacterSetPredefinedSet = 10; pub static kCFCharacterSetPunctuation: CFCharacterSetPredefinedSet = 11; pub static kCFCharacterSetIllegal: CFCharacterSetPredefinedSet = 12; pub static kCFCharacterSetCapitalizedLetter: CFCharacterSetPredefinedSet = 13; pub static kCFCharacterSetSymbol: CFCharacterSetPredefinedSet = 14; pub static kCFCharacterSetNewline: CFCharacterSetPredefinedSet = 15; #[repr(C)] pub struct __CFCharacterSet(c_void); pub type CFCharacterSetRef = *const __CFCharacterSet; pub type CFMutableCharacterSetRef = *const __CFCharacterSet; extern { pub fn CFCharacterSetGetTypeID() -> CFTypeID; pub fn CFCharacterSetGetPredefined(theSetIdentifier: CFCharacterSetPredefinedSet) -> CFCharacterSetRef; pub fn CFCharacterSetCreateWithCharactersInRange(alloc: CFAllocatorRef, theRange: CFRange) -> CFCharacterSetRef; pub fn CFCharacterSetCreateWithCharactersInString(alloc: CFAllocatorRef, theString: CFStringRef) -> CFCharacterSetRef; pub fn CFCharacterSetCreateWithBitmapRepresentation(alloc: CFAllocatorRef, theData: CFDataRef) -> CFCharacterSetRef; pub fn CFCharacterSetCreateMutable(alloc: CFAllocatorRef) -> CFMutableCharacterSetRef; pub fn CFCharacterSetCreateCopy(alloc: CFAllocatorRef, theSet: CFCharacterSetRef) -> CFCharacterSetRef; pub fn CFCharacterSetCreateMutableCopy(alloc: CFAllocatorRef, theSet: CFCharacterSetRef) -> CFMutableCharacterSetRef; pub fn CFCharacterSetIsCharacterMember(theSet: CFCharacterSetRef, theChar: UniChar) -> Boolean; pub fn CFCharacterSetCreateBitmapRepresentation(alloc: CFAllocatorRef, theSet: CFCharacterSetRef) -> CFDataRef; pub fn CFCharacterSetAddCharactersInRange(theSet: CFMutableCharacterSetRef, theRange: CFRange); pub fn CFCharacterSetRemoveCharactersInRange(theSet: CFMutableCharacterSetRef, theRange: CFRange); pub fn CFCharacterSetAddCharactersInString(theSet: CFMutableCharacterSetRef, theString: CFStringRef); pub fn CFCharacterSetRemoveCharactersInString(theSet: CFMutableCharacterSetRef, theString: CFStringRef); pub fn CFCharacterSetUnion(theSet: CFMutableCharacterSetRef, theOtherSet: CFCharacterSetRef); pub fn CFCharacterSetIntersect(theSet: CFMutableCharacterSetRef, theOtherSet: CFCharacterSetRef); pub fn CFCharacterSetInvert(theSet: CFMutableCharacterSetRef); } core-foundation-sys-0.8.1/src/data.rs010064400007650000024000000020031366027130300156510ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFTypeID, CFIndex, CFRange}; #[repr(C)] pub struct __CFData(c_void); pub type CFDataRef = *const __CFData; extern { /* * CFData.h */ pub fn CFDataCreate(allocator: CFAllocatorRef, bytes: *const u8, length: CFIndex) -> CFDataRef; //fn CFDataFind pub fn CFDataGetBytePtr(theData: CFDataRef) -> *const u8; pub fn CFDataGetBytes(theData: CFDataRef, range: CFRange, buffer: *mut u8); pub fn CFDataGetLength(theData: CFDataRef) -> CFIndex; pub fn CFDataGetTypeID() -> CFTypeID; } core-foundation-sys-0.8.1/src/date.rs010064400007650000024000000023661324406220200156630ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFComparisonResult, CFTypeID}; #[repr(C)] pub struct __CFDate(c_void); pub type CFDateRef = *const __CFDate; pub type CFTimeInterval = f64; pub type CFAbsoluteTime = CFTimeInterval; extern { pub static kCFAbsoluteTimeIntervalSince1904: CFTimeInterval; pub static kCFAbsoluteTimeIntervalSince1970: CFTimeInterval; pub fn CFAbsoluteTimeGetCurrent() -> CFAbsoluteTime; pub fn CFDateCreate(allocator: CFAllocatorRef, at: CFAbsoluteTime) -> CFDateRef; pub fn CFDateGetAbsoluteTime(date: CFDateRef) -> CFAbsoluteTime; pub fn CFDateGetTimeIntervalSinceDate(date: CFDateRef, other: CFDateRef) -> CFTimeInterval; pub fn CFDateCompare(date: CFDateRef, other: CFDateRef, context: *mut c_void) -> CFComparisonResult; pub fn CFDateGetTypeID() -> CFTypeID; } core-foundation-sys-0.8.1/src/dictionary.rs010064400007650000024000000106001324406220200171010ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFHashCode, CFIndex, CFTypeID, Boolean}; use string::CFStringRef; pub type CFDictionaryApplierFunction = extern "C" fn(key: *const c_void, value: *const c_void, context: *mut c_void); pub type CFDictionaryRetainCallBack = extern "C" fn(allocator: CFAllocatorRef, value: *const c_void) -> *const c_void; pub type CFDictionaryReleaseCallBack = extern "C" fn(allocator: CFAllocatorRef, value: *const c_void); pub type CFDictionaryCopyDescriptionCallBack = extern "C" fn(value: *const c_void) -> CFStringRef; pub type CFDictionaryEqualCallBack = extern "C" fn(value1: *const c_void, value2: *const c_void) -> Boolean; pub type CFDictionaryHashCallBack = extern "C" fn(value: *const c_void) -> CFHashCode; #[repr(C)] #[derive(Clone, Copy)] pub struct CFDictionaryKeyCallBacks { pub version: CFIndex, pub retain: CFDictionaryRetainCallBack, pub release: CFDictionaryReleaseCallBack, pub copyDescription: CFDictionaryCopyDescriptionCallBack, pub equal: CFDictionaryEqualCallBack, pub hash: CFDictionaryHashCallBack } #[repr(C)] #[derive(Clone, Copy)] pub struct CFDictionaryValueCallBacks { pub version: CFIndex, pub retain: CFDictionaryRetainCallBack, pub release: CFDictionaryReleaseCallBack, pub copyDescription: CFDictionaryCopyDescriptionCallBack, pub equal: CFDictionaryEqualCallBack } #[repr(C)] pub struct __CFDictionary(c_void); pub type CFDictionaryRef = *const __CFDictionary; pub type CFMutableDictionaryRef = *mut __CFDictionary; extern { /* * CFDictionary.h */ pub static kCFTypeDictionaryKeyCallBacks: CFDictionaryKeyCallBacks; pub static kCFTypeDictionaryValueCallBacks: CFDictionaryValueCallBacks; pub fn CFDictionaryContainsKey(theDict: CFDictionaryRef, key: *const c_void) -> Boolean; pub fn CFDictionaryCreate(allocator: CFAllocatorRef, keys: *const *const c_void, values: *const *const c_void, numValues: CFIndex, keyCallBacks: *const CFDictionaryKeyCallBacks, valueCallBacks: *const CFDictionaryValueCallBacks) -> CFDictionaryRef; pub fn CFDictionaryGetCount(theDict: CFDictionaryRef) -> CFIndex; pub fn CFDictionaryGetTypeID() -> CFTypeID; pub fn CFDictionaryGetValueIfPresent(theDict: CFDictionaryRef, key: *const c_void, value: *mut *const c_void) -> Boolean; pub fn CFDictionaryApplyFunction(theDict: CFDictionaryRef, applier: CFDictionaryApplierFunction, context: *mut c_void); pub fn CFDictionaryGetKeysAndValues(theDict: CFDictionaryRef, keys: *mut *const c_void, values: *mut *const c_void); pub fn CFDictionaryCreateMutable(allocator: CFAllocatorRef, capacity: CFIndex, keyCallbacks: *const CFDictionaryKeyCallBacks, valueCallbacks: *const CFDictionaryValueCallBacks) -> CFMutableDictionaryRef; pub fn CFDictionaryCreateMutableCopy(allocator: CFAllocatorRef, capacity: CFIndex, theDict: CFDictionaryRef) -> CFMutableDictionaryRef; pub fn CFDictionaryAddValue(theDict: CFMutableDictionaryRef, key: *const c_void, value: *const c_void); pub fn CFDictionarySetValue(theDict: CFMutableDictionaryRef, key: *const c_void, value: *const c_void); pub fn CFDictionaryReplaceValue(theDict: CFMutableDictionaryRef, key: *const c_void, value: *const c_void); pub fn CFDictionaryRemoveValue(theDict: CFMutableDictionaryRef, key: *const c_void); pub fn CFDictionaryRemoveAllValues(theDict: CFMutableDictionaryRef); } core-foundation-sys-0.8.1/src/error.rs010064400007650000024000000020121324406220200160630ustar 00000000000000// Copyright 2016 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFTypeID, CFIndex}; use string::CFStringRef; #[repr(C)] pub struct __CFError(c_void); pub type CFErrorRef = *mut __CFError; extern "C" { pub fn CFErrorGetTypeID() -> CFTypeID; pub static kCFErrorDomainPOSIX: CFStringRef; pub static kCFErrorDomainOSStatus: CFStringRef; pub static kCFErrorDomainMach: CFStringRef; pub static kCFErrorDomainCocoa: CFStringRef; pub fn CFErrorGetDomain(err: CFErrorRef) -> CFStringRef; pub fn CFErrorGetCode(err: CFErrorRef) -> CFIndex; pub fn CFErrorCopyDescription(err: CFErrorRef) -> CFStringRef; } core-foundation-sys-0.8.1/src/filedescriptor.rs010064400007650000024000000045541324406220200177650ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::{c_int, c_void}; use base::{Boolean, CFIndex, CFTypeID, CFOptionFlags, CFAllocatorRef}; use string::CFStringRef; use runloop::CFRunLoopSourceRef; pub type CFFileDescriptorNativeDescriptor = c_int; #[repr(C)] pub struct __CFFileDescriptor(c_void); pub type CFFileDescriptorRef = *mut __CFFileDescriptor; /* Callback Reason Types */ pub const kCFFileDescriptorReadCallBack: CFOptionFlags = 1 << 0; pub const kCFFileDescriptorWriteCallBack: CFOptionFlags = 1 << 1; pub type CFFileDescriptorCallBack = extern "C" fn (f: CFFileDescriptorRef, callBackTypes: CFOptionFlags, info: *mut c_void); #[repr(C)] #[derive(Clone, Copy)] pub struct CFFileDescriptorContext { pub version: CFIndex, pub info: *mut c_void, pub retain: Option *const c_void>, pub release: Option, pub copyDescription: Option CFStringRef>, } extern { /* * CFFileDescriptor.h */ pub fn CFFileDescriptorGetTypeID() -> CFTypeID; pub fn CFFileDescriptorCreate(allocator: CFAllocatorRef, fd: CFFileDescriptorNativeDescriptor, closeOnInvalidate: Boolean, callout: CFFileDescriptorCallBack, context: *const CFFileDescriptorContext) -> CFFileDescriptorRef; pub fn CFFileDescriptorGetNativeDescriptor(f: CFFileDescriptorRef) -> CFFileDescriptorNativeDescriptor; pub fn CFFileDescriptorGetContext(f: CFFileDescriptorRef, context: *mut CFFileDescriptorContext); pub fn CFFileDescriptorEnableCallBacks(f: CFFileDescriptorRef, callBackTypes: CFOptionFlags); pub fn CFFileDescriptorDisableCallBacks(f: CFFileDescriptorRef, callBackTypes: CFOptionFlags); pub fn CFFileDescriptorInvalidate(f: CFFileDescriptorRef); pub fn CFFileDescriptorIsValid(f: CFFileDescriptorRef) -> Boolean; pub fn CFFileDescriptorCreateRunLoopSource(allocator: CFAllocatorRef, f: CFFileDescriptorRef, order: CFIndex) -> CFRunLoopSourceRef; } core-foundation-sys-0.8.1/src/lib.rs010064400007650000024000000017351366027130300155210ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, improper_ctypes)] #![cfg_attr(all(feature="mac_os_10_7_support", feature="mac_os_10_8_features"), feature(linkage))] // back-compat requires weak linkage pub mod array; pub mod attributed_string; pub mod base; pub mod bundle; pub mod characterset; pub mod data; pub mod date; pub mod dictionary; pub mod error; pub mod filedescriptor; pub mod messageport; pub mod number; pub mod propertylist; pub mod runloop; pub mod set; pub mod string; pub mod timezone; pub mod url; pub mod uuid; core-foundation-sys-0.8.1/src/messageport.rs010064400007650000024000000065721324406220200173020ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean}; use data::CFDataRef; use date::CFTimeInterval; use runloop::CFRunLoopSourceRef; use string::CFStringRef; #[repr(C)] #[derive(Copy, Clone)] #[derive(Debug)] pub struct CFMessagePortContext { pub version: CFIndex, pub info: *mut c_void, pub retain: Option *const c_void>, pub release: Option, pub copyDescription: Option CFStringRef>, } pub type CFMessagePortCallBack = Option< unsafe extern fn(local: CFMessagePortRef, msgid: i32, data: CFDataRef, info: *mut c_void) -> CFDataRef>; pub type CFMessagePortInvalidationCallBack = Option< unsafe extern "C" fn(ms: CFMessagePortRef, info: *mut c_void)>; #[repr(C)] pub struct __CFMessagePort(c_void); pub type CFMessagePortRef = *mut __CFMessagePort; extern { /* * CFMessagePort.h */ pub fn CFMessagePortGetTypeID() -> CFTypeID; pub fn CFMessagePortCreateLocal(allocator: CFAllocatorRef, name: CFStringRef, callout: CFMessagePortCallBack, context: *const CFMessagePortContext, shouldFreeInfo: *mut Boolean) -> CFMessagePortRef; pub fn CFMessagePortCreateRemote(allocator: CFAllocatorRef, name: CFStringRef) -> CFMessagePortRef; pub fn CFMessagePortIsRemote(ms: CFMessagePortRef) -> Boolean; pub fn CFMessagePortGetName(ms: CFMessagePortRef) -> CFStringRef; pub fn CFMessagePortSetName(ms: CFMessagePortRef, newName: CFStringRef) -> Boolean; pub fn CFMessagePortGetContext(ms: CFMessagePortRef, context: *mut CFMessagePortContext); pub fn CFMessagePortInvalidate(ms: CFMessagePortRef); pub fn CFMessagePortIsValid(ms: CFMessagePortRef) -> Boolean; pub fn CFMessagePortGetInvalidationCallBack(ms: CFMessagePortRef) -> CFMessagePortInvalidationCallBack; pub fn CFMessagePortSetInvalidationCallBack(ms: CFMessagePortRef, callout: CFMessagePortInvalidationCallBack); pub fn CFMessagePortSendRequest(remote: CFMessagePortRef, msgid: i32, data: CFDataRef, sendTimeout: CFTimeInterval, rcvTimeout: CFTimeInterval, replyMode: CFStringRef, returnData: *mut CFDataRef) -> i32; pub fn CFMessagePortCreateRunLoopSource(allocator: CFAllocatorRef, local: CFMessagePortRef, order: CFIndex) -> CFRunLoopSourceRef; // CFMessagePortSetDispatchQueue } core-foundation-sys-0.8.1/src/number.rs010064400007650000024000000045011324406220200162270ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFTypeID, CFComparisonResult}; #[repr(C)] pub struct __CFBoolean(c_void); pub type CFBooleanRef = *const __CFBoolean; pub type CFNumberType = u32; // members of enum CFNumberType // static kCFNumberSInt8Type: CFNumberType = 1; // static kCFNumberSInt16Type: CFNumberType = 2; pub static kCFNumberSInt32Type: CFNumberType = 3; pub static kCFNumberSInt64Type: CFNumberType = 4; pub static kCFNumberFloat32Type: CFNumberType = 5; pub static kCFNumberFloat64Type: CFNumberType = 6; // static kCFNumberCharType: CFNumberType = 7; // static kCFNumberShortType: CFNumberType = 8; // static kCFNumberIntType: CFNumberType = 9; // static kCFNumberLongType: CFNumberType = 10; // static kCFNumberLongLongType: CFNumberType = 11; // static kCFNumberFloatType: CFNumberType = 12; // static kCFNumberDoubleType: CFNumberType = 13; // static kCFNumberCFIndexType: CFNumberType = 14; // static kCFNumberNSIntegerType: CFNumberType = 15; // static kCFNumberCGFloatType: CFNumberType = 16; // static kCFNumberMaxType: CFNumberType = 16; // This is an enum due to zero-sized types warnings. // For more details see https://github.com/rust-lang/rust/issues/27303 pub enum __CFNumber {} pub type CFNumberRef = *const __CFNumber; extern { /* * CFNumber.h */ pub static kCFBooleanTrue: CFBooleanRef; pub static kCFBooleanFalse: CFBooleanRef; pub fn CFBooleanGetTypeID() -> CFTypeID; pub fn CFNumberCreate(allocator: CFAllocatorRef, theType: CFNumberType, valuePtr: *const c_void) -> CFNumberRef; //fn CFNumberGetByteSize pub fn CFNumberGetValue(number: CFNumberRef, theType: CFNumberType, valuePtr: *mut c_void) -> bool; pub fn CFNumberCompare(date: CFNumberRef, other: CFNumberRef, context: *mut c_void) -> CFComparisonResult; pub fn CFNumberGetTypeID() -> CFTypeID; } core-foundation-sys-0.8.1/src/propertylist.rs010064400007650000024000000040621324406220200175210ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use base::{CFAllocatorRef, CFIndex, CFOptionFlags, CFTypeRef}; use data::CFDataRef; use error::CFErrorRef; pub type CFPropertyListRef = CFTypeRef; pub type CFPropertyListFormat = CFIndex; pub const kCFPropertyListOpenStepFormat: CFPropertyListFormat = 1; pub const kCFPropertyListXMLFormat_v1_0: CFPropertyListFormat = 100; pub const kCFPropertyListBinaryFormat_v1_0: CFPropertyListFormat = 200; pub type CFPropertyListMutabilityOptions = CFOptionFlags; pub const kCFPropertyListImmutable: CFPropertyListMutabilityOptions = 0; pub const kCFPropertyListMutableContainers: CFPropertyListMutabilityOptions = 1; pub const kCFPropertyListMutableContainersAndLeaves: CFPropertyListMutabilityOptions = 2; extern "C" { // CFPropertyList.h // // fn CFPropertyListCreateDeepCopy // fn CFPropertyListIsValid pub fn CFPropertyListCreateWithData(allocator: CFAllocatorRef, data: CFDataRef, options: CFPropertyListMutabilityOptions, format: *mut CFPropertyListFormat, error: *mut CFErrorRef) -> CFPropertyListRef; // fn CFPropertyListCreateWithStream // fn CFPropertyListWrite pub fn CFPropertyListCreateData(allocator: CFAllocatorRef, propertyList: CFPropertyListRef, format: CFPropertyListFormat, options: CFOptionFlags, error: *mut CFErrorRef) -> CFDataRef; } core-foundation-sys-0.8.1/src/runloop.rs010064400007650000024000000216361366027130300164530ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use array::CFArrayRef; use base::{Boolean, CFIndex, CFTypeID, CFAllocatorRef, CFOptionFlags, CFHashCode, mach_port_t}; use date::{CFAbsoluteTime, CFTimeInterval}; use string::CFStringRef; #[repr(C)] pub struct __CFRunLoop(c_void); pub type CFRunLoopRef = *mut __CFRunLoop; #[repr(C)] pub struct __CFRunLoopSource(c_void); pub type CFRunLoopSourceRef = *mut __CFRunLoopSource; #[repr(C)] pub struct __CFRunLoopObserver(c_void); pub type CFRunLoopObserverRef = *mut __CFRunLoopObserver; // Reasons for CFRunLoopRunInMode() to Return pub const kCFRunLoopRunFinished: i32 = 1; pub const kCFRunLoopRunStopped: i32 = 2; pub const kCFRunLoopRunTimedOut: i32 = 3; pub const kCFRunLoopRunHandledSource: i32 = 4; // Run Loop Observer Activities //typedef CF_OPTIONS(CFOptionFlags, CFRunLoopActivity) { pub type CFRunLoopActivity = CFOptionFlags; pub const kCFRunLoopEntry: CFOptionFlags = 1 << 0; pub const kCFRunLoopBeforeTimers: CFOptionFlags = 1 << 1; pub const kCFRunLoopBeforeSources: CFOptionFlags = 1 << 2; pub const kCFRunLoopBeforeWaiting: CFOptionFlags = 1 << 5; pub const kCFRunLoopAfterWaiting: CFOptionFlags = 1 << 6; pub const kCFRunLoopExit: CFOptionFlags = 1 << 7; pub const kCFRunLoopAllActivities: CFOptionFlags = 0x0FFFFFFF; #[repr(C)] pub struct CFRunLoopSourceContext { pub version: CFIndex, pub info: *mut c_void, pub retain: Option *const c_void>, pub release: Option, pub copyDescription: Option CFStringRef>, pub equal: Option Boolean>, pub hash: Option CFHashCode>, pub schedule: Option, pub cancel: Option, pub perform: extern "C" fn (info: *const c_void), } #[repr(C)] pub struct CFRunLoopSourceContext1 { pub version: CFIndex, pub info: *mut c_void, pub retain: Option *const c_void>, pub release: Option, pub copyDescription: Option CFStringRef>, pub equal: Option Boolean>, pub hash: Option CFHashCode>, // note that the following two fields are platform dependent in the C header, the ones here are for macOS pub getPort: extern "C" fn (info: *mut c_void) -> mach_port_t, pub perform: extern "C" fn (msg: *mut c_void, size: CFIndex, allocator: CFAllocatorRef, info: *mut c_void) -> *mut c_void, } #[repr(C)] pub struct CFRunLoopObserverContext { pub version: CFIndex, pub info: *mut c_void, pub retain: Option *const c_void>, pub release: Option, pub copyDescription: Option CFStringRef>, } pub type CFRunLoopObserverCallBack = extern "C" fn (observer: CFRunLoopObserverRef, activity: CFRunLoopActivity, info: *mut c_void); #[repr(C)] pub struct CFRunLoopTimerContext { pub version: CFIndex, pub info: *mut c_void, pub retain: Option *const c_void>, pub release: Option, pub copyDescription: Option CFStringRef>, } pub type CFRunLoopTimerCallBack = extern "C" fn (timer: CFRunLoopTimerRef, info: *mut c_void); #[repr(C)] pub struct __CFRunLoopTimer(c_void); pub type CFRunLoopTimerRef = *mut __CFRunLoopTimer; extern { /* * CFRunLoop.h */ pub static kCFRunLoopDefaultMode: CFStringRef; pub static kCFRunLoopCommonModes: CFStringRef; pub fn CFRunLoopGetTypeID() -> CFTypeID; pub fn CFRunLoopGetCurrent() -> CFRunLoopRef; pub fn CFRunLoopGetMain() -> CFRunLoopRef; pub fn CFRunLoopCopyCurrentMode(rl: CFRunLoopRef) -> CFStringRef; pub fn CFRunLoopCopyAllModes(rl: CFRunLoopRef) -> CFArrayRef; pub fn CFRunLoopAddCommonMode(rl: CFRunLoopRef, mode: CFStringRef); pub fn CFRunLoopGetNextTimerFireDate(rl: CFRunLoopRef, mode: CFStringRef) -> CFAbsoluteTime; pub fn CFRunLoopRun(); pub fn CFRunLoopRunInMode(mode: CFStringRef, seconds: CFTimeInterval, returnAfterSourceHandled: Boolean) -> i32; pub fn CFRunLoopIsWaiting(rl: CFRunLoopRef) -> Boolean; pub fn CFRunLoopWakeUp(rl: CFRunLoopRef); pub fn CFRunLoopStop(rl: CFRunLoopRef); // fn CFRunLoopPerformBlock(rl: CFRunLoopRef, mode: CFTypeRef, block: void (^)(void)); pub fn CFRunLoopContainsSource(rl: CFRunLoopRef, source: CFRunLoopSourceRef, mode: CFStringRef) -> Boolean; pub fn CFRunLoopAddSource(rl: CFRunLoopRef, source: CFRunLoopSourceRef, mode: CFStringRef); pub fn CFRunLoopRemoveSource(rl: CFRunLoopRef, source: CFRunLoopSourceRef, mode: CFStringRef); pub fn CFRunLoopContainsObserver(rl: CFRunLoopRef, observer: CFRunLoopObserverRef, mode: CFStringRef) -> Boolean; pub fn CFRunLoopAddObserver(rl: CFRunLoopRef, observer: CFRunLoopObserverRef, mode: CFStringRef); pub fn CFRunLoopRemoveObserver(rl: CFRunLoopRef, observer: CFRunLoopObserverRef, mode: CFStringRef); pub fn CFRunLoopContainsTimer(rl: CFRunLoopRef, timer: CFRunLoopTimerRef, mode: CFStringRef) -> Boolean; pub fn CFRunLoopAddTimer(rl: CFRunLoopRef, timer: CFRunLoopTimerRef, mode: CFStringRef); pub fn CFRunLoopRemoveTimer(rl: CFRunLoopRef, timer: CFRunLoopTimerRef, mode: CFStringRef); pub fn CFRunLoopSourceGetTypeID() -> CFTypeID; pub fn CFRunLoopSourceCreate(allocator: CFAllocatorRef, order: CFIndex, context: *mut CFRunLoopSourceContext) -> CFRunLoopSourceRef; pub fn CFRunLoopSourceGetOrder(source: CFRunLoopSourceRef) -> CFIndex; pub fn CFRunLoopSourceInvalidate(source: CFRunLoopSourceRef); pub fn CFRunLoopSourceIsValid(source: CFRunLoopSourceRef) -> Boolean; pub fn CFRunLoopSourceGetContext(source: CFRunLoopSourceRef, context: *mut CFRunLoopSourceContext); pub fn CFRunLoopSourceSignal(source: CFRunLoopSourceRef); pub fn CFRunLoopObserverGetTypeID() -> CFTypeID; pub fn CFRunLoopObserverCreate(allocator: CFAllocatorRef, activities: CFOptionFlags, repeats: Boolean, order: CFIndex, callout: CFRunLoopObserverCallBack, context: *mut CFRunLoopObserverContext) -> CFRunLoopObserverRef; // fn CFRunLoopObserverCreateWithHandler(allocator: CFAllocatorRef, activities: CFOptionFlags, repeats: Boolean, order: CFIndex, block: void (^) (CFRunLoopObserverRef observer, CFRunLoopActivity activity)) -> CFRunLoopObserverRef; pub fn CFRunLoopObserverGetActivities(observer: CFRunLoopObserverRef) -> CFOptionFlags; pub fn CFRunLoopObserverDoesRepeat(observer: CFRunLoopObserverRef) -> Boolean; pub fn CFRunLoopObserverGetOrder(observer: CFRunLoopObserverRef) -> CFIndex; pub fn CFRunLoopObserverInvalidate(observer: CFRunLoopObserverRef); pub fn CFRunLoopObserverIsValid(observer: CFRunLoopObserverRef) -> Boolean; pub fn CFRunLoopObserverGetContext(observer: CFRunLoopObserverRef, context: *mut CFRunLoopObserverContext); pub fn CFRunLoopTimerGetTypeID() -> CFTypeID; pub fn CFRunLoopTimerCreate(allocator: CFAllocatorRef, fireDate: CFAbsoluteTime, interval: CFTimeInterval, flags: CFOptionFlags, order: CFIndex, callout: CFRunLoopTimerCallBack, context: *mut CFRunLoopTimerContext) -> CFRunLoopTimerRef; // fn CFRunLoopTimerCreateWithHandler(allocator: CFAllocatorRef, fireDate: CFAbsoluteTime, interval: CFTimeInterval, flags: CFOptionFlags, order: CFIndex, block: void (^) (CFRunLoopTimerRef timer)) -> CFRunLoopTimerRef; pub fn CFRunLoopTimerGetNextFireDate(timer: CFRunLoopTimerRef) -> CFAbsoluteTime; pub fn CFRunLoopTimerSetNextFireDate(timer: CFRunLoopTimerRef, fireDate: CFAbsoluteTime); pub fn CFRunLoopTimerGetInterval(timer: CFRunLoopTimerRef) -> CFTimeInterval; pub fn CFRunLoopTimerDoesRepeat(timer: CFRunLoopTimerRef) -> Boolean; pub fn CFRunLoopTimerGetOrder(timer: CFRunLoopTimerRef) -> CFIndex; pub fn CFRunLoopTimerInvalidate(timer: CFRunLoopTimerRef); pub fn CFRunLoopTimerIsValid(timer: CFRunLoopTimerRef) -> Boolean; pub fn CFRunLoopTimerGetContext(timer: CFRunLoopTimerRef, context: *mut CFRunLoopTimerContext); pub fn CFRunLoopTimerGetTolerance(timer: CFRunLoopTimerRef) -> CFTimeInterval; pub fn CFRunLoopTimerSetTolerance(timer: CFRunLoopTimerRef, tolerance: CFTimeInterval); } core-foundation-sys-0.8.1/src/set.rs010064400007650000024000000045721366027130600155530ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFIndex, CFTypeID, Boolean}; pub type CFSetApplierFunction = extern "C" fn (value: *const c_void, context: *const c_void); pub type CFSetRetainCallBack = *const u8; pub type CFSetReleaseCallBack = *const u8; pub type CFSetCopyDescriptionCallBack = *const u8; pub type CFSetEqualCallBack = *const u8; pub type CFSetHashCallBack = *const u8; #[repr(C)] #[derive(Clone, Copy)] pub struct CFSetCallBacks { pub version: CFIndex, pub retain: CFSetRetainCallBack, pub release: CFSetReleaseCallBack, pub copyDescription: CFSetCopyDescriptionCallBack, pub equal: CFSetEqualCallBack, pub hash: CFSetHashCallBack, } #[repr(C)] pub struct __CFSet(c_void); pub type CFSetRef = *const __CFSet; extern { /* * CFSet.h */ pub static kCFTypeSetCallBacks: CFSetCallBacks; /* Creating Sets */ pub fn CFSetCreate(allocator: CFAllocatorRef, values: *const *const c_void, numValues: CFIndex, callBacks: *const CFSetCallBacks) -> CFSetRef; pub fn CFSetCreateCopy(allocator: CFAllocatorRef, theSet: CFSetRef) -> CFSetRef; /* Examining a Set */ pub fn CFSetContainsValue(theSet: CFSetRef, value: *const c_void) -> Boolean; pub fn CFSetGetCount(theSet: CFSetRef) -> CFIndex; pub fn CFSetGetCountOfValue(theSet: CFSetRef, value: *const c_void) -> CFIndex; pub fn CFSetGetValue(theSet: CFSetRef, value: *const c_void) -> *const c_void; pub fn CFSetGetValueIfPresent(theSet: CFSetRef, candidate: *const c_void, value: *mut *const c_void) -> Boolean; pub fn CFSetGetValues(theSet: CFSetRef, values: *mut *const c_void); /* Applying a Function to Set Members */ pub fn CFSetApplyFunction(theSet: CFSetRef, applier: CFSetApplierFunction, context: *const c_void); /* Getting the CFSet Type ID */ pub fn CFSetGetTypeID() -> CFTypeID; } core-foundation-sys-0.8.1/src/string.rs010064400007650000024000000370401355563064400162710ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::{c_char, c_ushort, c_void}; use base::{Boolean, CFOptionFlags, CFIndex, CFAllocatorRef, CFRange, CFTypeID}; pub type UniChar = c_ushort; // CFString.h pub type CFStringCompareFlags = CFOptionFlags; //static kCFCompareCaseInsensitive: CFStringCompareFlags = 1; //static kCFCompareBackwards: CFStringCompareFlags = 4; //static kCFCompareAnchored: CFStringCompareFlags = 8; //static kCFCompareNonliteral: CFStringCompareFlags = 16; //static kCFCompareLocalized: CFStringCompareFlags = 32; //static kCFCompareNumerically: CFStringCompareFlags = 64; //static kCFCompareDiacriticInsensitive: CFStringCompareFlags = 128; //static kCFCompareWidthInsensitive: CFStringCompareFlags = 256; //static kCFCompareForcedOrdering: CFStringCompareFlags = 512; pub type CFStringEncoding = u32; // macOS built-in encodings. //static kCFStringEncodingMacRoman: CFStringEncoding = 0; //static kCFStringEncodingWindowsLatin1: CFStringEncoding = 0x0500; //static kCFStringEncodingISOLatin1: CFStringEncoding = 0x0201; //static kCFStringEncodingNextStepLatin: CFStringEncoding = 0x0B01; //static kCFStringEncodingASCII: CFStringEncoding = 0x0600; //static kCFStringEncodingUnicode: CFStringEncoding = 0x0100; pub static kCFStringEncodingUTF8: CFStringEncoding = 0x08000100; //static kCFStringEncodingNonLossyASCII: CFStringEncoding = 0x0BFF; //static kCFStringEncodingUTF16: CFStringEncoding = 0x0100; //static kCFStringEncodingUTF16BE: CFStringEncoding = 0x10000100; //static kCFStringEncodingUTF16LE: CFStringEncoding = 0x14000100; //static kCFStringEncodingUTF32: CFStringEncoding = 0x0c000100; //static kCFStringEncodingUTF32BE: CFStringEncoding = 0x18000100; //static kCFStringEncodingUTF32LE: CFStringEncoding = 0x1c000100; // CFStringEncodingExt.h pub type CFStringEncodings = CFIndex; // External encodings, except those defined above. // Defined above: kCFStringEncodingMacRoman = 0 //static kCFStringEncodingMacJapanese: CFStringEncoding = 1; //static kCFStringEncodingMacChineseTrad: CFStringEncoding = 2; //static kCFStringEncodingMacKorean: CFStringEncoding = 3; //static kCFStringEncodingMacArabic: CFStringEncoding = 4; //static kCFStringEncodingMacHebrew: CFStringEncoding = 5; //static kCFStringEncodingMacGreek: CFStringEncoding = 6; //static kCFStringEncodingMacCyrillic: CFStringEncoding = 7; //static kCFStringEncodingMacDevanagari: CFStringEncoding = 9; //static kCFStringEncodingMacGurmukhi: CFStringEncoding = 10; //static kCFStringEncodingMacGujarati: CFStringEncoding = 11; //static kCFStringEncodingMacOriya: CFStringEncoding = 12; //static kCFStringEncodingMacBengali: CFStringEncoding = 13; //static kCFStringEncodingMacTamil: CFStringEncoding = 14; //static kCFStringEncodingMacTelugu: CFStringEncoding = 15; //static kCFStringEncodingMacKannada: CFStringEncoding = 16; //static kCFStringEncodingMacMalayalam: CFStringEncoding = 17; //static kCFStringEncodingMacSinhalese: CFStringEncoding = 18; //static kCFStringEncodingMacBurmese: CFStringEncoding = 19; //static kCFStringEncodingMacKhmer: CFStringEncoding = 20; //static kCFStringEncodingMacThai: CFStringEncoding = 21; //static kCFStringEncodingMacLaotian: CFStringEncoding = 22; //static kCFStringEncodingMacGeorgian: CFStringEncoding = 23; //static kCFStringEncodingMacArmenian: CFStringEncoding = 24; //static kCFStringEncodingMacChineseSimp: CFStringEncoding = 25; //static kCFStringEncodingMacTibetan: CFStringEncoding = 26; //static kCFStringEncodingMacMongolian: CFStringEncoding = 27; //static kCFStringEncodingMacEthiopic: CFStringEncoding = 28; //static kCFStringEncodingMacCentralEurRoman: CFStringEncoding = 29; //static kCFStringEncodingMacVietnamese: CFStringEncoding = 30; //static kCFStringEncodingMacExtArabic: CFStringEncoding = 31; //static kCFStringEncodingMacSymbol: CFStringEncoding = 33; //static kCFStringEncodingMacDingbats: CFStringEncoding = 34; //static kCFStringEncodingMacTurkish: CFStringEncoding = 35; //static kCFStringEncodingMacCroatian: CFStringEncoding = 36; //static kCFStringEncodingMacIcelandic: CFStringEncoding = 37; //static kCFStringEncodingMacRomanian: CFStringEncoding = 38; //static kCFStringEncodingMacCeltic: CFStringEncoding = 39; //static kCFStringEncodingMacGaelic: CFStringEncoding = 40; //static kCFStringEncodingMacFarsi: CFStringEncoding = 0x8C; //static kCFStringEncodingMacUkrainian: CFStringEncoding = 0x98; //static kCFStringEncodingMacInuit: CFStringEncoding = 0xEC; //static kCFStringEncodingMacVT100: CFStringEncoding = 0xFC; //static kCFStringEncodingMacHFS: CFStringEncoding = 0xFF; // Defined above: kCFStringEncodingISOLatin1 = 0x0201 //static kCFStringEncodingISOLatin2: CFStringEncoding = 0x0202; //static kCFStringEncodingISOLatin3: CFStringEncoding = 0x0203; //static kCFStringEncodingISOLatin4: CFStringEncoding = 0x0204; //static kCFStringEncodingISOLatinCyrillic: CFStringEncoding = 0x0205; //static kCFStringEncodingISOLatinArabic: CFStringEncoding = 0x0206; //static kCFStringEncodingISOLatinGreek: CFStringEncoding = 0x0207; //static kCFStringEncodingISOLatinHebrew: CFStringEncoding = 0x0208; //static kCFStringEncodingISOLatin5: CFStringEncoding = 0x0209; //static kCFStringEncodingISOLatin6: CFStringEncoding = 0x020A; //static kCFStringEncodingISOLatinThai: CFStringEncoding = 0x020B; //static kCFStringEncodingISOLatin7: CFStringEncoding = 0x020D; //static kCFStringEncodingISOLatin8: CFStringEncoding = 0x020E; //static kCFStringEncodingISOLatin9: CFStringEncoding = 0x020F; //static kCFStringEncodingISOLatin10: CFStringEncoding = 0x0210; //static kCFStringEncodingDOSLatinUS: CFStringEncoding = 0x0400; //static kCFStringEncodingDOSGreek: CFStringEncoding = 0x0405; //static kCFStringEncodingDOSBalticRim: CFStringEncoding = 0x0406; //static kCFStringEncodingDOSLatin1: CFStringEncoding = 0x0410; //static kCFStringEncodingDOSGreek1: CFStringEncoding = 0x0411; //static kCFStringEncodingDOSLatin2: CFStringEncoding = 0x0412; //static kCFStringEncodingDOSCyrillic: CFStringEncoding = 0x0413; //static kCFStringEncodingDOSTurkish: CFStringEncoding = 0x0414; //static kCFStringEncodingDOSPortuguese: CFStringEncoding = 0x0415; //static kCFStringEncodingDOSIcelandic: CFStringEncoding = 0x0416; //static kCFStringEncodingDOSHebrew: CFStringEncoding = 0x0417; //static kCFStringEncodingDOSCanadianFrench: CFStringEncoding = 0x0418; //static kCFStringEncodingDOSArabic: CFStringEncoding = 0x0419; //static kCFStringEncodingDOSNordic: CFStringEncoding = 0x041A; //static kCFStringEncodingDOSRussian: CFStringEncoding = 0x041B; //static kCFStringEncodingDOSGreek2: CFStringEncoding = 0x041C; //static kCFStringEncodingDOSThai: CFStringEncoding = 0x041D; //static kCFStringEncodingDOSJapanese: CFStringEncoding = 0x0420; //static kCFStringEncodingDOSChineseSimplif: CFStringEncoding = 0x0421; //static kCFStringEncodingDOSKorean: CFStringEncoding = 0x0422; //static kCFStringEncodingDOSChineseTrad: CFStringEncoding = 0x0423; // Defined above: kCFStringEncodingWindowsLatin1 = 0x0500 //static kCFStringEncodingWindowsLatin2: CFStringEncoding = 0x0501; //static kCFStringEncodingWindowsCyrillic: CFStringEncoding = 0x0502; //static kCFStringEncodingWindowsGreek: CFStringEncoding = 0x0503; //static kCFStringEncodingWindowsLatin5: CFStringEncoding = 0x0504; //static kCFStringEncodingWindowsHebrew: CFStringEncoding = 0x0505; //static kCFStringEncodingWindowsArabic: CFStringEncoding = 0x0506; //static kCFStringEncodingWindowsBalticRim: CFStringEncoding = 0x0507; //static kCFStringEncodingWindowsVietnamese: CFStringEncoding = 0x0508; //static kCFStringEncodingWindowsKoreanJohab: CFStringEncoding = 0x0510; // Defined above: kCFStringEncodingASCII = 0x0600 //static kCFStringEncodingANSEL: CFStringEncoding = 0x0601; //static kCFStringEncodingJIS_X0201_76: CFStringEncoding = 0x0620; //static kCFStringEncodingJIS_X0208_83: CFStringEncoding = 0x0621; //static kCFStringEncodingJIS_X0208_90: CFStringEncoding = 0x0622; //static kCFStringEncodingJIS_X0212_90: CFStringEncoding = 0x0623; //static kCFStringEncodingJIS_C6226_78: CFStringEncoding = 0x0624; //static kCFStringEncodingShiftJIS_X0213: CFStringEncoding = 0x0628; //static kCFStringEncodingShiftJIS_X0213_MenKuTen: CFStringEncoding = 0x0629; //static kCFStringEncodingGB_2312_80: CFStringEncoding = 0x0630; //static kCFStringEncodingGBK_95: CFStringEncoding = 0x0631; //static kCFStringEncodingGB_18030_2000: CFStringEncoding = 0x0632; //static kCFStringEncodingKSC_5601_87: CFStringEncoding = 0x0640; //static kCFStringEncodingKSC_5601_92_Johab: CFStringEncoding = 0x0641; //static kCFStringEncodingCNS_11643_92_P1: CFStringEncoding = 0x0651; //static kCFStringEncodingCNS_11643_92_P2: CFStringEncoding = 0x0652; //static kCFStringEncodingCNS_11643_92_P3: CFStringEncoding = 0x0653; //static kCFStringEncodingISO_2022_JP: CFStringEncoding = 0x0820; //static kCFStringEncodingISO_2022_JP_2: CFStringEncoding = 0x0821; //static kCFStringEncodingISO_2022_JP_1: CFStringEncoding = 0x0822; //static kCFStringEncodingISO_2022_JP_3: CFStringEncoding = 0x0823; //static kCFStringEncodingISO_2022_CN: CFStringEncoding = 0x0830; //static kCFStringEncodingISO_2022_CN_EXT: CFStringEncoding = 0x0831; //static kCFStringEncodingISO_2022_KR: CFStringEncoding = 0x0840; //static kCFStringEncodingEUC_JP: CFStringEncoding = 0x0920; //static kCFStringEncodingEUC_CN: CFStringEncoding = 0x0930; //static kCFStringEncodingEUC_TW: CFStringEncoding = 0x0931; //static kCFStringEncodingEUC_KR: CFStringEncoding = 0x0940; //static kCFStringEncodingShiftJIS: CFStringEncoding = 0x0A01; //static kCFStringEncodingKOI8_R: CFStringEncoding = 0x0A02; //static kCFStringEncodingBig5: CFStringEncoding = 0x0A03; //static kCFStringEncodingMacRomanLatin1: CFStringEncoding = 0x0A04; //static kCFStringEncodingHZ_GB_2312: CFStringEncoding = 0x0A05; //static kCFStringEncodingBig5_HKSCS_1999: CFStringEncoding = 0x0A06; //static kCFStringEncodingVISCII: CFStringEncoding = 0x0A07; //static kCFStringEncodingKOI8_U: CFStringEncoding = 0x0A08; //static kCFStringEncodingBig5_E: CFStringEncoding = 0x0A09; // Defined above: kCFStringEncodingNextStepLatin = 0x0B01 //static kCFStringEncodingNextStepJapanese: CFStringEncoding = 0x0B02; //static kCFStringEncodingEBCDIC_US: CFStringEncoding = 0x0C01; //static kCFStringEncodingEBCDIC_CP037: CFStringEncoding = 0x0C02; //static kCFStringEncodingUTF7: CFStringEncoding = 0x04000100; //static kCFStringEncodingUTF7_IMAP: CFStringEncoding = 0x0A10; //static kCFStringEncodingShiftJIS_X0213_00: CFStringEncoding = 0x0628; /* Deprecated */ #[repr(C)] pub struct __CFString(c_void); pub type CFStringRef = *const __CFString; extern { /* * CFString.h */ // N.B. organized according to "Functions by task" in docs /* Creating a CFString */ //fn CFSTR //fn CFStringCreateArrayBySeparatingStrings //fn CFStringCreateByCombiningStrings //fn CFStringCreateCopy //fn CFStringCreateFromExternalRepresentation pub fn CFStringCreateWithBytes(alloc: CFAllocatorRef, bytes: *const u8, numBytes: CFIndex, encoding: CFStringEncoding, isExternalRepresentation: Boolean) -> CFStringRef; pub fn CFStringCreateWithBytesNoCopy(alloc: CFAllocatorRef, bytes: *const u8, numBytes: CFIndex, encoding: CFStringEncoding, isExternalRepresentation: Boolean, contentsDeallocator: CFAllocatorRef) -> CFStringRef; //fn CFStringCreateWithCharacters //fn CFStringCreateWithCharactersNoCopy pub fn CFStringCreateWithCString(alloc: CFAllocatorRef, cStr: *const c_char, encoding: CFStringEncoding) -> CFStringRef; //fn CFStringCreateWithCStringNoCopy //fn CFStringCreateWithFormat //fn CFStringCreateWithFormatAndArguments //fn CFStringCreateWithPascalString //fn CFStringCreateWithPascalStringNoCopy //fn CFStringCreateWithSubstring /* Searching Strings */ //fn CFStringCreateArrayWithFindResults //fn CFStringFind //fn CFStringFindCharacterFromSet //fn CFStringFindWithOptions //fn CFStringFindWithOptionsAndLocale //fn CFStringGetLineBounds /* Comparing Strings */ //fn CFStringCompare //fn CFStringCompareWithOptions //fn CFStringCompareWithOptionsAndLocale //fn CFStringHasPrefix //fn CFStringHasSuffix /* Accessing Characters */ //fn CFStringCreateExternalRepresentation pub fn CFStringGetBytes(theString: CFStringRef, range: CFRange, encoding: CFStringEncoding, lossByte: u8, isExternalRepresentation: Boolean, buffer: *mut u8, maxBufLen: CFIndex, usedBufLen: *mut CFIndex) -> CFIndex; //fn CFStringGetCharacterAtIndex //fn CFStringGetCharacters //fn CFStringGetCharactersPtr //fn CFStringGetCharacterFromInlineBuffer pub fn CFStringGetCString(theString: CFStringRef, buffer: *mut c_char, bufferSize: CFIndex, encoding: CFStringEncoding) -> Boolean; pub fn CFStringGetCStringPtr(theString: CFStringRef, encoding: CFStringEncoding) -> *const c_char; pub fn CFStringGetLength(theString: CFStringRef) -> CFIndex; //fn CFStringGetPascalString //fn CFStringGetPascalStringPtr //fn CFStringGetRangeOfComposedCharactersAtIndex //fn CFStringInitInlineBuffer /* Working With Hyphenation */ //fn CFStringGetHyphenationLocationBeforeIndex //fn CFStringIsHyphenationAvailableForLocale /* Working With Encodings */ //fn CFStringConvertEncodingToIANACharSetName //fn CFStringConvertEncodingToNSStringEncoding //fn CFStringConvertEncodingToWindowsCodepage //fn CFStringConvertIANACharSetNameToEncoding //fn CFStringConvertNSStringEncodingToEncoding //fn CFStringConvertWindowsCodepageToEncoding //fn CFStringGetFastestEncoding //fn CFStringGetListOfAvailableEncodings //fn CFStringGetMaximumSizeForEncoding //fn CFStringGetMostCompatibleMacStringEncoding //fn CFStringGetNameOfEncoding //fn CFStringGetSmallestEncoding //fn CFStringGetSystemEncoding //fn CFStringIsEncodingAvailable /* Getting Numeric Values */ //fn CFStringGetDoubleValue //fn CFStringGetIntValue /* Getting String Properties */ //fn CFShowStr pub fn CFStringGetTypeID() -> CFTypeID; /* String File System Representations */ //fn CFStringCreateWithFileSystemRepresentation //fn CFStringGetFileSystemRepresentation //fn CFStringGetMaximumSizeOfFileSystemRepresentation /* Getting Paragraph Bounds */ //fn CFStringGetParagraphBounds /* Managing Surrogates */ //fn CFStringGetLongCharacterForSurrogatePair //fn CFStringGetSurrogatePairForLongCharacter //fn CFStringIsSurrogateHighCharacter //fn CFStringIsSurrogateLowCharacter } core-foundation-sys-0.8.1/src/timezone.rs010064400007650000024000000021231367640336500166110ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFTypeID}; use date::{CFTimeInterval, CFAbsoluteTime}; use string::CFStringRef; #[repr(C)] pub struct __CFTimeZone(c_void); pub type CFTimeZoneRef = *const __CFTimeZone; extern { pub fn CFTimeZoneCopySystem() -> CFTimeZoneRef; pub fn CFTimeZoneCopyDefault() -> CFTimeZoneRef; pub fn CFTimeZoneCreateWithTimeIntervalFromGMT(allocator: CFAllocatorRef, interval: CFTimeInterval) -> CFTimeZoneRef; pub fn CFTimeZoneGetSecondsFromGMT(tz: CFTimeZoneRef, time: CFAbsoluteTime) -> CFTimeInterval; pub fn CFTimeZoneGetTypeID() -> CFTypeID; pub fn CFTimeZoneGetName(tz: CFTimeZoneRef) -> CFStringRef; } core-foundation-sys-0.8.1/src/url.rs010064400007650000024000000223671366027130300155610ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFOptionFlags, CFIndex, CFAllocatorRef, Boolean, CFTypeID, CFTypeRef, SInt32}; use data::CFDataRef; use array::CFArrayRef; use dictionary::CFDictionaryRef; use string::{CFStringRef, CFStringEncoding}; use error::CFErrorRef; #[repr(C)] pub struct __CFURL(c_void); pub type CFURLRef = *const __CFURL; pub type CFURLBookmarkCreationOptions = CFOptionFlags; pub type CFURLBookmarkResolutionOptions = CFOptionFlags; pub type CFURLBookmarkFileCreationOptions = CFOptionFlags; pub type CFURLPathStyle = CFIndex; /* typedef CF_ENUM(CFIndex, CFURLPathStyle) */ pub const kCFURLPOSIXPathStyle: CFURLPathStyle = 0; pub const kCFURLHFSPathStyle: CFURLPathStyle = 1; pub const kCFURLWindowsPathStyle: CFURLPathStyle = 2; pub static kCFURLBookmarkCreationPreferFileIDResolutionMask: CFURLBookmarkCreationOptions = (1u32 << 8) as usize; pub static kCFURLBookmarkCreationMinimalBookmarkMask: CFURLBookmarkCreationOptions = (1u32 << 9) as usize; pub static kCFURLBookmarkCreationSuitableForBookmarkFile: CFURLBookmarkCreationOptions = (1u32 << 10) as usize; pub static kCFURLBookmarkCreationWithSecurityScope: CFURLBookmarkCreationOptions = (1u32 << 11) as usize; pub static kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess: CFURLBookmarkCreationOptions = (1u32 << 12) as usize; // TODO: there are a lot of missing keys and constants. Add if you are bored or need them. extern { /* * CFURL.h */ /* Common File System Resource Keys */ pub static kCFURLAttributeModificationDateKey: CFStringRef; pub static kCFURLContentAccessDateKey: CFStringRef; pub static kCFURLContentModificationDateKey: CFStringRef; pub static kCFURLCreationDateKey: CFStringRef; pub static kCFURLFileResourceIdentifierKey: CFStringRef; pub static kCFURLFileSecurityKey: CFStringRef; pub static kCFURLHasHiddenExtensionKey: CFStringRef; pub static kCFURLIsDirectoryKey: CFStringRef; pub static kCFURLIsExecutableKey: CFStringRef; pub static kCFURLIsHiddenKey: CFStringRef; pub static kCFURLIsPackageKey: CFStringRef; pub static kCFURLIsReadableKey: CFStringRef; pub static kCFURLIsRegularFileKey: CFStringRef; pub static kCFURLIsSymbolicLinkKey: CFStringRef; pub static kCFURLIsSystemImmutableKey: CFStringRef; pub static kCFURLIsUserImmutableKey: CFStringRef; pub static kCFURLIsVolumeKey: CFStringRef; pub static kCFURLIsWritableKey: CFStringRef; pub static kCFURLLabelNumberKey: CFStringRef; pub static kCFURLLinkCountKey: CFStringRef; pub static kCFURLLocalizedLabelKey: CFStringRef; pub static kCFURLLocalizedNameKey: CFStringRef; pub static kCFURLLocalizedTypeDescriptionKey: CFStringRef; pub static kCFURLNameKey: CFStringRef; pub static kCFURLParentDirectoryURLKey: CFStringRef; pub static kCFURLPreferredIOBlockSizeKey: CFStringRef; pub static kCFURLTypeIdentifierKey: CFStringRef; pub static kCFURLVolumeIdentifierKey: CFStringRef; pub static kCFURLVolumeURLKey: CFStringRef; #[cfg(feature="mac_os_10_8_features")] #[cfg_attr(feature = "mac_os_10_7_support", linkage = "extern_weak")] pub static kCFURLIsExcludedFromBackupKey: CFStringRef; pub static kCFURLFileResourceTypeKey: CFStringRef; /* Creating a CFURL */ pub fn CFURLCopyAbsoluteURL(anURL: CFURLRef) -> CFURLRef; pub fn CFURLCreateAbsoluteURLWithBytes(allocator: CFAllocatorRef, relativeURLBytes: *const u8, length: CFIndex, encoding: CFStringEncoding, baseURL: CFURLRef, useCompatibilityMode: Boolean) -> CFURLRef; pub fn CFURLCreateByResolvingBookmarkData(allocator: CFAllocatorRef, bookmark: CFDataRef, options: CFURLBookmarkResolutionOptions, relativeToURL: CFURLRef, resourcePropertiesToInclude: CFArrayRef, isStale: *mut Boolean, error: *mut CFErrorRef) -> CFURLRef; //fn CFURLCreateCopyAppendingPathComponent //fn CFURLCreateCopyAppendingPathExtension //fn CFURLCreateCopyDeletingLastPathComponent //fn CFURLCreateCopyDeletingPathExtension pub fn CFURLCreateFilePathURL(allocator: CFAllocatorRef, url: CFURLRef, error: *mut CFErrorRef) -> CFURLRef; //fn CFURLCreateFileReferenceURL pub fn CFURLCreateFromFileSystemRepresentation(allocator: CFAllocatorRef, buffer: *const u8, bufLen: CFIndex, isDirectory: Boolean) -> CFURLRef; //fn CFURLCreateFromFileSystemRepresentationRelativeToBase //fn CFURLCreateFromFSRef pub fn CFURLCreateWithBytes(allocator: CFAllocatorRef, URLBytes: *const u8, length: CFIndex, encoding: CFStringEncoding, baseURL: CFURLRef) -> CFURLRef; pub fn CFURLCreateWithFileSystemPath(allocator: CFAllocatorRef, filePath: CFStringRef, pathStyle: CFURLPathStyle, isDirectory: Boolean) -> CFURLRef; pub fn CFURLCreateWithFileSystemPathRelativeToBase(allocator: CFAllocatorRef, filePath: CFStringRef, pathStyle: CFURLPathStyle, isDirectory: Boolean, baseURL: CFURLRef) -> CFURLRef; //fn CFURLCreateWithString(allocator: CFAllocatorRef, urlString: CFStringRef, // baseURL: CFURLRef) -> CFURLRef; /* Accessing the Parts of a URL */ pub fn CFURLCanBeDecomposed(anURL: CFURLRef) -> Boolean; pub fn CFURLCopyFileSystemPath(anURL: CFURLRef, pathStyle: CFURLPathStyle) -> CFStringRef; pub fn CFURLCopyFragment(anURL: CFURLRef, charactersToLeaveEscaped: CFStringRef) -> CFStringRef; pub fn CFURLCopyHostName(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyLastPathComponent(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyNetLocation(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyParameterString(anURL: CFURLRef, charactersToLeaveEscaped: CFStringRef) -> CFStringRef; pub fn CFURLCopyPassword(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyPath(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyPathExtension(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyQueryString(anURL: CFURLRef, charactersToLeaveEscaped: CFStringRef) -> CFStringRef; pub fn CFURLCopyResourceSpecifier(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyScheme(anURL: CFURLRef) -> CFStringRef; pub fn CFURLCopyStrictPath(anURL: CFURLRef, isAbsolute: *mut Boolean) -> CFStringRef; pub fn CFURLCopyUserName(anURL: CFURLRef) -> CFStringRef; pub fn CFURLGetPortNumber(anURL: CFURLRef) -> SInt32; pub fn CFURLHasDirectoryPath(anURL: CFURLRef) -> Boolean; /* Converting URLs to Other Representations */ //fn CFURLCreateData(allocator: CFAllocatorRef, url: CFURLRef, // encoding: CFStringEncoding, escapeWhitespace: bool) -> CFDataRef; //fn CFURLCreateStringByAddingPercentEscapes //fn CFURLCreateStringByReplacingPercentEscapes //fn CFURLCreateStringByReplacingPercentEscapesUsingEncoding pub fn CFURLGetFileSystemRepresentation(anURL: CFURLRef, resolveAgainstBase: Boolean, buffer: *mut u8, maxBufLen: CFIndex) -> Boolean; //fn CFURLGetFSRef pub fn CFURLGetString(anURL: CFURLRef) -> CFStringRef; /* Getting URL Properties */ //fn CFURLGetBaseURL(anURL: CFURLRef) -> CFURLRef; pub fn CFURLGetBytes(anURL: CFURLRef, buffer: *mut u8, bufferLength: CFIndex) -> CFIndex; //fn CFURLGetByteRangeForComponent pub fn CFURLGetTypeID() -> CFTypeID; //fn CFURLResourceIsReachable /* Getting and Setting File System Resource Properties */ pub fn CFURLClearResourcePropertyCache(url: CFURLRef); //fn CFURLClearResourcePropertyCacheForKey //fn CFURLCopyResourcePropertiesForKeys //fn CFURLCopyResourcePropertyForKey pub fn CFURLCreateResourcePropertiesForKeysFromBookmarkData(allocator: CFAllocatorRef, resourcePropertiesToReturn: CFArrayRef, bookmark: CFDataRef) -> CFDictionaryRef; pub fn CFURLCreateResourcePropertyForKeyFromBookmarkData(allocator: CFAllocatorRef, resourcePropertyKey: CFStringRef, bookmark: CFDataRef) -> CFTypeRef; //fn CFURLSetResourcePropertiesForKeys pub fn CFURLSetResourcePropertyForKey(url: CFURLRef, key: CFStringRef, value: CFTypeRef, error: *mut CFErrorRef) -> Boolean; //fn CFURLSetTemporaryResourcePropertyForKey /* Working with Bookmark Data */ pub fn CFURLCreateBookmarkData(allocator: CFAllocatorRef, url: CFURLRef, options: CFURLBookmarkCreationOptions, resourcePropertiesToInclude: CFArrayRef, relativeToURL: CFURLRef, error: *mut CFErrorRef) -> CFDataRef; pub fn CFURLCreateBookmarkDataFromAliasRecord(allocator: CFAllocatorRef, aliasRecordDataRef: CFDataRef) -> CFDataRef; pub fn CFURLCreateBookmarkDataFromFile(allocator: CFAllocatorRef, fileURL: CFURLRef, errorRef: *mut CFErrorRef) -> CFDataRef; pub fn CFURLWriteBookmarkDataToFile(bookmarkRef: CFDataRef, fileURL: CFURLRef, options: CFURLBookmarkFileCreationOptions, errorRef: *mut CFErrorRef) -> Boolean; pub fn CFURLStartAccessingSecurityScopedResource(url: CFURLRef) -> Boolean; pub fn CFURLStopAccessingSecurityScopedResource(url: CFURLRef); } #[test] #[cfg(feature="mac_os_10_8_features")] fn can_see_excluded_from_backup_key() { let _ = unsafe { kCFURLIsExcludedFromBackupKey }; } core-foundation-sys-0.8.1/src/uuid.rs010064400007650000024000000023771324406220200157160ustar 00000000000000// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use std::os::raw::c_void; use base::{CFAllocatorRef, CFTypeID}; #[repr(C)] pub struct __CFUUID(c_void); pub type CFUUIDRef = *const __CFUUID; #[repr(C)] #[derive(Clone, Copy, Default)] pub struct CFUUIDBytes { pub byte0: u8, pub byte1: u8, pub byte2: u8, pub byte3: u8, pub byte4: u8, pub byte5: u8, pub byte6: u8, pub byte7: u8, pub byte8: u8, pub byte9: u8, pub byte10: u8, pub byte11: u8, pub byte12: u8, pub byte13: u8, pub byte14: u8, pub byte15: u8 } extern { /* * CFUUID.h */ pub fn CFUUIDCreate(allocator: CFAllocatorRef) -> CFUUIDRef; pub fn CFUUIDCreateFromUUIDBytes(allocator: CFAllocatorRef, bytes: CFUUIDBytes) -> CFUUIDRef; pub fn CFUUIDGetUUIDBytes(uuid: CFUUIDRef) -> CFUUIDBytes; pub fn CFUUIDGetTypeID() -> CFTypeID; }