| 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 crate::array::CFArrayRef; |
| 13 |
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFOptionFlags, CFTypeID}; |
| 14 |
use crate::error::CFErrorRef; |
| 15 |
use crate::url::CFURLRef; |
| 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 "C" { |
| 39 |
/* |
| 40 |
* CFURLEnumerator.h |
| 41 |
*/ |
| 42 |
pub fn CFURLEnumeratorGetTypeID() -> CFTypeID; |
| 43 |
pub fn CFURLEnumeratorCreateForDirectoryURL( |
| 44 |
alloc: CFAllocatorRef, |
| 45 |
directoryURL: CFURLRef, |
| 46 |
option: CFURLEnumeratorOptions, |
| 47 |
propertyKeys: CFArrayRef, |
| 48 |
) -> CFURLEnumeratorRef; |
| 49 |
pub fn CFURLEnumeratorCreateForMountedVolumes( |
| 50 |
alloc: CFAllocatorRef, |
| 51 |
option: CFURLEnumeratorOptions, |
| 52 |
propertyKeys: CFArrayRef, |
| 53 |
) -> CFURLEnumeratorRef; |
| 54 |
pub fn CFURLEnumeratorGetNextURL( |
| 55 |
enumerator: CFURLEnumeratorRef, |
| 56 |
url: *mut CFURLRef, |
| 57 |
error: *mut CFErrorRef, |
| 58 |
) -> CFURLEnumeratorResult; |
| 59 |
pub fn CFURLEnumeratorSkipDescendents(enumerator: CFURLEnumeratorRef); |
| 60 |
pub fn CFURLEnumeratorGetDescendentLevel(enumerator: CFURLEnumeratorRef) -> CFIndex; |
| 61 |
pub fn CFURLEnumeratorGetSourceDidChange(enumerator: CFURLEnumeratorRef) -> Boolean; // deprecated since macos 10.7 |
| 62 |
} |