|
| 1 | +// Copyright 2023 The Servo Project Developers. See the COPYRIGHT |
| 2 | +// file at the top-level directory of this distribution. |
| 3 | +// |
| 4 | +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 5 | +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 6 | +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 7 | +// option. This file may not be copied, modified, or distributed |
| 8 | +// except according to those terms. |
| 9 | + |
| 10 | +use std::os::raw::c_void; |
| 11 | + |
| 12 | +use base::{CFOptionFlags, CFIndex, CFTypeID, CFAllocatorRef, Boolean}; |
| 13 | +use url::CFURLRef; |
| 14 | +use error::CFErrorRef; |
| 15 | +use array::CFArrayRef; |
| 16 | + |
| 17 | +#[repr(C)] |
| 18 | +pub struct __CFURLEnumerator(c_void); |
| 19 | + |
| 20 | +pub type CFURLEnumeratorRef = *mut __CFURLEnumerator; |
| 21 | + |
| 22 | +pub type CFURLEnumeratorOptions = CFOptionFlags; |
| 23 | +pub const kCFURLEnumeratorDefaultBehavior: CFURLEnumeratorOptions = 0; |
| 24 | +pub const kCFURLEnumeratorDescendRecursively: CFURLEnumeratorOptions = 1 << 0; |
| 25 | +pub const kCFURLEnumeratorSkipInvisibles: CFURLEnumeratorOptions = 1 << 1; |
| 26 | +pub const kCFURLEnumeratorGenerateFileReferenceURLs: CFURLEnumeratorOptions = 1 << 2; |
| 27 | +pub const kCFURLEnumeratorSkipPackageContents: CFURLEnumeratorOptions = 1 << 3; |
| 28 | +pub const kCFURLEnumeratorIncludeDirectoriesPreOrder: CFURLEnumeratorOptions = 1 << 4; |
| 29 | +pub const kCFURLEnumeratorIncludeDirectoriesPostOrder: CFURLEnumeratorOptions = 1 << 5; |
| 30 | +//pub const kCFURLEnumeratorGenerateRelativePathURLs = 1UL << 6; // macos(10.15)+ |
| 31 | + |
| 32 | +pub type CFURLEnumeratorResult = CFIndex; |
| 33 | +pub const kCFURLEnumeratorSuccess: CFURLEnumeratorOptions = 1; |
| 34 | +pub const kCFURLEnumeratorEnd: CFURLEnumeratorOptions = 2; |
| 35 | +pub const kCFURLEnumeratorError: CFURLEnumeratorOptions = 3; |
| 36 | +pub const kCFURLEnumeratorDirectoryPostOrderSuccess: CFURLEnumeratorOptions = 4; |
| 37 | + |
| 38 | +extern { |
| 39 | + /* |
| 40 | + * CFURLEnumerator.h |
| 41 | + */ |
| 42 | + pub fn CFURLEnumeratorGetTypeID() -> CFTypeID; |
| 43 | + pub fn CFURLEnumeratorCreateForDirectoryURL(alloc: CFAllocatorRef, directoryURL: CFURLRef, option: CFURLEnumeratorOptions, propertyKeys: CFArrayRef) -> CFURLEnumeratorRef; |
| 44 | + pub fn CFURLEnumeratorCreateForMountedVolumes(alloc: CFAllocatorRef, option: CFURLEnumeratorOptions, propertyKeys: CFArrayRef) -> CFURLEnumeratorRef; |
| 45 | + pub fn CFURLEnumeratorGetNextURL(enumerator: CFURLEnumeratorRef, url: *mut CFURLRef, error: *mut CFErrorRef) -> CFURLEnumeratorResult; |
| 46 | + pub fn CFURLEnumeratorSkipDescendents(enumerator: CFURLEnumeratorRef); |
| 47 | + pub fn CFURLEnumeratorGetDescendentLevel(enumerator: CFURLEnumeratorRef) -> CFIndex; |
| 48 | + pub fn CFURLEnumeratorGetSourceDidChange(enumerator: CFURLEnumeratorRef) -> Boolean; // deprecated since macos 10.7 |
| 49 | +} |
0 commit comments